예제 #1
0
        /// <summary>
        /// Adds a command to the manager.
        /// </summary>
        /// <param name="command">Reference to the command to add</param>
        public void Add(CommandBase command)
        {
            Commands2 vsCommands = (Commands2)dte.Commands;

            // Get full name how Visual Studio queries this command
            string fullname = vsCommands.GetFullname(addIn, command.Name);

            // Add to our own VsTortoise command management
            commands[fullname] = command;

            // Create the command inside Visual Studio permanently
            Command vsCommand = vsCommands.CreateCommandButton(addIn, command);
        }