Class DownloadService
- Namespace
- BootstrapBlazor.Components
- Assembly
- BootstrapBlazor.dll
文件下载服务类
public class DownloadService
- Inheritance
-
DownloadService
- Inherited Members
- Extension Methods
Constructors
DownloadService()
public DownloadService()
Properties
StreamCache
获得 回调委托缓存集合
protected List<(IComponent Key, Func<DownloadOption, Task> Callback)> StreamCache { get; }
Property Value
- List<(IComponent Key, Func<DownloadOption, Task> Callback)>
UrlCache
获得 获取地址的回调委托缓存集合
protected List<(IComponent Key, Func<DownloadOption, Task> Callback)> UrlCache { get; }
Property Value
- List<(IComponent Key, Func<DownloadOption, Task> Callback)>
Methods
DownloadFromStreamAsync(DownloadOption)
下载文件方法
public virtual Task DownloadFromStreamAsync(DownloadOption option)
Parameters
option
DownloadOption文件下载选项
Returns
DownloadFromUrlAsync(DownloadOption)
获取文件连接方法
public virtual Task DownloadFromUrlAsync(DownloadOption option)
Parameters
option
DownloadOption文件下载选项
Returns
RegisterStream(IComponent, Func<DownloadOption, Task>)
注册服务
protected virtual void RegisterStream(IComponent key, Func<DownloadOption, Task> callback)
Parameters
key
IComponentcallback
Func<DownloadOption, Task>
RegisterUrl(IComponent, Func<DownloadOption, Task>)
注册获取Url服务
protected virtual void RegisterUrl(IComponent key, Func<DownloadOption, Task> callback)
Parameters
key
IComponentcallback
Func<DownloadOption, Task>
UnRegisterStream(IComponent)
注销事件
protected virtual void UnRegisterStream(IComponent key)
Parameters
key
IComponent
UnRegisterUrl(IComponent)
注销获取Url事件
protected virtual void UnRegisterUrl(IComponent key)
Parameters
key
IComponent