private void PopActiveBehavior() { ToolBehavior activeBehavior = this.ActiveBehavior; if (activeBehavior == null) { throw new InvalidOperationException(ExceptionStringTable.EventRouterCannotPopBehavior); } this.behaviorStack.Pop(); activeBehavior.Suspend(); activeBehavior.Detach(); }
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(); }