public void SubjectBuffersConnected(IWpfTextView textView, ConnectionReason reason, Collection <ITextBuffer> subjectBuffers) { AssertIsForeground(); if (!_hasTextViewOpened) { _hasTextViewOpened = true; _colorApplier = new EnhancedColorApplier(_serviceProvider); // Check which experimental flights we are in _inUseEnhancedColorsFlight = _experimentationService.IsExperimentEnabled(UseEnhancedColorsFlight); _inStopEnhancedColorsFlight = _experimentationService.IsExperimentEnabled(StopEnhancedColorsFlight); _settingsManager = (ISettingsManager)_serviceProvider.GetService(typeof(SVsSettingsPersistenceManager)); // Do not hook settings changed if we have stopped the experiment. // We will simply remove the enhanced colors if they are applied. if (!_inStopEnhancedColorsFlight) { // We need to update the theme whenever the Preview Setting changes or the VS Theme changes. _settingsManager.GetSubset(UseEnhancedColorsSetting).SettingChangedAsync += UseEnhancedColorsSettingChangedAsync; VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged; } VsTaskLibraryHelper.CreateAndStartTask(VsTaskLibraryHelper.ServiceInstance, VsTaskRunContext.UIThreadIdlePriority, UpdateThemeColors); } }
public void SubjectBuffersConnected(IWpfTextView textView, ConnectionReason reason, Collection <ITextBuffer> subjectBuffers) { AssertIsForeground(); if (!_hasTextViewOpened) { _hasTextViewOpened = true; _colorApplier = new EnhancedColorApplier(_serviceProvider); _settingsManager = (ISettingsManager)_serviceProvider.GetService(typeof(SVsSettingsPersistenceManager)); // We need to update the theme whenever the Preview Setting changes or the VS Theme changes. _settingsManager.GetSubset(UseEnhancedColorsSetting).SettingChangedAsync += UseEnhancedColorsSettingChangedAsync; VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged; VsTaskLibraryHelper.CreateAndStartTask(VsTaskLibraryHelper.ServiceInstance, VsTaskRunContext.UIThreadIdlePriority, UpdateThemeColors); } }