diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-10-26 11:57:11 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-10-26 11:57:50 +0400 |
commit | d11c606e5b8568c4fd3366d6f6d32a1ec556b8f9 (patch) | |
tree | 702a36198bc5a991fbaa3fd7f37d391091db56b3 /main/src/addins/MonoDevelop.Refactoring | |
parent | e7127cbcf3aebc3638f1ed5215480b4ce65eee18 (diff) |
[Undo] Removed begin/end atomic undo action functions & replaced them
with an IDispoable pattern.
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring')
-rw-r--r-- | main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs index 174c7145c8..3e5a48e757 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs @@ -86,13 +86,16 @@ namespace MonoDevelop.Refactoring } static List<TextEditorData> textEditorDatas = new List<TextEditorData> (); + static List<IDisposable> undoGroups = new List<IDisposable> (); + public static void FinishRefactoringOperation () { foreach (TextEditorData data in textEditorDatas) { - data.Document.EndAtomicUndo (); data.Document.CommitUpdateAll (); } textEditorDatas.Clear (); + undoGroups.ForEach (grp => grp.Dispose ()); + undoGroups.Clear (); } internal static TextEditorData GetTextEditorData (string fileName) @@ -104,7 +107,7 @@ namespace MonoDevelop.Refactoring TextEditorData result = doc.Editor; if (result != null) { textEditorDatas.Add (result); - result.Document.BeginAtomicUndo (); + undoGroups.Add (result.OpenUndoGroup ()); return result; } } |