public void ResetKeyBindings()
        {
            foreach (Command command in Enum.GetValues(typeof(Command)))
            {
                _keyBindings.WriteValueAsJson(command.ToString(), _defaultValueProvider.GetDefaultKeyBindings(command));
            }

            KeyBindingsChanged?.Invoke(this, System.EventArgs.Empty);
        }
示例#2
0
        public void SaveKeyBindings(string command, ICollection <KeyBinding> keyBindings)
        {
            if (!Enum.IsDefined(typeof(Command), command))
            {
                throw new InvalidOperationException();
            }

            _keyBindings.WriteValueAsJson(command.ToString(), keyBindings);
            KeyBindingsChanged?.Invoke(this, System.EventArgs.Empty);
        }
示例#3
0
        public void SaveKeyBindings(string command, ICollection <KeyBinding> keyBindings)
        {
            if (!Enum.TryParse <Command>(command, true, out var enumValue))
            {
                throw new InvalidOperationException();
            }

            _keyBindings.WriteValueAsJson(enumValue.ToString(), keyBindings);
            KeyBindingsChanged?.Invoke(this, System.EventArgs.Empty);
        }
示例#4
0
        public void SaveShellProfile(ShellProfile shellProfile, bool newShell = false)
        {
            _shellProfiles.WriteValueAsJson(shellProfile.Id.ToString(), shellProfile);

            // When saving the shell profile, we also need to update keybindings for everywhere.
            KeyBindingsChanged?.Invoke(this, System.EventArgs.Empty);

            if (newShell)
            {
                ShellProfileAdded?.Invoke(this, shellProfile);
            }
        }
 public void SaveKeyBindings(Command command, ICollection <KeyBinding> keyBindings)
 {
     _keyBindings.WriteValueAsJson(command.ToString(), keyBindings);
     KeyBindingsChanged?.Invoke(this, System.EventArgs.Empty);
 }
 public void SaveKeyBindings(Command command, ICollection <KeyBinding> keyBindings)
 {
     _keyBindings.WriteValueAsJson(command.ToString(), keyBindings);
     _roamingSettings.WriteValueAsJson(nameof(KeyBindings), keyBindings);
     KeyBindingsChanged?.Invoke(this, EventArgs.Empty);
 }
示例#7
0
 public void SaveKeyBindings(KeyBindings keyBindings)
 {
     _roamingSettings.WriteValueAsJson(nameof(KeyBindings), keyBindings);
     KeyBindingsChanged?.Invoke(this, EventArgs.Empty);
 }