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) 1137Close(ToolStripDropDownCloseReason.ItemClicked); 1323SetCloseReason(ToolStripDropDownCloseReason.Keyboard); 1360SetCloseReason(ToolStripDropDownCloseReason.Keyboard); 1376SetCloseReason(ToolStripDropDownCloseReason.Keyboard); 1646ToolStripDropDownCloseReason reason = _closeReason; 1653e.Cancel = e.CloseReason != ToolStripDropDownCloseReason.CloseCalled && !AutoClose; 1678if ((reason == ToolStripDropDownCloseReason.AppClicked) || 1679(reason == ToolStripDropDownCloseReason.ItemClicked) || 1680(reason == ToolStripDropDownCloseReason.CloseCalled && topLevelToolStrip == parentToolStrip) || 1681(reason == ToolStripDropDownCloseReason.AppFocusChange && topLevelToolStrip == parentToolStrip)) 1690if (reason == ToolStripDropDownCloseReason.ItemClicked) 1743Debug.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)
1988e.Cancel = (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
2003e.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)