Index: branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.cs
===================================================================
--- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.cs	(revision 5010)
+++ branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.cs	(revision 5275)
@@ -20,8 +20,8 @@
 #endregion
 
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Windows.Forms;
-using alglib;
 using HeuristicLab.Common;
 using HeuristicLab.Data;
@@ -29,10 +29,9 @@
 using HeuristicLab.MainForm.WindowsForms;
 using HeuristicLab.Optimization;
-using System;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [Content(typeof(RunCollection), false)]
   [View("RunCollection Variable Impact View")]
-  public partial class RunCollectionVariableImpactView : AsynchronousContentView {
+  public sealed partial class RunCollectionVariableImpactView : AsynchronousContentView {
     private const string variableImpactResultName = "Integrated variable frequencies";
     public RunCollectionVariableImpactView() {
@@ -45,16 +44,49 @@
     }
 
+    #region events
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
-      this.Content.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
-      this.Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
-      this.Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
+      Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
+      Content.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
+      Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
+      Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
+      RegisterRunEvents(Content);
     }
     protected override void DeregisterContentEvents() {
       base.RegisterContentEvents();
-      this.Content.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
-      this.Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
-      this.Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
-    }
+      Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
+      Content.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
+      Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
+      Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
+      DeregisterRunEvents(Content);
+    }
+    private void RegisterRunEvents(IEnumerable<IRun> runs) {
+      foreach (IRun run in runs)
+        run.Changed += new EventHandler(Run_Changed);
+    }
+    private void DeregisterRunEvents(IEnumerable<IRun> runs) {
+      foreach (IRun run in runs)
+        run.Changed -= new EventHandler(Run_Changed);
+    }
+    private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
+      RegisterRunEvents(e.Items);
+      UpdateData();
+    }
+    private void Content_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
+      DeregisterRunEvents(e.Items);
+      UpdateData();
+    }
+    private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
+      DeregisterRunEvents(e.OldItems);
+      RegisterRunEvents(e.Items);
+      UpdateData();
+    }
+    private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) {
+      if (!Content.UpdateOfRunsInProgress) UpdateData();
+    }
+    private void Run_Changed(object sender, EventArgs e) {
+      if (!Content.UpdateOfRunsInProgress) UpdateData();
+    }
+    #endregion
 
     protected override void OnContentChanged() {
@@ -62,13 +94,4 @@
       this.UpdateData();
     }
-    private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
-      this.UpdateData();
-    }
-    private void Content_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
-      this.UpdateData();
-    }
-    private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
-      this.UpdateData();
-    }
 
     private void UpdateData() {
@@ -76,8 +99,8 @@
     }
 
-    public DoubleMatrix CalculateVariableImpactMatrix() {
+    private DoubleMatrix CalculateVariableImpactMatrix() {
       DoubleMatrix matrix = null;
       if (Content != null) {
-        List<IRun> runsWithVariables = Content.Where(r => r.Results.ContainsKey(variableImpactResultName)).ToList();
+        List<IRun> runsWithVariables = Content.Where(r => r.Visible && r.Results.ContainsKey(variableImpactResultName)).ToList();
         IEnumerable<DoubleMatrix> allVariableImpacts = (from run in runsWithVariables
                                                         select run.Results[variableImpactResultName]).Cast<DoubleMatrix>();
