protected override void Initialize() { base.Initialize(); try { Environment.SetEnvironmentVariable("RecipeFrameworkPath", Path.GetDirectoryName(this.GetType().Assembly.Location)); LoadTraceLevelSetting(); AdviseSolutionEvents(); AdviseTrackProjectDocumentsEvents(); IVsRegisterNewDialogFilters filterService = (IVsRegisterNewDialogFilters)GetService(typeof(SVsRegisterNewDialogFilters)); filterService.RegisterAddNewItemDialogFilter( (IVsFilterAddProjectItemDlg)GetService(typeof(IVsFilterAddProjectItemDlg)), out itemsFilterCookie); filterService.RegisterNewProjectDialogFilter( (IVsFilterNewProjectDlg)GetService(typeof(IVsFilterAddProjectItemDlg)), out projectsFilterCookie); AddOptionKey(GaxUserDataPersistenceKey); ServiceHelper.CheckDependencies(this, (System.IServiceProvider) this); guidanceNavigatorManager = new GuidanceNavigatorManager(this as System.IServiceProvider); IRecipeManagerService rms = (IRecipeManagerService)GetService(typeof(IRecipeManagerService)); rms.EnablingPackage += OnEnablingPackage; rms.EnabledPackage += OnEnabledPackage; } catch (Exception e) { ErrorHelper.Show((IUIService)GetService(typeof(IUIService)), e); throw; } }
int IVsSolutionLoadEvents.OnAfterBackgroundSolutionLoadComplete() { if (guidanceNavigatorManager == null) { guidanceNavigatorManager = new GuidanceNavigatorManager(this as System.IServiceProvider); } IRecipeManagerService rms = (IRecipeManagerService)GetService(typeof(IRecipeManagerService)); rms.EnabledPackage += new PackageEventHandler(OnEnabledPackage); IVsSolutionLoadEvents hostService = (IVsSolutionLoadEvents)GetService(typeof(IHostService)); int result = hostService.OnAfterBackgroundSolutionLoadComplete(); isOpeningSolution = false; return(result); }
int IVsSolutionEvents.OnAfterOpenSolution(object pUnkReserved, int fNewSolution) { if (fNewSolution == 0) { isOpeningSolution = true; } if (guidanceNavigatorManager == null) { guidanceNavigatorManager = new GuidanceNavigatorManager(this as System.IServiceProvider); } IRecipeManagerService rms = (IRecipeManagerService)GetService(typeof(IRecipeManagerService)); rms.EnabledPackage += new PackageEventHandler(OnEnabledPackage); IVsSolutionEvents hostService = (IVsSolutionEvents)GetService(typeof(IHostService)); int result = hostService.OnAfterOpenSolution(pUnkReserved, fNewSolution); isOpeningSolution = false; return(result); }
private void UnsubscribeToGaxEvents() { guidanceNavigatorManager = RecipeManagerPackage.Singleton.GuidanceNavigatorManager; guidanceNavigatorManager.BindedPackagesChange -= new EventHandler(guidanceNavigatorManager_BindedPackagesChange); guidanceNavigatorManager.RecipeExecuted -= new RecipeEventHandler(guidanceNavigatorManager_RecipeExecuted); }