Esempio n. 1
0
 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);
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        /// <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);
 }
Esempio n. 8
0
 internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, bool checkOnInit)
 {
     SetCommand(index, commandName, functionPointer, new ShortcutKey(), checkOnInit);
 }
Esempio n. 9
0
 internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut)
 {
     SetCommand(index, commandName, functionPointer, shortcut, false);
 }
Esempio n. 10
0
 internal void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer)
 {
     SetCommand(index, commandName, functionPointer, new ShortcutKey(), false);
 }
Esempio n. 11
0
        // 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);
        }
Esempio n. 12
0
 internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit)
 {
     AddMenuItem(commandName, functionPointer, checkOnInit, shortcut);
 }
Esempio n. 13
0
 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);
 }
Esempio n. 15
0
 internal static void SetCommand(int index, NppFuncItemDelegate functionPointer)
 {
     SetCommand(index, string.Empty, functionPointer, new ShortcutKey(), false);
 }