예제 #1
0
        public InitialNode(DocumentIdNode documentIdNode, IInitial initial) : base(documentIdNode, children: null)
        {
            Infra.NotNull(initial.Transition);

            _initial   = initial;
            Transition = initial.Transition.As <TransitionNode>();

            Transition.SetSource(this);
        }
예제 #2
0
 /// <summary>
 /// Calls Undo method for all actions in the UndoStack and the InitialStack, from top to bottom.
 /// </summary>
 public void UndoAll()
 {
     if (CanUndo)
     {
         while (UndoStack.Count > 0)
         {
             IAction a = UndoStack.Pop();
             a.UndoAction();
         }
     }
     if (HasInitials)
     {
         while (InitialStack.Count > 0)
         {
             IInitial i = InitialStack.Pop();
             i.Reset();
         }
     }
 }
예제 #3
0
 /// <summary>
 /// Adds the action to the InitialStack. This stack is undone when UndoAll is called.
 /// </summary>
 /// <param name="action"></param>
 public void SetInitial(IInitial initial)
 {
     InitialStack.Push(initial);
 }