Exemple #1
0
        private void PopActiveBehavior()
        {
            ToolBehavior activeBehavior = this.ActiveBehavior;

            if (activeBehavior == null)
            {
                throw new InvalidOperationException(ExceptionStringTable.EventRouterCannotPopBehavior);
            }
            this.behaviorStack.Pop();
            activeBehavior.Suspend();
            activeBehavior.Detach();
        }
Exemple #2
0
        public void PushBehavior(ToolBehavior newActiveBehavior)
        {
            if (newActiveBehavior == null)
            {
                throw new ArgumentNullException("newActiveBehavior");
            }
            ToolBehavior activeBehavior = this.ActiveBehavior;

            if (activeBehavior != null)
            {
                activeBehavior.Suspend();
            }
            this.behaviorStack.Push(newActiveBehavior);
            newActiveBehavior.Attach(this);
            this.ResumeActiveBehavior();
        }