示例#1
0
文件: Invoker.cs 项目: wertkh32/gg
 private bool IsUndoableCommand(Command cmd)
 {
     IUndoable undoObject = cmd as IUndoable;
     if (undoObject != null)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
示例#2
0
文件: Invoker.cs 项目: wertkh32/gg
 private GGResult ExecuteAndPushToStack(string userCommand, Command cmd)
 {
     GGResult result = cmd.Execute(userCommand, ggList);
     if (cmd.GetIsSuccessful() && IsUndoableCommand(cmd))
     {
         undoableCommands.Push((IUndoable)cmd);
     }
     return result;
 }