Index: /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.Designer.cs
===================================================================
--- /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.Designer.cs	(revision 16786)
+++ /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.Designer.cs	(revision 16787)
@@ -38,4 +38,5 @@
       this.variableInput = new System.Windows.Forms.TextBox();
       this.groupBox1 = new System.Windows.Forms.GroupBox();
+      this.numberderivationInput = new System.Windows.Forms.ComboBox();
       this.ischeckedCheckBox = new System.Windows.Forms.CheckBox();
       this.expressionInput = new System.Windows.Forms.TextBox();
@@ -45,5 +46,4 @@
       this.derivationInput = new System.Windows.Forms.CheckBox();
       this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
-      this.numberderivationInput = new System.Windows.Forms.ComboBox();
       this.groupBox1.SuspendLayout();
       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
@@ -191,4 +191,15 @@
       this.groupBox1.Text = "Interval Constraints Detail";
       // 
+      // numberderivationInput
+      // 
+      this.numberderivationInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.numberderivationInput.FormattingEnabled = true;
+      this.numberderivationInput.Location = new System.Drawing.Point(111, 224);
+      this.numberderivationInput.Name = "numberderivationInput";
+      this.numberderivationInput.Size = new System.Drawing.Size(470, 21);
+      this.numberderivationInput.TabIndex = 27;
+      this.numberderivationInput.SelectedIndexChanged += new System.EventHandler(this.numberderivationInput_SelectedIndexChanged);
+      // 
       // ischeckedCheckBox
       // 
@@ -200,5 +211,5 @@
       this.ischeckedCheckBox.Text = "Enabled";
       this.ischeckedCheckBox.UseVisualStyleBackColor = true;
-      this.ischeckedCheckBox.CheckStateChanged += new System.EventHandler(this.ischeckedCheckBox_CheckStateChanged);
+      this.ischeckedCheckBox.CheckedChanged += new System.EventHandler(this.ischeckedCheckBox_CheckedChanged);
       // 
       // expressionInput
@@ -253,15 +264,4 @@
       this.errorProvider.ContainerControl = this;
       this.errorProvider.RightToLeft = true;
-      // 
-      // numberderivationInput
-      // 
-      this.numberderivationInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-      this.numberderivationInput.FormattingEnabled = true;
-      this.numberderivationInput.Location = new System.Drawing.Point(111, 224);
-      this.numberderivationInput.Name = "numberderivationInput";
-      this.numberderivationInput.Size = new System.Drawing.Size(470, 21);
-      this.numberderivationInput.TabIndex = 27;
-      this.numberderivationInput.SelectedIndexChanged += new System.EventHandler(this.numberderivationInput_SelectedIndexChanged);
       // 
       // IntervalConstraintView
Index: /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs
===================================================================
--- /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs	(revision 16786)
+++ /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs	(revision 16787)
@@ -38,4 +38,13 @@
     }
 
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.Changed -= new EventHandler(Content_Changed);
+    }
 
     protected override void SetEnabledStateOfControls() {
@@ -91,6 +100,6 @@
           numberderivationInput.SelectedItem = Content.NumberOfDerivation;
         }
+
         ischeckedCheckBox.Checked = Content.IsChecked;
-        Content.Changed += Content_Changed;
       }
       SetEnabledStateOfControls();
@@ -201,5 +210,5 @@
     }
 
-    private void ischeckedCheckBox_CheckStateChanged(object sender, EventArgs e) {
+    private void ischeckedCheckBox_CheckedChanged(object sender, EventArgs e) {
       if (Content.IsChecked != ischeckedCheckBox.Checked) {
         Content.IsChecked = ischeckedCheckBox.Checked;
@@ -227,6 +236,6 @@
     }
 
+
     #endregion
-
 
   }
Index: /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ParsedConstraintView.cs
===================================================================
--- /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ParsedConstraintView.cs	(revision 16786)
+++ /branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ParsedConstraintView.cs	(revision 16787)
@@ -1,3 +1,4 @@
 ﻿using System;
+using System.Collections.Generic;
 using HeuristicLab.Collections;
 using HeuristicLab.Core;
@@ -19,5 +20,5 @@
       errorOutput.Text = "";
       intervalConstraints = new CheckedItemList<IntervalConstraint>();
-      intervalConstraints.CheckedItemsChanged += constraints_CheckedItemsChanged;
+      intervalConstraints.CheckedItemsChanged += constraint_CheckedItemChanged;
     }
 
