Changeset 2715 for trunk/sources/HeuristicLab.Parameters.Views/3.3
- Timestamp:
- 01/29/10 04:15:45 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Parameters.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Parameters.Views/3.3/ItemParameterView.Designer.cs
r2714 r2715 21 21 22 22 namespace HeuristicLab.Parameters.Views { 23 partial class ItemParameterView {23 partial class ItemParameterView<T> { 24 24 /// <summary> 25 25 /// Required designer variable. -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ItemParameterView.cs
r2714 r2715 35 35 /// The visual representation of a <see cref="Parameter"/>. 36 36 /// </summary> 37 [Content(typeof(ItemParameter ), true)]38 public partial class ItemParameterView : ParameterView{37 [Content(typeof(ItemParameter<>), true)] 38 public partial class ItemParameterView<T> : ParameterView where T : class, IItem { 39 39 protected TypeSelectorDialog typeSelectorDialog; 40 40 … … 44 44 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 45 45 /// No own data storage present.</remarks> 46 public new ItemParameter Content {47 get { return (ItemParameter )base.Content; }46 public new ItemParameter<T> Content { 47 get { return (ItemParameter<T>)base.Content; } 48 48 set { base.Content = value; } 49 49 } … … 61 61 /// <remarks>Calls <see cref="VariableView()"/>.</remarks> 62 62 /// <param name="variable">The variable to represent visually.</param> 63 public ItemParameterView(ItemParameter parameter)63 public ItemParameterView(ItemParameter<T> parameter) 64 64 : this() { 65 65 Content = parameter; … … 134 134 typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, false); 135 135 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) 136 Content.Value = ( IItem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();136 Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 137 137 } 138 138 protected virtual void clearValueButton_Click(object sender, EventArgs e) { … … 152 152 protected virtual void valuePanel_DragDrop(object sender, DragEventArgs e) { 153 153 if (e.Effect != DragDropEffects.None) { 154 IItem item = e.Data.GetData("Value") as IItem;155 if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) item = ( IItem)item.Clone();154 T item = e.Data.GetData("Value") as T; 155 if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) item = (T)item.Clone(); 156 156 Content.Value = item; 157 157 }
Note: See TracChangeset
for help on using the changeset viewer.