sealed commands

This commit is contained in:
2022-05-24 10:56:05 +02:00
parent 1adf5386b8
commit 90cb345f96
14 changed files with 18 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class CloseTabCommand : IIdentifiableUserCommand public sealed class CloseTabCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "close_tab"; public const string CommandName = "close_tab";
public static CloseTabCommand Instance { get; } = new CloseTabCommand(); public static CloseTabCommand Instance { get; } = new CloseTabCommand();

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class CopyCommand : IIdentifiableUserCommand public sealed class CopyCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "copy"; public const string CommandName = "copy";
public static CopyCommand Instance { get; } = new CopyCommand(); public static CopyCommand Instance { get; } = new CopyCommand();

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class CreateContainer : IIdentifiableUserCommand public sealed class CreateContainer : IIdentifiableUserCommand
{ {
public const string CommandName = "create_container"; public const string CommandName = "create_container";
public static CreateContainer Instance { get; } = new CreateContainer(); public static CreateContainer Instance { get; } = new CreateContainer();

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class EnterRapidTravelCommand : IIdentifiableUserCommand public sealed class EnterRapidTravelCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "exter_rapid_travel_mode"; public const string CommandName = "exter_rapid_travel_mode";
public static EnterRapidTravelCommand Instance { get; } = new EnterRapidTravelCommand(); public static EnterRapidTravelCommand Instance { get; } = new EnterRapidTravelCommand();

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class ExitRapidTravelCommand : IIdentifiableUserCommand public sealed class ExitRapidTravelCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "exit_rapid_travel_mode"; public const string CommandName = "exit_rapid_travel_mode";
public static ExitRapidTravelCommand Instance { get; } = new ExitRapidTravelCommand(); public static ExitRapidTravelCommand Instance { get; } = new ExitRapidTravelCommand();

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class GoUpCommand : IIdentifiableUserCommand public sealed class GoUpCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "go_up"; public const string CommandName = "go_up";
public static GoUpCommand Instance { get; } = new GoUpCommand(); public static GoUpCommand Instance { get; } = new GoUpCommand();

View File

@@ -2,7 +2,7 @@ namespace FileTime.App.Core.UserCommand;
public interface IUserCommand public interface IUserCommand
{ {
} }
/*public enum Command /*public enum Command

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class MarkCommand : IIdentifiableUserCommand public sealed class MarkCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "mark_selected"; public const string CommandName = "mark_selected";
public static MarkCommand Instance { get; } = new MarkCommand(); public static MarkCommand Instance { get; } = new MarkCommand();

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class MoveCursorDownCommand : IIdentifiableUserCommand public sealed class MoveCursorDownCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "move_cursor_down"; public const string CommandName = "move_cursor_down";
public static MoveCursorDownCommand Instance { get; } = new MoveCursorDownCommand(); public static MoveCursorDownCommand Instance { get; } = new MoveCursorDownCommand();

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class MoveCursorUpCommand : IIdentifiableUserCommand public sealed class MoveCursorUpCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "move_cursor_up"; public const string CommandName = "move_cursor_up";
public static MoveCursorUpCommand Instance { get; } = new MoveCursorUpCommand(); public static MoveCursorUpCommand Instance { get; } = new MoveCursorUpCommand();

View File

@@ -2,7 +2,7 @@ using FileTime.Core.Models;
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class OpenContainerCommand : IUserCommand public sealed class OpenContainerCommand : IUserCommand
{ {
public AbsolutePath Path { get; } public AbsolutePath Path { get; }

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class OpenSelectedCommand : IIdentifiableUserCommand public sealed class OpenSelectedCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "open_selected"; public const string CommandName = "open_selected";
public static OpenSelectedCommand Instance { get; } = new OpenSelectedCommand(); public static OpenSelectedCommand Instance { get; } = new OpenSelectedCommand();

View File

@@ -2,16 +2,16 @@ using FileTime.App.Core.Models.Enums;
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class PasteCommand : IIdentifiableUserCommand public sealed class PasteCommand : IIdentifiableUserCommand
{ {
public const string PasteMergeCommandName = "paste_merge"; public const string PasteMergeCommandName = "paste_merge";
public const string PasteOverwriteCommandName = "paste_overwrite"; public const string PasteOverwriteCommandName = "paste_overwrite";
public const string PasteSkipCommandName = "paste_skip"; public const string PasteSkipCommandName = "paste_skip";
public static PasteCommand Merge { get; } = new PasteCommand(PasteMode.Merge, PasteMergeCommandName); public static PasteCommand Merge { get; } = new PasteCommand(PasteMode.Merge, PasteMergeCommandName);
public static PasteCommand Overwrite { get; } = new PasteCommand(PasteMode.Overwrite, PasteOverwriteCommandName); public static PasteCommand Overwrite { get; } = new PasteCommand(PasteMode.Overwrite, PasteOverwriteCommandName);
public static PasteCommand Skip { get; } = new PasteCommand(PasteMode.Skip, PasteSkipCommandName); public static PasteCommand Skip { get; } = new PasteCommand(PasteMode.Skip, PasteSkipCommandName);
public PasteMode PasteMode { get; } public PasteMode PasteMode { get; }
private PasteCommand(PasteMode pasteMode, string commandName) private PasteCommand(PasteMode pasteMode, string commandName)

View File

@@ -1,6 +1,6 @@
namespace FileTime.App.Core.UserCommand; namespace FileTime.App.Core.UserCommand;
public class SwitchToTabCommand : IIdentifiableUserCommand public sealed class SwitchToTabCommand : IIdentifiableUserCommand
{ {
private const string SwitchToTabBase = "switch_to_tab"; private const string SwitchToTabBase = "switch_to_tab";
public const string SwitchToTab1CommandName = SwitchToTabBase + "1"; public const string SwitchToTab1CommandName = SwitchToTabBase + "1";
@@ -12,7 +12,7 @@ public class SwitchToTabCommand : IIdentifiableUserCommand
public const string SwitchToTab7CommandName = SwitchToTabBase + "7"; public const string SwitchToTab7CommandName = SwitchToTabBase + "7";
public const string SwitchToTab8CommandName = SwitchToTabBase + "8"; public const string SwitchToTab8CommandName = SwitchToTabBase + "8";
public const string SwitchToLastTabCommandName = "switch_to_last_tab"; public const string SwitchToLastTabCommandName = "switch_to_last_tab";
public static SwitchToTabCommand SwitchToTab1 { get; } = new(1, SwitchToTab1CommandName); public static SwitchToTabCommand SwitchToTab1 { get; } = new(1, SwitchToTab1CommandName);
public static SwitchToTabCommand SwitchToTab2 { get; } = new(2, SwitchToTab2CommandName); public static SwitchToTabCommand SwitchToTab2 { get; } = new(2, SwitchToTab2CommandName);
public static SwitchToTabCommand SwitchToTab3 { get; } = new(3, SwitchToTab3CommandName); public static SwitchToTabCommand SwitchToTab3 { get; } = new(3, SwitchToTab3CommandName);
@@ -22,7 +22,7 @@ public class SwitchToTabCommand : IIdentifiableUserCommand
public static SwitchToTabCommand SwitchToTab7 { get; } = new(7, SwitchToTab7CommandName); public static SwitchToTabCommand SwitchToTab7 { get; } = new(7, SwitchToTab7CommandName);
public static SwitchToTabCommand SwitchToTab8 { get; } = new(8, SwitchToTab8CommandName); public static SwitchToTabCommand SwitchToTab8 { get; } = new(8, SwitchToTab8CommandName);
public static SwitchToTabCommand SwitchToLastTab { get; } = new(-1, SwitchToLastTabCommandName); public static SwitchToTabCommand SwitchToLastTab { get; } = new(-1, SwitchToLastTabCommandName);
private SwitchToTabCommand(int tabNumber, string commandName) private SwitchToTabCommand(int tabNumber, string commandName)
{ {
TabNumber = tabNumber; TabNumber = tabNumber;