Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/15/14 17:19:36 (10 years ago)
Author:
ascheibe
Message:

#2031 adapted sample size view to the changes of #2120

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs

    r10017 r11368  
    2525using System.Windows.Forms;
    2626using System.Windows.Forms.DataVisualization.Charting;
     27using HeuristicLab.Collections;
    2728using HeuristicLab.Common;
    2829using HeuristicLab.Core;
     
    9394
    9495    protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) {
    95       foreach (IRun run in runs)
    96         run.Changed += new EventHandler(run_Changed);
    97     }
     96      foreach (IRun run in runs) {
     97        RegisterRunParametersEvents(run);
     98        RegisterRunResultsEvents(run);
     99      }
     100    }
     101
    98102    protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) {
    99       foreach (IRun run in runs)
    100         run.Changed -= new EventHandler(run_Changed);
     103      foreach (IRun run in runs) {
     104        DeregisterRunParametersEvents(run);
     105        DeregisterRunResultsEvents(run);
     106      }
     107    }
     108
     109    private void RegisterRunParametersEvents(IRun run) {
     110      IObservableDictionary<string, IItem> dict = run.Parameters;
     111      dict.ItemsAdded += run_Changed;
     112      dict.ItemsRemoved += run_Changed;
     113      dict.ItemsReplaced += run_Changed;
     114      dict.CollectionReset += run_Changed;
     115    }
     116
     117    private void RegisterRunResultsEvents(IRun run) {
     118      IObservableDictionary<string, IItem> dict = run.Results;
     119      dict.ItemsAdded += run_Changed;
     120      dict.ItemsRemoved += run_Changed;
     121      dict.ItemsReplaced += run_Changed;
     122      dict.CollectionReset += run_Changed;
     123    }
     124
     125    private void DeregisterRunParametersEvents(IRun run) {
     126      IObservableDictionary<string, IItem> dict = run.Parameters;
     127      dict.ItemsAdded -= run_Changed;
     128      dict.ItemsRemoved -= run_Changed;
     129      dict.ItemsReplaced -= run_Changed;
     130      dict.CollectionReset -= run_Changed;
     131    }
     132
     133    private void DeregisterRunResultsEvents(IRun run) {
     134      IObservableDictionary<string, IItem> dict = run.Results;
     135      dict.ItemsAdded -= run_Changed;
     136      dict.ItemsRemoved -= run_Changed;
     137      dict.ItemsReplaced -= run_Changed;
     138      dict.CollectionReset -= run_Changed;
    101139    }
    102140
Note: See TracChangeset for help on using the changeset viewer.