Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3649


Ignore:
Timestamp:
05/05/10 18:35:30 (15 years ago)
Author:
svonolfe
Message:

Fixed wiring of analyzer views (#999)

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Knapsack.Views/3.3/KnapsackSolutionView.cs

    r3566 r3649  
    5050      Content.WeightsChanged -= new EventHandler(Content_WeightsChanged);
    5151      Content.ValuesChanged -= new EventHandler(Content_ValuesChanged);
     52      Content.QualityChanged -= new EventHandler(Content_QualityChanged);
    5253      base.DeregisterContentEvents();
    5354    }
     
    5960      Content.WeightsChanged += new EventHandler(Content_WeightsChanged);
    6061      Content.ValuesChanged += new EventHandler(Content_ValuesChanged);
     62      Content.QualityChanged += new EventHandler(Content_QualityChanged);
    6163    }
    6264
     
    6466      if (InvokeRequired)
    6567        Invoke(new EventHandler(Content_BinaryVectorChanged), sender, e);
     68      else
     69        GenerateImage();
     70    }
     71
     72    void Content_QualityChanged(object sender, EventArgs e) {
     73      if (InvokeRequired)
     74        Invoke(new EventHandler(Content_QualityChanged), sender, e);
    6675      else
    6776        GenerateImage();
  • trunk/sources/HeuristicLab.Problems.OneMax.Views/3.3/OneMaxSolutionView.cs

    r3645 r3649  
    4848    }
    4949
     50    protected override void DeregisterContentEvents() {
     51      Content.BinaryVectorChanged -= new EventHandler(Content_BinaryVectorChanged);
     52      Content.QualityChanged -= new EventHandler(Content_QualityChanged);
     53      base.DeregisterContentEvents();
     54    }
     55    protected override void RegisterContentEvents() {
     56      base.RegisterContentEvents();
     57      Content.BinaryVectorChanged += new EventHandler(Content_BinaryVectorChanged);
     58      Content.QualityChanged += new EventHandler(Content_QualityChanged);
     59    }
     60
     61    void Content_QualityChanged(object sender, EventArgs e) {
     62      if (InvokeRequired)
     63        Invoke(new EventHandler(Content_QualityChanged), sender, e);
     64      else {
     65        qualityView.ViewType = null;
     66        qualityView.Content = Content.Quality;
     67      }
     68    }
     69
     70    void Content_BinaryVectorChanged(object sender, EventArgs e) {
     71      if (InvokeRequired)
     72        Invoke(new EventHandler(Content_QualityChanged), sender, e);
     73      else {
     74        binaryVectorView.ViewType = null;
     75        binaryVectorView.Content = Content.BinaryVector;
     76      }
     77    }
     78
    5079    protected override void OnContentChanged() {
    5180      base.OnContentChanged();
  • trunk/sources/HeuristicLab.Problems.TestFunctions.Views/3.3/SingleObjectiveTestFunctionSolutionView.cs

    r3647 r3649  
    4848    }
    4949
     50    protected override void DeregisterContentEvents() {
     51      Content.RealVectorChanged -= new EventHandler(Content_RealVectorChanged);
     52      Content.QualityChanged -= new EventHandler(Content_QualityChanged);
     53      base.DeregisterContentEvents();
     54    }
     55    protected override void RegisterContentEvents() {
     56      base.RegisterContentEvents();
     57      Content.RealVectorChanged += new EventHandler(Content_RealVectorChanged);
     58      Content.QualityChanged += new EventHandler(Content_QualityChanged);
     59    }
     60
     61    void Content_QualityChanged(object sender, EventArgs e) {
     62      if (InvokeRequired)
     63        Invoke(new EventHandler(Content_QualityChanged), sender, e);
     64      else {
     65        qualityView.ViewType = null;
     66        qualityView.Content = Content.Quality;
     67      }
     68    }
     69
     70    void Content_RealVectorChanged(object sender, EventArgs e) {
     71      if (InvokeRequired)
     72        Invoke(new EventHandler(Content_QualityChanged), sender, e);
     73      else {
     74        realVectorView.ViewType = null;
     75        realVectorView.Content = Content.RealVector;
     76      }
     77    }
     78
    5079    protected override void OnContentChanged() {
    5180      base.OnContentChanged();
Note: See TracChangeset for help on using the changeset viewer.