From 0ee4025e00eb4075aa4aec2d2b618ebc42f44305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Kov=C3=A1cs?= Date: Wed, 11 May 2022 11:49:26 +0200 Subject: [PATCH] Rename Commands enum to Command --- .../Command/{Commands.cs => Command.cs} | 2 +- .../Services/ICommandHandler.cs | 4 +- .../Services/ICommandHandlerService.cs | 2 +- .../CommandHandler/CommandHandlerBase.cs | 12 +- .../ItemManipulationCommandHandler.cs | 14 +- .../NavigationCommandHandler.cs | 12 +- .../Services/CommandHandlerService.cs | 2 +- .../CommandBindingConfiguration.cs | 10 +- .../Configuration/MainConfiguration.cs | 120 +++++++++--------- .../CommandToCommandNameConverter.cs | 2 +- .../Services/DefaultModeKeyInputHandler.cs | 2 +- .../Services/KeyboardConfigurationService.cs | 4 +- .../RapidTravelModeKeyInputHandler.cs | 2 +- 13 files changed, 94 insertions(+), 94 deletions(-) rename src/AppCommon/FileTime.App.Core.Abstraction/Command/{Commands.cs => Command.cs} (98%) diff --git a/src/AppCommon/FileTime.App.Core.Abstraction/Command/Commands.cs b/src/AppCommon/FileTime.App.Core.Abstraction/Command/Command.cs similarity index 98% rename from src/AppCommon/FileTime.App.Core.Abstraction/Command/Commands.cs rename to src/AppCommon/FileTime.App.Core.Abstraction/Command/Command.cs index cde308b..a80dab5 100644 --- a/src/AppCommon/FileTime.App.Core.Abstraction/Command/Commands.cs +++ b/src/AppCommon/FileTime.App.Core.Abstraction/Command/Command.cs @@ -1,6 +1,6 @@ namespace FileTime.App.Core.Command; -public enum Commands +public enum Command { None, diff --git a/src/AppCommon/FileTime.App.Core.Abstraction/Services/ICommandHandler.cs b/src/AppCommon/FileTime.App.Core.Abstraction/Services/ICommandHandler.cs index 116fb4f..92883c6 100644 --- a/src/AppCommon/FileTime.App.Core.Abstraction/Services/ICommandHandler.cs +++ b/src/AppCommon/FileTime.App.Core.Abstraction/Services/ICommandHandler.cs @@ -4,6 +4,6 @@ namespace FileTime.App.Core.Services; public interface ICommandHandler { - bool CanHandleCommand(Commands command); - Task HandleCommandAsync(Commands command); + bool CanHandleCommand(Command.Command command); + Task HandleCommandAsync(Command.Command command); } \ No newline at end of file diff --git a/src/AppCommon/FileTime.App.Core.Abstraction/Services/ICommandHandlerService.cs b/src/AppCommon/FileTime.App.Core.Abstraction/Services/ICommandHandlerService.cs index b48cef7..362c78c 100644 --- a/src/AppCommon/FileTime.App.Core.Abstraction/Services/ICommandHandlerService.cs +++ b/src/AppCommon/FileTime.App.Core.Abstraction/Services/ICommandHandlerService.cs @@ -4,5 +4,5 @@ namespace FileTime.App.Core.Services; public interface ICommandHandlerService { - Task HandleCommandAsync(Commands command); + Task HandleCommandAsync(Command.Command command); } \ No newline at end of file diff --git a/src/AppCommon/FileTime.App.Core/Services/CommandHandler/CommandHandlerBase.cs b/src/AppCommon/FileTime.App.Core/Services/CommandHandler/CommandHandlerBase.cs index 034a38a..6e2d5fa 100644 --- a/src/AppCommon/FileTime.App.Core/Services/CommandHandler/CommandHandlerBase.cs +++ b/src/AppCommon/FileTime.App.Core/Services/CommandHandler/CommandHandlerBase.cs @@ -8,7 +8,7 @@ namespace FileTime.App.Core.Services.CommandHandler; public abstract class CommandHandlerBase : ICommandHandler { - private readonly Dictionary> _commandHandlers = new(); + private readonly Dictionary> _commandHandlers = new(); private readonly IAppState? _appState; protected CommandHandlerBase(IAppState? appState = null) @@ -16,12 +16,12 @@ public abstract class CommandHandlerBase : ICommandHandler _appState = appState; } - public bool CanHandleCommand(Commands command) => _commandHandlers.ContainsKey(command); + public bool CanHandleCommand(Command.Command command) => _commandHandlers.ContainsKey(command); - public async Task HandleCommandAsync(Commands command) => await _commandHandlers[command].Invoke(); + public async Task HandleCommandAsync(Command.Command command) => await _commandHandlers[command].Invoke(); - protected void AddCommandHandler(Commands command, Func handler) => _commandHandlers.Add(command, handler); - protected void AddCommandHandlers(IEnumerable<(Commands command, Func handler)> commandHandlers) + protected void AddCommandHandler(Command.Command command, Func handler) => _commandHandlers.Add(command, handler); + protected void AddCommandHandlers(IEnumerable<(Command.Command command, Func handler)> commandHandlers) { foreach (var (command, handler) in commandHandlers) { @@ -29,7 +29,7 @@ public abstract class CommandHandlerBase : ICommandHandler } } - protected void RemoveCommandHandler(Commands command) => _commandHandlers.Remove(command); + protected void RemoveCommandHandler(Command.Command command) => _commandHandlers.Remove(command); protected IDisposable SaveSelectedTab(Action handler) => RunWithAppState(appState => appState.SelectedTab.Subscribe(handler)); protected IDisposable SaveCurrentSelectedItem(Action handler) diff --git a/src/AppCommon/FileTime.App.Core/Services/CommandHandler/ItemManipulationCommandHandler.cs b/src/AppCommon/FileTime.App.Core/Services/CommandHandler/ItemManipulationCommandHandler.cs index 6d16ca3..d0e66e6 100644 --- a/src/AppCommon/FileTime.App.Core/Services/CommandHandler/ItemManipulationCommandHandler.cs +++ b/src/AppCommon/FileTime.App.Core/Services/CommandHandler/ItemManipulationCommandHandler.cs @@ -29,13 +29,13 @@ public class ItemManipulationCommandHandler : CommandHandlerBase _markedItems = new BindedCollection(appState.SelectedTab.Select(t => t?.MarkedItems)); - AddCommandHandlers(new (Commands, Func)[] + AddCommandHandlers(new (Command.Command, Func)[] { - (Commands.Copy, Copy), - (Commands.Mark, MarkItem), - (Commands.PasteMerge, PasteMerge), - (Commands.PasteOverwrite, PasteOverwrite), - (Commands.PasteSkip, PasteSkip), + (Command.Command.Copy, Copy), + (Command.Command.Mark, MarkItem), + (Command.Command.PasteMerge, PasteMerge), + (Command.Command.PasteOverwrite, PasteOverwrite), + (Command.Command.PasteSkip, PasteSkip), }); } @@ -44,7 +44,7 @@ public class ItemManipulationCommandHandler : CommandHandlerBase if (_selectedTab == null || _currentSelectedItem?.BaseItem?.FullName == null) return; _selectedTab.ToggleMarkedItem(new AbsolutePath(_currentSelectedItem.BaseItem)); - await _commandHandlerService.HandleCommandAsync(Commands.MoveCursorDown); + await _commandHandlerService.HandleCommandAsync(Command.Command.MoveCursorDown); } private Task Copy() diff --git a/src/AppCommon/FileTime.App.Core/Services/CommandHandler/NavigationCommandHandler.cs b/src/AppCommon/FileTime.App.Core/Services/CommandHandler/NavigationCommandHandler.cs index 1af1243..595a4a1 100644 --- a/src/AppCommon/FileTime.App.Core/Services/CommandHandler/NavigationCommandHandler.cs +++ b/src/AppCommon/FileTime.App.Core/Services/CommandHandler/NavigationCommandHandler.cs @@ -24,13 +24,13 @@ public class NavigationCommandHandler : CommandHandlerBase SaveCurrentLocation(l => _currentLocation = l); SaveCurrentItems(i => _currentItems = i); - AddCommandHandlers(new (Commands, Func)[] + AddCommandHandlers(new (Command.Command, Func)[] { - (Commands.EnterRapidTravel, EnterRapidTravel), - (Commands.GoUp, GoUp), - (Commands.MoveCursorDown, MoveCursorDown), - (Commands.MoveCursorUp, MoveCursorUp), - (Commands.Open, OpenContainer), + (Command.Command.EnterRapidTravel, EnterRapidTravel), + (Command.Command.GoUp, GoUp), + (Command.Command.MoveCursorDown, MoveCursorDown), + (Command.Command.MoveCursorUp, MoveCursorUp), + (Command.Command.Open, OpenContainer), }); } diff --git a/src/AppCommon/FileTime.App.Core/Services/CommandHandlerService.cs b/src/AppCommon/FileTime.App.Core/Services/CommandHandlerService.cs index aa96613..0e79fa0 100644 --- a/src/AppCommon/FileTime.App.Core/Services/CommandHandlerService.cs +++ b/src/AppCommon/FileTime.App.Core/Services/CommandHandlerService.cs @@ -67,7 +67,7 @@ public class CommandHandlerService : ICommandHandlerService //(Commands.ToggleHidden, ToggleHidden), } - public async Task HandleCommandAsync(Commands command) + public async Task HandleCommandAsync(Command.Command command) { var handler = _commandHandlers.Value.FirstOrDefault(h => h.CanHandleCommand(command)); diff --git a/src/GuiApp/Avalonia/FileTime.GuiApp.Abstractions/Configuration/CommandBindingConfiguration.cs b/src/GuiApp/Avalonia/FileTime.GuiApp.Abstractions/Configuration/CommandBindingConfiguration.cs index c33e702..ae62bb2 100644 --- a/src/GuiApp/Avalonia/FileTime.GuiApp.Abstractions/Configuration/CommandBindingConfiguration.cs +++ b/src/GuiApp/Avalonia/FileTime.GuiApp.Abstractions/Configuration/CommandBindingConfiguration.cs @@ -7,31 +7,31 @@ public class CommandBindingConfiguration { public List Keys { get; set; } = new List(); - public Commands Command { get; set; } = Commands.None; + public Command Command { get; set; } = Command.None; public string KeysDisplayText => GetKeysDisplayText(); public CommandBindingConfiguration() { } - public CommandBindingConfiguration(Commands command, IEnumerable keys) + public CommandBindingConfiguration(Command command, IEnumerable keys) { Keys = new List(keys); Command = command; } - public CommandBindingConfiguration(Commands command, KeyConfig key) + public CommandBindingConfiguration(Command command, KeyConfig key) { Keys = new List() { key }; Command = command; } - public CommandBindingConfiguration(Commands command, IEnumerable keys) + public CommandBindingConfiguration(Command command, IEnumerable keys) { Keys = keys.Select(k => new KeyConfig(k)).ToList(); Command = command; } - public CommandBindingConfiguration(Commands command, Key key) + public CommandBindingConfiguration(Command command, Key key) { Keys = new List() { new KeyConfig(key) }; Command = command; diff --git a/src/GuiApp/Avalonia/FileTime.GuiApp.Abstractions/Configuration/MainConfiguration.cs b/src/GuiApp/Avalonia/FileTime.GuiApp.Abstractions/Configuration/MainConfiguration.cs index 61db9c6..24d59c3 100644 --- a/src/GuiApp/Avalonia/FileTime.GuiApp.Abstractions/Configuration/MainConfiguration.cs +++ b/src/GuiApp/Avalonia/FileTime.GuiApp.Abstractions/Configuration/MainConfiguration.cs @@ -42,66 +42,66 @@ public static class MainConfiguration { return new List() { - new CommandBindingConfiguration(Commands.AutoRefresh, new KeyConfig(Key.R, shift: true)), - new CommandBindingConfiguration(Commands.ChangeTimelineMode, new[] { Key.T, Key.M }), - new CommandBindingConfiguration(Commands.CloseTab, Key.Q), - new CommandBindingConfiguration(Commands.Compress, new[] { Key.Y, Key.C }), - new CommandBindingConfiguration(Commands.Copy, new[] { Key.Y, Key.Y }), - new CommandBindingConfiguration(Commands.CopyHash, new[] { Key.C, Key.H }), - new CommandBindingConfiguration(Commands.CopyPath, new[] { Key.C, Key.P }), - new CommandBindingConfiguration(Commands.CreateContainer, Key.F7), - new CommandBindingConfiguration(Commands.CreateContainer, new[] { Key.C, Key.C }), - new CommandBindingConfiguration(Commands.CreateElement, new[] { Key.C, Key.E }), - new CommandBindingConfiguration(Commands.Cut, new[] { Key.D, Key.D }), - new CommandBindingConfiguration(Commands.Edit, new KeyConfig(Key.F4)), - new CommandBindingConfiguration(Commands.EnterRapidTravel, new KeyConfig(Key.OemComma, shift: true)), - new CommandBindingConfiguration(Commands.FindByName, new[] { Key.F, Key.N }), - new CommandBindingConfiguration(Commands.FindByNameRegex, new[] { Key.F, Key.R }), - new CommandBindingConfiguration(Commands.GoToHome, new[] { Key.G, Key.H }), - new CommandBindingConfiguration(Commands.GoToPath, new KeyConfig(Key.L, ctrl: true)), - new CommandBindingConfiguration(Commands.GoToPath, new[] { Key.G, Key.P }), - new CommandBindingConfiguration(Commands.GoToProvider, new[] { Key.G, Key.T }), - new CommandBindingConfiguration(Commands.GoToRoot, new[] { Key.G, Key.R }), - new CommandBindingConfiguration(Commands.HardDelete, new[] { new KeyConfig(Key.D,shift: true), new KeyConfig(Key.D, shift: true) }), - new CommandBindingConfiguration(Commands.Mark, Key.Space), - new CommandBindingConfiguration(Commands.MoveToLast, new KeyConfig(Key.G, shift: true)), - new CommandBindingConfiguration(Commands.MoveToFirst, new[] { Key.G, Key.G }), - new CommandBindingConfiguration(Commands.NextTimelineBlock, Key.L ), - new CommandBindingConfiguration(Commands.NextTimelineCommand, Key.J ), - new CommandBindingConfiguration(Commands.OpenInFileBrowser, new[] { Key.O, Key.E }), - new CommandBindingConfiguration(Commands.PasteMerge, new[] { Key.P, Key.P }), - new CommandBindingConfiguration(Commands.PasteOverwrite, new[] { Key.P, Key.O }), - new CommandBindingConfiguration(Commands.PasteSkip, new[] { Key.P, Key.S }), - new CommandBindingConfiguration(Commands.PinFavorite, new[] { Key.F, Key.P }), - new CommandBindingConfiguration(Commands.PreviousTimelineBlock, Key.H ), - new CommandBindingConfiguration(Commands.PreviousTimelineCommand, Key.K ), - new CommandBindingConfiguration(Commands.Refresh, Key.R), - new CommandBindingConfiguration(Commands.Rename, Key.F2), - new CommandBindingConfiguration(Commands.Rename, new[] { Key.C, Key.W }), - new CommandBindingConfiguration(Commands.RunCommand, new KeyConfig(Key.D4, shift: true)), - new CommandBindingConfiguration(Commands.ScanContainerSize, new[] { Key.C, Key.S }), - new CommandBindingConfiguration(Commands.ShowAllShotcut, Key.F1), - new CommandBindingConfiguration(Commands.SoftDelete, new[] { new KeyConfig(Key.D), new KeyConfig(Key.D, shift: true) }), - new CommandBindingConfiguration(Commands.SwitchToLastTab, Key.D9), - new CommandBindingConfiguration(Commands.SwitchToTab1, Key.D1), - new CommandBindingConfiguration(Commands.SwitchToTab2, Key.D2), - new CommandBindingConfiguration(Commands.SwitchToTab3, Key.D3), - new CommandBindingConfiguration(Commands.SwitchToTab4, Key.D4), - new CommandBindingConfiguration(Commands.SwitchToTab5, Key.D5), - new CommandBindingConfiguration(Commands.SwitchToTab6, Key.D6), - new CommandBindingConfiguration(Commands.SwitchToTab7, Key.D7), - new CommandBindingConfiguration(Commands.SwitchToTab8, Key.D8), - new CommandBindingConfiguration(Commands.TimelinePause, new[] { Key.T, Key.P }), - new CommandBindingConfiguration(Commands.TimelineRefresh, new[] { Key.T, Key.R }), - new CommandBindingConfiguration(Commands.TimelineStart, new[] { Key.T, Key.S }), - new CommandBindingConfiguration(Commands.ToggleAdvancedIcons, new[] { Key.Z, Key.I }), - new CommandBindingConfiguration(Commands.GoUp, Key.Left), - new CommandBindingConfiguration(Commands.Open, Key.Right), - new CommandBindingConfiguration(Commands.OpenOrRun, Key.Enter), - new CommandBindingConfiguration(Commands.MoveCursorUp, Key.Up), - new CommandBindingConfiguration(Commands.MoveCursorDown, Key.Down), - new CommandBindingConfiguration(Commands.MoveCursorUpPage, Key.PageUp), - new CommandBindingConfiguration(Commands.MoveCursorDownPage, Key.PageDown), + new CommandBindingConfiguration(Command.AutoRefresh, new KeyConfig(Key.R, shift: true)), + new CommandBindingConfiguration(Command.ChangeTimelineMode, new[] { Key.T, Key.M }), + new CommandBindingConfiguration(Command.CloseTab, Key.Q), + new CommandBindingConfiguration(Command.Compress, new[] { Key.Y, Key.C }), + new CommandBindingConfiguration(Command.Copy, new[] { Key.Y, Key.Y }), + new CommandBindingConfiguration(Command.CopyHash, new[] { Key.C, Key.H }), + new CommandBindingConfiguration(Command.CopyPath, new[] { Key.C, Key.P }), + new CommandBindingConfiguration(Command.CreateContainer, Key.F7), + new CommandBindingConfiguration(Command.CreateContainer, new[] { Key.C, Key.C }), + new CommandBindingConfiguration(Command.CreateElement, new[] { Key.C, Key.E }), + new CommandBindingConfiguration(Command.Cut, new[] { Key.D, Key.D }), + new CommandBindingConfiguration(Command.Edit, new KeyConfig(Key.F4)), + new CommandBindingConfiguration(Command.EnterRapidTravel, new KeyConfig(Key.OemComma, shift: true)), + new CommandBindingConfiguration(Command.FindByName, new[] { Key.F, Key.N }), + new CommandBindingConfiguration(Command.FindByNameRegex, new[] { Key.F, Key.R }), + new CommandBindingConfiguration(Command.GoToHome, new[] { Key.G, Key.H }), + new CommandBindingConfiguration(Command.GoToPath, new KeyConfig(Key.L, ctrl: true)), + new CommandBindingConfiguration(Command.GoToPath, new[] { Key.G, Key.P }), + new CommandBindingConfiguration(Command.GoToProvider, new[] { Key.G, Key.T }), + new CommandBindingConfiguration(Command.GoToRoot, new[] { Key.G, Key.R }), + new CommandBindingConfiguration(Command.HardDelete, new[] { new KeyConfig(Key.D,shift: true), new KeyConfig(Key.D, shift: true) }), + new CommandBindingConfiguration(Command.Mark, Key.Space), + new CommandBindingConfiguration(Command.MoveToLast, new KeyConfig(Key.G, shift: true)), + new CommandBindingConfiguration(Command.MoveToFirst, new[] { Key.G, Key.G }), + new CommandBindingConfiguration(Command.NextTimelineBlock, Key.L ), + new CommandBindingConfiguration(Command.NextTimelineCommand, Key.J ), + new CommandBindingConfiguration(Command.OpenInFileBrowser, new[] { Key.O, Key.E }), + new CommandBindingConfiguration(Command.PasteMerge, new[] { Key.P, Key.P }), + new CommandBindingConfiguration(Command.PasteOverwrite, new[] { Key.P, Key.O }), + new CommandBindingConfiguration(Command.PasteSkip, new[] { Key.P, Key.S }), + new CommandBindingConfiguration(Command.PinFavorite, new[] { Key.F, Key.P }), + new CommandBindingConfiguration(Command.PreviousTimelineBlock, Key.H ), + new CommandBindingConfiguration(Command.PreviousTimelineCommand, Key.K ), + new CommandBindingConfiguration(Command.Refresh, Key.R), + new CommandBindingConfiguration(Command.Rename, Key.F2), + new CommandBindingConfiguration(Command.Rename, new[] { Key.C, Key.W }), + new CommandBindingConfiguration(Command.RunCommand, new KeyConfig(Key.D4, shift: true)), + new CommandBindingConfiguration(Command.ScanContainerSize, new[] { Key.C, Key.S }), + new CommandBindingConfiguration(Command.ShowAllShotcut, Key.F1), + new CommandBindingConfiguration(Command.SoftDelete, new[] { new KeyConfig(Key.D), new KeyConfig(Key.D, shift: true) }), + new CommandBindingConfiguration(Command.SwitchToLastTab, Key.D9), + new CommandBindingConfiguration(Command.SwitchToTab1, Key.D1), + new CommandBindingConfiguration(Command.SwitchToTab2, Key.D2), + new CommandBindingConfiguration(Command.SwitchToTab3, Key.D3), + new CommandBindingConfiguration(Command.SwitchToTab4, Key.D4), + new CommandBindingConfiguration(Command.SwitchToTab5, Key.D5), + new CommandBindingConfiguration(Command.SwitchToTab6, Key.D6), + new CommandBindingConfiguration(Command.SwitchToTab7, Key.D7), + new CommandBindingConfiguration(Command.SwitchToTab8, Key.D8), + new CommandBindingConfiguration(Command.TimelinePause, new[] { Key.T, Key.P }), + new CommandBindingConfiguration(Command.TimelineRefresh, new[] { Key.T, Key.R }), + new CommandBindingConfiguration(Command.TimelineStart, new[] { Key.T, Key.S }), + new CommandBindingConfiguration(Command.ToggleAdvancedIcons, new[] { Key.Z, Key.I }), + new CommandBindingConfiguration(Command.GoUp, Key.Left), + new CommandBindingConfiguration(Command.Open, Key.Right), + new CommandBindingConfiguration(Command.OpenOrRun, Key.Enter), + new CommandBindingConfiguration(Command.MoveCursorUp, Key.Up), + new CommandBindingConfiguration(Command.MoveCursorDown, Key.Down), + new CommandBindingConfiguration(Command.MoveCursorUpPage, Key.PageUp), + new CommandBindingConfiguration(Command.MoveCursorDownPage, Key.PageDown), }; } diff --git a/src/GuiApp/Avalonia/FileTime.GuiApp/Converters/CommandToCommandNameConverter.cs b/src/GuiApp/Avalonia/FileTime.GuiApp/Converters/CommandToCommandNameConverter.cs index 75e8c13..e12710f 100644 --- a/src/GuiApp/Avalonia/FileTime.GuiApp/Converters/CommandToCommandNameConverter.cs +++ b/src/GuiApp/Avalonia/FileTime.GuiApp/Converters/CommandToCommandNameConverter.cs @@ -8,7 +8,7 @@ public class CommandToCommandNameConverter : IValueConverter { public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { - if(value is not Commands command) return value; + if(value is not Command command) return value; //TODO: implement return command.ToString(); diff --git a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/DefaultModeKeyInputHandler.cs b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/DefaultModeKeyInputHandler.cs index 9a97079..20b7feb 100644 --- a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/DefaultModeKeyInputHandler.cs +++ b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/DefaultModeKeyInputHandler.cs @@ -136,7 +136,7 @@ public class DefaultModeKeyInputHandler : IDefaultModeKeyInputHandler } } - private async Task CallCommandAsync(Commands command) + private async Task CallCommandAsync(Command command) { try { diff --git a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/KeyboardConfigurationService.cs b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/KeyboardConfigurationService.cs index 3ba414b..66b6533 100644 --- a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/KeyboardConfigurationService.cs +++ b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/KeyboardConfigurationService.cs @@ -23,7 +23,7 @@ public class KeyboardConfigurationService : IKeyboardConfigurationService foreach (var keyBinding in keyBindings) { - if (keyBinding.Command == Commands.None) + if (keyBinding.Command == Command.None) { throw new FormatException($"No command is set in keybinding for keys '{keyBinding.KeysDisplayText}'"); } @@ -49,6 +49,6 @@ public class KeyboardConfigurationService : IKeyboardConfigurationService private static bool IsUniversal(CommandBindingConfiguration keyMapping) { - return keyMapping.Command is Commands.GoUp or Commands.Open or Commands.OpenOrRun or Commands.MoveCursorUp or Commands.MoveCursorDown or Commands.MoveCursorUpPage or Commands.MoveCursorDownPage; + return keyMapping.Command is Command.GoUp or Command.Open or Command.OpenOrRun or Command.MoveCursorUp or Command.MoveCursorDown or Command.MoveCursorUpPage or Command.MoveCursorDownPage; } } \ No newline at end of file diff --git a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/RapidTravelModeKeyInputHandler.cs b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/RapidTravelModeKeyInputHandler.cs index 94051f6..901f393 100644 --- a/src/GuiApp/Avalonia/FileTime.GuiApp/Services/RapidTravelModeKeyInputHandler.cs +++ b/src/GuiApp/Avalonia/FileTime.GuiApp/Services/RapidTravelModeKeyInputHandler.cs @@ -122,7 +122,7 @@ public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler } } - private async Task CallCommandAsync(Commands command) + private async Task CallCommandAsync(Command command) { try {