GH_MenuShortcut

Maintains information about context and dropdown menu shortcuts.

Constructors

GH_MenuShortcut

#
public GH_MenuShortcut()
Create a new blank instance of the GH_MenuShortcutInfo class.

GH_MenuShortcut

#
public GH_MenuShortcut(string itemPath, Keys shortcut, string shortcutText)
Create a new instance of the GH_MenuShortcutInfo class.
itemPath (string)Path to menu item in menu hierarchy. Use back-slash symbols to separate parent-child items.
shortcut (Keys)Shortcut to use for menu item.
shortcutText (string)Text override to display for menu shortcut. Leave blank for default display.

GH_MenuShortcut

#
public GH_MenuShortcut(string itemPath)
Create a new instance of the GH_MenuShortcutInfo class.
itemPath (string)Path to menu item in menu hierarchy. Use back-slash symbols to separate parent-child items.

Properties

ItemHierarchy

#
public string[] ItemHierarchy { get; }
Gets the menu item hierarchy.

ItemPath

#
public string ItemPath { get; set; }
Gets or sets the menu item path. Submenus are indicated using back-slash symbols (i.e. "File\Special Folders\Components Folder")

Shortcut

#
public Keys Shortcut { get; set; }
Gets or sets the menu shortcut keys.

ShortcutText

#
public string ShortcutText { get; set; }
Gets or sets the menu shortcut display string. Leave blank for default display.

Methods

ApplyToMenu

#
public ToolStripMenuItem ApplyToMenu(MenuStrip menu, IEnumerable<ToolStripMenuItem> filter)
Apply this shortcut to an actual menu item.
menu (MenuStrip)Menu that contains relevant menu item.
filter (IEnumerable<ToolStripMenuItem>)A collection of mutable menu items.
The menu item that was changed or null on failure.

Read

#
public bool Read(GH_IReader reader)
reader (GH_IReader)
Read

Write

#
public bool Write(GH_IWriter writer)
writer (GH_IWriter)
Write