Search by regex, modal Enter fixes
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using FileTime.Core.Models;
|
||||
|
||||
namespace FileTime.App.Core.Exceptions;
|
||||
|
||||
public enum ItemNotFoundExceptionType
|
||||
{
|
||||
Raw,
|
||||
FullName,
|
||||
NativePath
|
||||
}
|
||||
public class ItemNotFoundException : Exception
|
||||
{
|
||||
public string Path { get; }
|
||||
public ItemNotFoundExceptionType Type { get; } = ItemNotFoundExceptionType.Raw;
|
||||
|
||||
public ItemNotFoundException(string path)
|
||||
{
|
||||
Path = path;
|
||||
}
|
||||
|
||||
public ItemNotFoundException(FullName path)
|
||||
{
|
||||
Path = path.Path;
|
||||
Type = ItemNotFoundExceptionType.FullName;
|
||||
}
|
||||
|
||||
public ItemNotFoundException(NativePath path)
|
||||
{
|
||||
Path = path.Path;
|
||||
Type = ItemNotFoundExceptionType.NativePath;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Reactive.Subjects;
|
||||
using FileTime.App.Core.Models;
|
||||
using FileTime.Core.Interactions;
|
||||
using FileTime.Core.Models;
|
||||
|
||||
namespace FileTime.App.Core.Interactions;
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace FileTime.App.Core.Models;
|
||||
|
||||
public record ItemNamePart(string Text, bool IsSpecial = false);
|
||||
@@ -1,4 +1,5 @@
|
||||
using FileTime.App.Core.Models;
|
||||
using FileTime.Core.Models;
|
||||
|
||||
namespace FileTime.App.Core.Services;
|
||||
|
||||
|
||||
@@ -21,10 +21,14 @@ public class SearchCommand : IUserCommand
|
||||
public sealed class IdentifiableSearchCommand : SearchCommand, IIdentifiableUserCommand
|
||||
{
|
||||
public const string SearchByNameContainsCommandName = "search_name_contains";
|
||||
public const string SearchByRegexCommandName = "search_name_regex";
|
||||
|
||||
public static readonly IdentifiableSearchCommand SearchByNameContains =
|
||||
new(null, SearchType.NameContains, SearchByNameContainsCommandName, "Search by name");
|
||||
|
||||
public static readonly IdentifiableSearchCommand SearchByRegex =
|
||||
new(null, SearchType.NameRegex, SearchByRegexCommandName, "Search by name (Regex)");
|
||||
|
||||
private IdentifiableSearchCommand(
|
||||
string? searchText,
|
||||
SearchType searchType,
|
||||
|
||||
@@ -10,7 +10,7 @@ public interface IAppState
|
||||
ReadOnlyObservableCollection<ITabViewModel> Tabs { get; }
|
||||
IObservable<ITabViewModel?> SelectedTab { get; }
|
||||
IObservable<string?> SearchText { get; }
|
||||
IObservable<ViewMode> ViewMode { get; }
|
||||
IDeclarativeProperty<ViewMode> ViewMode { get; }
|
||||
DeclarativeProperty<string?> RapidTravelText { get; }
|
||||
ITabViewModel? CurrentSelectedTab { get; }
|
||||
ITimelineViewModel TimelineViewModel { get; }
|
||||
@@ -18,6 +18,6 @@ public interface IAppState
|
||||
void AddTab(ITabViewModel tabViewModel);
|
||||
void RemoveTab(ITabViewModel tabViewModel);
|
||||
void SetSearchText(string? searchText);
|
||||
void SwitchViewMode(ViewMode newViewMode);
|
||||
Task SwitchViewModeAsync(ViewMode newViewMode);
|
||||
void SetSelectedTab(ITabViewModel tabToSelect);
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using DeclarativeProperty;
|
||||
using FileTime.App.Core.Models;
|
||||
using FileTime.App.Core.Models.Enums;
|
||||
using FileTime.Core.Models;
|
||||
using InitableService;
|
||||
|
||||
Reference in New Issue
Block a user