Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/10/09 16:50:26 (15 years ago)
Author:
swagner
Message:

Implemented generic EventArgs (#796)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.2/ScopeView.cs

    r1529 r2474  
    2828using System.Windows.Forms;
    2929using HeuristicLab.PluginInfrastructure;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Core {
     
    103104      scopeExpandedTable.Add(scope, false);
    104105      if (myAutomaticUpdating) {
    105         scope.SubScopeAdded += new EventHandler<ScopeIndexEventArgs>(Scope_SubScopeAdded);
    106         scope.SubScopeRemoved += new EventHandler<ScopeIndexEventArgs>(Scope_SubScopeRemoved);
     106        scope.SubScopeAdded += new EventHandler<EventArgs<IScope, int>>(Scope_SubScopeAdded);
     107        scope.SubScopeRemoved += new EventHandler<EventArgs<IScope, int>>(Scope_SubScopeRemoved);
    107108        scope.SubScopesReordered += new EventHandler(Scope_SubScopesReordered);
    108109      }
     
    119120        scopeNodeTable.Remove(scope);
    120121        scopeExpandedTable.Remove(scope);
    121         scope.SubScopeAdded -= new EventHandler<ScopeIndexEventArgs>(Scope_SubScopeAdded);
    122         scope.SubScopeRemoved -= new EventHandler<ScopeIndexEventArgs>(Scope_SubScopeRemoved);
     122        scope.SubScopeAdded -= new EventHandler<EventArgs<IScope, int>>(Scope_SubScopeAdded);
     123        scope.SubScopeRemoved -= new EventHandler<EventArgs<IScope, int>>(Scope_SubScopeRemoved);
    123124        scope.SubScopesReordered -= new EventHandler(Scope_SubScopesReordered);
    124125      }
     
    209210    private delegate void ScopeDelegate(IScope scope);
    210211    private delegate void ScopeScopeIndexDelegate(IScope scope, IScope subScope, int index);
    211     private void Scope_SubScopeAdded(object sender, ScopeIndexEventArgs e) {
     212    private void Scope_SubScopeAdded(object sender, EventArgs<IScope, int> e) {
    212213      IScope scope = (IScope)sender;
    213214      TreeNode node = scopeNodeTable[scope];
    214215      if (scopeExpandedTable[scope] || (scope.SubScopes.Count == 1))
    215         AddSubScope(scope, e.Scope, e.Index);
     216        AddSubScope(scope, e.Value, e.Value2);
    216217    }
    217218    private void AddSubScope(IScope scope, IScope subScope, int index) {
     
    228229      }
    229230    }
    230     private void Scope_SubScopeRemoved(object sender, ScopeIndexEventArgs e) {
     231    private void Scope_SubScopeRemoved(object sender, EventArgs<IScope, int> e) {
    231232      IScope scope = (IScope)sender;
    232233      TreeNode node = scopeNodeTable[scope];
    233234      if (scopeExpandedTable[scope] || (scope.SubScopes.Count == 0))
    234         RemoveSubScope(scope, e.Scope, e.Index);
     235        RemoveSubScope(scope, e.Value, e.Value2);
    235236    }
    236237    private void RemoveSubScope(IScope scope, IScope subScope, int index) {
Note: See TracChangeset for help on using the changeset viewer.