/// <summary> /// Sets the Visual Studio IDE object. /// </summary> private DTE InitializeDTE() { // Store the dte so that it can be used later. var dte = Package.GetService <DTE>(); _events = dte.Events; // Registers handlers for the Activated and Closing events from the text window. _windowsEvents = _events.get_WindowEvents(null); _windowsEvents.WindowActivated += windowsEvents_WindowActivated; _windowsEvents.WindowClosing += windowsEvents_WindowClosing; // Registers handlers for certain solution events. _solnEvents = _events.SolutionEvents; _solnEvents.Opened += solnEvents_Opened; _solnEvents.QueryCloseSolution += solnEvents_QueryCloseSolution; // Get the code model data. _codeCache = new CodeOutlineCache(_control, dte); return(dte); }
/// <summary> /// Sets the Visual Studio IDE object. /// </summary> private DTE InitializeDTE() { // Store the dte so that it can be used later. var dte = Package.GetService<DTE>(); _events = dte.Events; // Registers handlers for the Activated and Closing events from the text window. _windowsEvents = _events.get_WindowEvents(null); _windowsEvents.WindowActivated += windowsEvents_WindowActivated; _windowsEvents.WindowClosing += windowsEvents_WindowClosing; // Registers handlers for certain solution events. _solnEvents = _events.SolutionEvents; _solnEvents.Opened += solnEvents_Opened; _solnEvents.QueryCloseSolution += solnEvents_QueryCloseSolution; // Get the code model data. _codeCache = new CodeOutlineCache(_control, dte); return dte; }