Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/29/10 04:15:45 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • adapted parameters to be able to use generic content types of views
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ItemParameterView.cs

    r2714 r2715  
    3535  /// The visual representation of a <see cref="Parameter"/>.
    3636  /// </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 {
    3939    protected TypeSelectorDialog typeSelectorDialog;
    4040
     
    4444    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
    4545    /// 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; }
    4848      set { base.Content = value; }
    4949    }
     
    6161    /// <remarks>Calls <see cref="VariableView()"/>.</remarks>
    6262    /// <param name="variable">The variable to represent visually.</param>
    63     public ItemParameterView(ItemParameter parameter)
     63    public ItemParameterView(ItemParameter<T> parameter)
    6464      : this() {
    6565      Content = parameter;
     
    134134      typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, false);
    135135      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK)
    136         Content.Value = (IItem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     136        Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    137137    }
    138138    protected virtual void clearValueButton_Click(object sender, EventArgs e) {
     
    152152    protected virtual void valuePanel_DragDrop(object sender, DragEventArgs e) {
    153153      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();
    156156        Content.Value = item;
    157157      }
Note: See TracChangeset for help on using the changeset viewer.