Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2712


Ignore:
Timestamp:
01/29/10 01:41:59 (15 years ago)
Author:
swagner
Message:

Worked on ContentView (#857)

  • added interface IContentView
  • renamed RegisterObjectEvents and DeregisterObjectEvents to RegisterContentEvents and DeregisterContentEvents
  • removed EventArgs parameter from OnContentChanged
  • called DeregisterContentEvents in Dispose to remove content events correctly
Location:
trunk/sources
Files:
1 added
3 edited

Legend:

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

    r2696 r2712  
    1111    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    1212    protected override void Dispose(bool disposing) {
    13       if (disposing && (components != null)) {
    14         components.Dispose();
     13      if (disposing) {
     14        if (Content != null) DeregisterContentEvents();
     15        if (components != null) components.Dispose();
    1516      }
    1617      base.Dispose(disposing);
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ContentView.cs

    r2696 r2712  
    3030
    3131namespace HeuristicLab.MainForm.WindowsForms {
    32   public partial class ContentView : View {
     32  public partial class ContentView : View, IContentView {
    3333    public ContentView()
    3434      : base() {
     
    5151        } else {
    5252          if (this.content != value) {
    53             if (this.content != null)
    54               this.DeregisterObjectEvents();
     53            if (this.content != null) this.DeregisterContentEvents();
    5554            this.content = value;
    56             this.OnContentChanged(new EventArgs());
    57             if (this.content != null)
    58               this.RegisterObjectEvents();
     55            this.OnContentChanged();
     56            if (this.content != null) this.RegisterContentEvents();
    5957          }
    6058        }
     
    6563    /// Adds eventhandlers to the current instance.
    6664    /// </summary>
    67     protected virtual void RegisterObjectEvents() {
     65    protected virtual void RegisterContentEvents() {
    6866    }
    6967
     
    7169    /// Removes the eventhandlers from the current instance.
    7270    /// </summary>
    73     protected virtual void DeregisterObjectEvents() {
     71    protected virtual void DeregisterContentEvents() {
    7472    }
    7573
     
    7775    /// Is called when the content property changes.
    7876    /// </summary>
    79     protected virtual void OnContentChanged(EventArgs e) {
     77    protected virtual void OnContentChanged() {
    8078    }
    81 
    8279  }
    8380}
  • trunk/sources/HeuristicLab.MainForm/3.2/HeuristicLab.MainForm-3.2.csproj

    r2704 r2712  
    8181  </ItemGroup>
    8282  <ItemGroup>
     83    <Compile Include="Interfaces\IContentView.cs" />
    8384    <Compile Include="Interfaces\IActionUserInterfaceItem.cs" />
    8485    <Compile Include="Interfaces\IPositionableUserInterfaceItem.cs" />
Note: See TracChangeset for help on using the changeset viewer.