Search WIP
This commit is contained in:
@@ -8,9 +8,9 @@ public sealed class PasteCommand : IIdentifiableUserCommand
|
||||
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 static readonly PasteCommand Merge = new(PasteMode.Merge, PasteMergeCommandName);
|
||||
public static readonly PasteCommand Overwrite = new(PasteMode.Overwrite, PasteOverwriteCommandName);
|
||||
public static readonly PasteCommand Skip = new(PasteMode.Skip, PasteSkipCommandName);
|
||||
|
||||
public PasteMode PasteMode { get; }
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
namespace FileTime.App.Core.UserCommand;
|
||||
|
||||
public enum SearchType
|
||||
{
|
||||
NameContains,
|
||||
NameRegex
|
||||
}
|
||||
|
||||
public class SearchCommand : IUserCommand
|
||||
{
|
||||
public string? SearchText { get; }
|
||||
public SearchType SearchType { get; }
|
||||
|
||||
public SearchCommand(string? searchText, SearchType searchType)
|
||||
{
|
||||
SearchText = searchText;
|
||||
SearchType = searchType;
|
||||
}
|
||||
}
|
||||
|
||||
public class IdentifiableSearchCommand : SearchCommand, IIdentifiableUserCommand
|
||||
{
|
||||
public const string SearchByNameContainsCommandName = "search_name_contains";
|
||||
|
||||
public static readonly IdentifiableSearchCommand SearchByNameContains =
|
||||
new(null, SearchType.NameContains, SearchByNameContainsCommandName);
|
||||
|
||||
public IdentifiableSearchCommand(
|
||||
string? searchText,
|
||||
SearchType searchType,
|
||||
string commandId)
|
||||
: base(searchText, searchType)
|
||||
{
|
||||
UserCommandID = commandId;
|
||||
}
|
||||
|
||||
public string UserCommandID { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user