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

@@ -66,7 +66,9 @@ public class SearchContentProvider : ContentProviderBase, ISearchContentProvider
.First(searchTask => searchTask.SearchContainer.NativePath == nativePath).SearchContainer);
}
public override NativePath GetNativePath(FullName fullName) => new(fullName.Path);
public override ValueTask<NativePath> GetNativePathAsync(FullName fullName)
=> ValueTask.FromResult(new NativePath(fullName.Path));
public override FullName GetFullName(NativePath nativePath) => new(nativePath.Path);
public override Task<byte[]?> GetContentAsync(
@@ -76,7 +78,7 @@ public class SearchContentProvider : ContentProviderBase, ISearchContentProvider
)
=> Task.FromResult(null as byte[]);
public override bool CanHandlePath(NativePath path) => path.Path.StartsWith(ContentProviderName);
public override Task<bool> CanHandlePathAsync(NativePath path) => Task.FromResult(path.Path.StartsWith(ContentProviderName));
public override VolumeSizeInfo? GetVolumeSizeInfo(FullName path) => null;
public async Task<ISearchTask> StartSearchAsync(ISearchMatcher matcher, IContainer searchIn)