- Timestamp:
- 10/07/14 08:32:58 (10 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj
r11412 r11421 49 49 </ItemGroup> 50 50 <ItemGroup> 51 <Compile Include="PortView.cs"> 52 <SubType>UserControl</SubType> 53 </Compile> 54 <Compile Include="PortView.Designer.cs"> 55 <DependentUpon>PortView.cs</DependentUpon> 56 </Compile> 51 57 <Compile Include="VariablesNodeView.cs"> 52 58 <SubType>UserControl</SubType> … … 67 73 <DependentUpon>InputPortView.cs</DependentUpon> 68 74 </Compile> 69 <Compile Include=" PortView.cs">75 <Compile Include="ValuePortView.cs"> 70 76 <SubType>UserControl</SubType> 71 77 </Compile> 72 <Compile Include=" PortView.Designer.cs">73 <DependentUpon> PortView.cs</DependentUpon>78 <Compile Include="ValuePortView.Designer.cs"> 79 <DependentUpon>ValuePortView.cs</DependentUpon> 74 80 </Compile> 75 81 <Compile Include="NodeView.cs"> -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/InputPortView.cs
r11412 r11421 29 29 [Content(typeof(IInputPort<>), false)] 30 30 [Content(typeof(IInputPort), false)] 31 public partial class InputPortView : PortView {31 public partial class InputPortView : ValuePortView { 32 32 public new IInputPort Content { 33 33 get { return (IInputPort)base.Content; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/PortView.Designer.cs
r11412 r11421 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.valueGroupBox = new System.Windows.Forms.GroupBox();48 this.valuePanel = new System.Windows.Forms.Panel();49 this.valueViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();50 47 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 51 this.valueGroupBox.SuspendLayout();52 this.valuePanel.SuspendLayout();53 48 this.SuspendLayout(); 54 49 // … … 64 59 this.infoLabel.Location = new System.Drawing.Point(626, 3); 65 60 // 66 // valueGroupBox67 //68 this.valueGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)69 | System.Windows.Forms.AnchorStyles.Left)70 | System.Windows.Forms.AnchorStyles.Right)));71 this.valueGroupBox.Controls.Add(this.valuePanel);72 this.valueGroupBox.Location = new System.Drawing.Point(0, 26);73 this.valueGroupBox.Name = "valueGroupBox";74 this.valueGroupBox.Size = new System.Drawing.Size(645, 491);75 this.valueGroupBox.TabIndex = 3;76 this.valueGroupBox.TabStop = false;77 this.valueGroupBox.Text = "Value";78 //79 // valuePanel80 //81 this.valuePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)82 | System.Windows.Forms.AnchorStyles.Left)83 | System.Windows.Forms.AnchorStyles.Right)));84 this.valuePanel.Controls.Add(this.valueViewHost);85 this.valuePanel.Location = new System.Drawing.Point(6, 19);86 this.valuePanel.Name = "valuePanel";87 this.valuePanel.Size = new System.Drawing.Size(633, 466);88 this.valuePanel.TabIndex = 0;89 //90 // valueViewHost91 //92 this.valueViewHost.Caption = "View";93 this.valueViewHost.Content = null;94 this.valueViewHost.Dock = System.Windows.Forms.DockStyle.Fill;95 this.valueViewHost.Enabled = false;96 this.valueViewHost.Location = new System.Drawing.Point(0, 0);97 this.valueViewHost.Name = "valueViewHost";98 this.valueViewHost.ReadOnly = false;99 this.valueViewHost.Size = new System.Drawing.Size(633, 466);100 this.valueViewHost.TabIndex = 0;101 this.valueViewHost.ViewsLabelVisible = true;102 this.valueViewHost.ViewType = null;103 //104 61 // PortView 105 62 // 106 63 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 107 this.Controls.Add(this.valueGroupBox);108 64 this.Name = "PortView"; 109 65 this.Size = new System.Drawing.Size(645, 517); … … 111 67 this.Controls.SetChildIndex(this.nameTextBox, 0); 112 68 this.Controls.SetChildIndex(this.infoLabel, 0); 113 this.Controls.SetChildIndex(this.valueGroupBox, 0);114 69 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 115 this.valueGroupBox.ResumeLayout(false);116 this.valuePanel.ResumeLayout(false);117 70 this.ResumeLayout(false); 118 71 this.PerformLayout(); … … 122 75 #endregion 123 76 124 protected System.Windows.Forms.GroupBox valueGroupBox;125 protected System.Windows.Forms.Panel valuePanel;126 protected MainForm.WindowsForms.ViewHost valueViewHost;127 128 129 130 77 131 78 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/PortView.cs
r11412 r11421 28 28 namespace HeuristicLab.Optimization.Networks.Views { 29 29 [View("Port View")] 30 [Content(typeof(Port<>), true)] 31 [Content(typeof(IPort<>), false)] 30 [Content(typeof(Port), true)] 32 31 [Content(typeof(IPort), false)] 33 32 public partial class PortView : NamedItemView { … … 40 39 InitializeComponent(); 41 40 } 42 43 protected override void DeregisterContentEvents() {44 Content.ValueChanged -= Content_ValueChanged;45 base.DeregisterContentEvents();46 }47 48 protected override void RegisterContentEvents() {49 base.RegisterContentEvents();50 Content.ValueChanged += Content_ValueChanged;51 }52 53 protected override void OnContentChanged() {54 base.OnContentChanged();55 if (Content == null) {56 valueViewHost.Content = null;57 } else {58 valueViewHost.ViewType = null;59 valueViewHost.Content = Content.Value as IContent;60 }61 }62 63 protected override void SetEnabledStateOfControls() {64 base.SetEnabledStateOfControls();65 valueGroupBox.Enabled = (Content as IContent) != null;66 }67 protected virtual void Content_ValueChanged(object sender, System.EventArgs e) {68 if (InvokeRequired)69 Invoke(new EventHandler(Content_ValueChanged), sender, e);70 else {71 valueViewHost.ViewType = null;72 valueViewHost.Content = Content.Value as IContent;73 74 }75 }76 41 } 77 42 }
Note: See TracChangeset
for help on using the changeset viewer.