Use target typed new in commands

This commit is contained in:
2023-07-04 19:18:15 +02:00
parent c29df77d39
commit 718fd53026
23 changed files with 24 additions and 24 deletions

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private CloseTabCommand() private CloseTabCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private CopyCommand() private CopyCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class CopyNativePathCommand : IIdentifiableUserCommand public class CopyNativePathCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "copy_path"; public const string CommandName = "copy_path";
public static CopyNativePathCommand Instance { get; } = new CopyNativePathCommand(); public static CopyNativePathCommand Instance { get; } = new();
private CopyNativePathCommand() private CopyNativePathCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private CreateContainer() private CreateContainer()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed class CreateElement : IIdentifiableUserCommand public sealed class CreateElement : IIdentifiableUserCommand
{ {
public const string CommandName = "create_element"; public const string CommandName = "create_element";
public static CreateElement Instance { get; } = new CreateElement(); public static CreateElement Instance { get; } = new();
private CreateElement() private CreateElement()
{ {

View File

@@ -5,8 +5,8 @@ public class DeleteCommand : IIdentifiableUserCommand
public const string SoftDeleteCommandName = "soft_delete"; public const string SoftDeleteCommandName = "soft_delete";
public const string HardDeleteCommandName = "hard_delete"; public const string HardDeleteCommandName = "hard_delete";
public static DeleteCommand SoftDelete { get; } = new DeleteCommand(SoftDeleteCommandName, false); public static DeleteCommand SoftDelete { get; } = new(SoftDeleteCommandName, false);
public static DeleteCommand HardDelete { get; } = new DeleteCommand(HardDeleteCommandName, true); public static DeleteCommand HardDelete { get; } = new(HardDeleteCommandName, true);
private DeleteCommand(string commandName, bool hardDelete) private DeleteCommand(string commandName, bool hardDelete)
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private EnterRapidTravelCommand() private EnterRapidTravelCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private ExitRapidTravelCommand() private ExitRapidTravelCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class GoToHomeCommand : IIdentifiableUserCommand public class GoToHomeCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "go_to_home"; public const string CommandName = "go_to_home";
public static GoToHomeCommand Instance { get; } = new GoToHomeCommand(); public static GoToHomeCommand Instance { get; } = new();
private GoToHomeCommand() private GoToHomeCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class GoToPathCommand : IIdentifiableUserCommand public class GoToPathCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "go_to_path"; public const string CommandName = "go_to_path";
public static GoToPathCommand Instance { get; } = new GoToPathCommand(); public static GoToPathCommand Instance { get; } = new();
private GoToPathCommand() private GoToPathCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class GoToProviderCommand : IIdentifiableUserCommand public class GoToProviderCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "go_to_provider"; public const string CommandName = "go_to_provider";
public static GoToProviderCommand Instance { get; } = new GoToProviderCommand(); public static GoToProviderCommand Instance { get; } = new();
private GoToProviderCommand() private GoToProviderCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class GoToRootCommand : IIdentifiableUserCommand public class GoToRootCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "go_to_root"; public const string CommandName = "go_to_root";
public static GoToRootCommand Instance { get; } = new GoToRootCommand(); public static GoToRootCommand Instance { get; } = new();
private GoToRootCommand() private GoToRootCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private GoUpCommand() private GoUpCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private MarkCommand() private MarkCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private MoveCursorDownCommand() private MoveCursorDownCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class MoveCursorDownPageCommand : IIdentifiableUserCommand public class MoveCursorDownPageCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "move_cursor_down_page"; public const string CommandName = "move_cursor_down_page";
public static MoveCursorDownPageCommand Instance { get; } = new MoveCursorDownPageCommand(); public static MoveCursorDownPageCommand Instance { get; } = new();
private MoveCursorDownPageCommand() private MoveCursorDownPageCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class MoveCursorToFirstCommand : IIdentifiableUserCommand public class MoveCursorToFirstCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "move_cursor_to_first"; public const string CommandName = "move_cursor_to_first";
public static MoveCursorToFirstCommand Instance { get; } = new MoveCursorToFirstCommand(); public static MoveCursorToFirstCommand Instance { get; } = new();
private MoveCursorToFirstCommand() private MoveCursorToFirstCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class MoveCursorToLastCommand : IIdentifiableUserCommand public class MoveCursorToLastCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "move_cursor_to_last"; public const string CommandName = "move_cursor_to_last";
public static MoveCursorToLastCommand Instance { get; } = new MoveCursorToLastCommand(); public static MoveCursorToLastCommand Instance { get; } = new();
private MoveCursorToLastCommand() private MoveCursorToLastCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private MoveCursorUpCommand() private MoveCursorUpCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class MoveCursorUpPageCommand : IIdentifiableUserCommand public class MoveCursorUpPageCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "move_cursor_up_page"; public const string CommandName = "move_cursor_up_page";
public static MoveCursorUpPageCommand Instance { get; } = new MoveCursorUpPageCommand(); public static MoveCursorUpPageCommand Instance { get; } = new();
private MoveCursorUpPageCommand() private MoveCursorUpPageCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public class OpenInDefaultFileExplorerCommand : IIdentifiableUserCommand public class OpenInDefaultFileExplorerCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "open_in_default_explorer"; public const string CommandName = "open_in_default_explorer";
public static OpenInDefaultFileExplorerCommand Instance { get; } = new OpenInDefaultFileExplorerCommand(); public static OpenInDefaultFileExplorerCommand Instance { get; } = new();
private OpenInDefaultFileExplorerCommand() private OpenInDefaultFileExplorerCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed 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();
private OpenSelectedCommand() private OpenSelectedCommand()
{ {

View File

@@ -3,7 +3,7 @@ namespace FileTime.App.Core.UserCommand;
public sealed class RefreshCommand : IIdentifiableUserCommand public sealed class RefreshCommand : IIdentifiableUserCommand
{ {
public const string CommandName = "refresh"; public const string CommandName = "refresh";
public static RefreshCommand Instance { get; } = new RefreshCommand(); public static RefreshCommand Instance { get; } = new();
private RefreshCommand() private RefreshCommand()
{ {