コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: GitExtCommands.cs プロジェクト: IEVin/gitextensions
        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;
        }