/// <summary> /// Run initialization code on first connection of the AddIn. /// </summary> /// <param name="appObj"> Application Object. </param> /// <param name="addin"> Add In Object. </param> public void Connect(DTE2 appObj, EnvDTE.AddIn addin) { /// Initialize External and Internal Variables. _applicationObject = appObj; _addInInstance = addin; /// Register Command Events _commandEvents = new VSNDKCommandEvents(appObj); _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionPlatform, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec); _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionCfg, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec); _commandEvents.RegisterCommand(GuidList.guidVSDebugGroup, CommandConstants.cmdidDebugBreakatFunction, cmdNewFunctionBreakpoint_afterExec, cmdNewFunctionBreakpoint_beforeExec); DisableIntelliSenseErrorReport(true); CheckSolutionPlatformCommand(); }
/// <summary> /// Run initialization code on first connection of the AddIn. /// </summary> /// <param name="appObj"> Application Object. </param> /// <param name="addin"> Add In Object. </param> public void Connect(DTE2 appObj, EnvDTE.AddIn addin) { /// Initialize External and Internal Variables. _applicationObject = appObj; _addInInstance = addin; configTable = new List<configtableentry>(); /// Register Command Events _commandEvents = new VSNDKCommandEvents(appObj); _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionPlatform, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec); _commandEvents.RegisterCommand(GuidList.guidVSDebugGroup, CommandConstants.cmdidDebugBreakatFunction, cmdNewFunctionBreakpoint_afterExec, cmdNewFunctionBreakpoint_beforeExec); DisableIntelliSenseErrorReport(true); CheckSolutionPlatformCommand(); }
/// <summary> /// Run initialization code on first connection of the AddIn /// </summary> /// <param name="appObj">Application Object</param> /// <param name="addin">Add In Object</param> public void Connect(DTE2 appObj, EnvDTE.AddIn addin) { /// Initialize External and Internal Variables. _applicationObject = appObj; _addInInstance = addin; isDebugEngineRunning = false; /// Register Command Events _commandEvents = new VSNDKCommandEvents(appObj); _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionPlatform, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec); _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidSolutionCfg, cmdNewPlatform_afterExec, cmdNewPlatform_beforeExec); _commandEvents.RegisterCommand(GuidList.guidVSStd97String, CommandConstants.cmdidStartDebug, startDebugCommandEvents_AfterExecute, startDebugCommandEvents_BeforeExecute); _commandEvents.RegisterCommand(GuidList.guidVSStd2KString, CommandConstants.cmdidStartDebugContext, startDebugCommandEvents_AfterExecute, startDebugCommandEvents_BeforeExecute); _commandEvents.RegisterCommand(GuidList.guidVSStd97String, CommandConstants.cmdidStartNoDebug, startNoDebugCommandEvents_AfterExecute, startNoDebugCommandEvents_BeforeExecute); _commandEvents.RegisterCommand(GuidList.guidVSDebugGroup, CommandConstants.cmdidDebugBreakatFunction, cmdNewFunctionBreakpoint_afterExec, cmdNewFunctionBreakpoint_beforeExec); // ??? Check why Solution.SolutionBuild.Deploy(false) fires OnBuildComplete event immediately after start deploying when _buildEvents is initialized here. // ??? To avoid that, we should initialize _buildEvents in BuildBar(), but here should be the right place. _buildEvents = _applicationObject.Events.BuildEvents; _buildEvents.OnBuildBegin += new _dispBuildEvents_OnBuildBeginEventHandler(this.OnBuildBegin); // Create a reference to the Output window. // Create a tool window reference for the Output window // and window pane. OutputWindow ow = _applicationObject.ToolWindows.OutputWindow; // Select the Build pane in the Output window. _owP = ow.OutputWindowPanes.Item("Build"); _owP.Activate(); DisableIntelliSenseErrorReport(true); CheckSolutionPlatformCommand(); }