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 const string CommandName = "close_tab";
public static CloseTabCommand Instance { get; } = new CloseTabCommand();
public static CloseTabCommand Instance { get; } = new();
private CloseTabCommand()
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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