SetCommand() public static method

Creates entry in the FuncItems list, which list the menu entry displayed in Npp's plugin menu
public static SetCommand ( int index, string commandName, System.Action functionPointer, ShortcutKey shortcut = newShortcutKey(), bool checkOnInit = false ) : void
index int
commandName string
functionPointer System.Action
shortcut _3PA.Interop.ShortcutKey
checkOnInit bool
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Called when the plugin menu of the plugin needs to be filled
        /// We can call UnmanagedExports.NppFuncItems.RefreshItems(); later on if we had stuff
        /// in the plugin menu via Npp.SetCommand
        /// </summary>
        internal static void DoFuncItemsNeeded()
        {
            var cmdIndex = 0;

            AppliMenu.MainMenuCommandIndex = cmdIndex;
            Npp.SetCommand(cmdIndex++, "Show main menu  [Ctrl + Right click]", () => AppliMenu.ShowMainMenu(true));
            CodeExplorer.Instance.DockableCommandIndex = cmdIndex;
            Npp.SetCommand(cmdIndex++, "Toggle code explorer", CodeExplorer.Instance.Toggle);
            FileExplorer.Instance.DockableCommandIndex = cmdIndex;
            Npp.SetCommand(cmdIndex, "Toggle file explorer", FileExplorer.Instance.Toggle);
        }