53 references to ToolStripDropDownCloseReason
System.Windows.Forms (29)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (18)
25private ToolStripDropDownCloseReason _closeReason = ToolStripDropDownCloseReason.AppFocusChange; 961SetCloseReason(ToolStripDropDownCloseReason.CloseCalled); 972_closeReason = ToolStripDropDownCloseReason.AppFocusChange; 975internal void SetCloseReason(ToolStripDropDownCloseReason reason) 980public void Close(ToolStripDropDownCloseReason reason) 1140Close(ToolStripDropDownCloseReason.ItemClicked); 1326SetCloseReason(ToolStripDropDownCloseReason.Keyboard); 1363SetCloseReason(ToolStripDropDownCloseReason.Keyboard); 1379SetCloseReason(ToolStripDropDownCloseReason.Keyboard); 1649ToolStripDropDownCloseReason reason = _closeReason; 1656e.Cancel = e.CloseReason != ToolStripDropDownCloseReason.CloseCalled && !AutoClose; 1681if ((reason == ToolStripDropDownCloseReason.AppClicked) || 1682(reason == ToolStripDropDownCloseReason.ItemClicked) || 1683(reason == ToolStripDropDownCloseReason.CloseCalled && topLevelToolStrip == parentToolStrip) || 1684(reason == ToolStripDropDownCloseReason.AppFocusChange && topLevelToolStrip == parentToolStrip)) 1693if (reason == ToolStripDropDownCloseReason.ItemClicked) 1746Debug.Assert(reason != ToolStripDropDownCloseReason.ItemClicked,
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (2)
136ToolStripManager.ModalMenuFilter.CloseActiveDropDown(DropDown, ToolStripDropDownCloseReason.AppClicked); 160ToolStripManager.ModalMenuFilter.CloseActiveDropDown(DropDown, ToolStripDropDownCloseReason.AppClicked);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownClosedEventArgs.cs (2)
8public ToolStripDropDownClosedEventArgs(ToolStripDropDownCloseReason reason) 13public ToolStripDropDownCloseReason CloseReason { get; }
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownClosingEventArgs.cs (2)
10public ToolStripDropDownClosingEventArgs(ToolStripDropDownCloseReason reason) 15public ToolStripDropDownCloseReason CloseReason { get; }
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
627parent.SetCloseReason(ToolStripDropDownCloseReason.Keyboard);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (2)
292internal static void CloseActiveDropDown(ToolStripDropDown activeToolStripDropDown, ToolStripDropDownCloseReason reason) 348CloseActiveDropDown(activeToolStripDropDown, ToolStripDropDownCloseReason.AppClicked);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
891ToolStripManager.ModalMenuFilter.CloseActiveDropDown(DropDown, ToolStripDropDownCloseReason.AppClicked);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (1)
459ToolStripManager.ModalMenuFilter.CloseActiveDropDown(DropDown, ToolStripDropDownCloseReason.AppClicked);
System.Windows.Forms.Design (8)
System\ComponentModel\Design\DesignerActionUI.cs (2)
587if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked) 592if (e.CloseReason == ToolStripDropDownCloseReason.Keyboard)
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (4)
78if (e.CloseReason == ToolStripDropDownCloseReason.AppFocusChange && _cancelClose) 87else if (e.CloseReason is ToolStripDropDownCloseReason.AppFocusChange or ToolStripDropDownCloseReason.AppClicked) 90if (Handle == hwndActivating && e.CloseReason == ToolStripDropDownCloseReason.AppClicked)
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
2007e.Cancel = (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
2019e.Cancel = (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked);
System.Windows.Forms.Tests (16)
System\Windows\Forms\ToolStripDropDownClosedEventArgsTests.cs (3)
10[InlineData(ToolStripDropDownCloseReason.AppClicked)] 11[InlineData((ToolStripDropDownCloseReason.AppFocusChange - 1))] 12public void Ctor_CloseReason(ToolStripDropDownCloseReason closeReason)
System\Windows\Forms\ToolStripDropDownClosingEventArgsTests.cs (3)
10[InlineData(ToolStripDropDownCloseReason.AppClicked)] 11[InlineData((ToolStripDropDownCloseReason.AppFocusChange - 1))] 12public void Ctor_CloseReason(ToolStripDropDownCloseReason closeReason)
System\Windows\Forms\ToolStripDropDownTests.cs (10)
3713yield return new object[] { null, new ToolStripDropDownClosedEventArgs(ToolStripDropDownCloseReason.AppFocusChange) }; 3715yield return new object[] { new SubToolStripItem(), new ToolStripDropDownClosedEventArgs(ToolStripDropDownCloseReason.AppFocusChange) }; 3729yield return new object[] { designModeOwnerItem, new ToolStripDropDownClosedEventArgs(ToolStripDropDownCloseReason.AppFocusChange) }; 3806yield return new object[] { new ToolStripDropDownClosingEventArgs(ToolStripDropDownCloseReason.AppFocusChange) }; 4963[InlineData(ToolStripDropDownCloseReason.AppClicked)] 4964[InlineData(ToolStripDropDownCloseReason.AppFocusChange)] 4965[InlineData(ToolStripDropDownCloseReason.CloseCalled)] 4966[InlineData(ToolStripDropDownCloseReason.ItemClicked)] 4967[InlineData(ToolStripDropDownCloseReason.Keyboard)] 4968public void ToolStripDropDown_Close_InvokeReason_Success(ToolStripDropDownCloseReason? reason)