InputHandler, CreateContainer user command

This commit is contained in:
2022-05-19 22:46:25 +02:00
parent 40f36ed845
commit ced0c88a10
28 changed files with 358 additions and 52 deletions

View File

@@ -47,8 +47,8 @@ public static class MainConfiguration
new CommandBindingConfiguration(CopyCommand.CommandName, new[] { Key.Y, Key.Y }),
//new CommandBindingConfiguration(ConfigCommand.CopyHash, new[] { Key.C, Key.H }),
//new CommandBindingConfiguration(ConfigCommand.CopyPath, new[] { Key.C, Key.P }),
//new CommandBindingConfiguration(ConfigCommand.CreateContainer, Key.F7),
//new CommandBindingConfiguration(ConfigCommand.CreateContainer, new[] { Key.C, Key.C }),
new CommandBindingConfiguration(CreateContainer.CommandName, Key.F7),
new CommandBindingConfiguration(CreateContainer.CommandName, new[] { Key.C, Key.C }),
//new CommandBindingConfiguration(ConfigCommand.CreateElement, new[] { Key.C, Key.E }),
//new CommandBindingConfiguration(ConfigCommand.Cut, new[] { Key.D, Key.D }),
//new CommandBindingConfiguration(ConfigCommand.Edit, new KeyConfig(Key.F4)),

View File

@@ -0,0 +1,10 @@
using FileTime.Core.Interactions;
using FileTime.GuiApp.ViewModels;
namespace FileTime.GuiApp.Services;
public interface IDialogService : IInputInterface
{
IObservable<ReadInputsViewModel?> ReadInput { get; }
void ReadInputs(IEnumerable<IInputElement> inputs, Action inputHandler, Action? cancelHandler = null);
}

View File

@@ -4,7 +4,7 @@ namespace FileTime.GuiApp.Services;
public interface IKeyboardConfigurationService
{
IReadOnlyDictionary<string, CommandBindingConfiguration> CommandBindings { get; }
IReadOnlyDictionary<string, CommandBindingConfiguration> UniversalCommandBindings { get; }
IReadOnlyDictionary<string, CommandBindingConfiguration> AllShortcut { get; }
IReadOnlyList<CommandBindingConfiguration> CommandBindings { get; }
IReadOnlyList<CommandBindingConfiguration> UniversalCommandBindings { get; }
IReadOnlyList<CommandBindingConfiguration> AllShortcut { get; }
}

View File

@@ -0,0 +1,28 @@
using FileTime.App.Core.ViewModels;
using FileTime.Core.Interactions;
using MvvmGen;
namespace FileTime.GuiApp.ViewModels;
[ViewModel]
[Inject(typeof(Action<ReadInputsViewModel>), "_cancel")]
[Inject(typeof(Action<ReadInputsViewModel>), "_process")]
public partial class ReadInputsViewModel : IModalViewModelBase
{
public string Name => "ReadInputs";
public List<IInputElement> Inputs { get; set; }
public Action SuccessHandler { get; set; }
public Action? CancelHandler { get; set; }
[Command]
public void Process()
{
_process.Invoke(this);
}
[Command]
public void Cancel()
{
_cancel.Invoke(this);
}
}