2 types derived from MenuCommand
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\DesignerVerb.cs (1)
12public partial class DesignerVerb : MenuCommand
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\CommandSet.CommandSetItem.cs (1)
19protected partial class CommandSetItem : MenuCommand
47 instantiations of MenuCommand
System.Windows.Forms.Design (47)
System\ComponentModel\Design\DesignerActionUI.cs (1)
95_cmdShowDesignerActions = new MenuCommand(OnKeyShowDesignerActions, MenuCommands.KeyInvokeSmartTag);
System\Windows\Forms\Design\Behavior\DesignerActionKeyboardBehavior.cs (1)
43MenuCommand dummyMC = new(delegate
System\Windows\Forms\Design\ComponentTray.cs (3)
105_menucmdArrangeIcons = new MenuCommand(OnMenuArrangeIcons, StandardCommands.ArrangeIcons); 106_menucmdLineupIcons = new MenuCommand(OnMenuLineupIcons, StandardCommands.LineupIcons); 107_menucmdLargeIcons = new MenuCommand(OnMenuShowLargeIcons, StandardCommands.ShowLargeIcons);
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (4)
297command = new MenuCommand(handler, StandardCommands.Copy) 307command = new MenuCommand(handler, StandardCommands.Paste) 317command = new MenuCommand(handler, StandardCommands.Delete) 327command = new MenuCommand(handler, StandardCommands.Cut)
System\Windows\Forms\Design\TabOrder.cs (9)
81new(new EventHandler(OnKeyCancel), 84new(new EventHandler(OnKeyDefault), 87new(new EventHandler(OnKeyPrevious), 90new(new EventHandler(OnKeyNext), 93new(new EventHandler(OnKeyPrevious), 96new(new EventHandler(OnKeyNext), 99new(new EventHandler(OnKeyNext), 102new(new EventHandler(OnKeyPrevious), 108new(new EventHandler(OnKeyDefault),
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (28)
553_newCommandPaste = new MenuCommand(new EventHandler(OnCommandPaste), StandardCommands.Paste); 1499_newCommands.Add(new MenuCommand(new EventHandler(OnKeySelect), MenuCommands.KeySelectNext)); 1500_newCommands.Add(new MenuCommand(new EventHandler(OnKeySelect), MenuCommands.KeySelectPrevious)); 1501_newCommands.Add(new MenuCommand(new EventHandler(OnKeyDefault), MenuCommands.KeyDefaultAction)); 1502_newCommands.Add(new MenuCommand(new EventHandler(OnKeyEdit), MenuCommands.EditLabel)); 1504_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyMoveUp)); 1505_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyMoveDown)); 1506_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyMoveLeft)); 1507_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyMoveRight)); 1509_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyNudgeUp)); 1510_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyNudgeDown)); 1511_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyNudgeLeft)); 1512_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyNudgeRight)); 1514_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeySizeWidthIncrease)); 1515_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeySizeHeightIncrease)); 1516_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeySizeWidthDecrease)); 1517_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeySizeHeightDecrease)); 1519_newCommands.Add(new MenuCommand(new EventHandler(OnKeyCancel), MenuCommands.KeyCancel)); 1520_newCommands.Add(new MenuCommand(new EventHandler(OnKeyCancel), MenuCommands.KeyReverseCancel)); 1521_newCommands.Add(new MenuCommand(new EventHandler(OnCommandCopy), StandardCommands.Copy)); 1522_newCommands.Add(new MenuCommand(new EventHandler(OnCommandSelectAll), StandardCommands.SelectAll)); 1524_newCommands.Add(new MenuCommand(new EventHandler(OnCommandHome), MenuCommands.KeyHome)); 1525_newCommands.Add(new MenuCommand(new EventHandler(OnCommandEnd), MenuCommands.KeyEnd)); 1526_newCommands.Add(new MenuCommand(new EventHandler(OnCommandHome), MenuCommands.KeyShiftHome)); 1527_newCommands.Add(new MenuCommand(new EventHandler(OnCommandEnd), MenuCommands.KeyShiftEnd)); 1530_newCommands.Add(new MenuCommand(new EventHandler(OnKeyShowDesignerActions), MenuCommands.KeyInvokeSmartTag)); 1532_newCommands.Add(new MenuCommand(new EventHandler(OnCommandCopy), StandardCommands.Cut)); 1533_newCommands.Add(new MenuCommand(new EventHandler(OnCommandDelete), StandardCommands.Delete));
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
438_designerShortCutCommand = new MenuCommand(OnKeyShowDesignerActions, MenuCommands.KeyInvokeSmartTag);
150 references to MenuCommand
netstandard (1)
netstandard.cs (1)
274[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.Design.MenuCommand))]
System (1)
src\runtime\src\libraries\shims\System\ref\System.cs (1)
260[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.Design.MenuCommand))]
System.ComponentModel.TypeConverter (7)
System\ComponentModel\Design\IMenuCommandService.cs (5)
21void AddCommand(MenuCommand command); 29/// Searches for the given command ID and returns the <see cref='System.ComponentModel.Design.MenuCommand'/> 32MenuCommand? FindCommand(CommandID commandID); 40/// Removes the specified <see cref='System.ComponentModel.Design.MenuCommand'/> from the document. 42void RemoveCommand(MenuCommand command);
System\ComponentModel\Design\MenuCommand.cs (2)
45/// Initializes a new instance of <see cref='System.ComponentModel.Design.MenuCommand'/>. 157/// a <see cref='System.ComponentModel.Design.MenuCommand.CommandChanged'/> event.
System.Windows.Forms (1)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
5225MenuCommand? reset = menuCommandService.FindCommand(PropertyGridCommands.Reset);
System.Windows.Forms.Design (140)
System\ComponentModel\Design\DesignerActionUI.cs (1)
38private readonly MenuCommand? _cmdShowDesignerActions; // used to respond to the Alt+Shift+F10 command
System\ComponentModel\Design\MenuCommandsChangedEventArgs.cs (2)
18public MenuCommandsChangedEventArgs(MenuCommandsChangedType changeType, MenuCommand? command) 33public MenuCommand? Command { get; }
System\ComponentModel\Design\MenuCommandService.cs (16)
19private readonly Dictionary<Guid, List<MenuCommand>> _commandGroups; 73public virtual void AddCommand(MenuCommand command) 89if (!_commandGroups.TryGetValue(commandId.Guid, out List<MenuCommand>? commandsList)) 156foreach (KeyValuePair<Guid, List<MenuCommand>> group in _commandGroups) 158List<MenuCommand> commands = group.Value; 159foreach (MenuCommand command in commands) 312public MenuCommand? FindCommand(CommandID commandID) 321protected MenuCommand? FindCommand(Guid guid, int id) 324List<MenuCommand>? commands; 332foreach (MenuCommand command in commands) 380List<MenuCommand>? commands; 410MenuCommand? cmd = ((IMenuCommandService)this).FindCommand(commandID); 429MenuCommand? cmd = ((IMenuCommandService)this).FindCommand(commandId); 444OnCommandsChanged(new MenuCommandsChangedEventArgs(MenuCommandsChangedType.CommandChanged, (MenuCommand?)sender)); 480public virtual void RemoveCommand(MenuCommand command) 486if (_commandGroups.TryGetValue(command.CommandID!.Guid, out List<MenuCommand>? commands))
System\Windows\Forms\Design\Behavior\Behavior.cs (1)
68public virtual MenuCommand? FindCommand(CommandID commandId)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (3)
539private MenuCommand? FindCommand(CommandID commandID, IMenuCommandService menuService) 547MenuCommand? menuCommand = menuService.FindCommand(commandID); 556MenuCommand? menuCommand = behavior.FindCommand(commandID);
System\Windows\Forms\Design\Behavior\BehaviorService.MenuCommandHandler.cs (3)
23void IMenuCommandService.AddCommand(MenuCommand command) => MenuService.AddCommand(command); 27void IMenuCommandService.RemoveCommand(MenuCommand command) => MenuService.RemoveCommand(command); 29MenuCommand? IMenuCommandService.FindCommand(CommandID commandID)
System\Windows\Forms\Design\Behavior\DesignerActionKeyboardBehavior.cs (2)
29public override MenuCommand? FindCommand(CommandID commandId) 43MenuCommand dummyMC = new(delegate
System\Windows\Forms\Design\CommandSet.cs (27)
731CommandID? cmd = ((MenuCommand)sender!).CommandID; 957MenuCommand cmd = (MenuCommand)sender!; 1231MenuCommand cmd = (MenuCommand)sender!; 2163MenuCommand? btf = MenuService?.FindCommand(StandardCommands.BringToFront); 2255((MenuCommand)sender!).Checked = !drawGrid; 2270MenuCommand cmd = (MenuCommand)sender!; 2488((MenuCommand)sender!).Checked = !snapToGrid; 2505MenuCommand cmd = (MenuCommand)sender!; 2964MenuCommand cmd = (MenuCommand)sender!; 2974MenuCommand cmd = (MenuCommand)sender!; 2984MenuCommand cmd = (MenuCommand)sender!; 3022if (((MenuCommand)sender!).Enabled) 3035MenuCommand cmd = (MenuCommand)sender!; 3070MenuCommand cmd = (MenuCommand)sender!; 3115MenuCommand cmd = (MenuCommand)sender!; 3121MenuCommand cmd = (MenuCommand)sender!;
System\Windows\Forms\Design\ComponentTray.cs (4)
45private MenuCommand _tabOrderCommand; 62private readonly MenuCommand _menucmdArrangeIcons; 63private readonly MenuCommand _menucmdLineupIcons; 64private readonly MenuCommand _menucmdLargeIcons;
System\Windows\Forms\Design\ControlCommandSet.cs (31)
446MenuCommand cmd = (MenuCommand)sender; 538CommandID cmd = ((MenuCommand)sender).CommandID; 824MenuCommand cmd = (MenuCommand)sender; 860MenuCommand cmd = (MenuCommand)sender; 921MenuCommand cmd = (MenuCommand)sender; 960MenuCommand cmd = (MenuCommand)sender; 1134MenuCommand cmd = (MenuCommand)sender; 1150MenuCommand cmd = (MenuCommand)sender; 1161MenuCommand cmd = (MenuCommand)sender; 1168MenuCommand cmd = (MenuCommand)sender; 1214MenuCommand cmd = (MenuCommand)sender; 1225MenuCommand cmd = (MenuCommand)sender; 1235MenuCommand cmd = (MenuCommand)sender; 1253MenuCommand cmd = (MenuCommand)sender; 1270MenuCommand cmd = (MenuCommand)sender; 1286MenuCommand cmd = (MenuCommand)sender;
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (2)
292public override MenuCommand? FindCommand(CommandID commandId) 294MenuCommand command;
System\Windows\Forms\Design\DocumentDesigner.cs (2)
40private MenuCommand _tabOrderCommand; 1327MenuCommand cmd = mcs.FindCommand(StandardCommands.TabOrder);
System\Windows\Forms\Design\IMenuStatusHandler.cs (2)
17bool OverrideInvoke(MenuCommand cmd); 23bool OverrideStatus(MenuCommand cmd);
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
1468MenuCommand tabCommand = ms.FindCommand(StandardCommands.TabOrder); 1667MenuCommand tabCommand = ms.FindCommand(StandardCommands.TabOrder);
System\Windows\Forms\Design\ParentControlDesigner.EscapeHandler.cs (2)
28public bool OverrideInvoke(MenuCommand cmd) 45public bool OverrideStatus(MenuCommand cmd)
System\Windows\Forms\Design\StandardCommandToolStripMenuItem.cs (1)
20private readonly MenuCommand? _menuCommand;
System\Windows\Forms\Design\StatusCommandUI.cs (2)
16private MenuCommand? _statusRectCommand; 33private MenuCommand? StatusRectCommand => _statusRectCommand ??= MenuService?.FindCommand(MenuCommands.SetStatusRectangle);
System\Windows\Forms\Design\TabOrder.cs (7)
34private readonly MenuCommand[] _commands; 35private readonly MenuCommand[] _newCommands; 115foreach (MenuCommand mc in _newCommands) 158foreach (MenuCommand mc in _newCommands) 502MenuCommand? mc = mcs.FindCommand(StandardCommands.TabOrder); 669public bool OverrideInvoke(MenuCommand cmd) 688public bool OverrideStatus(MenuCommand cmd)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (22)
36private List<MenuCommand> _oldCommands; 38private List<MenuCommand> _newCommands; 40private MenuCommand _oldCommandPaste; 41private MenuCommand _newCommandPaste; 229foreach (MenuCommand newCommand in _newCommands) 247foreach (MenuCommand newCommand in _newCommands) 268foreach (MenuCommand oldCommand in _oldCommands) 283foreach (MenuCommand newCommand in _newCommands) 439MenuCommand command = sender as MenuCommand; 440foreach (MenuCommand oldCommand in _oldCommands) 519if (sender is MenuCommand com && com.CommandID == StandardCommands.Cut) 914CommandID cmd = ((MenuCommand)sender).CommandID; 965MenuCommand cmd = (MenuCommand)sender; 1044MenuCommand cmd = (MenuCommand)sender; 1070MenuCommand cmd = (MenuCommand)sender; 1545foreach (MenuCommand newCommand in _newCommands) 1554foreach (MenuCommand oldCommand in _oldCommands) 1601foreach (MenuCommand newCommand in _newCommands)
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
34private MenuCommand? _designerShortCutCommand; 35private MenuCommand? _oldShortCutCommand;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (6)
52private readonly MenuCommand[] _commands; 54private readonly MenuCommand[] _addCommands; 101private MenuCommand _oldUndoCommand; 102private MenuCommand _oldRedoCommand; 1190public bool OverrideInvoke(MenuCommand cmd) 1210public bool OverrideStatus(MenuCommand cmd)