Add Cancellation to IPublicAPI download method

This commit is contained in:
弘韬 张 2021-02-14 22:43:11 +08:00
parent 8a26471c4f
commit 20c0b1788f
2 changed files with 2 additions and 2 deletions

View file

@ -119,7 +119,7 @@ namespace Flow.Launcher.Plugin
/// <param name="url">URL to download file</param>
/// <param name="token">place to store file</param>
/// <returns>Task showing the progress</returns>
Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath);
Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath, CancellationToken token = default);
/// <summary>
/// Add ActionKeyword for specific plugin

View file

@ -117,7 +117,7 @@ namespace Flow.Launcher
public Task<Stream> HttpGetStreamAsync(string url, CancellationToken token = default) => Http.GetStreamAsync(url);
public Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath) => Http.DownloadAsync(url, filePath);
public Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath, CancellationToken token = default) => Http.DownloadAsync(url, filePath, token);
public void AddActionKeyword(string pluginId, string newActionKeyword) => PluginManager.AddActionKeyword(pluginId, newActionKeyword);