예제 #1
0
 /// <summary>
 /// Create an <see cref="T:Northwoods.Go.IGoUndoableEdit" /> for a <see cref="T:Northwoods.Go.GoDocument" /> Changed event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 /// <remarks>
 /// This calls <see cref="M:Northwoods.Go.GoUndoManager.SkipEvent(Northwoods.Go.GoChangedEventArgs)" /> if for some reason we should ignore
 /// the <paramref name="e" />.
 /// This then creates a <see cref="T:Northwoods.Go.GoChangedEventArgs" /> and adds it to the
 /// <see cref="P:Northwoods.Go.GoUndoManager.CurrentEdit" />, a <see cref="T:Northwoods.Go.GoUndoManagerCompoundEdit" /> which it allocates
 /// if needed.
 /// This method always ignores all Changed events while we are performing an
 /// <see cref="M:Northwoods.Go.GoUndoManager.Undo" /> or <see cref="M:Northwoods.Go.GoUndoManager.Redo" />.
 /// </remarks>
 public virtual void DocumentChanged(object sender, GoChangedEventArgs e)
 {
     if (!IsUndoing && !IsRedoing && !SkipEvent(e))
     {
         GoUndoManagerCompoundEdit goUndoManagerCompoundEdit = CurrentEdit;
         if (goUndoManagerCompoundEdit == null || goUndoManagerCompoundEdit.IsComplete)
         {
             goUndoManagerCompoundEdit = (CurrentEdit = new GoUndoManagerCompoundEdit());
         }
         GoChangedEventArgs goChangedEventArgs = new GoChangedEventArgs(e);
         goUndoManagerCompoundEdit.AddEdit(goChangedEventArgs);
         if (ChecksTransactionLevel && TransactionLevel <= 0)
         {
             GoObject.Trace("Change not within a transaction: " + goChangedEventArgs.ToString());
         }
     }
 }