Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs	(revision 10611)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs	(revision 10612)
@@ -44,66 +44,66 @@
 
     public void ReplaceIndicesByAverageValue(Dictionary<int, List<int>> cells) {
-      preprocessingData.BeginTransaction();
-      foreach (var column in cells) {
-        double average = statisticInfo.GetAverage(column.Key);
-        ReplaceIndicesByValue<double>(column.Key, column.Value, average);
-      }
-      preprocessingData.EndTransaction();
+      preprocessingData.InTransaction(() => {
+        foreach (var column in cells) {
+          double average = statisticInfo.GetAverage(column.Key);
+          ReplaceIndicesByValue<double>(column.Key, column.Value, average);
+        }
+      });
     }
 
     public void ReplaceIndicesByMedianValue(Dictionary<int, List<int>> cells) {
-      preprocessingData.BeginTransaction();
-      foreach (var column in cells) {
-        double median = statisticInfo.GetMedian(column.Key);
-        ReplaceIndicesByValue<double>(column.Key, column.Value, median);
-      }
-      preprocessingData.EndTransaction();
+      preprocessingData.InTransaction(() => {
+        foreach (var column in cells) {
+          double median = statisticInfo.GetMedian(column.Key);
+          ReplaceIndicesByValue<double>(column.Key, column.Value, median);
+        }
+      });
     }
 
     public void ReplaceIndicesByRandomValue(Dictionary<int, List<int>> cells) {
-      preprocessingData.BeginTransaction();
-      Random r = new Random();
-
-      foreach (var column in cells) {
-        double max = statisticInfo.GetMax<double>(column.Key);
-        double min = statisticInfo.GetMin<double>(column.Key);
-        double randMultiplier = (max - min);
-        foreach (int index in column.Value) {
-          double rand = r.NextDouble() * randMultiplier + min;
-          preprocessingData.SetCell<double>(column.Key, index, rand);
-        }
-      }
-      preprocessingData.EndTransaction();
+      preprocessingData.InTransaction(() => {
+        Random r = new Random();
+
+        foreach (var column in cells) {
+          double max = statisticInfo.GetMax<double>(column.Key);
+          double min = statisticInfo.GetMin<double>(column.Key);
+          double randMultiplier = (max - min);
+          foreach (int index in column.Value) {
+            double rand = r.NextDouble() * randMultiplier + min;
+            preprocessingData.SetCell<double>(column.Key, index, rand);
+          }
+        }
+      });
     }
 
     public void ReplaceIndicesByLinearInterpolationOfNeighbours(Dictionary<int, List<int>> cells) {
-      preprocessingData.BeginTransaction();
-      foreach (var column in cells) {
-        int countValues = preprocessingData.GetValues<double>(column.Key).Count();
-        foreach (int index in column.Value) {
-          // dont replace first or last values
-          if (index > 0 && index < countValues) {
-            int prevIndex = indexOfPrevPresentValue(column.Key, index);
-            int nextIndex = indexOfNextPresentValue(column.Key, index);
-
-            // no neighbours found
-            if (prevIndex < 0 && nextIndex >= countValues) {
-              continue;
+      preprocessingData.InTransaction(() => {
+        foreach (var column in cells) {
+          int countValues = preprocessingData.GetValues<double>(column.Key).Count();
+          foreach (int index in column.Value) {
+            // dont replace first or last values
+            if (index > 0 && index < countValues) {
+              int prevIndex = indexOfPrevPresentValue(column.Key, index);
+              int nextIndex = indexOfNextPresentValue(column.Key, index);
+
+              // no neighbours found
+              if (prevIndex < 0 && nextIndex >= countValues) {
+                continue;
+              }
+              double prev = preprocessingData.GetCell<double>(column.Key, prevIndex);
+              double next = preprocessingData.GetCell<double>(column.Key, nextIndex);
+
+              int valuesToInterpolate = nextIndex - prevIndex;
+
+              double interpolationStep = (prev + next) / valuesToInterpolate;
+
+              for (int i = prevIndex; i < nextIndex; ++i) {
+                double interpolated = prev + (interpolationStep * (i - prevIndex));
+                preprocessingData.SetCell<double>(column.Key, i, interpolated);
+              }
             }
-            double prev = preprocessingData.GetCell<double>(column.Key, prevIndex);
-            double next = preprocessingData.GetCell<double>(column.Key, nextIndex);
-
-            int valuesToInterpolate = nextIndex - prevIndex;
-
-            double interpolationStep = (prev + next) / valuesToInterpolate;
-
-            for (int i = prevIndex; i < nextIndex; ++i) {
-              double interpolated = prev + (interpolationStep * (i - prevIndex));
-              preprocessingData.SetCell<double>(column.Key, i, interpolated);
-            }
-          }
-        }
-      }
-      preprocessingData.EndTransaction();
+          }
+        }
+      });
     }
 
@@ -127,17 +127,17 @@
 
     public void ReplaceIndicesByMostCommonValue(Dictionary<int, List<int>> cells) {
-      preprocessingData.BeginTransaction();
-      foreach (var column in cells) {
-        if (preprocessingData.IsType<double>(column.Key)) {
-          ReplaceIndicesByValue<double>(column.Key, column.Value, statisticInfo.GetMostCommonValue<double>(column.Key));
-        } else if (preprocessingData.IsType<string>(column.Key)) {
-          ReplaceIndicesByValue<string>(column.Key, column.Value, statisticInfo.GetMostCommonValue<string>(column.Key));
-        } else if (preprocessingData.IsType<DateTime>(column.Key)) {
-          ReplaceIndicesByValue<DateTime>(column.Key, column.Value, statisticInfo.GetMostCommonValue<DateTime>(column.Key));
-        } else {
-          throw new ArgumentException("column with index: " + column.Key + " contains a non supported type.");
-        }
-      }
-      preprocessingData.EndTransaction();
+      preprocessingData.InTransaction(() => {
+        foreach (var column in cells) {
+          if (preprocessingData.IsType<double>(column.Key)) {
+            ReplaceIndicesByValue<double>(column.Key, column.Value, statisticInfo.GetMostCommonValue<double>(column.Key));
+          } else if (preprocessingData.IsType<string>(column.Key)) {
+            ReplaceIndicesByValue<string>(column.Key, column.Value, statisticInfo.GetMostCommonValue<string>(column.Key));
+          } else if (preprocessingData.IsType<DateTime>(column.Key)) {
+            ReplaceIndicesByValue<DateTime>(column.Key, column.Value, statisticInfo.GetMostCommonValue<DateTime>(column.Key));
+          } else {
+            throw new ArgumentException("column with index: " + column.Key + " contains a non supported type.");
+          }
+        }
+      });
     }
 
@@ -146,18 +146,18 @@
       Random random = new Random();
 
-      preprocessingData.BeginTransaction();
-      // process all given ranges - e.g. TrainingPartition, Trainingpartition
-      foreach (IntRange range in ranges) {
-        List<Tuple<int, int>> shuffledIndices = new List<Tuple<int, int>>();
-
-        // generate random indices used for shuffeling each column
-        for (int i = range.End; i > range.Start; --i) {
-          int rand = random.Next(range.Start, i);
-          shuffledIndices.Add(new Tuple<int, int>(i, rand));
-        }
-
-        ReOrderToIndices(shuffledIndices);
-      }
-      preprocessingData.EndTransaction();
+      preprocessingData.InTransaction(() => {
+        // process all given ranges - e.g. TrainingPartition, Trainingpartition
+        foreach (IntRange range in ranges) {
+          List<Tuple<int, int>> shuffledIndices = new List<Tuple<int, int>>();
+
+          // generate random indices used for shuffeling each column
+          for (int i = range.End; i > range.Start; --i) {
+            int rand = random.Next(range.Start, i);
+            shuffledIndices.Add(new Tuple<int, int>(i, rand));
+          }
+
+          ReOrderToIndices(shuffledIndices);
+        }
+      });
     }
 
