Command refactor
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class CloseTabCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "close_tab";
|
||||
public static CloseTabCommand Instance { get; } = new CloseTabCommand();
|
||||
|
||||
private CloseTabCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class CopyCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "copy";
|
||||
public static CopyCommand Instance { get; } = new CopyCommand();
|
||||
|
||||
private CopyCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class EnterRapidTravelCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "exter_rapid_travel_mode";
|
||||
public static EnterRapidTravelCommand Instance { get; } = new EnterRapidTravelCommand();
|
||||
|
||||
private EnterRapidTravelCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class ExitRapidTravelCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "exit_rapid_travel_mode";
|
||||
public static ExitRapidTravelCommand Instance { get; } = new ExitRapidTravelCommand();
|
||||
|
||||
private ExitRapidTravelCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class GoUpCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "go_up";
|
||||
public static GoUpCommand Instance { get; } = new GoUpCommand();
|
||||
|
||||
private GoUpCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public interface IIdentifiableUserCommand : IUserCommand
|
||||
{
|
||||
string UserCommandID { get; }
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public interface IUserCommand
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*public enum Command
|
||||
{
|
||||
None,
|
||||
|
||||
AutoRefresh,
|
||||
ChangeTimelineMode,
|
||||
CloseTab,
|
||||
Compress,
|
||||
Copy,
|
||||
CopyHash,
|
||||
CopyPath,
|
||||
CreateContainer,
|
||||
CreateElement,
|
||||
Cut,
|
||||
Edit,
|
||||
EnterRapidTravel,
|
||||
ExitRapidTravel,
|
||||
FindByName,
|
||||
FindByNameRegex,
|
||||
GoToHome,
|
||||
GoToPath,
|
||||
GoToProvider,
|
||||
GoToRoot,
|
||||
GoUp,
|
||||
HardDelete,
|
||||
Mark,
|
||||
MoveCursorDown,
|
||||
MoveCursorDownPage,
|
||||
MoveCursorUp,
|
||||
MoveCursorUpPage,
|
||||
MoveToFirst,
|
||||
MoveToLast,
|
||||
NextTimelineBlock,
|
||||
NextTimelineCommand,
|
||||
Open,
|
||||
OpenInFileBrowser,
|
||||
OpenOrRun,
|
||||
PasteMerge,
|
||||
PasteOverwrite,
|
||||
PasteSkip,
|
||||
PinFavorite,
|
||||
PreviousTimelineBlock,
|
||||
PreviousTimelineCommand,
|
||||
Refresh,
|
||||
Rename,
|
||||
RunCommand,
|
||||
ScanContainerSize,
|
||||
ShowAllShortcut,
|
||||
SoftDelete,
|
||||
SwitchToLastTab,
|
||||
SwitchToTab1,
|
||||
SwitchToTab2,
|
||||
SwitchToTab3,
|
||||
SwitchToTab4,
|
||||
SwitchToTab5,
|
||||
SwitchToTab6,
|
||||
SwitchToTab7,
|
||||
SwitchToTab8,
|
||||
TimelinePause,
|
||||
TimelineRefresh,
|
||||
TimelineStart,
|
||||
ToggleAdvancedIcons,
|
||||
ToggleHidden,
|
||||
}*/
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class MarkCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "mark_selected";
|
||||
public static MarkCommand Instance { get; } = new MarkCommand();
|
||||
|
||||
private MarkCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class MoveCursorDownCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "move_cursor_down";
|
||||
public static MoveCursorDownCommand Instance { get; } = new MoveCursorDownCommand();
|
||||
|
||||
private MoveCursorDownCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class MoveCursorUpCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "move_cursor_up";
|
||||
public static MoveCursorUpCommand Instance { get; } = new MoveCursorUpCommand();
|
||||
|
||||
private MoveCursorUpCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using FileTime.Core.Models;
|
||||
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class OpenContainerCommand : IUserCommand
|
||||
{
|
||||
public IAbsolutePath Path { get; }
|
||||
|
||||
private OpenContainerCommand(IAbsolutePath path)
|
||||
{
|
||||
Path = path;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class OpenSelectedCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string CommandName = "open_selected";
|
||||
public static OpenSelectedCommand Instance { get; } = new OpenSelectedCommand();
|
||||
|
||||
private OpenSelectedCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public string UserCommandID => CommandName;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using FileTime.App.Core.Models.Enums;
|
||||
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class PasteCommand : IIdentifiableUserCommand
|
||||
{
|
||||
public const string PasteMergeCommandName = "paste_merge";
|
||||
public const string PasteOverwriteCommandName = "paste_overwrite";
|
||||
public const string PasteSkipCommandName = "paste_skip";
|
||||
|
||||
public static PasteCommand Merge { get; } = new PasteCommand(PasteMode.Merge, PasteMergeCommandName);
|
||||
public static PasteCommand Overwrite { get; } = new PasteCommand(PasteMode.Overwrite, PasteOverwriteCommandName);
|
||||
public static PasteCommand Skip { get; } = new PasteCommand(PasteMode.Skip, PasteSkipCommandName);
|
||||
|
||||
public PasteMode PasteMode { get; }
|
||||
|
||||
private PasteCommand(PasteMode pasteMode, string commandName)
|
||||
{
|
||||
PasteMode = pasteMode;
|
||||
UserCommandID = commandName;
|
||||
}
|
||||
|
||||
public string UserCommandID { get; }
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public class SwitchToTabCommand : IIdentifiableUserCommand
|
||||
{
|
||||
private const string SwitchToTabBase = "switch_to_tab";
|
||||
public const string SwitchToTab1CommandName = SwitchToTabBase + "1";
|
||||
public const string SwitchToTab2CommandName = SwitchToTabBase + "2";
|
||||
public const string SwitchToTab3CommandName = SwitchToTabBase + "3";
|
||||
public const string SwitchToTab4CommandName = SwitchToTabBase + "4";
|
||||
public const string SwitchToTab5CommandName = SwitchToTabBase + "5";
|
||||
public const string SwitchToTab6CommandName = SwitchToTabBase + "6";
|
||||
public const string SwitchToTab7CommandName = SwitchToTabBase + "7";
|
||||
public const string SwitchToTab8CommandName = SwitchToTabBase + "8";
|
||||
public const string SwitchToLastTabCommandName = "switch_to_last_tab";
|
||||
|
||||
public static SwitchToTabCommand SwitchToTab1 { get; } = new(1, SwitchToTab1CommandName);
|
||||
public static SwitchToTabCommand SwitchToTab2 { get; } = new(2, SwitchToTab2CommandName);
|
||||
public static SwitchToTabCommand SwitchToTab3 { get; } = new(3, SwitchToTab3CommandName);
|
||||
public static SwitchToTabCommand SwitchToTab4 { get; } = new(4, SwitchToTab4CommandName);
|
||||
public static SwitchToTabCommand SwitchToTab5 { get; } = new(5, SwitchToTab5CommandName);
|
||||
public static SwitchToTabCommand SwitchToTab6 { get; } = new(6, SwitchToTab6CommandName);
|
||||
public static SwitchToTabCommand SwitchToTab7 { get; } = new(7, SwitchToTab7CommandName);
|
||||
public static SwitchToTabCommand SwitchToTab8 { get; } = new(8, SwitchToTab8CommandName);
|
||||
public static SwitchToTabCommand SwitchToLastTab { get; } = new(-1, SwitchToLastTabCommandName);
|
||||
|
||||
private SwitchToTabCommand(int tabNumber, string commandName)
|
||||
{
|
||||
TabNumber = tabNumber;
|
||||
UserCommandID = commandName;
|
||||
}
|
||||
|
||||
public string UserCommandID { get; }
|
||||
public int TabNumber { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user