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
42 instantiations of MenuCommand
Microsoft.VisualStudio.LanguageServices (3)
StackTraceExplorer\StackTraceExplorerCommandHandler.cs (3)
190var menuItem = new MenuCommand(_instance.Execute, menuCommandId); 196var pasteMenuItem = new MenuCommand(_instance.Paste, pasteCommandId); 197var clearMenuItem = new MenuCommand(_instance.Clear, clearCommandId);
Roslyn.VisualStudio.DiagnosticsWindow (1)
VisualStudioDiagnosticsWindowPackage.cs (1)
89var menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID);
System.Windows.Forms.Design (38)
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)
301command = new MenuCommand(handler, StandardCommands.Copy) 311command = new MenuCommand(handler, StandardCommands.Paste) 321command = new MenuCommand(handler, StandardCommands.Delete) 331command = new MenuCommand(handler, StandardCommands.Cut)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (28)
556_newCommandPaste = new MenuCommand(new EventHandler(OnCommandPaste), StandardCommands.Paste); 1511_newCommands.Add(new MenuCommand(new EventHandler(OnKeySelect), MenuCommands.KeySelectNext)); 1512_newCommands.Add(new MenuCommand(new EventHandler(OnKeySelect), MenuCommands.KeySelectPrevious)); 1513_newCommands.Add(new MenuCommand(new EventHandler(OnKeyDefault), MenuCommands.KeyDefaultAction)); 1514_newCommands.Add(new MenuCommand(new EventHandler(OnKeyEdit), MenuCommands.EditLabel)); 1516_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyMoveUp)); 1517_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyMoveDown)); 1518_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyMoveLeft)); 1519_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyMoveRight)); 1521_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyNudgeUp)); 1522_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyNudgeDown)); 1523_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyNudgeLeft)); 1524_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeyNudgeRight)); 1526_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeySizeWidthIncrease)); 1527_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeySizeHeightIncrease)); 1528_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeySizeWidthDecrease)); 1529_newCommands.Add(new MenuCommand(new EventHandler(OnKeyMove), MenuCommands.KeySizeHeightDecrease)); 1531_newCommands.Add(new MenuCommand(new EventHandler(OnKeyCancel), MenuCommands.KeyCancel)); 1532_newCommands.Add(new MenuCommand(new EventHandler(OnKeyCancel), MenuCommands.KeyReverseCancel)); 1533_newCommands.Add(new MenuCommand(new EventHandler(OnCommandCopy), StandardCommands.Copy)); 1534_newCommands.Add(new MenuCommand(new EventHandler(OnCommandSelectAll), StandardCommands.SelectAll)); 1536_newCommands.Add(new MenuCommand(new EventHandler(OnCommandHome), MenuCommands.KeyHome)); 1537_newCommands.Add(new MenuCommand(new EventHandler(OnCommandEnd), MenuCommands.KeyEnd)); 1538_newCommands.Add(new MenuCommand(new EventHandler(OnCommandHome), MenuCommands.KeyShiftHome)); 1539_newCommands.Add(new MenuCommand(new EventHandler(OnCommandEnd), MenuCommands.KeyShiftEnd)); 1542_newCommands.Add(new MenuCommand(new EventHandler(OnKeyShowDesignerActions), MenuCommands.KeyInvokeSmartTag)); 1544_newCommands.Add(new MenuCommand(new EventHandler(OnCommandCopy), StandardCommands.Cut)); 1545_newCommands.Add(new MenuCommand(new EventHandler(OnCommandDelete), StandardCommands.Delete));
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
450_designerShortCutCommand = new MenuCommand(OnKeyShowDesignerActions, MenuCommands.KeyInvokeSmartTag);
158 references to MenuCommand
DesignSurfaceExt (1)
DesignSurfaceExt.cs (1)
363MenuCommand menuCommand = ims?.FindCommand(commandId);
Microsoft.VisualStudio.LanguageServices (3)
StackTraceExplorer\StackTraceExplorerCommandHandler.cs (3)
190var menuItem = new MenuCommand(_instance.Execute, menuCommandId); 196var pasteMenuItem = new MenuCommand(_instance.Paste, pasteCommandId); 197var clearMenuItem = new MenuCommand(_instance.Clear, clearCommandId);
netstandard (1)
netstandard.cs (1)
274[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.Design.MenuCommand))]
Roslyn.VisualStudio.DiagnosticsWindow (1)
VisualStudioDiagnosticsWindowPackage.cs (1)
89var menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID);
System (1)
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)
5192MenuCommand? 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)) 159foreach (KeyValuePair<Guid, List<MenuCommand>> group in _commandGroups) 161List<MenuCommand> commands = group.Value; 162foreach (MenuCommand command in commands) 315public MenuCommand? FindCommand(CommandID commandID) 324protected MenuCommand? FindCommand(Guid guid, int id) 327List<MenuCommand>? commands; 335foreach (MenuCommand command in commands) 383List<MenuCommand>? commands; 413MenuCommand? cmd = ((IMenuCommandService)this).FindCommand(commandID); 432MenuCommand? cmd = ((IMenuCommandService)this).FindCommand(commandId); 447OnCommandsChanged(new MenuCommandsChangedEventArgs(MenuCommandsChangedType.CommandChanged, (MenuCommand?)sender)); 483public virtual void RemoveCommand(MenuCommand command) 489if (_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); 559MenuCommand? 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)
737CommandID? cmd = ((MenuCommand)sender!).CommandID; 963MenuCommand cmd = (MenuCommand)sender!; 1237MenuCommand cmd = (MenuCommand)sender!; 2168MenuCommand? btf = MenuService?.FindCommand(StandardCommands.BringToFront); 2260((MenuCommand)sender!).Checked = !drawGrid; 2275MenuCommand cmd = (MenuCommand)sender!; 2493((MenuCommand)sender!).Checked = !snapToGrid; 2510MenuCommand cmd = (MenuCommand)sender!; 2969MenuCommand cmd = (MenuCommand)sender!; 2979MenuCommand cmd = (MenuCommand)sender!; 2989MenuCommand cmd = (MenuCommand)sender!; 3027if (((MenuCommand)sender!).Enabled) 3040MenuCommand cmd = (MenuCommand)sender!; 3075MenuCommand cmd = (MenuCommand)sender!; 3120MenuCommand cmd = (MenuCommand)sender!; 3126MenuCommand 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)
449MenuCommand cmd = (MenuCommand)sender; 541CommandID cmd = ((MenuCommand)sender).CommandID; 827MenuCommand cmd = (MenuCommand)sender; 863MenuCommand cmd = (MenuCommand)sender; 924MenuCommand cmd = (MenuCommand)sender; 966MenuCommand cmd = (MenuCommand)sender; 1140MenuCommand cmd = (MenuCommand)sender; 1156MenuCommand cmd = (MenuCommand)sender; 1167MenuCommand cmd = (MenuCommand)sender; 1174MenuCommand cmd = (MenuCommand)sender; 1220MenuCommand cmd = (MenuCommand)sender; 1231MenuCommand cmd = (MenuCommand)sender; 1241MenuCommand cmd = (MenuCommand)sender; 1259MenuCommand cmd = (MenuCommand)sender; 1276MenuCommand cmd = (MenuCommand)sender; 1292MenuCommand cmd = (MenuCommand)sender;
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (2)
296public override MenuCommand? FindCommand(CommandID commandId) 298MenuCommand command;
System\Windows\Forms\Design\DocumentDesigner.cs (2)
40private MenuCommand _tabOrderCommand; 1369MenuCommand 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) 161foreach (MenuCommand mc in _newCommands) 511MenuCommand? mc = mcs.FindCommand(StandardCommands.TabOrder); 678public bool OverrideInvoke(MenuCommand cmd) 697public 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; 232foreach (MenuCommand newCommand in _newCommands) 250foreach (MenuCommand newCommand in _newCommands) 271foreach (MenuCommand oldCommand in _oldCommands) 286foreach (MenuCommand newCommand in _newCommands) 442MenuCommand command = sender as MenuCommand; 443foreach (MenuCommand oldCommand in _oldCommands) 522if (sender is MenuCommand com && com.CommandID == StandardCommands.Cut) 926CommandID cmd = ((MenuCommand)sender).CommandID; 977MenuCommand cmd = (MenuCommand)sender; 1056MenuCommand cmd = (MenuCommand)sender; 1082MenuCommand cmd = (MenuCommand)sender; 1557foreach (MenuCommand newCommand in _newCommands) 1566foreach (MenuCommand oldCommand in _oldCommands) 1613foreach (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; 1238public bool OverrideInvoke(MenuCommand cmd) 1258public bool OverrideStatus(MenuCommand cmd)
System.Windows.Forms.Tests (3)
System\Windows\Forms\AccessibleObjects\PropertyGrid.PropertyGridAccessibleObjectTests.cs (3)
195public void AddCommand(MenuCommand command) => throw new NotImplementedException(); 199public MenuCommand FindCommand(CommandID commandID) => throw new NotImplementedException(); 203public void RemoveCommand(MenuCommand command) => throw new NotImplementedException();