public int OnShellPropertyChange(int propid, object var)
        {
            if ((int)__VSSPROPID.VSSPROPID_Zombie == propid)
            {
                if ((bool)var == false)
                {
                    //Visual Studio is now ready and loaded up
                    var shellService = GetService(typeof(SVsShell)) as IVsShell;
                    if (shellService != null)
                    {
                        ErrorHandler.ThrowOnFailure(shellService.UnadviseShellPropertyChanges(cookie));
                    }
                    cookie = 0;

                    optionsPage = (OptionsPage)GetDialogPage(typeof(OptionsPage));
                    optionsPage.SettingsDirectoryPathUpdated += OptionsPageSettingsDirectoryPathUpdated;

                    var vsExtensionManager    = GetService(typeof(SVsExtensionManager)) as IVsExtensionManager;
                    var vsExtensionRepository = GetService(typeof(SVsExtensionRepository)) as IVsExtensionRepository;

                    extensionManager      = new ExtensionManagerFacade(vsExtensionManager, vsExtensionRepository);
                    extensionManager.Log += LogMessage;

                    SetupFileWatcher();
                    SetUpLogger();
                    SynchronizeExtensions();
                }
            }
            return(VSConstants.S_OK);
        }
Exemple #2
0
 public SettingsRepository(ExtensionManagerFacade visualStudioExtensionManager, string path)
 {
     extensionManager = visualStudioExtensionManager;
     settingsFilePath = path;
 }
 public SettingsRepository(ExtensionManagerFacade visualStudioExtensionManager, string path)
 {
     extensionManager = visualStudioExtensionManager;
     settingsFilePath = path;
 }
        public int OnShellPropertyChange(int propid, object var)
        {
            if ((int)__VSSPROPID.VSSPROPID_Zombie == propid)
            {
                if ((bool)var == false)
                {
                    //Visual Studio is now ready and loaded up
                    var shellService = GetService(typeof(SVsShell)) as IVsShell;
                    if (shellService != null)
                        ErrorHandler.ThrowOnFailure(shellService.UnadviseShellPropertyChanges(cookie));
                    cookie = 0;

                    optionsPage = (OptionsPage)GetDialogPage(typeof(OptionsPage));
                    optionsPage.SettingsDirectoryPathUpdated += OptionsPageSettingsDirectoryPathUpdated;

                    var vsExtensionManager = GetService(typeof(SVsExtensionManager)) as IVsExtensionManager;
                    var vsExtensionRepository = GetService(typeof(SVsExtensionRepository)) as IVsExtensionRepository;

                    extensionManager = new ExtensionManagerFacade(vsExtensionManager, vsExtensionRepository);
                    extensionManager.Log += LogMessage;

                    SetupFileWatcher();
                    SetUpLogger();
                    SynchronizeExtensions();
                }
            }
            return VSConstants.S_OK;
        }