private void EndTransition(bool forceClose) { ToolStripMenuItem fromItem = this.fromItem; this.fromItem = null; if (this.InTransition) { this.InTransition = false; if (((forceClose || (((this.CurrentItem != null) && (this.CurrentItem != fromItem)) && this.CurrentItem.Selected)) && (fromItem != null)) && fromItem.HasDropDownItems) { fromItem.HideDropDown(); } } }
private void EndTransition(bool forceClose) { ToolStripMenuItem lastSelected = fromItem; fromItem = null; // immediately clear BEFORE we call user code. if (InTransition) { InTransition = false; // we should roolup if the current item has changed and is selected. bool rollup = forceClose || (CurrentItem is not null && CurrentItem != lastSelected && CurrentItem.Selected); if (rollup && lastSelected is not null && lastSelected.HasDropDownItems) { lastSelected.HideDropDown(); } } }