Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Page History: Add-Ins in Visual Studio

Compare Page Revisions



« Older Revision - Back to Page History - Current Revision


Page Revision: Fri, Jul 09, 2010, 12:45 PM


Walkthrough

  • Change the following methods in your Connect class.

public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst,
    ref Array custom)
{
    InitAddIn(application, connectMode, addInInst);
}
//-------------------------------------------------------------------------------------------------
public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
{
    if (disconnectMode != ext_DisconnectMode.ext_dm_UISetupComplete)
    {
        DeleteToolbar();
    }

}
//-------------------------------------------------------------------------------------------------
public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref 
    vsCommandStatus status, ref object commandText)
{
    if(neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
    {
        bool bEnabled = true;
        bool bHidden = false;

        QueryStatus(commandName, ref bEnabled, ref bHidden);
        status = (vsCommandStatus)(
            vsCommandStatus.vsCommandStatusSupported 
            | 
            (bEnabled? vsCommandStatus.vsCommandStatusEnabled : 0)
            |
            (bHidden? vsCommandStatus.vsCommandStatusInvisible : 0)
            );
        return;
    }
}
//-------------------------------------------------------------------------------------------------
public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, 
    ref object varOut, ref bool handled)
{
    handled = false;
    if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
    {
        Execute(commandName, ref handled);
    }
}

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.