Example #1
0
 // 撤销重做相关方法
 public override void Undo(HCCustomUndoAction aUndoAction)
 {
     if (aUndoAction is HCItemSelfUndoAction)
     {
         HCUndoList vUndoList = (aUndoAction as HCItemSelfUndoAction).Object as HCUndoList;
         if (vUndoList != null)
         {
             vUndoList.Undo();
         }
         else
         {
             base.Undo(aUndoAction);
         }
     }
     else
     {
         base.Undo(aUndoAction);
     }
 }
Example #2
0
        /// <summary> 撤销 </summary>
        public void Undo()
        {
            if (FUndoList.Enable)
            {
                try
                {
                    FUndoList.Enable = false;

                    BeginUpdate();
                    try
                    {
                        FUndoList.Undo();
                    }
                    finally
                    {
                        EndUpdate();
                    }
                }
                finally
                {
                    FUndoList.Enable = true;
                }
            }
        }