예제 #1
0
파일: UndoRedo.cs 프로젝트: daszat/zetbox
 private static void AttachEventHandlers(TextBoxBase textBox, UndoManager manager)
 {
     if (textBox != null && manager != null)
     {
         textBox.AddHandler(CommandManager.PreviewExecutedEvent, new ExecutedRoutedEventHandler(manager.ExecutedHandler), true); // we need to see all events to subvert the built-in undo/redo tracking in the text boxes
         textBox.TextChanged += new TextChangedEventHandler(manager.TextChangedHandler);
     }
 }
예제 #2
0
파일: UndoRedo.cs 프로젝트: daszat/zetbox
        public static void SetSharedUndoScope(DependencyObject obj, UndoManager value)
        {
            if (obj == null) { throw new ArgumentNullException("obj"); }

            obj.SetValue(SharedUndoScopeProperty, value);
        }
예제 #3
0
파일: UndoRedo.cs 프로젝트: daszat/zetbox
 private static void RemoveEventHandlers(TextBoxBase textBox, UndoManager manager)
 {
     if (textBox != null && manager != null)
     {
         textBox.RemoveHandler(CommandManager.PreviewExecutedEvent, new ExecutedRoutedEventHandler(manager.ExecutedHandler));
         textBox.TextChanged -= new TextChangedEventHandler(manager.TextChangedHandler);
     }
 }