/// <summary>
 /// Add an <see cref="T:Northwoods.Go.IGoUndoableEdit" /> to the end of the list.
 /// </summary>
 /// <param name="edit"></param>
 public virtual void AddEdit(IGoUndoableEdit edit)
 {
     if (!IsComplete)
     {
         myEdits.Add(edit);
     }
 }
Example #2
0
 /// <summary>
 /// Restore the state of some documents to after the current <see cref="T:Northwoods.Go.IGoUndoableEdit" />.
 /// </summary>
 /// <remarks>
 /// This calls <see cref="M:Northwoods.Go.IGoUndoableEdit.Redo" /> on the current <see cref="P:Northwoods.Go.GoUndoManager.EditToRedo" />.
 /// This will raise a <see cref="E:Northwoods.Go.GoDocument.Changed" /> event with a hint of
 /// <see cref="F:Northwoods.Go.GoDocument.StartingRedo" /> before actually performing the redo, and will raise a
 /// Changed event with a hint of <see cref="F:Northwoods.Go.GoDocument.FinishedRedo" /> afterwards.
 /// The <see cref="T:Northwoods.Go.GoChangedEventArgs" />.<see cref="P:Northwoods.Go.GoChangedEventArgs.Object" />
 /// is the <see cref="T:Northwoods.Go.GoUndoManagerCompoundEdit" /> that was the value of
 /// <see cref="P:Northwoods.Go.GoUndoManager.EditToRedo" /> before calling Redo.
 /// </remarks>
 /// <seealso cref="M:Northwoods.Go.GoUndoManager.CanRedo" />
 public virtual void Redo()
 {
     checked
     {
         if (CanRedo())
         {
             IGoUndoableEdit editToRedo = EditToRedo;
             try
             {
                 foreach (GoDocument document in Documents)
                 {
                     document.RaiseChanged(109, 0, editToRedo, 0, null, GoObject.NullRect, 0, null, GoObject.NullRect);
                 }
                 myIsRedoing = true;
                 myCurrentEditIndex++;
                 editToRedo.Redo();
             }
             catch (Exception ex)
             {
                 GoObject.Trace("Redo: " + ex.ToString());
                 throw;
             }
             finally
             {
                 myIsRedoing = false;
                 foreach (GoDocument document2 in Documents)
                 {
                     document2.RaiseChanged(110, 0, editToRedo, 0, null, GoObject.NullRect, 0, null, GoObject.NullRect);
                 }
             }
         }
     }
 }