Volume size info for sub content providers
This commit is contained in:
@@ -66,14 +66,14 @@ public sealed partial class LocalContentProvider : ContentProviderBase, ILocalCo
|
||||
return rootDrive is not null;
|
||||
}
|
||||
|
||||
public override VolumeSizeInfo? GetVolumeSizeInfo(FullName path)
|
||||
public override ValueTask<VolumeSizeInfo?> GetVolumeSizeInfoAsync(FullName path)
|
||||
{
|
||||
var rootDriveInfos = _rootDriveInfos.Value;
|
||||
var rootDriveInfo = rootDriveInfos.FirstOrDefault(d => path.Path.StartsWith(d.Path.Path));
|
||||
|
||||
if (rootDriveInfo is null) return null;
|
||||
if (rootDriveInfo is null) return ValueTask.FromResult<VolumeSizeInfo?>(null);
|
||||
|
||||
return new VolumeSizeInfo(rootDriveInfo.Size, rootDriveInfo.Free);
|
||||
return ValueTask.FromResult<VolumeSizeInfo?>(new VolumeSizeInfo(rootDriveInfo.Size, rootDriveInfo.Free));
|
||||
}
|
||||
|
||||
public override async Task<IItem> GetItemByNativePathAsync(NativePath nativePath,
|
||||
|
||||
@@ -103,7 +103,7 @@ public sealed class RemoteContentProvider : ContentProviderBase, IRemoteContentP
|
||||
public override Task<byte[]?> GetContentAsync(IElement element, int? maxLength = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
|
||||
|
||||
public override Task<bool> CanHandlePathAsync(NativePath path) => throw new NotImplementedException();
|
||||
public override VolumeSizeInfo? GetVolumeSizeInfo(FullName path) => throw new NotImplementedException();
|
||||
public override ValueTask<VolumeSizeInfo?> GetVolumeSizeInfoAsync(FullName path) => throw new NotImplementedException();
|
||||
public override ValueTask<NativePath?> GetSupportedPathPart(NativePath nativePath) => throw new NotImplementedException();
|
||||
|
||||
private string ConvertLocalFullNameToRemote(FullName fullName)
|
||||
|
||||
Reference in New Issue
Block a user