Using CancellationToken

This commit is contained in:
2022-02-04 00:17:03 +01:00
parent 3f8309dc0f
commit 2e832f72d2
23 changed files with 1509 additions and 147 deletions

View File

@@ -51,7 +51,7 @@ namespace FileTime.Providers.Smb
_items = _rootContainers.OrderBy(c => c.Name).ToList().AsReadOnly();
}
await Refresh();
await RefreshAsync();
return container;
}
@@ -89,7 +89,7 @@ namespace FileTime.Providers.Smb
public async Task<bool> IsExists(string name) => (await GetItems())?.Any(i => i.Name == name) ?? false;
public async Task Refresh() => await Refreshed.InvokeAsync(this, AsyncEventArgs.Empty);
public async Task RefreshAsync(CancellationToken token = default) => await Refreshed.InvokeAsync(this, AsyncEventArgs.Empty, token);
public bool CanHandlePath(string path) => path.StartsWith("smb://") || path.StartsWith(@"\\");