Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/19 14:15:55 (5 years ago)
Author:
abeham
Message:

#3005: merged to stable (16872, 16873, 16875, 16890)

Location:
stable
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Parameters.Views/3.3/ConstrainedValueParameterView.cs

    r17097 r17149  
    6262    protected override void DeregisterContentEvents() {
    6363      Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged);
     64      Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged);
    6465      Content.ValidValues.ItemsAdded -= new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsAdded);
    6566      Content.ValidValues.ItemsRemoved -= new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsRemoved);
     
    7677      base.RegisterContentEvents();
    7778      Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged);
     79      Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged);
    7880      Content.ValidValues.ItemsAdded += new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsAdded);
    7981      Content.ValidValues.ItemsRemoved += new CollectionItemsChangedEventHandler<T>(ValidValues_ItemsRemoved);
     
    100102      base.SetEnabledStateOfControls();
    101103      valueGroupBox.Enabled = Content != null;
    102       valueComboBox.Enabled = (valueComboBox.Items.Count > 0) && !ReadOnly;
     104      valueComboBox.Enabled = Content != null && valueComboBox.Items.Count > 0 && !Content.ReadOnly && !ReadOnly;
    103105      showInRunCheckBox.Enabled = Content != null && !ReadOnly;
    104106    }
     
    153155        FillValueComboBox();
    154156    }
     157    protected virtual void Content_ReadOnlyChanged(object sender, EventArgs e) {
     158      if (InvokeRequired)
     159        Invoke(new EventHandler(Content_ReadOnlyChanged), sender, e);
     160      else {
     161        SetEnabledStateOfControls();
     162      }
     163    }
    155164    protected virtual void Content_GetsCollectedChanged(object sender, EventArgs e) {
    156165      if (InvokeRequired)
  • stable/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs

    r17097 r17149  
    7474      Content.ActualNameChanged -= new EventHandler(Content_ActualNameChanged);
    7575      Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged);
     76      Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged);
    7677      Content.ValueChanged -= new EventHandler(Content_ValueChanged);
    7778      base.DeregisterContentEvents();
     
    8687      Content.ActualNameChanged += new EventHandler(Content_ActualNameChanged);
    8788      Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged);
     89      Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged);
    8890      Content.ValueChanged += new EventHandler(Content_ValueChanged);
    8991    }
     
    108110      actualNameTextBox.Enabled = Content != null;
    109111      actualNameTextBox.ReadOnly = ReadOnly;
    110       setValueButton.Enabled = Content != null && !ReadOnly;
    111       clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly;
     112      setValueButton.Enabled = Content != null && !Content.ReadOnly && !ReadOnly;
     113      clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !ReadOnly;
    112114      showInRunCheckBox.Enabled = Content != null && !ReadOnly;
    113115    }
     
    124126      else {
    125127        SetDataTypeTextBoxText();
    126         clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly;
     128        clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !ReadOnly;
    127129        valueViewHost.ViewType = null;
    128130        valueViewHost.Content = Content != null ? Content.Value : null;
     131      }
     132    }
     133    protected virtual void Content_ReadOnlyChanged(object sender, EventArgs e) {
     134      if (InvokeRequired)
     135        Invoke(new EventHandler(Content_ReadOnlyChanged), sender, e);
     136      else {
     137        SetEnabledStateOfControls();
    129138      }
    130139    }
  • stable/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs

    r17097 r17149  
    7474    protected override void DeregisterContentEvents() {
    7575      Content.GetsCollectedChanged -= new EventHandler(Content_GetsCollectedChanged);
     76      Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged);
    7677      Content.ValueChanged -= new EventHandler(Content_ValueChanged);
    7778      base.DeregisterContentEvents();
     
    8586      base.RegisterContentEvents();
    8687      Content.GetsCollectedChanged += new EventHandler(Content_GetsCollectedChanged);
     88      Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged);
    8789      Content.ValueChanged += new EventHandler(Content_ValueChanged);
    8890    }
     
    103105    protected override void SetEnabledStateOfControls() {
    104106      base.SetEnabledStateOfControls();
    105       setValueButton.Enabled = Content != null && !(Content is IFixedValueParameter) && !ReadOnly;
    106       clearValueButton.Enabled = Content != null && Content.Value != null && !(Content is IFixedValueParameter) && !(Content is ValueParameter<T>) && !ReadOnly;
     107      setValueButton.Enabled = Content != null && !Content.ReadOnly && !(Content is IFixedValueParameter) && !ReadOnly;
     108      clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !(Content is IFixedValueParameter) && !(Content is ValueParameter<T>) && !ReadOnly;
    107109      showInRunCheckBox.Enabled = Content != null && !ReadOnly;
    108110    }
     
    113115      else {
    114116        SetDataTypeTextBoxText();
    115         setValueButton.Enabled = Content != null && !(Content is IFixedValueParameter) && !ReadOnly;
    116         clearValueButton.Enabled = Content != null && Content.Value != null && !(Content is IFixedValueParameter<T>) && !(Content is ValueParameter<T>) && !ReadOnly;
     117        setValueButton.Enabled = Content != null && !Content.ReadOnly && !(Content is IFixedValueParameter) && !ReadOnly;
     118        clearValueButton.Enabled = Content != null && !Content.ReadOnly && Content.Value != null && !(Content is IFixedValueParameter<T>) && !(Content is ValueParameter<T>) && !ReadOnly;
    117119        valueViewHost.ViewType = null;
    118120        valueViewHost.Content = Content != null ? Content.Value : null;
     121      }
     122    }
     123
     124    protected virtual void Content_ReadOnlyChanged(object sender, EventArgs e) {
     125      if (InvokeRequired)
     126        Invoke(new EventHandler(Content_ReadOnlyChanged), sender, e);
     127      else {
     128        SetEnabledStateOfControls();
    119129      }
    120130    }
     
    135145        try {
    136146          Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    137         }
    138         catch (Exception ex) {
     147        } catch (Exception ex) {
    139148          ErrorHandling.ShowErrorDialog(this, ex);
    140149        }
Note: See TracChangeset for help on using the changeset viewer.