/// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary> /// <param term='application'>Root object of the host application.</param> /// <param term='connectMode'>Describes how the Add-in is being loaded.</param> /// <param term='addInInst'>Object representing this Add-in.</param> /// <seealso class='IDTExtensibility2' /> public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) { _applicationObject = (DTE2)application; _addInInstance = (AddIn)addInInst; _dbgWatchConfig = new QuickWatchConfig(); try { CommandBar commandBar = ((CommandBars)_applicationObject.CommandBars)["Code Window"]; // Create Quick watch menu _controlQuickWatch = commandBar.Controls.Add(MsoControlType.msoControlButton, System.Reflection.Missing.Value, System.Reflection.Missing.Value, 1, true); _controlQuickWatch.Caption = "QuickWatchEx..."; _controlQuickWatch.Enabled = IsInDebugMode(_applicationObject); _menuItemHandlerQuickWatch = (CommandBarEvents)_applicationObject.Events.CommandBarEvents[_controlQuickWatch]; _menuItemHandlerQuickWatch.Click += MenuItemHandlerQuickWatch_Click; _debuggerEvents = _applicationObject.Events.DebuggerEvents; _debuggerEvents.OnEnterDesignMode += DebuggerEvents_OnEnterDesignMode; _debuggerEvents.OnEnterBreakMode += DebuggerEvents_OnEnterBreakMode; _debuggerEvents.OnEnterRunMode += DebuggerEvents_OnEnterRunMode; } catch (Exception e) { MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected DebugControllerBase(string expression, QuickWatchConfig config) { _model = new TreeModel(new Expression(this)); _search = ""; _config = config; }
public EnvDteDebugControllerBase(DTE2 dte, string expression, QuickWatchConfig config) : base(expression, config) { _dte = dte; Expression = expression; }