Index: /branches/TerminationCriteria/HeuristicLab.Termination/3.3/TerminationOperator.cs
===================================================================
--- /branches/TerminationCriteria/HeuristicLab.Termination/3.3/TerminationOperator.cs	(revision 12307)
+++ /branches/TerminationCriteria/HeuristicLab.Termination/3.3/TerminationOperator.cs	(revision 12308)
@@ -32,5 +32,5 @@
   [Item("TerminationOperator", "An operator which either calls the terminate- or the continue branch.")]
   [StorableClass]
-  public sealed class TerminationOperator : AlgorithmOperator {
+  public sealed class TerminationOperator : InstrumentedOperator {
     public ILookupParameter<ITerminationCriterion> TerminationCriteriaParameter {
       get { return (ILookupParameter<ITerminationCriterion>)Parameters["TerminationCriteria"]; }
@@ -57,21 +57,10 @@
     [StorableConstructor]
     private TerminationOperator(bool deserializing) : base(deserializing) { }
-
     private TerminationOperator(TerminationOperator original, Cloner cloner)
       : base(original, cloner) {
-      Initialize();
     }
     public override IDeepCloneable Clone(Cloner cloner) {
       return new TerminationOperator(this, cloner);
     }
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      Initialize();
-    }
-
-
-    private Assigner Assigner { get { return OperatorGraph.Iterate().OfType<Assigner>().Single(); } }
-    private Placeholder Placeholder { get { return OperatorGraph.Iterate().OfType<Placeholder>().Single(); } }
-    private ConditionalBranch Branch { get { return OperatorGraph.Iterate().OfType<ConditionalBranch>().Single(); } }
 
     public TerminationOperator()
@@ -83,43 +72,23 @@
 
       var assigner = new Assigner() { Name = "Terminate = false" };
-      var placeholder = new Placeholder() { Name = "Check termination criteria (Placeholder)" };
-      var branch = new ConditionalBranch() { Name = "Terminate?" };
-
-      OperatorGraph.InitialOperator = assigner;
-
       assigner.LeftSideParameter.ActualName = TerminateParameter.Name;
       assigner.RightSideParameter.Value = new BoolValue(false);
-      assigner.Successor = placeholder;
 
+      var placeholder = new Placeholder() { Name = "Check termination criteria (Placeholder)" };
       placeholder.OperatorParameter.ActualName = TerminationCriteriaParameter.Name;
-      placeholder.Successor = branch;
 
-      branch.ConditionParameter.ActualName = TerminateParameter.Name;
-
-      Initialize();
+      BeforeExecutionOperators.Add(assigner);
+      BeforeExecutionOperators.Add(placeholder);
     }
 
-    private void Initialize() {
-      TerminateBranchParameter.ValueChanged += TerminateBranchParameter_ValueChanged;
-      ContinueBranchParameter.ValueChanged += ContinueBranchParameter_ValueChanged;
-
-      TerminateParameter.ActualNameChanged += TerminateParameter_ActualNameChanged;
-      TerminationCriteriaParameter.ActualNameChanged += TerminationCriteriaParameter_ActualNameChanged;
+    public override IOperation InstrumentedApply() {
+      var next = new OperationCollection(base.InstrumentedApply());
+      if (TerminateParameter.ActualValue != null && TerminateParameter.ActualValue.Value) {
+        if (TerminateBranch != null) next.Insert(0, ExecutionContext.CreateOperation(TerminateBranch));
+      } else {
+        if (ContinueBranch != null) next.Insert(0, ExecutionContext.CreateOperation(ContinueBranch));
+      }
+      return next;
     }
-
-    #region Events
-    private void TerminateBranchParameter_ValueChanged(object s, EventArgs e) {
-      Branch.TrueBranch = TerminateBranch;
-    }
-    private void ContinueBranchParameter_ValueChanged(object s, EventArgs e) {
-      Branch.FalseBranch = ContinueBranch;
-    }
-    private void TerminateParameter_ActualNameChanged(object s, EventArgs e) {
-      Assigner.LeftSideParameter.ActualName = TerminateParameter.ActualName;
-    }
-    private void TerminationCriteriaParameter_ActualNameChanged(object s, EventArgs e) {
-      Placeholder.OperatorParameter.ActualName = TerminationCriteriaParameter.ActualName;
-    }
-    #endregion
   }
 }
