示例#1
0
        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, "");
        }
示例#2
0
        public static ComboModeSettings GetComboModeSettings()
        {
            if (comboModeSettingsCache == null)
            {
                comboModeSettingsCache = SettingsRepository.GetComboModeSettings(ServiceProvider.GlobalProvider);
            }

            return(comboModeSettingsCache);
        }
示例#3
0
        public static void SaveToStorage(ComboModeSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            SettingsRepository.SaveToStorage(settings, ServiceProvider.GlobalProvider);

            comboModeSettingsCache.CloneFrom(settings);
        }