@@ -173,15 +173,15 @@
 
     public void ReOrderToIndices(IList<System.Tuple<int, int>> indices) {
-      preprocessingData.BeginTransaction();
-      for (int i = 0; i < preprocessingData.Columns; ++i) {
-        if (preprocessingData.IsType<double>(i)) {
-          reOrderToIndices<double>(i, indices);
-        } else if (preprocessingData.IsType<string>(i)) {
-          reOrderToIndices<string>(i, indices);
-        } else if (preprocessingData.IsType<DateTime>(i)) {
-          reOrderToIndices<DateTime>(i, indices);
-        }
-      }
-      preprocessingData.EndTransaction();
+      preprocessingData.InTransaction(() => {
+        for (int i = 0; i < preprocessingData.Columns; ++i) {
+          if (preprocessingData.IsType<double>(i)) {
+            reOrderToIndices<double>(i, indices);
+          } else if (preprocessingData.IsType<string>(i)) {
+            reOrderToIndices<string>(i, indices);
+          } else if (preprocessingData.IsType<DateTime>(i)) {
+            reOrderToIndices<DateTime>(i, indices);
+          }
+        }
+      });
     }
 
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/TransactionalPreprocessingData.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/TransactionalPreprocessingData.cs	(revision 10611)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/TransactionalPreprocessingData.cs	(revision 10612)
@@ -158,4 +158,10 @@
     }
 
+    public void InTransaction(Action action) {
+      BeginTransaction();
+      action();
+      EndTransaction();
+    }
+
     public void BeginTransaction() {
       SaveSnapshot(DataPreprocessingChangedEventType.Any, -1, -1);
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ITransactionalPreprocessingData.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ITransactionalPreprocessingData.cs	(revision 10611)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ITransactionalPreprocessingData.cs	(revision 10612)
@@ -21,4 +21,5 @@
 
 
+using System;
 namespace HeuristicLab.DataPreprocessing {
 
@@ -29,4 +30,5 @@
     bool IsUndoAvailable { get; }
     void Undo();
+    void InTransaction(Action action);
     void BeginTransaction();
     void EndTransaction();