@@ -27,14 +28,17 @@
     }
 
-    private CheckedItemList<IntervalConstraint> ParseConstraints(string input) {
-      CheckedItemList<IntervalConstraint> constraints = new CheckedItemList<IntervalConstraint>(IntervalConstraintsParser.ParseInput(input, Content.ProblemData.TargetVariable, Content.ProblemData.AllowedInputVariables));
-      return constraints;
+    private IEnumerable<IntervalConstraint> ParseConstraints(string input) {
+      return IntervalConstraintsParser.ParseInput(input, Content.ProblemData.TargetVariable,
+        Content.ProblemData.AllowedInputVariables);
     }
 
     private void parseBtn_Click(object sender, EventArgs e) {
       if (constraintsInput.Text != null) {
-        intervalConstraints = ParseConstraints(constraintsInput.Text);
-        intervalConstraints.CheckedItemsChanged -= constraints_CheckedItemsChanged;
-        intervalConstraints.CheckedItemsChanged += constraints_CheckedItemsChanged;
+        ClearConstraints();
+        var parsedConstraints = ParseConstraints(constraintsInput.Text);
+        foreach (var constraint in parsedConstraints) {
+          constraint.Changed += constraint_Changed;
+          intervalConstraints.Add(constraint, constraint.IsChecked);
+        }
         constraintsOutput.Content = intervalConstraints;
         Content.Constraints = intervalConstraints;
@@ -49,15 +53,29 @@
       if (Content == null) {
         ClearConstraints();
-        constraintsInput.Text = string.Empty;
-        errorOutput.Text = string.Empty;
-        constraintsOutput.Content = intervalConstraints;
+        constraintsOutput.Content = intervalConstraints.AsReadOnly();
       } else {
+        ClearConstraints();
         constraintsInput.Text = Content.Input;
         foreach (var constraint in Content.Constraints) {
-          constraint.Changed += new EventHandler(Content_Changed);
+          constraint.Changed += constraint_Changed;
           intervalConstraints.Add(constraint, constraint.IsChecked);
         }
+
+        constraintsOutput.Content = intervalConstraints.AsReadOnly();
       }
-      constraintsOutput.Content = intervalConstraints;
+      SetEnabledStateOfControls();
+    }
+
+    private void constraint_Changed(object sender, EventArgs e) {
+      var constraint = (IntervalConstraint) sender;
+      intervalConstraints.SetItemCheckedState(constraint, constraint.IsChecked);
+    }
+
+    private void constraint_CheckedItemChanged(object sender,
+      CollectionItemsChangedEventArgs<IndexedItem<IntervalConstraint>> e) {
+      ICheckedItemList<IntervalConstraint> checkedItemList = (ICheckedItemList<IntervalConstraint>) sender;
+      foreach (var indexedItem in e.Items) {
+        indexedItem.Value.IsChecked = checkedItemList.ItemChecked(indexedItem.Value);
+      }
     }
 
@@ -66,21 +84,7 @@
     }
 
-    private void Content_Changed(object sender, EventArgs e) {
-      var constraint = (IntervalConstraint) sender;
-      intervalConstraints.SetItemCheckedState(constraint, constraint.IsChecked);
-      constraintsOutput.Content = intervalConstraints;
-    }
-
-    private void constraints_CheckedItemsChanged(object sender,
-      CollectionItemsChangedEventArgs<IndexedItem<IntervalConstraint>> e) {
-      var checkedItemList = (ICheckedItemList<IntervalConstraint>) sender;
-      foreach (var indexedItem in e.Items) {
-        indexedItem.Value.IsChecked = checkedItemList.ItemChecked(indexedItem.Value);
-      }
-    }
-
     private void ClearConstraints() {
       foreach (var constraint in intervalConstraints) {
-        constraint.Changed -= new EventHandler(Content_Changed);
+        constraint.Changed -= constraint_Changed;
       }
       intervalConstraints.Clear();
