public void ResetKeyBindings() { foreach (Command command in Enum.GetValues(typeof(Command))) { _keyBindings.WriteValueAsJson(command.ToString(), _defaultValueProvider.GetDefaultKeyBindings(command)); } KeyBindingsChanged?.Invoke(this, System.EventArgs.Empty); }
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); }
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); }
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); }
public void SaveKeyBindings(KeyBindings keyBindings) { _roamingSettings.WriteValueAsJson(nameof(KeyBindings), keyBindings); KeyBindingsChanged?.Invoke(this, EventArgs.Empty); }