Beispiel #1
0
        public VSMenuCommand AddCommand(string commandName, string displayName, string description)
        {
            VSMenuCommand vSMenuCommand = new VSMenuCommand(this, commandName, displayName, description);

            this.MenuCommands.Add(vSMenuCommand);
            return(vSMenuCommand);
        }
Beispiel #2
0
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            VSMenuCommand vSMenuCommand = this[commandName];

            if (vSMenuCommand != null)
            {
                vSMenuCommand.OnQueryStatus(neededText, ref status, ref commandText);
            }
        }
Beispiel #3
0
        /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
        /// <param term='commandName'>The name of the command to determine state for.</param>
        /// <param term='neededText'>Text that is needed for the command.</param>
        /// <param term='status'>The state of the command in the user interface.</param>
        /// <param term='commandText'>Text requested by the neededText parameter.</param>
        /// <seealso class='Exec' />
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            // TODO: route to the child menu item

            VSMenuCommand command = this[commandName];

            if (command != null)
            {
                command.OnQueryStatus(neededText, ref status, ref commandText);
            }
        }
Beispiel #4
0
 public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
 {
     handled = false;
     if (executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
     {
         VSMenuCommand vSMenuCommand = this[commandName];
         if (vSMenuCommand != null)
         {
             vSMenuCommand.OnExecute();
             handled = true;
         }
     }
 }
 public VSMenuCommand AddCommand(string commandName, string displayName, string description)
 {
     VSMenuCommand vSMenuCommand = new VSMenuCommand(this, commandName, displayName, description);
     this.MenuCommands.Add(vSMenuCommand);
     return vSMenuCommand;
 }