Exemple #1
0
        public void ReplayAll(int delay)
        {
            if (!isReplaying)
            {
                while (s_undo.Count > 0)
                {
                    Undo();
                }

                Timer timer = new Timer(delay);

                timer.Elapsed += new ElapsedEventHandler(delegate(object sender, ElapsedEventArgs e) {
                    if (!(s_redo.Count > 0))
                    {
                        timer.Stop();
                        isReplaying = false;
                    }
                    else
                    {
                        IAction a = s_redo.Pop();
                        a.Execute();
                        s_undo.Push(a);
                        ExecuteRedo.SafeInvoke(this, EventArgs.Empty);
                    }
                });

                isReplaying = true;
                timer.Start();
            }
        }
Exemple #2
0
 public void Redo()
 {
     if (canRedo)
     {
         IAction a = s_redo.Pop();
         a.Execute();
         s_undo.Push(a);
         EditorEngine.Instance.HasEdit = true;
         ExecuteRedo.SafeInvoke(this, EventArgs.Empty);
     }
 }