public void Transition(ToolStripMenuItem fromItem, ToolStripMenuItem toItem) { Debug.WriteLineIf(ToolStrip.s_menuAutoExpandDebug.TraceVerbose, "[MenuTimer.Transition] transitioning items " + fromItem.ToString() + " " + toItem.ToString()); if (toItem is null && InTransition) { Cancel(); // in this case we're likely to have hit an item that's not a menu item // or nothing is selected. EndTransition(/*forceClose*/ true); return; } if (this.fromItem != fromItem) { this.fromItem = fromItem; CancelCore(); StartCore(toItem); } // set up the current item to be the toItem so it will be auto expanded when complete. CurrentItem = toItem; InTransition = true; }
public void Transition(ToolStripMenuItem fromItem, ToolStripMenuItem toItem) { Debug.WriteLineIf(ToolStrip.MenuAutoExpandDebug.TraceVerbose, "[MenuTimer.Transition] transitioning items " + fromItem.ToString() + " " + toItem.ToString()); if (toItem == null && InTransition) { Cancel(); // in this case we're likely to have hit an item that's not a menu item // or nothing is selected. EndTransition(/*forceClose*/ true); return; } if (this.fromItem != fromItem) { this.fromItem = fromItem; CancelCore(); StartCore(toItem); } // set up the current item to be the toItem so it will be auto expanded when complete. CurrentItem = toItem; InTransition = true; }