Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/05/10 05:23:56 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on parameters and operators
File:
1 moved

Legend:

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

    r2754 r2756  
    3535  /// The visual representation of a <see cref="Parameter"/>.
    3636  /// </summary>
    37   [Content(typeof(OperatorParameter), true)]
    38   [Content(typeof(IOperatorParameter), 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 {
    4040    protected TypeSelectorDialog typeSelectorDialog;
    4141
     
    4545    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
    4646    /// No own data storage present.</remarks>
    47     public new IOperatorParameter Content {
    48       get { return (IOperatorParameter)base.Content; }
     47    public new IValueParameter<T> Content {
     48      get { return (IValueParameter<T>)base.Content; }
    4949      set { base.Content = value; }
    5050    }
     
    5353    /// Initializes a new instance of <see cref="VariableView"/> with caption "Variable".
    5454    /// </summary>
    55     public OperatorParameterView() {
     55    public ValueParameterView() {
    5656      InitializeComponent();
    57       Caption = "OperatorParameter";
     57      Caption = "ValueParameter";
    5858    }
    5959    /// <summary>
     
    6262    /// <remarks>Calls <see cref="VariableView()"/>.</remarks>
    6363    /// <param name="variable">The variable to represent visually.</param>
    64     public OperatorParameterView(IOperatorParameter content)
     64    public ValueParameterView(IValueParameter<T> content)
    6565      : this() {
    6666      Content = content;
     
    8888      base.OnContentChanged();
    8989      if (Content == null) {
    90         Caption = "OperatorParameter";
     90        Caption = "ValueParameter";
    9191        setValueButton.Enabled = false;
    9292        clearValueButton.Enabled = false;
     
    115115      if (typeSelectorDialog == null) {
    116116        typeSelectorDialog = new TypeSelectorDialog();
    117         typeSelectorDialog.Caption = "Select Operator";
     117        typeSelectorDialog.Caption = "Select Value";
    118118        typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, false);
    119119      }
    120120      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK)
    121         Content.Value = (IOperator)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     121        Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    122122    }
    123123    protected virtual void clearValueButton_Click(object sender, EventArgs e) {
     
    137137    protected virtual void valuePanel_DragDrop(object sender, DragEventArgs e) {
    138138      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();
    141141        Content.Value = value;
    142142      }
Note: See TracChangeset for help on using the changeset viewer.