Search by regex, modal Enter fixes

This commit is contained in:
2023-07-31 14:07:52 +02:00
parent a537277546
commit bc31b71130
38 changed files with 301 additions and 53 deletions

View File

@@ -0,0 +1,8 @@
using FileTime.Core.Models;
namespace FileTime.Core.Behaviors;
public interface IItemNameConverterProvider
{
Task<IEnumerable<ItemNamePart>> GetItemNamePartsAsync(IItem item);
}

View File

@@ -26,4 +26,6 @@ public interface IItem
ReadOnlyExtensionCollection Extensions { get; }
T? GetExtension<T>() => (T?)Extensions.FirstOrDefault(i => i is T);
IItem WithParent(AbsolutePath parent);
}

View File

@@ -0,0 +1,3 @@
namespace FileTime.Core.Models;
public record ItemNamePart(string Text, bool IsSpecial = false);

View File

@@ -90,4 +90,5 @@ public abstract class ContentProviderBase : IContentProvider
public abstract bool CanHandlePath(NativePath path);
public bool CanHandlePath(FullName path) => CanHandlePath(GetNativePath(path));
public IItem WithParent(AbsolutePath parent) => this;
}

View File

@@ -84,4 +84,5 @@ public class RootContentProvider : IRootContentProvider
public bool CanHandlePath(NativePath path) => throw new NotImplementedException();
public bool CanHandlePath(FullName path) => throw new NotImplementedException();
public IItem WithParent(AbsolutePath parent) => this;
}

View File

@@ -45,15 +45,19 @@ public record Container(
_isLoading.OnNext(true);
IsLoaded = false;
}
public void StopLoading()
{
_isLoading.OnNext(false);
IsLoaded = true;
}
public void CancelLoading()
{
_loadingCancellationTokenSource.Cancel();
_isLoading.OnNext(false);
IsLoaded = true;
}
public IItem WithParent(AbsolutePath parent) => this with {Parent = parent};
}

View File

@@ -24,4 +24,6 @@ public record Element(
ReadOnlyExtensionCollection Extensions) : IElement
{
public AbsolutePathType Type => AbsolutePathType.Element;
public IItem WithParent(AbsolutePath parent) => this with { Parent = parent };
}