public void AddStack(CmdStack Stack) { if (!m_Stacks.Contains(Stack)) { m_Stacks.Add(Stack); Stack.EventCanRedoChanged += new EventHandler <BoolEventArgs>(Stack_EventCanRedoChanged); Stack.EventCanUndoChanged += new EventHandler <BoolEventArgs>(Stack_EventCanUndoChanged); Stack.EventUpdate += new EventHandler <EventArgs>(Stack_EventUpdate); } }
public void SetActiveStack(CmdStack Stack) { if (m_Stacks.Contains(Stack)) { m_ActiveStack = Stack; FireCanRedoChanged(); FireCanUndoChanged(); FireUpdateEvent(); } }
public void RemoveStack(CmdStack Stack) { if (m_Stacks.Contains(Stack)) { Stack.EventUpdate -= Stack_EventUpdate; Stack.EventCanRedoChanged -= Stack_EventCanRedoChanged; Stack.EventCanUndoChanged -= Stack_EventCanUndoChanged; m_Stacks.Remove(Stack); } ; if (m_ActiveStack == Stack) { m_ActiveStack = null; } }