2121using System . ComponentModel ;
2222using System . Windows . Forms ;
2323using NClass . Core ;
24+ using NClass . Core . UndoRedo ;
2425using NClass . CSharp ;
2526using NClass . Java ;
2627using NClass . DiagramEditor ;
@@ -39,6 +40,7 @@ public sealed partial class MainForm : Form
3940 bool showNavigator = true ;
4041 DynamicMenu dynamicMenu = null ;
4142 List < Plugin > plugins = new List < Plugin > ( ) ;
43+ private readonly UndoRedoExplorer undoRedoExplorer = new UndoRedoExplorer ( ) ;
4244
4345 public MainForm ( )
4446 {
@@ -54,6 +56,7 @@ public MainForm()
5456 modelExplorer . Workspace = Workspace . Default ;
5557 tabbedWindow . DocumentManager = docManager ;
5658 diagramNavigator . DocumentVisualizer = tabbedWindow . Canvas ;
59+ undoRedoExplorer . Show ( this ) ;
5760
5861 UpdateTexts ( ) ;
5962 UpdateStatusBar ( ) ;
@@ -466,7 +469,7 @@ private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e
466469 docManager . ActiveDocument . StatusChanged += ActiveDocument_StatusChanged ;
467470 docManager . ActiveDocument . ClipboardAvailabilityChanged +=
468471 ActiveDocument_ClipboardAvailabilityChanged ;
469- docManager . ActiveDocument . UndoRedoChanged += ActiveDocument_UndoRedChanged ;
472+ docManager . ActiveDocument . UndoRedoChanged += ActiveDocument_UndoRedoChanged ;
470473 }
471474 else
472475 {
@@ -480,7 +483,7 @@ private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e
480483 oldDocument . StatusChanged -= ActiveDocument_StatusChanged ;
481484 oldDocument . ClipboardAvailabilityChanged -=
482485 ActiveDocument_ClipboardAvailabilityChanged ;
483- oldDocument . UndoRedoChanged -= ActiveDocument_UndoRedChanged ;
486+ oldDocument . UndoRedoChanged -= ActiveDocument_UndoRedoChanged ;
484487 }
485488
486489 UpdateStatusBar ( ) ;
@@ -490,9 +493,10 @@ private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e
490493 UpdateStandardToolStrip ( ) ;
491494 }
492495
493- private void ActiveDocument_UndoRedChanged ( object sender , EventArgs e )
496+ private void ActiveDocument_UndoRedoChanged ( object sender , UndoRedoEventArgs e )
494497 {
495498 UpdateUndoRedoButtons ( ) ;
499+ undoRedoExplorer . Track ( e ) ;
496500 }
497501
498502 private void ActiveDocument_Modified ( object sender , EventArgs e )
0 commit comments