public PowerModeAdornment(IWpfTextView view, ITextDocumentFactoryService textDocumentFactory) { if (view == null) { throw new ArgumentNullException("view"); } this.view = view; adornmentLayer = view.GetAdornmentLayer("PowerModeAdornment"); this.textDocumentFactory = textDocumentFactory; streakCounterAdornment = new StreakCounterAdornment(); screenShakeAdornment = new ScreenShakeAdornment(); particlesAdornment = new ParticlesAdornment(); generalSettings = SettingsService.GetGeneralSettings(); comboModeSettings = SettingsService.GetComboModeSettings(); this.view.TextBuffer.Changed += TextBuffer_Changed; this.view.ViewportHeightChanged += View_ViewportSizeChanged; this.view.ViewportWidthChanged += View_ViewportSizeChanged; this.view.BackgroundBrushChanged += View_BackgroundBrushChanged; this.view.LayoutChanged += View_LayoutChanged; PropertyChangedEventManager.AddHandler(generalSettings, GeneralSettingModelPropertyChanged, ""); PropertyChangedEventManager.AddHandler(comboModeSettings, ComboModeSettingsModelPropertyChanged, ""); }
public static ComboModeSettings GetComboModeSettings() { if (comboModeSettingsCache == null) { comboModeSettingsCache = SettingsRepository.GetComboModeSettings(ServiceProvider.GlobalProvider); } return(comboModeSettingsCache); }
public static void SaveToStorage(ComboModeSettings settings) { if (settings == null) { throw new ArgumentNullException("settings"); } SettingsRepository.SaveToStorage(settings, ServiceProvider.GlobalProvider); comboModeSettingsCache.CloneFrom(settings); }