public MenuItem(string settingname, string text, NppFuncItemDelegate function, ShortcutKey shortcut) { SettingName = settingname; Text = text; Function = function; Shortcut = shortcut; }
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit) { FuncItem funcItem = new FuncItem(); funcItem._cmdID = index; funcItem._itemName = commandName; if (functionPointer != null) funcItem._pFunc = new NppFuncItemDelegate(functionPointer); if (shortcut._key != 0) funcItem._pShKey = shortcut; funcItem._init2Check = checkOnInit; _funcItems.Add(funcItem); }
public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, string shortcutSpec) { ShortcutKey shortcutKey; if (string.IsNullOrEmpty(shortcutSpec)) { shortcutKey = new ShortcutKey(false, false, false, Keys.None); } else { shortcutKey = shortcutSpec.ParseAsShortcutKey(commandName); } PluginBase.SetCommand(index, commandName, functionPointer, shortcutKey, false); }
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit) { FuncItem funcItem = new FuncItem(); funcItem._cmdID = index; funcItem._itemName = commandName; if (functionPointer != null) { funcItem._pFunc = new NppFuncItemDelegate(functionPointer); } if (shortcut._key != 0) { funcItem._pShKey = shortcut; } funcItem._init2Check = checkOnInit; _funcItems.Add(funcItem); }
/// <summary> /// Adds an entry in the Notepad++ Plugin menu. /// </summary> /// <param name="text"></param> /// <param name="functionPointer"></param> /// <param name="checkOnInit"></param> /// <param name="shortcut"></param> /// <returns></returns> public static int AddMenuItem(string text, NppFuncItemDelegate functionPointer, bool checkOnInit = false, ShortcutKey shortcut = new ShortcutKey()) { var funcItem = new FuncItem { _itemName = text }; if (functionPointer != null) { funcItem._pFunc = functionPointer; } if (shortcut._key != 0) { funcItem._pShKey = shortcut; } funcItem._init2Check = checkOnInit; return(_funcItems.Add(funcItem)); }
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, bool checkOnInit) { SetCommand(index, commandName, functionPointer, new ShortcutKey(), checkOnInit); }
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut) { SetCommand(index, commandName, functionPointer, shortcut, false); }
internal void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer) { SetCommand(index, commandName, functionPointer, new ShortcutKey(), false); }
// public static NppData NppData; // public static FuncItems FuncItems = new FuncItems(); public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer) { PluginBase.SetCommand(index, commandName, functionPointer, new ShortcutKey(), false); }
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit) { AddMenuItem(commandName, functionPointer, checkOnInit, shortcut); }
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer) { AddMenuItem(commandName, functionPointer); }
void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer) { SetCommand(index, commandName, functionPointer, new ShortcutKey(), false); }
internal static void SetCommand(int index, NppFuncItemDelegate functionPointer) { SetCommand(index, string.Empty, functionPointer, new ShortcutKey(), false); }