Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/10 04:13:49 (14 years ago)
Author:
mkommend
Message:

adapted HL.Optimization.Views to new ReadOnly mechanism (ticket #973)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs

    r3361 r3367  
    5656    protected override void OnContentChanged() {
    5757      base.OnContentChanged();
    58       if (Content == null) 
     58      if (Content == null)
    5959        globalScopeView.Content = null;
    60       else 
     60      else
    6161        globalScopeView.Content = Content.GlobalScope;
     62      SetEnableStateOfControls();
    6263    }
    6364
    64     protected override void Content_ExecutionStateChanged(object sender, EventArgs e) {
    65       if (InvokeRequired)
    66         Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);
    67       else {
     65    protected override void OnReadOnlyChanged() {
     66      base.OnReadOnlyChanged();
     67      SetEnableStateOfControls();
     68    }
     69    private void SetEnableStateOfControls() {
     70      globalScopeView.ReadOnly = ReadOnly;
     71      operatorGraphViewHost.ReadOnly = ReadOnly;
     72      if (Content == null)
     73        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = false;
     74      else
    6875        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = Content.ExecutionState != ExecutionState.Started;
    69         globalScopeView.Enabled = Content.ExecutionState != ExecutionState.Started;
    70         base.Content_ExecutionStateChanged(sender, e);
    71       }
    7276    }
    7377
Note: See TracChangeset for help on using the changeset viewer.