- Timestamp:
- 02/05/10 05:23:56 (14 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
r2754 r2756 35 35 /// The visual representation of a <see cref="Parameter"/>. 36 36 /// </summary> 37 [Content(typeof( OperatorParameter), true)]38 [Content(typeof(I OperatorParameter), false)]39 public partial class OperatorParameterView : ParameterView{37 [Content(typeof(ValueParameter<>), true)] 38 [Content(typeof(IValueParameter<>), false)] 39 public partial class ValueParameterView<T> : ParameterView where T : class, IItem { 40 40 protected TypeSelectorDialog typeSelectorDialog; 41 41 … … 45 45 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 46 46 /// No own data storage present.</remarks> 47 public new I OperatorParameterContent {48 get { return (I OperatorParameter)base.Content; }47 public new IValueParameter<T> Content { 48 get { return (IValueParameter<T>)base.Content; } 49 49 set { base.Content = value; } 50 50 } … … 53 53 /// Initializes a new instance of <see cref="VariableView"/> with caption "Variable". 54 54 /// </summary> 55 public OperatorParameterView() {55 public ValueParameterView() { 56 56 InitializeComponent(); 57 Caption = " OperatorParameter";57 Caption = "ValueParameter"; 58 58 } 59 59 /// <summary> … … 62 62 /// <remarks>Calls <see cref="VariableView()"/>.</remarks> 63 63 /// <param name="variable">The variable to represent visually.</param> 64 public OperatorParameterView(IOperatorParametercontent)64 public ValueParameterView(IValueParameter<T> content) 65 65 : this() { 66 66 Content = content; … … 88 88 base.OnContentChanged(); 89 89 if (Content == null) { 90 Caption = " OperatorParameter";90 Caption = "ValueParameter"; 91 91 setValueButton.Enabled = false; 92 92 clearValueButton.Enabled = false; … … 115 115 if (typeSelectorDialog == null) { 116 116 typeSelectorDialog = new TypeSelectorDialog(); 117 typeSelectorDialog.Caption = "Select Operator";117 typeSelectorDialog.Caption = "Select Value"; 118 118 typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, false); 119 119 } 120 120 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) 121 Content.Value = ( IOperator)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();121 Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 122 122 } 123 123 protected virtual void clearValueButton_Click(object sender, EventArgs e) { … … 137 137 protected virtual void valuePanel_DragDrop(object sender, DragEventArgs e) { 138 138 if (e.Effect != DragDropEffects.None) { 139 IOperator value = e.Data.GetData("Value") as IOperator;140 if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) value = ( IOperator)value.Clone();139 T value = e.Data.GetData("Value") as T; 140 if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) value = (T)value.Clone(); 141 141 Content.Value = value; 142 142 }
Note: See TracChangeset
for help on using the changeset viewer.