#pragma once using namespace System; using namespace Extensibility; using namespace EnvDTE; using namespace EnvDTE80;<%BEGIN VSCommand%> using namespace Microsoft::VisualStudio::CommandBars; using namespace System::Resources; using namespace System::Reflection; using namespace System::Globalization;<%END VSCommand%> namespace <%=SAFEOBJNAME%> { /// The object for implementing an Add-in. /// public ref class Connect : public IDTExtensibility2<%BEGIN VSCommand%>, public IDTCommandTarget<%END VSCommand%> { public: /// Implements the constructor for the Add-in object. Place your initialization code within this method. Connect() { } /// Implements the OnAddInsUpdate method of the IDTExtensibility2 interface. Receives notification when the collection of Add-ins has changed. /// Array of parameters that are host application specific. /// virtual void OnAddInsUpdate(System::Array ^%custom); /// Implements the OnBeginShutdown method of the IDTExtensibility2 interface. Receives notification that the host application is being unloaded. /// Array of parameters that are host application specific. /// virtual void OnBeginShutdown(System::Array ^%custom); /// Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded. /// Root object of the host application. /// Describes how the Add-in is being loaded. /// Object representing this Add-in. /// virtual void OnConnection(System::Object ^Application, ext_ConnectMode ConnectMode, System::Object ^AddInInst, System::Array ^%custom); /// Implements the OnStartupComplete method of the IDTExtensibility2 interface. Receives notification that the host application has completed loading. /// Array of parameters that are host application specific. /// virtual void OnStartupComplete(System::Array ^%custom); /// Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded. /// Describes how the Add-in is being unloaded. /// Array of parameters that are host application specific. /// virtual void OnDisconnection(ext_DisconnectMode removeMode, System::Array ^%custom); <%BEGIN VSCommand%>/// 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. /// virtual void Exec(String ^CmdName, vsCommandExecOption ExecuteOption, Object ^%VariantIn, Object ^%VariantOut, bool %handled); /// Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated /// The name of the command to determine state for. /// Text that is needed for the command. /// The state of the command in the user interface. /// Text requested by the neededText parameter. /// virtual void QueryStatus(String ^CmdName, vsCommandStatusTextWanted NeededText, vsCommandStatus %StatusOption, Object ^%CommandText);<%END VSCommand%> private: DTE2 ^_applicationObject; AddIn ^_addInInstance; }; }