private void RegisterCommand(CommandBase command, int id)
        {
            var commandId   = new CommandID(CommandSet, id);
            var menuCommand = new OleMenuCommand(MenuItemCallback, commandId);

            menuCommand.BeforeQueryStatus += MenuCommand_BeforeQueryStatus;
            _commandService.AddCommand(menuCommand);
            _commands[id] = new VsixCommandBase(command);
        }
Esempio n. 2
0
        private void RegisterCommand(string commandName, VsixCommandBase command, int id)
        {
            _commandsByName[commandName] = command;
            var commandId   = new CommandID(CommandSet, id);
            var menuCommand = new OleMenuCommand(MenuItemCallback, commandId);

            menuCommand.BeforeQueryStatus += MenuCommand_BeforeQueryStatus;
            _commandService.AddCommand(menuCommand);
            _commands[id] = command;
        }