Connect.cs
/// <summary>Implements the Exec method of the IDTCommandTarget interface. This is called when the command is invoked.</summary>
/// <param term='commandName'>The name of the command to execute.</param>
/// <param term='executeOption'>Describes how the command should be run.</param>
/// <param term='varIn'>Parameters passed from the caller to the command handler.</param>
/// <param term='varOut'>Parameters passed from the command handler to the caller.</param>
/// <param term='handled'>Informs the caller if the command was handled or not.</param>
/// <seealso class='Exec' />
Implements the Exec method of the IDTCommandTarget interface. This is called when the command is invoked.
The name of the command to execute.
Describes how the command should be run.
Parameters passed from the caller to the command handler.
Parameters passed from the command handler to the caller.
Informs the caller if the command was handled or not.
Implements the Exec method of the IDTCommandTarget interface . This is called when the command is invoked . The name of the command to execute . Describes how the command should be run . Parameters passed from the caller to the command handler . Parameters passed from the command handler to the caller . Informs the caller if the command was handled or not .
public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if (executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "SSMSQueryHistory.Connect.SSMSQueryHistory")
                {
                    handled = true;
                    if (toolWin == null)
                    {
                        Windows2 win = (Windows2)_addInInstance.DTE.Windows;
                        object ctlObject = null;
                        toolWin = win.CreateToolWindow2(_addInInstance, Assembly.GetExecutingAssembly().Location, "SSMSQueryHistory.SSMSQueryHistoryControl", "Query History Search", SSMSQueryHistoryGuid, ref ctlObject);
                    }
                    if (toolWin != null)
                    {
                        toolWin.Visible = true;
                    }
                    return;
                }
            }
        }
public void Exec ( string commandName , vsCommandExecOption executeOption , ref object varIn , ref object varOut , ref bool handled ) { handled = false ; if ( executeOption == vsCommandExecOption . vsCommandExecOptionDoDefault ) { if ( commandName == " " ) { handled = true ; if ( toolWin == null ) { Windows2 win = ( Windows2 ) _addInInstance . DTE . Windows ; object ctlObject = null ; toolWin = win . CreateToolWindow2 ( _addInInstance , Assembly . GetExecutingAssembly ( ) . Location , " " , " " , SSMSQueryHistoryGuid , ref ctlObject ) ; } if ( toolWin != null ) { toolWin . Visible = true ; } return ; } } }
<summary>Implements the Exec method of the IDTCommandTarget interface.
<summary > Implements the Exec method of the IDTCommandTarget interface .
commandName
string
executeOption
vsCommandExecOption
object
ref
bool
ref