/// <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()
		{
			base.Initialize();

			var settingsStore = new Lazy<WritableSettingsStore>(() =>
			{
				return new ShellSettingsManager(this).
					GetWritableSettingsStore(SettingsScope.UserSettings);
			});

			Settings = new BuildHelperSettings(settingsStore);
			m_VsInstance = (DTE2)GetService(typeof(DTE));
			var solutionBuildManager = (IVsSolutionBuildManager2)GetService(typeof(SVsSolutionBuildManager));
			var statusBar = (IVsStatusbar)GetService(typeof(SVsStatusbar));
			var logger = new ExtensionLogger(() => GetService(typeof(SVsActivityLog)) as IVsActivityLog, statusBar);
			var winHelper = new WinHelper(logger); //never cache the activity log reference
			m_BuildTracker = new BuildTracker(m_VsInstance, solutionBuildManager, Settings, winHelper);
		}
Example #2
0
		public BuildTracker(
			DTE2 vsInstance,
			IVsSolutionBuildManager2 buildManager,
			BuildHelperSettings settings,
			WinHelper winHelper)
		{
			Ensure.That(() => vsInstance).IsNotNull();
			Ensure.That(() => settings).IsNotNull();
			Ensure.That(() => winHelper).IsNotNull();
			Ensure.That(() => buildManager).IsNotNull();

			m_VsInstance = vsInstance;
			m_Settings = settings;
			m_WinHelper = winHelper;

			uint pdwCookieSolutionBM;
			m_BuildManager = buildManager;
			m_BuildManager.AdviseUpdateSolutionEvents(this, out pdwCookieSolutionBM);
		}