Changeset 4332 for trunk/sources
- Timestamp:
- 08/27/10 03:10:17 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/Interfaces/IValueParameter.cs
r2852 r4332 25 25 public interface IValueParameter : IParameter { 26 26 IItem Value { get; set; } 27 bool GetsCollected { get; set; } 27 28 event EventHandler ValueChanged; 29 event EventHandler GetsCollectedChanged; 28 30 } 29 31 -
trunk/sources/HeuristicLab.Core/3.3/ParameterizedNamedItem.cs
r4068 r4332 86 86 public virtual void CollectParameterValues(IDictionary<string, IItem> values) { 87 87 foreach (IValueParameter param in parameters.OfType<IValueParameter>()) { 88 values.Add(param.Name, param.Value);88 if (param.GetsCollected && param.Value != null) values.Add(param.Name, param.Value); 89 89 if (param.Value is IParameterizedItem) { 90 90 Dictionary<string, IItem> children = new Dictionary<string, IItem>(); -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ConstrainedValueParameterView.Designer.cs
r3281 r4332 46 46 private void InitializeComponent() { 47 47 this.valueGroupBox = new System.Windows.Forms.GroupBox(); 48 this.showInRunCheckBox = new System.Windows.Forms.CheckBox(); 48 49 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 49 50 this.valueComboBox = new System.Windows.Forms.ComboBox(); … … 51 52 this.valueGroupBox.SuspendLayout(); 52 53 this.SuspendLayout(); 53 //54 // dataTypeLabel55 //56 this.dataTypeLabel.Location = new System.Drawing.Point(3, 55);57 54 // 58 55 // dataTypeTextBox … … 78 75 | System.Windows.Forms.AnchorStyles.Left) 79 76 | System.Windows.Forms.AnchorStyles.Right))); 77 this.valueGroupBox.Controls.Add(this.showInRunCheckBox); 80 78 this.valueGroupBox.Controls.Add(this.viewHost); 81 79 this.valueGroupBox.Controls.Add(this.valueComboBox); … … 87 85 this.valueGroupBox.Text = "Value"; 88 86 // 87 // showInRunCheckBox 88 // 89 this.showInRunCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 90 this.showInRunCheckBox.AutoSize = true; 91 this.showInRunCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 92 this.showInRunCheckBox.Checked = true; 93 this.showInRunCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 94 this.showInRunCheckBox.Location = new System.Drawing.Point(290, 21); 95 this.showInRunCheckBox.Name = "showInRunCheckBox"; 96 this.showInRunCheckBox.Size = new System.Drawing.Size(90, 17); 97 this.showInRunCheckBox.TabIndex = 1; 98 this.showInRunCheckBox.Text = "&Show in Run:"; 99 this.toolTip.SetToolTip(this.showInRunCheckBox, "Check to show the value of this parameter in each run."); 100 this.showInRunCheckBox.UseVisualStyleBackColor = true; 101 this.showInRunCheckBox.CheckedChanged += new System.EventHandler(this.showInRunCheckBox_CheckedChanged); 102 // 89 103 // viewHost 90 104 // … … 92 106 | System.Windows.Forms.AnchorStyles.Left) 93 107 | System.Windows.Forms.AnchorStyles.Right))); 108 this.viewHost.Caption = "View"; 94 109 this.viewHost.Content = null; 95 110 this.viewHost.Location = new System.Drawing.Point(6, 46); 96 111 this.viewHost.Name = "viewHost"; 112 this.viewHost.ReadOnly = false; 97 113 this.viewHost.Size = new System.Drawing.Size(374, 185); 98 this.viewHost.TabIndex = 0;114 this.viewHost.TabIndex = 2; 99 115 this.viewHost.ViewType = null; 100 116 // … … 107 123 this.valueComboBox.Location = new System.Drawing.Point(6, 19); 108 124 this.valueComboBox.Name = "valueComboBox"; 109 this.valueComboBox.Size = new System.Drawing.Size( 374, 21);110 this.valueComboBox.TabIndex = 1;125 this.valueComboBox.Size = new System.Drawing.Size(278, 21); 126 this.valueComboBox.TabIndex = 0; 111 127 this.toolTip.SetToolTip(this.valueComboBox, "Selected Value"); 112 128 this.valueComboBox.SelectedIndexChanged += new System.EventHandler(this.valueComboBox_SelectedIndexChanged); … … 128 144 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 129 145 this.valueGroupBox.ResumeLayout(false); 146 this.valueGroupBox.PerformLayout(); 130 147 this.ResumeLayout(false); 131 148 this.PerformLayout(); … … 138 155 protected HeuristicLab.MainForm.WindowsForms.ViewHost viewHost; 139 156 protected System.Windows.Forms.ComboBox valueComboBox; 157 protected System.Windows.Forms.CheckBox showInRunCheckBox; 140 158 } 141 159 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ConstrainedValueParameterView.cs
r4257 r4332 61 61 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 62 62 protected override void DeregisterContentEvents() { 63 Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged); 63 64 Content.ValidValues.ItemsAdded -= new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsAdded); 64 65 Content.ValidValues.ItemsRemoved -= new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsRemoved); … … 74 75 protected override void RegisterContentEvents() { 75 76 base.RegisterContentEvents(); 77 Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged); 76 78 Content.ValidValues.ItemsAdded += new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsAdded); 77 79 Content.ValidValues.ItemsRemoved += new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsRemoved); … … 83 85 base.OnContentChanged(); 84 86 if (Content == null) { 87 showInRunCheckBox.Checked = false; 85 88 viewHost.Content = null; 86 89 FillValueComboBox(); … … 88 91 SetDataTypeTextBoxText(); 89 92 FillValueComboBox(); 93 showInRunCheckBox.Checked = Content.GetsCollected; 90 94 viewHost.ViewType = null; 91 95 viewHost.Content = Content.Value; … … 97 101 valueGroupBox.Enabled = Content != null; 98 102 valueComboBox.Enabled = (valueComboBox.Items.Count > 0) && !ReadOnly; 103 showInRunCheckBox.Enabled = Content != null && !ReadOnly; 99 104 } 100 105 101 pr ivatevoid FillValueComboBox() {106 protected virtual void FillValueComboBox() { 102 107 valueComboBox.SelectedIndexChanged -= new EventHandler(valueComboBox_SelectedIndexChanged); 103 108 valueComboBoxItems.Clear(); … … 119 124 120 125 #region Content Events 121 pr ivatevoid Content_ValueChanged(object sender, EventArgs e) {126 protected virtual void Content_ValueChanged(object sender, EventArgs e) { 122 127 if (InvokeRequired) 123 128 Invoke(new EventHandler(Content_ValueChanged), sender, e); … … 129 134 } 130 135 } 131 pr ivatevoid ValidValues_ItemsAdded(object sender, CollectionItemsChangedEventArgs<T> e) {136 protected virtual void ValidValues_ItemsAdded(object sender, CollectionItemsChangedEventArgs<T> e) { 132 137 if (InvokeRequired) 133 138 Invoke(new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsAdded), sender, e); … … 135 140 FillValueComboBox(); 136 141 } 137 pr ivatevoid ValidValues_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<T> e) {142 protected virtual void ValidValues_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<T> e) { 138 143 if (InvokeRequired) 139 144 Invoke(new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsRemoved), sender, e); … … 141 146 FillValueComboBox(); 142 147 } 143 pr ivatevoid ValidValues_CollectionReset(object sender, CollectionItemsChangedEventArgs<T> e) {148 protected virtual void ValidValues_CollectionReset(object sender, CollectionItemsChangedEventArgs<T> e) { 144 149 if (InvokeRequired) 145 150 Invoke(new CollectionItemsChangedEventHandler<T>(ValidValues_CollectionReset), sender, e); … … 147 152 FillValueComboBox(); 148 153 } 154 protected virtual void Content_GetsCollectedChanged(object sender, EventArgs e) { 155 if (InvokeRequired) 156 Invoke(new EventHandler(Content_GetsCollectedChanged), sender, e); 157 else 158 showInRunCheckBox.Checked = Content != null && Content.GetsCollected; 159 } 149 160 #endregion 150 161 151 pr ivatevoid valueComboBox_SelectedIndexChanged(object sender, EventArgs e) {162 protected virtual void valueComboBox_SelectedIndexChanged(object sender, EventArgs e) { 152 163 if (valueComboBox.SelectedIndex >= 0) 153 164 Content.Value = valueComboBoxItems[valueComboBox.SelectedIndex]; 165 } 166 protected virtual void showInRunCheckBox_CheckedChanged(object sender, EventArgs e) { 167 if (Content != null) Content.GetsCollected = showInRunCheckBox.Checked; 154 168 } 155 169 -
trunk/sources/HeuristicLab.Parameters.Views/3.3/HeuristicLab.Parameters.Views-3.3.csproj
r4065 r4332 94 94 </PropertyGroup> 95 95 <ItemGroup> 96 <Reference Include="HeuristicLab.Data-3.3"> 97 <HintPath>..\..\HeuristicLab.Data\3.3\bin\Debug\HeuristicLab.Data-3.3.dll</HintPath> 98 </Reference> 99 <Reference Include="HeuristicLab.Data.Views-3.3"> 100 <HintPath>..\..\HeuristicLab.Data.Views\3.3\bin\Debug\HeuristicLab.Data.Views-3.3.dll</HintPath> 101 </Reference> 102 <Reference Include="HeuristicLab.Optimization-3.3"> 103 <HintPath>..\..\HeuristicLab.Optimization\3.3\bin\Debug\HeuristicLab.Optimization-3.3.dll</HintPath> 104 </Reference> 96 105 <Reference Include="System" /> 97 106 <Reference Include="System.Core"> … … 100 109 <Reference Include="System.Drawing" /> 101 110 <Reference Include="System.Windows.Forms" /> 111 <Reference Include="System.Windows.Forms.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> 102 112 <Reference Include="System.Xml.Linq"> 103 113 <RequiredTargetFramework>3.5</RequiredTargetFramework> … … 182 192 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project> 183 193 <Name>HeuristicLab.MainForm-3.3</Name> 194 </ProjectReference> 195 <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj"> 196 <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project> 197 <Name>HeuristicLab.Optimization.Views-3.3</Name> 184 198 </ProjectReference> 185 199 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.Designer.cs
r4011 r4332 47 47 private void InitializeComponent() { 48 48 this.valueGroupBox = new System.Windows.Forms.GroupBox(); 49 this.showInRunCheckBox = new System.Windows.Forms.CheckBox(); 49 50 this.valueViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 50 51 this.clearValueButton = new System.Windows.Forms.Button(); … … 90 91 | System.Windows.Forms.AnchorStyles.Left) 91 92 | System.Windows.Forms.AnchorStyles.Right))); 93 this.valueGroupBox.Controls.Add(this.showInRunCheckBox); 92 94 this.valueGroupBox.Controls.Add(this.valueViewHost); 93 95 this.valueGroupBox.Controls.Add(this.clearValueButton); … … 100 102 this.valueGroupBox.Text = "Value"; 101 103 // 102 // viewHost 104 // showInRunCheckBox 105 // 106 this.showInRunCheckBox.AutoSize = true; 107 this.showInRunCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 108 this.showInRunCheckBox.Checked = true; 109 this.showInRunCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 110 this.showInRunCheckBox.Location = new System.Drawing.Point(66, 24); 111 this.showInRunCheckBox.Name = "showInRunCheckBox"; 112 this.showInRunCheckBox.Size = new System.Drawing.Size(90, 17); 113 this.showInRunCheckBox.TabIndex = 2; 114 this.showInRunCheckBox.Text = "&Show in Run:"; 115 this.toolTip.SetToolTip(this.showInRunCheckBox, "Check to show the value of this parameter in each run."); 116 this.showInRunCheckBox.UseVisualStyleBackColor = true; 117 this.showInRunCheckBox.CheckedChanged += new System.EventHandler(this.showInRunCheckBox_CheckedChanged); 118 // 119 // valueViewHost 103 120 // 104 121 this.valueViewHost.AllowDrop = true; 105 this.valueViewHost.Content = null;106 122 this.valueViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 107 123 | System.Windows.Forms.AnchorStyles.Left) 108 124 | System.Windows.Forms.AnchorStyles.Right))); 125 this.valueViewHost.Caption = "View"; 126 this.valueViewHost.Content = null; 109 127 this.valueViewHost.Location = new System.Drawing.Point(6, 49); 110 128 this.valueViewHost.Name = "valueViewHost"; 129 this.valueViewHost.ReadOnly = false; 111 130 this.valueViewHost.Size = new System.Drawing.Size(374, 156); 112 this.valueViewHost.TabIndex = 0;131 this.valueViewHost.TabIndex = 3; 113 132 this.valueViewHost.ViewType = null; 114 this.valueViewHost.DragOver += new System.Windows.Forms.DragEventHandler(this.valueViewHostPanel_DragEnterOver);115 133 this.valueViewHost.DragDrop += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragDrop); 116 134 this.valueViewHost.DragEnter += new System.Windows.Forms.DragEventHandler(this.valueViewHostPanel_DragEnterOver); 135 this.valueViewHost.DragOver += new System.Windows.Forms.DragEventHandler(this.valueViewHostPanel_DragEnterOver); 117 136 // 118 137 // clearValueButton … … 178 197 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 179 198 this.valueGroupBox.ResumeLayout(false); 199 this.valueGroupBox.PerformLayout(); 180 200 this.ResumeLayout(false); 181 201 this.PerformLayout(); … … 191 211 protected System.Windows.Forms.TextBox actualNameTextBox; 192 212 protected System.Windows.Forms.Label actualNameLabel; 213 protected System.Windows.Forms.CheckBox showInRunCheckBox; 193 214 } 194 215 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs
r4257 r4332 61 61 protected override void DeregisterContentEvents() { 62 62 Content.ActualNameChanged -= new EventHandler(Content_ActualNameChanged); 63 Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged); 63 64 Content.ValueChanged -= new EventHandler(Content_ValueChanged); 64 65 base.DeregisterContentEvents(); … … 72 73 base.RegisterContentEvents(); 73 74 Content.ActualNameChanged += new EventHandler(Content_ActualNameChanged); 75 Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged); 74 76 Content.ValueChanged += new EventHandler(Content_ValueChanged); 75 77 } … … 79 81 if (Content == null) { 80 82 actualNameTextBox.Text = "-"; 83 showInRunCheckBox.Checked = false; 81 84 valueViewHost.Content = null; 82 85 } else { 83 86 SetDataTypeTextBoxText(); 84 87 actualNameTextBox.Text = Content.ActualName; 88 showInRunCheckBox.Checked = Content.GetsCollected; 85 89 valueViewHost.ViewType = null; 86 90 valueViewHost.Content = Content.Value; … … 94 98 setValueButton.Enabled = Content != null && !ReadOnly; 95 99 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly; 100 showInRunCheckBox.Enabled = Content != null && !ReadOnly; 96 101 valueGroupBox.Enabled = Content != null; 97 102 } … … 112 117 valueViewHost.Content = Content != null ? Content.Value : null; 113 118 } 119 } 120 protected virtual void Content_GetsCollectedChanged(object sender, EventArgs e) { 121 if (InvokeRequired) 122 Invoke(new EventHandler(Content_GetsCollectedChanged), sender, e); 123 else 124 showInRunCheckBox.Checked = Content != null && Content.GetsCollected; 114 125 } 115 126 … … 134 145 protected virtual void clearValueButton_Click(object sender, EventArgs e) { 135 146 Content.Value = null; 147 } 148 protected virtual void showInRunCheckBox_CheckedChanged(object sender, EventArgs e) { 149 if (Content != null) Content.GetsCollected = showInRunCheckBox.Checked; 136 150 } 137 151 protected virtual void valueViewHostPanel_DragEnterOver(object sender, DragEventArgs e) { -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.Designer.cs
r4011 r4332 47 47 private void InitializeComponent() { 48 48 this.valueGroupBox = new System.Windows.Forms.GroupBox(); 49 this.showInRunCheckBox = new System.Windows.Forms.CheckBox(); 49 50 this.valueViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 50 51 this.clearValueButton = new System.Windows.Forms.Button(); … … 76 77 | System.Windows.Forms.AnchorStyles.Left) 77 78 | System.Windows.Forms.AnchorStyles.Right))); 79 this.valueGroupBox.Controls.Add(this.showInRunCheckBox); 78 80 this.valueGroupBox.Controls.Add(this.valueViewHost); 79 81 this.valueGroupBox.Controls.Add(this.clearValueButton); … … 86 88 this.valueGroupBox.Text = "Value"; 87 89 // 88 // viewHost 90 // showInRunCheckBox 91 // 92 this.showInRunCheckBox.AutoSize = true; 93 this.showInRunCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 94 this.showInRunCheckBox.Checked = true; 95 this.showInRunCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 96 this.showInRunCheckBox.Location = new System.Drawing.Point(66, 24); 97 this.showInRunCheckBox.Name = "showInRunCheckBox"; 98 this.showInRunCheckBox.Size = new System.Drawing.Size(90, 17); 99 this.showInRunCheckBox.TabIndex = 2; 100 this.showInRunCheckBox.Text = "&Show in Run:"; 101 this.toolTip.SetToolTip(this.showInRunCheckBox, "Check to show the value of this parameter in each run."); 102 this.showInRunCheckBox.UseVisualStyleBackColor = true; 103 this.showInRunCheckBox.CheckedChanged += new System.EventHandler(this.showInRunCheckBox_CheckedChanged); 104 // 105 // valueViewHost 89 106 // 90 107 this.valueViewHost.AllowDrop = true; 91 this.valueViewHost.Content = null;92 108 this.valueViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 93 109 | System.Windows.Forms.AnchorStyles.Left) 94 110 | System.Windows.Forms.AnchorStyles.Right))); 111 this.valueViewHost.Caption = "View"; 112 this.valueViewHost.Content = null; 95 113 this.valueViewHost.Location = new System.Drawing.Point(6, 49); 96 this.valueViewHost.Name = "viewHost"; 114 this.valueViewHost.Name = "valueViewHost"; 115 this.valueViewHost.ReadOnly = false; 97 116 this.valueViewHost.Size = new System.Drawing.Size(374, 182); 98 this.valueViewHost.TabIndex = 0;117 this.valueViewHost.TabIndex = 3; 99 118 this.valueViewHost.ViewType = null; 100 this.valueViewHost.DragOver += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragEnterOver);101 119 this.valueViewHost.DragDrop += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragDrop); 102 120 this.valueViewHost.DragEnter += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragEnterOver); 121 this.valueViewHost.DragOver += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragEnterOver); 103 122 // 104 123 // clearValueButton … … 112 131 this.toolTip.SetToolTip(this.clearValueButton, "Clear Value"); 113 132 this.clearValueButton.UseVisualStyleBackColor = true; 114 this.clearValueButton.Click += new System.EventHandler(this. setValueButton_Click);133 this.clearValueButton.Click += new System.EventHandler(this.clearValueButton_Click); 115 134 // 116 135 // setValueButton … … 123 142 this.toolTip.SetToolTip(this.setValueButton, "Set Value"); 124 143 this.setValueButton.UseVisualStyleBackColor = true; 125 this.setValueButton.Click += new System.EventHandler(this. changeValueButton_Click);144 this.setValueButton.Click += new System.EventHandler(this.setValueButton_Click); 126 145 // 127 146 // ValueParameterView … … 141 160 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 142 161 this.valueGroupBox.ResumeLayout(false); 162 this.valueGroupBox.PerformLayout(); 143 163 this.ResumeLayout(false); 144 164 this.PerformLayout(); … … 152 172 protected System.Windows.Forms.Button setValueButton; 153 173 protected System.Windows.Forms.Button clearValueButton; 174 protected System.Windows.Forms.CheckBox showInRunCheckBox; 154 175 } 155 176 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
r4257 r4332 61 61 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> 62 62 protected override void DeregisterContentEvents() { 63 Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged); 63 64 Content.ValueChanged -= new EventHandler(Content_ValueChanged); 64 65 base.DeregisterContentEvents(); … … 71 72 protected override void RegisterContentEvents() { 72 73 base.RegisterContentEvents(); 74 Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged); 73 75 Content.ValueChanged += new EventHandler(Content_ValueChanged); 74 76 } … … 77 79 base.OnContentChanged(); 78 80 if (Content == null) { 79 clearValueButton.Visible = true;81 showInRunCheckBox.Checked = false; 80 82 valueViewHost.Content = null; 81 83 } else { 82 84 SetDataTypeTextBoxText(); 83 clearValueButton.Visible = !(Content is ValueParameter<T>);85 showInRunCheckBox.Checked = Content.GetsCollected; 84 86 valueViewHost.ViewType = null; 85 87 valueViewHost.Content = Content.Value; … … 90 92 base.SetEnabledStateOfControls(); 91 93 setValueButton.Enabled = Content != null && !ReadOnly; 92 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly; 94 clearValueButton.Enabled = Content != null && Content.Value != null && !(Content is ValueParameter<T>) && !ReadOnly; 95 showInRunCheckBox.Enabled = Content != null && !ReadOnly; 93 96 valueGroupBox.Enabled = Content != null; 94 97 } … … 99 102 else { 100 103 SetDataTypeTextBoxText(); 101 clearValueButton.Enabled = Content != null && Content.Value != null && ! ReadOnly;104 clearValueButton.Enabled = Content != null && Content.Value != null && !(Content is ValueParameter<T>) && !ReadOnly; 102 105 valueViewHost.ViewType = null; 103 106 valueViewHost.Content = Content != null ? Content.Value : null; 104 107 } 105 108 } 109 protected virtual void Content_GetsCollectedChanged(object sender, EventArgs e) { 110 if (InvokeRequired) 111 Invoke(new EventHandler(Content_GetsCollectedChanged), sender, e); 112 else 113 showInRunCheckBox.Checked = Content != null && Content.GetsCollected; 114 } 106 115 107 protected virtual void changeValueButton_Click(object sender, EventArgs e) {116 protected virtual void setValueButton_Click(object sender, EventArgs e) { 108 117 if (typeSelectorDialog == null) { 109 118 typeSelectorDialog = new TypeSelectorDialog(); … … 120 129 } 121 130 } 122 protected virtual void setValueButton_Click(object sender, EventArgs e) {131 protected virtual void clearValueButton_Click(object sender, EventArgs e) { 123 132 Content.Value = null; 133 } 134 protected virtual void showInRunCheckBox_CheckedChanged(object sender, EventArgs e) { 135 if (Content != null) Content.GetsCollected = showInRunCheckBox.Checked; 124 136 } 125 137 protected virtual void valueViewHost_DragEnterOver(object sender, DragEventArgs e) { -
trunk/sources/HeuristicLab.Parameters/3.3/ConstrainedValueParameter.cs
r4068 r4332 43 43 public ConstrainedValueParameter() : base() { } 44 44 public ConstrainedValueParameter(string name) : base(name) { } 45 public ConstrainedValueParameter(string name, bool getsCollected) : base(name, getsCollected) { } 45 46 public ConstrainedValueParameter(string name, ItemSet<T> validValues) : base(name, validValues) { } 47 public ConstrainedValueParameter(string name, ItemSet<T> validValues, bool getsCollected) : base(name, validValues, getsCollected) { } 46 48 public ConstrainedValueParameter(string name, ItemSet<T> validValues, T value) : base(name, validValues, value) { } 49 public ConstrainedValueParameter(string name, ItemSet<T> validValues, T value, bool getsCollected) : base(name, validValues, value, getsCollected) { } 47 50 public ConstrainedValueParameter(string name, string description) : base(name, description) { } 51 public ConstrainedValueParameter(string name, string description, bool getsCollected) : base(name, description, getsCollected) { } 48 52 public ConstrainedValueParameter(string name, string description, ItemSet<T> validValues) : base(name, description, validValues) { } 53 public ConstrainedValueParameter(string name, string description, ItemSet<T> validValues, bool getsCollected) : base(name, description, validValues, getsCollected) { } 49 54 public ConstrainedValueParameter(string name, string description, ItemSet<T> validValues, T value) : base(name, description, validValues, value) { } 55 public ConstrainedValueParameter(string name, string description, ItemSet<T> validValues, T value, bool getsCollected) : base(name, description, validValues, value, getsCollected) { } 56 [StorableConstructor] 57 protected ConstrainedValueParameter(bool deserializing) : base(deserializing) { } 50 58 51 59 protected override void ValidValues_ItemsAdded(object sender, CollectionItemsChangedEventArgs<T> e) { -
trunk/sources/HeuristicLab.Parameters/3.3/LookupParameter.cs
r3822 r4332 173 173 174 174 public event EventHandler ActualNameChanged; 175 pr ivatevoid OnActualNameChanged() {176 if (ActualNameChanged != null)177 ActualNameChanged(this, EventArgs.Empty);175 protected virtual void OnActualNameChanged() { 176 EventHandler handler = ActualNameChanged; 177 if (handler != null) handler(this, EventArgs.Empty); 178 178 OnToStringChanged(); 179 179 } -
trunk/sources/HeuristicLab.Parameters/3.3/OperatorParameter.cs
r4068 r4332 30 30 [StorableClass] 31 31 public class OperatorParameter : OptionalValueParameter<IOperator> { 32 public OperatorParameter() 33 : base("Anonymous") { 34 } 35 public OperatorParameter(string name) 36 : base(name) { 37 } 38 public OperatorParameter(string name, IOperator value) 39 : base(name, value) { 40 Value = value; 41 } 42 public OperatorParameter(string name, string description) 43 : base(name, description) { 44 } 45 public OperatorParameter(string name, string description, IOperator value) 46 : base(name, description, value) { 47 Value = value; 48 } 32 public OperatorParameter() : base("Anonymous") { } 33 public OperatorParameter(string name) : base(name) { } 34 public OperatorParameter(string name, bool getsCollected) : base(name, getsCollected) { } 35 public OperatorParameter(string name, IOperator value) : base(name, value) { } 36 public OperatorParameter(string name, IOperator value, bool getsCollected) : base(name, value, getsCollected) { } 37 public OperatorParameter(string name, string description) : base(name, description) { } 38 public OperatorParameter(string name, string description, bool getsCollected) : base(name, description, getsCollected) { } 39 public OperatorParameter(string name, string description, IOperator value) : base(name, description, value) { } 40 public OperatorParameter(string name, string description, IOperator value, bool getsCollected) : base(name, description, value, getsCollected) { } 41 [StorableConstructor] 42 protected OperatorParameter(bool deserializing) : base(deserializing) { } 49 43 } 50 44 } -
trunk/sources/HeuristicLab.Parameters/3.3/OptionalConstrainedValueParameter.cs
r3822 r4332 61 61 } 62 62 } 63 64 63 IItem IValueParameter.Value { 65 64 get { return Value; } … … 75 74 } 76 75 76 [Storable(DefaultValue = true)] 77 private bool getsCollected; 78 public bool GetsCollected { 79 get { return getsCollected; } 80 set { 81 if (value != getsCollected) { 82 getsCollected = value; 83 OnGetsCollectedChanged(); 84 } 85 } 86 } 87 88 #region Constructors 77 89 public OptionalConstrainedValueParameter() 78 90 : base("Anonymous", typeof(T)) { 79 91 this.validValues = new ItemSet<T>(); 92 this.getsCollected = true; 80 93 Initialize(); 81 94 } … … 83 96 : base(name, typeof(T)) { 84 97 this.validValues = new ItemSet<T>(); 98 this.getsCollected = true; 99 Initialize(); 100 } 101 public OptionalConstrainedValueParameter(string name, bool getsCollected) 102 : base(name, typeof(T)) { 103 this.validValues = new ItemSet<T>(); 104 this.getsCollected = getsCollected; 85 105 Initialize(); 86 106 } … … 88 108 : base(name, typeof(T)) { 89 109 this.validValues = validValues; 110 this.getsCollected = true; 111 Initialize(); 112 } 113 public OptionalConstrainedValueParameter(string name, ItemSet<T> validValues, bool getsCollected) 114 : base(name, typeof(T)) { 115 this.validValues = validValues; 116 this.getsCollected = getsCollected; 90 117 Initialize(); 91 118 } … … 94 121 this.validValues = validValues; 95 122 this.value = value; 123 this.getsCollected = true; 124 Initialize(); 125 } 126 public OptionalConstrainedValueParameter(string name, ItemSet<T> validValues, T value, bool getsCollected) 127 : base(name, typeof(T)) { 128 this.validValues = validValues; 129 this.value = value; 130 this.getsCollected = getsCollected; 96 131 Initialize(); 97 132 } … … 99 134 : base(name, description, typeof(T)) { 100 135 this.validValues = new ItemSet<T>(); 136 this.getsCollected = true; 137 Initialize(); 138 } 139 public OptionalConstrainedValueParameter(string name, string description, bool getsCollected) 140 : base(name, description, typeof(T)) { 141 this.validValues = new ItemSet<T>(); 142 this.getsCollected = getsCollected; 101 143 Initialize(); 102 144 } … … 104 146 : base(name, description, typeof(T)) { 105 147 this.validValues = validValues; 148 this.getsCollected = true; 149 Initialize(); 150 } 151 public OptionalConstrainedValueParameter(string name, string description, ItemSet<T> validValues, bool getsCollected) 152 : base(name, description, typeof(T)) { 153 this.validValues = validValues; 154 this.getsCollected = getsCollected; 106 155 Initialize(); 107 156 } … … 110 159 this.validValues = validValues; 111 160 this.value = value; 161 this.getsCollected = true; 162 Initialize(); 163 } 164 public OptionalConstrainedValueParameter(string name, string description, ItemSet<T> validValues, T value, bool getsCollected) 165 : base(name, description, typeof(T)) { 166 this.validValues = validValues; 167 this.value = value; 168 this.getsCollected = getsCollected; 112 169 Initialize(); 113 170 } 114 171 [StorableConstructor] 115 172 protected OptionalConstrainedValueParameter(bool deserializing) : base(deserializing) { } 173 #endregion 116 174 117 175 [StorableHook(HookType.AfterDeserialization)] … … 125 183 clone.validValues = (ItemSet<T>)cloner.Clone(validValues); 126 184 clone.value = (T)cloner.Clone(value); 185 clone.getsCollected = getsCollected; 127 186 clone.Initialize(); 128 187 return clone; … … 142 201 public event EventHandler ValueChanged; 143 202 protected virtual void OnValueChanged() { 144 if (ValueChanged != null)145 ValueChanged(this, EventArgs.Empty);203 EventHandler handler = ValueChanged; 204 if (handler != null) handler(this, EventArgs.Empty); 146 205 OnItemImageChanged(); 147 206 OnToStringChanged(); 207 } 208 public event EventHandler GetsCollectedChanged; 209 protected virtual void OnGetsCollectedChanged() { 210 EventHandler handler = GetsCollectedChanged; 211 if (handler != null) handler(this, EventArgs.Empty); 148 212 } 149 213 -
trunk/sources/HeuristicLab.Parameters/3.3/OptionalValueParameter.cs
r3822 r4332 66 66 } 67 67 68 [Storable(DefaultValue = true)] 69 private bool getsCollected; 70 public bool GetsCollected { 71 get { return getsCollected; } 72 set { 73 if (value != getsCollected) { 74 getsCollected = value; 75 OnGetsCollectedChanged(); 76 } 77 } 78 } 79 80 #region Constructors 68 81 public OptionalValueParameter() 69 82 : base("Anonymous", typeof(T)) { 83 this.getsCollected = true; 70 84 } 71 85 public OptionalValueParameter(string name) 72 86 : base(name, typeof(T)) { 87 this.getsCollected = true; 88 } 89 public OptionalValueParameter(string name, bool getsCollected) 90 : base(name, typeof(T)) { 91 this.getsCollected = getsCollected; 73 92 } 74 93 public OptionalValueParameter(string name, T value) 75 94 : base(name, typeof(T)) { 76 95 this.value = value; 96 this.getsCollected = true; 97 Initialize(); 98 } 99 public OptionalValueParameter(string name, T value, bool getsCollected) 100 : base(name, typeof(T)) { 101 this.value = value; 102 this.getsCollected = getsCollected; 77 103 Initialize(); 78 104 } 79 105 public OptionalValueParameter(string name, string description) 80 106 : base(name, description, typeof(T)) { 107 this.getsCollected = true; 108 } 109 public OptionalValueParameter(string name, string description, bool getsCollected) 110 : base(name, description, typeof(T)) { 111 this.getsCollected = getsCollected; 81 112 } 82 113 public OptionalValueParameter(string name, string description, T value) 83 114 : base(name, description, typeof(T)) { 84 115 this.value = value; 116 this.getsCollected = true; 117 Initialize(); 118 } 119 public OptionalValueParameter(string name, string description, T value, bool getsCollected) 120 : base(name, description, typeof(T)) { 121 this.value = value; 122 this.getsCollected = getsCollected; 85 123 Initialize(); 86 124 } 87 125 [StorableConstructor] 88 126 protected OptionalValueParameter(bool deserializing) : base(deserializing) { } 127 #endregion 89 128 90 129 [StorableHook(HookType.AfterDeserialization)] … … 96 135 OptionalValueParameter<T> clone = (OptionalValueParameter<T>)base.Clone(cloner); 97 136 clone.value = (T)cloner.Clone(value); 137 clone.getsCollected = getsCollected; 98 138 clone.Initialize(); 99 139 return clone; … … 112 152 113 153 public event EventHandler ValueChanged; 114 pr ivatevoid OnValueChanged() {115 if (ValueChanged != null)116 ValueChanged(this, EventArgs.Empty);154 protected virtual void OnValueChanged() { 155 EventHandler handler = ValueChanged; 156 if (handler != null) handler(this, EventArgs.Empty); 117 157 OnItemImageChanged(); 118 158 OnToStringChanged(); 159 } 160 public event EventHandler GetsCollectedChanged; 161 protected virtual void OnGetsCollectedChanged() { 162 EventHandler handler = GetsCollectedChanged; 163 if (handler != null) handler(this, EventArgs.Empty); 119 164 } 120 165 -
trunk/sources/HeuristicLab.Parameters/3.3/ScopeParameter.cs
r4068 r4332 44 44 : base(name, description, typeof(IScope)) { 45 45 } 46 [StorableConstructor] 47 protected ScopeParameter(bool deserializing) : base(deserializing) { } 46 48 47 49 public override string ToString() { -
trunk/sources/HeuristicLab.Parameters/3.3/ValueLookupParameter.cs
r3822 r4332 66 66 } 67 67 68 [Storable(DefaultValue = true)] 69 private bool getsCollected; 70 public bool GetsCollected { 71 get { return getsCollected; } 72 set { 73 if (value != getsCollected) { 74 getsCollected = value; 75 OnGetsCollectedChanged(); 76 } 77 } 78 } 79 80 #region Constructors 68 81 public ValueLookupParameter() 69 82 : base() { 83 this.getsCollected = true; 70 84 } 71 85 public ValueLookupParameter(string name) 72 86 : base(name) { 87 this.getsCollected = true; 88 } 89 public ValueLookupParameter(string name, bool getsCollected) 90 : base(name) { 91 this.getsCollected = getsCollected; 73 92 } 74 93 public ValueLookupParameter(string name, T value) 75 94 : base(name) { 76 95 this.value = value; 96 this.getsCollected = true; 97 Initialize(); 98 } 99 public ValueLookupParameter(string name, T value, bool getsCollected) 100 : base(name) { 101 this.value = value; 102 this.getsCollected = getsCollected; 77 103 Initialize(); 78 104 } 79 105 public ValueLookupParameter(string name, string description) 80 106 : base(name, description) { 107 this.getsCollected = true; 108 } 109 public ValueLookupParameter(string name, string description, bool getsCollected) 110 : base(name, description) { 111 this.getsCollected = getsCollected; 81 112 } 82 113 public ValueLookupParameter(string name, string description, T value) 83 114 : base(name, description) { 84 115 this.value = value; 116 this.getsCollected = true; 117 Initialize(); 118 } 119 public ValueLookupParameter(string name, string description, T value, bool getsCollected) 120 : base(name, description) { 121 this.value = value; 122 this.getsCollected = getsCollected; 85 123 Initialize(); 86 124 } 87 125 public ValueLookupParameter(string name, string description, string actualName) 88 126 : base(name, description, actualName) { 127 this.getsCollected = true; 128 } 129 public ValueLookupParameter(string name, string description, string actualName, bool getsCollected) 130 : base(name, description, actualName) { 131 this.getsCollected = getsCollected; 89 132 } 90 133 [StorableConstructor] 91 134 protected ValueLookupParameter(bool deserializing) : base(deserializing) { } 135 #endregion 92 136 93 137 [StorableHook(HookType.AfterDeserialization)] … … 99 143 ValueLookupParameter<T> clone = (ValueLookupParameter<T>)base.Clone(cloner); 100 144 clone.value = (T)cloner.Clone(value); 145 clone.getsCollected = getsCollected; 101 146 clone.Initialize(); 102 147 return clone; … … 113 158 114 159 public event EventHandler ValueChanged; 115 pr ivatevoid OnValueChanged() {116 if (ValueChanged != null)117 ValueChanged(this, EventArgs.Empty);160 protected virtual void OnValueChanged() { 161 EventHandler handler = ValueChanged; 162 if (handler != null) handler(this, EventArgs.Empty); 118 163 OnItemImageChanged(); 119 164 OnToStringChanged(); 165 } 166 public event EventHandler GetsCollectedChanged; 167 protected virtual void OnGetsCollectedChanged() { 168 EventHandler handler = GetsCollectedChanged; 169 if (handler != null) handler(this, EventArgs.Empty); 120 170 } 121 171 -
trunk/sources/HeuristicLab.Parameters/3.3/ValueParameter.cs
r4068 r4332 41 41 public ValueParameter() : base() { } 42 42 public ValueParameter(string name) : base(name) { } 43 public ValueParameter(string name, bool getsCollected) : base(name, getsCollected) { } 43 44 public ValueParameter(string name, T value) : base(name, value) { } 45 public ValueParameter(string name, T value, bool getsCollected) : base(name, value, getsCollected) { } 44 46 public ValueParameter(string name, string description) : base(name, description) { } 47 public ValueParameter(string name, string description, bool getsCollected) : base(name, description, getsCollected) { } 45 48 public ValueParameter(string name, string description, T value) : base(name, description, value) { } 49 public ValueParameter(string name, string description, T value, bool getsCollected) : base(name, description, value, getsCollected) { } 50 [StorableConstructor] 51 protected ValueParameter(bool deserializing) : base(deserializing) { } 46 52 } 47 53 }
Note: See TracChangeset
for help on using the changeset viewer.