public class UndoEngineExt : UndoEngine
{
private System.Collections.Generic.Stack<UndoEngine.UndoUnit> undoStack = new System.Collections.Generic.Stack<UndoEngine.UndoUnit>();
private System.Collections.Generic.Stack<UndoEngine.UndoUnit> redoStack = new System.Collections.Generic.Stack<UndoEngine.UndoUnit>();
public UndoEngineExt(IServiceProvider provider) : base(provider) { }
public bool EnableUndo
{
get { return undoStack.Count > 0; }
}
public bool EnableRedo
{
get { return redoStack.Count > 0; }
}
public void Undo()
{
if (undoStack.Count > 0 )
{
try
{
UndoEngine.UndoUnit unit = undoStack.Pop();