mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add Http.DownloadAsync
This commit is contained in:
parent
a3975a3531
commit
bd74a87d08
2 changed files with 10 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Flow.Launcher.Plugin.SharedModel;
|
||||
using JetBrains.Annotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
@ -92,5 +93,7 @@ namespace Flow.Launcher.Plugin
|
|||
Task<string> HttpGetStringAsync(string url, CancellationToken token = default);
|
||||
|
||||
Task<Stream> HttpGetStreamAsync(string url, CancellationToken token = default);
|
||||
|
||||
Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ using Flow.Launcher.Plugin.SharedModel;
|
|||
using System.Threading;
|
||||
using System.IO;
|
||||
using Flow.Launcher.Infrastructure.Http;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Flow.Launcher
|
||||
{
|
||||
|
|
@ -96,7 +97,7 @@ namespace Flow.Launcher
|
|||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
var msg = useMainWindowAsOwner ? new Msg {Owner = Application.Current.MainWindow} : new Msg();
|
||||
var msg = useMainWindowAsOwner ? new Msg { Owner = Application.Current.MainWindow } : new Msg();
|
||||
msg.Show(title, subTitle, iconPath);
|
||||
});
|
||||
}
|
||||
|
|
@ -143,6 +144,11 @@ namespace Flow.Launcher
|
|||
return Http.GetStreamAsync(url);
|
||||
}
|
||||
|
||||
public Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath)
|
||||
{
|
||||
return Http.DownloadAsync(url, filePath);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
|
|
|||
Loading…
Reference in a new issue