Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/29/10 01:44:57 (14 years ago)
Author:
swagner
Message:

Adapted HL 3.3 plugins according to changes in MainForm (#857)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs

    r2694 r2713  
    4242    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
    4343    /// No own data storage present.</remarks>
    44     public Variable Variable {
    45       get { return (Variable)Item; }
    46       set { base.Item = value; }
     44    public new Variable Content {
     45      get { return (Variable)base.Content; }
     46      set { base.Content = value; }
    4747    }
    4848
     
    6161    public VariableView(Variable variable)
    6262      : this() {
    63       Variable = variable;
     63      Content = variable;
    6464    }
    6565
     
    6868    /// </summary>
    6969    /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
    70     protected override void DeregisterObjectEvents() {
    71       Variable.ValueChanged -= new EventHandler(Variable_ValueChanged);
    72       base.DeregisterObjectEvents();
     70    protected override void DeregisterContentEvents() {
     71      Content.ValueChanged -= new EventHandler(Content_ValueChanged);
     72      base.DeregisterContentEvents();
    7373    }
    7474
     
    7777    /// </summary>
    7878    /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
    79     protected override void RegisterObjectEvents() {
    80       base.RegisterObjectEvents();
    81       Variable.ValueChanged += new EventHandler(Variable_ValueChanged);
     79    protected override void RegisterContentEvents() {
     80      base.RegisterContentEvents();
     81      Content.ValueChanged += new EventHandler(Content_ValueChanged);
    8282    }
    8383
    84     protected override void OnObjectChanged() {
    85       base.OnObjectChanged();
    86       if (Variable == null) {
     84    protected override void OnContentChanged() {
     85      base.OnContentChanged();
     86      if (Content == null) {
    8787        Caption = "Variable";
    8888        dataTypeTextBox.Text = "-";
     
    9191        clearValueButton.Enabled = false;
    9292        valueGroupBox.Enabled = false;
    93         viewHost.Object = null;
     93        viewHost.Content = null;
    9494      } else {
    95         Caption = Variable.Name + " (" + Variable.GetType().Name + ")";
    96         dataTypeTextBox.Text = Variable.Value == null ? "-" : Variable.Value.GetType().FullName;
    97         dataTypeTextBox.Enabled = Variable.Value != null;
    98         setValueButton.Enabled = Variable.Value == null;
    99         clearValueButton.Enabled = Variable.Value != null;
     95        Caption = Content.Name + " (" + Content.GetType().Name + ")";
     96        dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType().FullName;
     97        dataTypeTextBox.Enabled = Content.Value != null;
     98        setValueButton.Enabled = Content.Value == null;
     99        clearValueButton.Enabled = Content.Value != null;
    100100        valueGroupBox.Enabled = true;
    101         viewHost.Object = Variable.Value;
     101        viewHost.Content = Content.Value;
    102102      }
    103103    }
    104104
    105     protected virtual void Variable_ValueChanged(object sender, EventArgs e) {
     105    protected virtual void Content_ValueChanged(object sender, EventArgs e) {
    106106      if (InvokeRequired)
    107         Invoke(new EventHandler(Variable_ValueChanged), sender, e);
     107        Invoke(new EventHandler(Content_ValueChanged), sender, e);
    108108      else {
    109         dataTypeTextBox.Text = Variable.Value == null ? "-" : Variable.Value.GetType().FullName;
    110         dataTypeTextBox.Enabled = Variable.Value != null;
    111         setValueButton.Enabled = Variable.Value == null;
    112         clearValueButton.Enabled = Variable.Value != null;
    113         viewHost.Object = Variable.Value;
     109        dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType().FullName;
     110        dataTypeTextBox.Enabled = Content.Value != null;
     111        setValueButton.Enabled = Content.Value == null;
     112        clearValueButton.Enabled = Content.Value != null;
     113        viewHost.Content = Content.Value;
    114114      }
    115115    }
     
    122122      }
    123123      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    124         Variable.Value = (IItem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     124        Content.Value = (IItem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    125125      }
    126126    }
    127127    protected virtual void clearValueButton_Click(object sender, EventArgs e) {
    128       Variable.Value = null;
     128      Content.Value = null;
    129129    }
    130130    protected virtual void valuePanel_DragEnterOver(object sender, DragEventArgs e) {
     
    143143        IItem item = e.Data.GetData("Value") as IItem;
    144144        if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) item = (IItem)item.Clone();
    145         Variable.Value = item;
     145        Content.Value = item;
    146146      }
    147147    }
Note: See TracChangeset for help on using the changeset viewer.