ContentProvider more async

This commit is contained in:
2023-08-24 15:50:11 +02:00
parent f1daca788e
commit ff1f6e1c3e
31 changed files with 136 additions and 69 deletions

View File

@@ -2,6 +2,6 @@ namespace FileTime.Core.Command;
public interface ICommandHandler
{
bool CanHandle(ICommand command);
Task<bool> CanHandleAsync(ICommand command);
Task ExecuteAsync(ICommand command);
}

View File

@@ -22,11 +22,11 @@ public interface IContentProvider : IContainer, IOnContainerEnter
AbsolutePathType forceResolvePathType = AbsolutePathType.Unknown,
ItemInitializationSettings itemInitializationSettings = default);
NativePath GetNativePath(FullName fullName);
ValueTask<NativePath> GetNativePathAsync(FullName fullName);
FullName GetFullName(NativePath nativePath);
Task<byte[]?> GetContentAsync(IElement element, int? maxLength = null, CancellationToken cancellationToken = default);
bool CanHandlePath(NativePath path);
bool CanHandlePath(FullName path);
Task<bool> CanHandlePathAsync(NativePath path);
Task<bool> CanHandlePathAsync(FullName path);
VolumeSizeInfo? GetVolumeSizeInfo(FullName path);
}

View File

@@ -15,6 +15,6 @@ public interface ITimelessContentProvider
ItemInitializationSettings itemInitializationSettings = default);
Task<IItem?> GetItemByNativePathAsync(NativePath nativePath, PointInTime? pointInTime = null);
FullName? GetFullNameByNativePath(NativePath nativePath);
NativePath? GetNativePathByFullName(FullName fullName);
ValueTask<FullName?> GetFullNameByNativePathAsync(NativePath nativePath);
ValueTask<NativePath?> GetNativePathByFullNameAsync(FullName fullName);
}