Changeset 16946 for branches/2521_ProblemRefactoring/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
- Timestamp:
- 05/13/19 13:59:30 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
r16723 r16946 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.