private void Initialize() { log = package; traceController = package.GetService <STraceController, ITraceControllerInternal>(); Assumes.Present(traceController); solutionBrowser = new DteSolutionBrowser(package.GetService <SDTE, EnvDTE.DTE>()); }
public VsSolutionManager( ISolutionBrowser solutionBrowser, IVsMonitorSelection monitorSelection, IVsSolutionBuildManager solutionBuildManager, IDiagLog log) { ThreadHelper.ThrowIfNotOnUIThread(); this.solutionBrowser = solutionBrowser ?? throw new ArgumentNullException(nameof(solutionBrowser)); this.monitorSelection = monitorSelection ?? throw new ArgumentNullException(nameof(monitorSelection)); this.solutionBuildManager = solutionBuildManager ?? throw new ArgumentNullException(nameof(solutionBuildManager)); this.log = log ?? throw new ArgumentNullException(nameof(log)); // Advise to selection events (e.g. startup project changed) monitorSelection.AdviseSelectionEvents(this, out selectionEventsCookie); // Advise to update solution events (e.g. switched debug/release configuration) solutionBuildManager.AdviseUpdateSolutionEvents(this, out updateSolutionEventsCookie); }