Represents a node of the doubly linked-list SimpleHistory (StateX in the following diagram:) (State0) --- [Action0] --- (State1) --- [Action1] --- (State2) StateX (e.g. State1) has a link to the previous State, previous Action, next State and next Action. As you move from State1 to State2, an Action1 is executed (Redo). As you move from State1 to State0, an Action0 is un-executed (Undo).
Ejemplo n.º 1
0
        /// <summary>
        /// Enums the undoable actions.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <IAction> EnumUndoableActions()
        {
            SimpleHistoryNode Current = Head;

            while (Current != null && Current != CurrentState && Current.NextAction != null)
            {
                yield return(Current.NextAction);

                Current = Current.NextNode;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Inits this instance.
 /// </summary>
 private void Init()
 {
     CurrentState = new SimpleHistoryNode();
     Head         = CurrentState;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Inits this instance.
 /// </summary>
 private void Init()
 {
     CurrentState = new SimpleHistoryNode();
     Head = CurrentState;
 }