- Timestamp:
- 10/18/14 03:25:58 (10 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/AlgorithmServiceNodeView.Designer.cs
r11463 r11481 214 214 protected MainForm.WindowsForms.ViewHost templateViewHost; 215 215 protected System.Windows.Forms.TabPage runsTabPage; 216 pr ivateOptimization.Views.RunCollectionView runCollectionView;216 protected Optimization.Views.RunCollectionView runCollectionView; 217 217 218 218 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ClientNodeView.Designer.cs
r11468 r11481 74 74 this.portCollectionView.ReadOnly = false; 75 75 this.portCollectionView.ShowDetails = true; 76 this.portCollectionView.Size = new System.Drawing.Size(625, 4 16);76 this.portCollectionView.Size = new System.Drawing.Size(625, 424); 77 77 this.portCollectionView.TabIndex = 0; 78 78 // … … 85 85 this.tabControl.Controls.Add(this.portsTabPage); 86 86 this.tabControl.Controls.Add(this.serviceCallsTabPage); 87 this.tabControl.Location = new System.Drawing.Point(0, 63);87 this.tabControl.Location = new System.Drawing.Point(0, 26); 88 88 this.tabControl.Name = "tabControl"; 89 89 this.tabControl.SelectedIndex = 0; 90 this.tabControl.Size = new System.Drawing.Size(645, 4 54);91 this.tabControl.TabIndex = 5;90 this.tabControl.Size = new System.Drawing.Size(645, 462); 91 this.tabControl.TabIndex = 3; 92 92 // 93 93 // portsTabPage … … 97 97 this.portsTabPage.Name = "portsTabPage"; 98 98 this.portsTabPage.Padding = new System.Windows.Forms.Padding(3); 99 this.portsTabPage.Size = new System.Drawing.Size(637, 4 28);99 this.portsTabPage.Size = new System.Drawing.Size(637, 436); 100 100 this.portsTabPage.TabIndex = 0; 101 101 this.portsTabPage.Text = "Ports"; … … 128 128 // callServicesButton 129 129 // 130 this.callServicesButton.Location = new System.Drawing.Point(69, 26); 130 this.callServicesButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 131 this.callServicesButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play; 132 this.callServicesButton.Location = new System.Drawing.Point(0, 494); 131 133 this.callServicesButton.Name = "callServicesButton"; 132 this.callServicesButton.Size = new System.Drawing.Size(101, 23); 133 this.callServicesButton.TabIndex = 3; 134 this.callServicesButton.Text = "&Call Services"; 134 this.callServicesButton.Size = new System.Drawing.Size(23, 23); 135 this.callServicesButton.TabIndex = 4; 135 136 this.callServicesButton.UseVisualStyleBackColor = true; 136 137 this.callServicesButton.Click += new System.EventHandler(this.callServicesButton_Click); … … 138 139 // cancelServicesButton 139 140 // 140 this.cancelServicesButton.Location = new System.Drawing.Point(176, 26); 141 this.cancelServicesButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 142 this.cancelServicesButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop; 143 this.cancelServicesButton.Location = new System.Drawing.Point(29, 494); 141 144 this.cancelServicesButton.Name = "cancelServicesButton"; 142 this.cancelServicesButton.Size = new System.Drawing.Size(101, 23); 143 this.cancelServicesButton.TabIndex = 4; 144 this.cancelServicesButton.Text = "&Cancel Services"; 145 this.cancelServicesButton.Size = new System.Drawing.Size(23, 23); 146 this.cancelServicesButton.TabIndex = 5; 145 147 this.cancelServicesButton.UseVisualStyleBackColor = true; 146 148 this.cancelServicesButton.Click += new System.EventHandler(this.cancelServicesButton_Click); -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ClientNodeView.cs
r11468 r11481 21 21 22 22 using HeuristicLab.MainForm; 23 using HeuristicLab.PluginInfrastructure; 23 24 using System; 24 25 using System.Threading; … … 30 31 [Content(typeof(IClientNode), false)] 31 32 public partial class ClientNodeView : EntityView { 32 protected CancellationTokenSource tokenSource = new CancellationTokenSource(); 33 protected CancellationTokenSource tokenSource; 34 protected int openCalls = 0; 33 35 34 36 public new IClientNode Content { … … 43 45 protected override void OnContentChanged() { 44 46 base.OnContentChanged(); 47 48 if (tokenSource != null) tokenSource.Cancel(); 49 45 50 if (Content == null) { 51 tokenSource = null; 46 52 portCollectionView.Content = null; 47 53 serviceParameterCollectionCollectionView.Content = null; 48 54 } else { 55 tokenSource = new CancellationTokenSource(); 49 56 portCollectionView.Content = Content.Ports; 50 57 serviceParameterCollectionCollectionView.Content = Content.Calls; … … 55 62 base.SetEnabledStateOfControls(); 56 63 callServicesButton.Enabled = Content != null && !ReadOnly; 64 cancelServicesButton.Enabled = Content != null && !ReadOnly && openCalls > 0; 57 65 portCollectionView.Enabled = Content != null && !ReadOnly; 58 66 serviceParameterCollectionCollectionView.Enabled = Content != null && !ReadOnly; … … 60 68 61 69 protected virtual void callServicesButton_Click(object sender, EventArgs e) { 62 Content.CallServicesAsync(tokenSource.Token); 70 openCalls++; 71 cancelServicesButton.Enabled = Content != null && !ReadOnly && openCalls > 0; 72 Content.CallServicesAsync(tokenSource.Token).ContinueWith(t => { 73 Invoke(new Action(() => { 74 openCalls--; 75 cancelServicesButton.Enabled = Content != null && !ReadOnly && openCalls > 0; 76 77 try { 78 t.Wait(); 79 } 80 catch (Exception ex) { 81 ErrorHandling.ShowErrorDialog(this, ex); 82 } 83 })); 84 }); 63 85 } 64 86 protected virtual void cancelServicesButton_Click(object sender, EventArgs e) { 65 87 tokenSource.Cancel(); 88 tokenSource = new CancellationTokenSource(); 66 89 } 67 90 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ClientPortView.Designer.cs
r11454 r11481 34 34 /// </summary> 35 35 private void InitializeComponent() { 36 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ClientPortView));37 36 this.servicePortGroupBox = new System.Windows.Forms.GroupBox(); 38 37 this.setServicePortButton = new System.Windows.Forms.Button(); 39 38 this.clearServicePortButton = new System.Windows.Forms.Button(); 40 39 this.servicePortView = new HeuristicLab.Optimization.Networks.Views.PortView(); 40 this.cloneServicePortParametersButton = new System.Windows.Forms.Button(); 41 41 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 42 42 this.servicePortGroupBox.SuspendLayout(); … … 107 107 this.servicePortView.DragOver += new System.Windows.Forms.DragEventHandler(this.servicePortView_DragEnterOver); 108 108 // 109 // cloneServicePortParametersButton 110 // 111 this.cloneServicePortParametersButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Clone; 112 this.cloneServicePortParametersButton.Location = new System.Drawing.Point(156, 101); 113 this.cloneServicePortParametersButton.Name = "cloneServicePortParametersButton"; 114 this.cloneServicePortParametersButton.Size = new System.Drawing.Size(24, 24); 115 this.cloneServicePortParametersButton.TabIndex = 5; 116 this.toolTip.SetToolTip(this.cloneServicePortParametersButton, "Clone Parameters from Service Port"); 117 this.cloneServicePortParametersButton.UseVisualStyleBackColor = true; 118 this.cloneServicePortParametersButton.Click += new System.EventHandler(this.cloneServicePortParametersButton_Click); 119 // 109 120 // ClientPortView 110 121 // 111 122 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 123 this.Controls.Add(this.cloneServicePortParametersButton); 112 124 this.Controls.Add(this.servicePortGroupBox); 113 125 this.Name = "ClientPortView"; … … 117 129 this.Controls.SetChildIndex(this.infoLabel, 0); 118 130 this.Controls.SetChildIndex(this.servicePortGroupBox, 0); 131 this.Controls.SetChildIndex(this.cloneServicePortParametersButton, 0); 119 132 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 120 133 this.servicePortGroupBox.ResumeLayout(false); … … 130 143 protected System.Windows.Forms.Button clearServicePortButton; 131 144 protected System.Windows.Forms.Button setServicePortButton; 145 protected System.Windows.Forms.Button cloneServicePortParametersButton; 132 146 133 147 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ClientPortView.cs
r11454 r11481 71 71 setServicePortButton.Enabled = Content != null && !ReadOnly; 72 72 clearServicePortButton.Enabled = Content != null && Content.ServicePort != null && !ReadOnly; 73 cloneServicePortParametersButton.Enabled = Content != null && Content.ServicePort != null && !ReadOnly; 73 74 } 74 75 … … 78 79 else { 79 80 clearServicePortButton.Enabled = Content.ServicePort != null && !ReadOnly; 81 cloneServicePortParametersButton.Enabled = Content.ServicePort != null && !ReadOnly; 80 82 servicePortView.Content = Content.ServicePort; 81 83 } … … 133 135 } 134 136 } 137 protected virtual void cloneServicePortParametersButton_Click(object sender, EventArgs e) { 138 Content.CloneServicePortParameters(); 139 } 135 140 } 136 141 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ServiceParameterView.Designer.cs
r11454 r11481 27 27 private System.ComponentModel.IContainer components = null; 28 28 29 /// <summary>30 /// Clean up any resources being used.31 /// </summary>32 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>33 protected override void Dispose(bool disposing) {34 if (disposing) {35 if (components != null) components.Dispose();36 }37 base.Dispose(disposing);38 }39 40 29 #region Component Designer generated code 41 30 … … 46 35 private void InitializeComponent() { 47 36 this.valueGroupBox = new System.Windows.Forms.GroupBox(); 37 this.clearValueButton = new System.Windows.Forms.Button(); 38 this.setValueButton = new System.Windows.Forms.Button(); 48 39 this.valuePanel = new System.Windows.Forms.Panel(); 49 40 this.valueViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); … … 67 58 | System.Windows.Forms.AnchorStyles.Left) 68 59 | System.Windows.Forms.AnchorStyles.Right))); 60 this.valueGroupBox.Controls.Add(this.clearValueButton); 61 this.valueGroupBox.Controls.Add(this.setValueButton); 69 62 this.valueGroupBox.Controls.Add(this.valuePanel); 70 63 this.valueGroupBox.Location = new System.Drawing.Point(0, 79); … … 75 68 this.valueGroupBox.Text = "Value"; 76 69 // 70 // clearValueButton 71 // 72 this.clearValueButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Remove; 73 this.clearValueButton.Location = new System.Drawing.Point(35, 19); 74 this.clearValueButton.Name = "clearValueButton"; 75 this.clearValueButton.Size = new System.Drawing.Size(23, 23); 76 this.clearValueButton.TabIndex = 1; 77 this.clearValueButton.UseVisualStyleBackColor = true; 78 this.clearValueButton.Click += new System.EventHandler(this.clearValueButton_Click); 79 // 80 // setValueButton 81 // 82 this.setValueButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Edit; 83 this.setValueButton.Location = new System.Drawing.Point(6, 19); 84 this.setValueButton.Name = "setValueButton"; 85 this.setValueButton.Size = new System.Drawing.Size(23, 23); 86 this.setValueButton.TabIndex = 0; 87 this.setValueButton.UseVisualStyleBackColor = true; 88 this.setValueButton.Click += new System.EventHandler(this.setValueButton_Click); 89 // 77 90 // valuePanel 78 91 // 92 this.valuePanel.AllowDrop = true; 79 93 this.valuePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 80 94 | System.Windows.Forms.AnchorStyles.Left) 81 95 | System.Windows.Forms.AnchorStyles.Right))); 82 96 this.valuePanel.Controls.Add(this.valueViewHost); 83 this.valuePanel.Location = new System.Drawing.Point(6, 19);97 this.valuePanel.Location = new System.Drawing.Point(6, 48); 84 98 this.valuePanel.Name = "valuePanel"; 85 this.valuePanel.Size = new System.Drawing.Size(633, 413);99 this.valuePanel.Size = new System.Drawing.Size(633, 384); 86 100 this.valuePanel.TabIndex = 0; 101 this.valuePanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragDrop); 102 this.valuePanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver); 103 this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver); 87 104 // 88 105 // valueViewHost … … 95 112 this.valueViewHost.Name = "valueViewHost"; 96 113 this.valueViewHost.ReadOnly = false; 97 this.valueViewHost.Size = new System.Drawing.Size(633, 413);114 this.valueViewHost.Size = new System.Drawing.Size(633, 384); 98 115 this.valueViewHost.TabIndex = 0; 99 116 this.valueViewHost.ViewsLabelVisible = true; … … 175 192 protected System.Windows.Forms.TextBox dataTypeTextBox; 176 193 protected System.Windows.Forms.ComboBox typeComboBox; 194 protected System.Windows.Forms.Button setValueButton; 195 protected System.Windows.Forms.Button clearValueButton; 177 196 178 197 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ServiceParameterView.cs
r11454 r11481 21 21 22 22 using HeuristicLab.Common; 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Core.Views; 24 25 using HeuristicLab.MainForm; 26 using HeuristicLab.PluginInfrastructure; 25 27 using System; 26 28 using System.Windows.Forms; … … 32 34 [Content(typeof(IServiceParameter), false)] 33 35 public partial class ServiceParameterView : EntityView { 36 protected TypeSelectorDialog typeSelectorDialog; 37 34 38 public new IServiceParameter Content { 35 39 get { return (IServiceParameter)base.Content; } … … 39 43 public ServiceParameterView() { 40 44 InitializeComponent(); 45 } 46 47 protected override void Dispose(bool disposing) { 48 if (disposing) { 49 if (typeSelectorDialog != null) typeSelectorDialog.Dispose(); 50 if (components != null) components.Dispose(); 51 } 52 base.Dispose(disposing); 41 53 } 42 54 … … 63 75 typeComboBox.SelectedIndex = Content.Type == ServiceParameterType.Input ? 0 : 1; 64 76 valueViewHost.ViewType = null; 65 valueViewHost.Content = Content.Value as IContent;77 valueViewHost.Content = Content.Value; 66 78 } 67 79 } … … 71 83 dataTypeTextBox.Enabled = Content != null; 72 84 typeComboBox.Enabled = Content != null && !ReadOnly; 73 valueGroupBox.Enabled = (Content as IContent) != null; 85 valueGroupBox.Enabled = Content != null; 86 setValueButton.Enabled = Content != null && !ReadOnly; 87 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly; 74 88 } 75 89 protected virtual void Content_TypeChanged(object sender, EventArgs e) { … … 84 98 Invoke(new EventHandler(Content_ValueChanged), sender, e); 85 99 else { 100 clearValueButton.Enabled = Content.Value != null; 86 101 valueViewHost.ViewType = null; 87 valueViewHost.Content = Content.Value as IContent;102 valueViewHost.Content = Content.Value; 88 103 } 89 104 } … … 92 107 Content.Type = typeComboBox.SelectedIndex == 0 ? ServiceParameterType.Input : ServiceParameterType.Output; 93 108 } 109 110 protected virtual void setValueButton_Click(object sender, EventArgs e) { 111 if (typeSelectorDialog == null) { 112 typeSelectorDialog = new TypeSelectorDialog(); 113 typeSelectorDialog.Caption = "Select Value"; 114 typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, true); 115 } 116 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) { 117 try { 118 Content.Value = (IItem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 119 } 120 catch (Exception ex) { 121 ErrorHandling.ShowErrorDialog(this, ex); 122 } 123 } 124 } 125 protected virtual void clearValueButton_Click(object sender, EventArgs e) { 126 Content.Value = null; 127 } 128 protected virtual void valuePanel_DragEnterOver(object sender, DragEventArgs e) { 129 e.Effect = DragDropEffects.None; 130 if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IItem)) { 131 if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key 132 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key 133 else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy; 134 else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move; 135 else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link; 136 } 137 } 138 protected virtual void valuePanel_DragDrop(object sender, DragEventArgs e) { 139 if (e.Effect != DragDropEffects.None) { 140 IItem item = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IItem; 141 if (e.Effect.HasFlag(DragDropEffects.Copy)) item = (IItem)item.Clone(); 142 Content.Value = item; 143 } 144 } 94 145 } 95 146 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ValuePortView.cs
r11421 r11481 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 using HeuristicLab.Core.Views;24 22 using HeuristicLab.MainForm; 25 23 using System; … … 57 55 } else { 58 56 valueViewHost.ViewType = null; 59 valueViewHost.Content = Content.Value as IContent;57 valueViewHost.Content = Content.Value; 60 58 } 61 59 } … … 63 61 protected override void SetEnabledStateOfControls() { 64 62 base.SetEnabledStateOfControls(); 65 valueGroupBox.Enabled = (Content as IContent)!= null;63 valueGroupBox.Enabled = Content != null; 66 64 } 67 65 protected virtual void Content_ValueChanged(object sender, System.EventArgs e) { … … 70 68 else { 71 69 valueViewHost.ViewType = null; 72 valueViewHost.Content = Content.Value as IContent;70 valueViewHost.Content = Content.Value; 73 71 } 74 72 }
Note: See TracChangeset
for help on using the changeset viewer.