Exemplo n.º 1
0
 internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit)
 {
     AddMenuItem(commandName, functionPointer, checkOnInit, shortcut);
 }
Exemplo n.º 2
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));
        }