Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/08/10 17:46:53 (14 years ago)
Author:
mkommend
Message:

Added SetEnabledStateOfControls as protected virtual method in !View. Therefore the overloading of OnReadOnlyChanged and OnLockedChanged got obsolete in most views, because the method got called in the !View respectively ContentView. (ticket #1021)

Location:
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ContentView.cs

    r3788 r3904  
    5454            if (this.content != null) this.RegisterContentEvents();
    5555            this.OnContentChanged();
     56            this.SetEnabledStateOfControls();
    5657            this.OnChanged();
    5758            this.ResumeRepaint(true);
     
    7374            locked = value;
    7475            OnLockedChanged();
     76            this.SetEnabledStateOfControls();
    7577            PropertyInfo prop = typeof(IContentView).GetProperty("Locked");
    7678            PropagateStateChanges(this, typeof(IContentView), prop);
     
    9193      }
    9294    }
    93 
    9495    /// <summary>
    9596    /// Adds eventhandlers to the current instance.
     
    109110    protected virtual void OnContentChanged() {
    110111    }
     112
     113    /// <summary>
     114    /// This method is called if the ReadyOnly, Locked or Content property of the ContentView changes to update the controls of the view.
     115    /// </summary>
     116    protected override void SetEnabledStateOfControls() {
     117    }
    111118  }
    112119}
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/View.cs

    r3788 r3904  
    6767          if (value != readOnly) {
    6868            this.SuspendRepaint();
    69             readOnly = value;
    70             OnReadOnlyChanged();
     69            this.readOnly = value;
     70            this.OnReadOnlyChanged();
     71            this.SetEnabledStateOfControls();
    7172            PropertyInfo prop = typeof(IView).GetProperty("ReadOnly");
    7273            PropagateStateChanges(this, typeof(IView), prop);
     
    7576        }
    7677      }
     78    }
     79    /// <summary>
     80    /// This method is called if the ReadyOnly property of the View changes to update the controls of the view.
     81    /// </summary>
     82    protected virtual void SetEnabledStateOfControls() {
    7783    }
    7884
Note: See TracChangeset for help on using the changeset viewer.