Changeset 17149 for stable/HeuristicLab.Parameters.Views/3.3
- Timestamp:
- 07/22/19 14:15:55 (5 years ago)
- Location:
- stable
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 16872-16873,16875,16890
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Parameters.Views/3.3/ConstrainedValueParameterView.cs
r17097 r17149 62 62 protected override void DeregisterContentEvents() { 63 63 Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged); 64 Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged); 64 65 Content.ValidValues.ItemsAdded -= new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsAdded); 65 66 Content.ValidValues.ItemsRemoved -= new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsRemoved); … … 76 77 base.RegisterContentEvents(); 77 78 Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged); 79 Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged); 78 80 Content.ValidValues.ItemsAdded += new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsAdded); 79 81 Content.ValidValues.ItemsRemoved += new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsRemoved); … … 100 102 base.SetEnabledStateOfControls(); 101 103 valueGroupBox.Enabled = Content != null; 102 valueComboBox.Enabled = (valueComboBox.Items.Count > 0)&& !ReadOnly;104 valueComboBox.Enabled = Content != null && valueComboBox.Items.Count > 0 && !Content.ReadOnly && !ReadOnly; 103 105 showInRunCheckBox.Enabled = Content != null && !ReadOnly; 104 106 } … … 153 155 FillValueComboBox(); 154 156 } 157 protected virtual void Content_ReadOnlyChanged(object sender, EventArgs e) { 158 if (InvokeRequired) 159 Invoke(new EventHandler(Content_ReadOnlyChanged), sender, e); 160 else { 161 SetEnabledStateOfControls(); 162 } 163 } 155 164 protected virtual void Content_GetsCollectedChanged(object sender, EventArgs e) { 156 165 if (InvokeRequired) -
stable/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs
r17097 r17149 74 74 Content.ActualNameChanged -= new EventHandler(Content_ActualNameChanged); 75 75 Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged); 76 Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged); 76 77 Content.ValueChanged -= new EventHandler(Content_ValueChanged); 77 78 base.DeregisterContentEvents(); … … 86 87 Content.ActualNameChanged += new EventHandler(Content_ActualNameChanged); 87 88 Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged); 89 Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged); 88 90 Content.ValueChanged += new EventHandler(Content_ValueChanged); 89 91 } … … 108 110 actualNameTextBox.Enabled = Content != null; 109 111 actualNameTextBox.ReadOnly = ReadOnly; 110 setValueButton.Enabled = Content != null && ! ReadOnly;111 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly;112 setValueButton.Enabled = Content != null && !Content.ReadOnly && !ReadOnly; 113 clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !ReadOnly; 112 114 showInRunCheckBox.Enabled = Content != null && !ReadOnly; 113 115 } … … 124 126 else { 125 127 SetDataTypeTextBoxText(); 126 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly;128 clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !ReadOnly; 127 129 valueViewHost.ViewType = null; 128 130 valueViewHost.Content = Content != null ? Content.Value : null; 131 } 132 } 133 protected virtual void Content_ReadOnlyChanged(object sender, EventArgs e) { 134 if (InvokeRequired) 135 Invoke(new EventHandler(Content_ReadOnlyChanged), sender, e); 136 else { 137 SetEnabledStateOfControls(); 129 138 } 130 139 } -
stable/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
r17097 r17149 74 74 protected override void DeregisterContentEvents() { 75 75 Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged); 76 Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged); 76 77 Content.ValueChanged -= new EventHandler(Content_ValueChanged); 77 78 base.DeregisterContentEvents(); … … 85 86 base.RegisterContentEvents(); 86 87 Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged); 88 Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged); 87 89 Content.ValueChanged += new EventHandler(Content_ValueChanged); 88 90 } … … 103 105 protected override void SetEnabledStateOfControls() { 104 106 base.SetEnabledStateOfControls(); 105 setValueButton.Enabled = Content != null && ! (Content is IFixedValueParameter) && !ReadOnly;106 clearValueButton.Enabled = Content != null && Content.Value != null && !(Content is IFixedValueParameter) && !(Content is ValueParameter<T>) && !ReadOnly;107 setValueButton.Enabled = Content != null && !Content.ReadOnly && !(Content is IFixedValueParameter) && !ReadOnly; 108 clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !(Content is IFixedValueParameter) && !(Content is ValueParameter<T>) && !ReadOnly; 107 109 showInRunCheckBox.Enabled = Content != null && !ReadOnly; 108 110 } … … 113 115 else { 114 116 SetDataTypeTextBoxText(); 115 setValueButton.Enabled = Content != null && ! (Content is IFixedValueParameter) && !ReadOnly;116 clearValueButton.Enabled = Content != null && Content.Value != null && !(Content is IFixedValueParameter<T>) && !(Content is ValueParameter<T>) && !ReadOnly;117 setValueButton.Enabled = Content != null && !Content.ReadOnly && !(Content is IFixedValueParameter) && !ReadOnly; 118 clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !(Content is IFixedValueParameter<T>) && !(Content is ValueParameter<T>) && !ReadOnly; 117 119 valueViewHost.ViewType = null; 118 120 valueViewHost.Content = Content != null ? Content.Value : null; 121 } 122 } 123 124 protected virtual void Content_ReadOnlyChanged(object sender, EventArgs e) { 125 if (InvokeRequired) 126 Invoke(new EventHandler(Content_ReadOnlyChanged), sender, e); 127 else { 128 SetEnabledStateOfControls(); 119 129 } 120 130 } … … 135 145 try { 136 146 Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 137 } 138 catch (Exception ex) { 147 } catch (Exception ex) { 139 148 ErrorHandling.ShowErrorDialog(this, ex); 140 149 }
Note: See TracChangeset
for help on using the changeset viewer.