/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { Command.Initialize(this); base.Initialize(); applicationObject = (DTE2)GetService(typeof(DTE)); debugEvents = applicationObject.Events.DebuggerEvents; commandEvents = applicationObject.Events.CommandEvents; solutionEvents = applicationObject.Events.SolutionEvents; currentCommandStep = CurrentCommandStep.StepInto; solutionEvents.Opened += SolutionEvents_Opened; debugEvents.OnEnterBreakMode += DebugEvents_OnEnterBreakMode; debugEvents.OnEnterDesignMode += DebugEvents_OnEnterDesignMode; debugEvents.OnEnterRunMode += DebugEvents_OnEnterRunMode; commandEvents.AfterExecute += CommandEvents_AfterExecute; }
private void VerifyCommandStep(string Guid, int ID, DTE2 dte) { if (dte.Commands == null) { return; } EnvDTE.Command command = dte.Commands.Item(Guid, ID); if (command == null) { return; } switch (command.Name) { case "Debug.StepInto": currentCommandStep = CurrentCommandStep.StepInto; break; case "Debug.StepOver": currentCommandStep = CurrentCommandStep.StepOver; break; case "Debug.StepOut": currentCommandStep = CurrentCommandStep.StepOut; break; } }