Table of Contents

Class ButtonUploadBase<TValue>

Namespace
BootstrapBlazor.Components
Assembly
BootstrapBlazor.dll

按钮上传组件基类

public abstract class ButtonUploadBase<TValue> : SingleUploadBase<TValue>, IComponent, IHandleAfterRender, IHandleEvent, IAsyncDisposable, IValidateComponent, IUpload

Type Parameters

TValue
Inheritance
DisplayBase<TValue>
ValidateBase<TValue>
UploadBase<TValue>
ButtonUploadBase<TValue>
Implements
Derived
Inherited Members
Extension Methods

Constructors

ButtonUploadBase()

protected ButtonUploadBase()

Properties

CancelIcon

获得/设置 取消图标

[Parameter]
public string? CancelIcon { get; set; }

Property Value

string

FileIconArchive

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconArchive { get; set; }

Property Value

string

FileIconAudio

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconAudio { get; set; }

Property Value

string

FileIconCode

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconCode { get; set; }

Property Value

string

FileIconDocx

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconDocx { get; set; }

Property Value

string

FileIconExcel

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconExcel { get; set; }

Property Value

string

FileIconFile

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconFile { get; set; }

Property Value

string

FileIconImage

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconImage { get; set; }

Property Value

string

FileIconPPT

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconPPT { get; set; }

Property Value

string

FileIconPdf

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconPdf { get; set; }

Property Value

string

FileIconVideo

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconVideo { get; set; }

Property Value

string

FileIconZip

获得/设置 Excel 类型文件图标

[Parameter]
public string? FileIconZip { get; set; }

Property Value

string

IsDirectory

获得/设置 是否上传整个目录 默认为 false

[Parameter]
public bool IsDirectory { get; set; }

Property Value

bool

IsMultiple

获得/设置 是否允许多文件上传 默认 false 不允许

[Parameter]
public bool IsMultiple { get; set; }

Property Value

bool

Remarks

多选文件时,所有文件处理完毕后,会额外触发一次 OnAllFileUploaded 回调

OnAllFileUploaded

获得/设置 所有文件上传完毕回调方法 默认 null

[Parameter]
public Func<IReadOnlyCollection<UploadFile>, Task>? OnAllFileUploaded { get; set; }

Property Value

Func<IReadOnlyCollection<UploadFile>, Task>

OnCancel

获得/设置 点击取消按钮回调此方法 默认 null

[Parameter]
public Func<UploadFile, Task>? OnCancel { get; set; }

Property Value

Func<UploadFile, Task>

OnDownload

获得/设置 点击下载按钮回调方法 默认 null

[Parameter]
public Func<UploadFile, Task>? OnDownload { get; set; }

Property Value

Func<UploadFile, Task>

OnGetFileFormat

获得/设置 设置文件格式图标回调委托

[Parameter]
public Func<string?, string>? OnGetFileFormat { get; set; }

Property Value

Func<string, string>

ShowDownloadButton

获得/设置 是否显示下载按钮 默认 false

[Parameter]
public bool ShowDownloadButton { get; set; }

Property Value

bool

Methods

GetFileFormatClassString(UploadFile)

protected string? GetFileFormatClassString(UploadFile item)

Parameters

item UploadFile

Returns

string

GetUploadAdditionalAttributes()

protected override IDictionary<string, object> GetUploadAdditionalAttributes()

Returns

IDictionary<string, object>

OnClickCancel(UploadFile)

点击取消按钮回调此方法

protected Task OnClickCancel(UploadFile item)

Parameters

item UploadFile

Returns

Task

OnClickDownload(UploadFile)

点击下载按钮回调此方法

protected Task OnClickDownload(UploadFile item)

Parameters

item UploadFile

Returns

Task

OnFileChange(InputFileChangeEventArgs)

protected override Task OnFileChange(InputFileChangeEventArgs args)

Parameters

args InputFileChangeEventArgs

Returns

Task

OnInitialized()

OnInitialized 方法

protected override void OnInitialized()

OnParametersSet()

OnParametersSet 方法

protected override void OnParametersSet()