///////////////////////////////////////////////////////////////////////////// // Overriden Package Implementation #region Package Members /// <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 initilaization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", ToString())); base.Initialize(); // Add our command handlers for menu (commands must exist in the .vsct file) _commands = new Commands(this); _commands.Initialize(); _commands.RunAndAttach += RunAndAttachCallback; _commands.Step += StepCallback; _commands.Continue += ContinueCallback; _commands.ShowOptions += ShowOptions; _commands.ShowAbout += ShowAbout; _solutionHelper = new SolutionHelper(this, _commands); _solutionHelper.Register(); _output = new Output(this); _output.Initialize(); _debugger = new SimulatorDebugger(this, _output); _debugger.DebugStateChanged += () => _commands.SetDebugState(_debugger); _dte = GetService(typeof(SDTE)) as DTE; VSTraceListener.Instance.AddOutputPaneLogger(_output); }
public void SetDebugState(SimulatorDebugger server) { _stepCommand.Enabled = _continueCommand.Enabled = server.CanRun; if (!server.DebugServer.Caps.HasFlag(DebuggerCapabilities.CAPS_SINGLE_STEP_BIT)) { _stepCommand.Enabled = false; } }