Пример #1
0
        public void SaveTheme(TerminalTheme theme)
        {
            _themes.WriteValueAsJson(theme.Id.ToString(), theme);

            if (theme.Id == GetCurrentThemeId())
            {
                CurrentThemeChanged?.Invoke(this, theme.Id);
            }
        }
Пример #2
0
        public SettingsService(IDefaultValueProvider defaultValueProvider)
        {
            _defaultValueProvider = defaultValueProvider;
            _localSettings        = ApplicationData.Current.LocalSettings;
            _roamingSettings      = ApplicationData.Current.RoamingSettings;

            _themes = _roamingSettings.CreateContainer(ThemesContainerName, ApplicationDataCreateDisposition.Always);

            foreach (var theme in _defaultValueProvider.GetPreInstalledThemes())
            {
                _themes.WriteValueAsJson(theme.Id.ToString(), theme);
            }
        }
Пример #3
0
 public void SaveShellProfile(ShellProfile shellProfile)
 {
     _shellProfiles.WriteValueAsJson(shellProfile.Id.ToString(), shellProfile);
 }
Пример #4
0
 public void SaveKeyBindings(Command command, ICollection <KeyBinding> keyBindings)
 {
     _keyBindings.WriteValueAsJson(command.ToString(), keyBindings);
     _roamingSettings.WriteValueAsJson(nameof(KeyBindings), keyBindings);
     KeyBindingsChanged?.Invoke(this, EventArgs.Empty);
 }
Пример #5
0
 public void SaveTerminalOptions(TerminalOptions terminalOptions)
 {
     _roamingSettings.WriteValueAsJson(nameof(TerminalOptions), terminalOptions);
     TerminalOptionsChanged?.Invoke(this, terminalOptions);
 }
Пример #6
0
 public void SaveShellConfiguration(ShellConfiguration shellConfiguration)
 {
     _localSettings.WriteValueAsJson(nameof(ShellConfiguration), shellConfiguration);
 }