Changeset 4257
- Timestamp:
- 08/19/10 05:37:14 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Parameters.Views/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.Parameters.Views/3.3/ConstrainedValueParameterView.cs ¶
r4068 r4257 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Collections; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 27 using HeuristicLab.Core.Views; … … 85 86 FillValueComboBox(); 86 87 } else { 88 SetDataTypeTextBoxText(); 87 89 FillValueComboBox(); 88 90 viewHost.ViewType = null; … … 121 123 Invoke(new EventHandler(Content_ValueChanged), sender, e); 122 124 else { 123 valueComboBox.SelectedIndex = valueComboBoxItems.IndexOf(Content.Value); 125 SetDataTypeTextBoxText(); 126 valueComboBox.SelectedIndex = valueComboBoxItems.IndexOf(Content != null ? Content.Value : null); 124 127 viewHost.ViewType = null; 125 viewHost.Content = Content .Value;128 viewHost.Content = Content != null ? Content.Value : null; 126 129 } 127 130 } … … 150 153 Content.Value = valueComboBoxItems[valueComboBox.SelectedIndex]; 151 154 } 155 156 #region Helpers 157 protected void SetDataTypeTextBoxText() { 158 if (Content == null) { 159 dataTypeTextBox.Text = "-"; 160 } else { 161 if ((Content.Value != null) && (Content.Value.GetType() != Content.DataType)) 162 dataTypeTextBox.Text = Content.DataType.GetPrettyName() + " (" + Content.Value.GetType().GetPrettyName() + ")"; 163 else 164 dataTypeTextBox.Text = Content.DataType.GetPrettyName(); 165 } 166 } 167 #endregion 152 168 } 153 169 } -
TabularUnified trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs ¶
r4068 r4257 22 22 using System; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Core.Views; … … 80 81 valueViewHost.Content = null; 81 82 } else { 83 SetDataTypeTextBoxText(); 82 84 actualNameTextBox.Text = Content.ActualName; 83 85 valueViewHost.ViewType = null; … … 105 107 Invoke(new EventHandler(Content_ValueChanged), sender, e); 106 108 else { 107 clearValueButton.Enabled = Content.Value != null && !ReadOnly; 109 SetDataTypeTextBoxText(); 110 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly; 108 111 valueViewHost.ViewType = null; 109 valueViewHost.Content = Content .Value;112 valueViewHost.Content = Content != null ? Content.Value : null; 110 113 } 111 114 } … … 150 153 } 151 154 } 155 156 #region Helpers 157 protected void SetDataTypeTextBoxText() { 158 if (Content == null) { 159 dataTypeTextBox.Text = "-"; 160 } else { 161 if ((Content.Value != null) && (Content.Value.GetType() != Content.DataType)) 162 dataTypeTextBox.Text = Content.DataType.GetPrettyName() + " (" + Content.Value.GetType().GetPrettyName() + ")"; 163 else 164 dataTypeTextBox.Text = Content.DataType.GetPrettyName(); 165 } 166 } 167 #endregion 152 168 } 153 169 } -
TabularUnified trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs ¶
r4068 r4257 22 22 using System; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Core.Views; … … 79 80 valueViewHost.Content = null; 80 81 } else { 82 SetDataTypeTextBoxText(); 81 83 clearValueButton.Visible = !(Content is ValueParameter<T>); 82 84 valueViewHost.ViewType = null; … … 96 98 Invoke(new EventHandler(Content_ValueChanged), sender, e); 97 99 else { 98 clearValueButton.Enabled = Content.Value != null && !ReadOnly; 100 SetDataTypeTextBoxText(); 101 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly; 99 102 valueViewHost.ViewType = null; 100 valueViewHost.Content = Content .Value;103 valueViewHost.Content = Content != null ? Content.Value : null; 101 104 } 102 105 } … … 138 141 } 139 142 } 143 144 #region Helpers 145 protected void SetDataTypeTextBoxText() { 146 if (Content == null) { 147 dataTypeTextBox.Text = "-"; 148 } else { 149 if ((Content.Value != null) && (Content.Value.GetType() != Content.DataType)) 150 dataTypeTextBox.Text = Content.DataType.GetPrettyName() + " (" + Content.Value.GetType().GetPrettyName() + ")"; 151 else 152 dataTypeTextBox.Text = Content.DataType.GetPrettyName(); 153 } 154 } 155 #endregion 140 156 } 141 157 }
Note: See TracChangeset
for help on using the changeset viewer.