Files
FileTime2/src/AppCommon/FileTime.App.Core.Abstraction/UserCommand/SearchCommand.cs
2023-02-26 20:42:25 +01:00

38 lines
949 B
C#

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; }
}