public ValueTask<ValidationResult> EnsureContentDownloadedAsync(
IFileObject obj,
Func<IFileObject, FileContentDownloadState>? getStateFunc = null,
Func<FileContentDownloadState, CancellationToken, ValueTask>? setStateActionAsync = null,
Func<IFileObject, CancellationToken, ValueTask<IFileContent>>? getContentFuncAsync = null,
CancellationToken cancellationToken = default
)
Public Function EnsureContentDownloadedAsync (
obj As IFileObject,
Optional getStateFunc As Func(Of IFileObject, FileContentDownloadState) = Nothing,
Optional setStateActionAsync As Func(Of FileContentDownloadState, CancellationToken, ValueTask) = Nothing,
Optional getContentFuncAsync As Func(Of IFileObject, CancellationToken, ValueTask(Of IFileContent)) = Nothing,
Optional cancellationToken As CancellationToken = Nothing
) As ValueTask(Of ValidationResult)
public:
virtual ValueTask<ValidationResult^> EnsureContentDownloadedAsync(
IFileObject^ obj,
Func<IFileObject^, FileContentDownloadState>^ getStateFunc = nullptr,
Func<FileContentDownloadState, CancellationToken, ValueTask>^ setStateActionAsync = nullptr,
Func<IFileObject^, CancellationToken, ValueTask<IFileContent^>>^ getContentFuncAsync = nullptr,
CancellationToken cancellationToken = CancellationToken()
) sealed
abstract EnsureContentDownloadedAsync :
obj : IFileObject *
?getStateFunc : Func<IFileObject, FileContentDownloadState> *
?setStateActionAsync : Func<FileContentDownloadState, CancellationToken, ValueTask> *
?getContentFuncAsync : Func<IFileObject, CancellationToken, ValueTask<IFileContent>> *
?cancellationToken : CancellationToken
(* Defaults:
let _getStateFunc = defaultArg getStateFunc null
let _setStateActionAsync = defaultArg setStateActionAsync null
let _getContentFuncAsync = defaultArg getContentFuncAsync null
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> ValueTask<ValidationResult>
override EnsureContentDownloadedAsync :
obj : IFileObject *
?getStateFunc : Func<IFileObject, FileContentDownloadState> *
?setStateActionAsync : Func<FileContentDownloadState, CancellationToken, ValueTask> *
?getContentFuncAsync : Func<IFileObject, CancellationToken, ValueTask<IFileContent>> *
?cancellationToken : CancellationToken
(* Defaults:
let _getStateFunc = defaultArg getStateFunc null
let _setStateActionAsync = defaultArg setStateActionAsync null
let _getContentFuncAsync = defaultArg getContentFuncAsync null
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> ValueTask<ValidationResult>
Метод, устанавливающий состояние загружаемого контента, или null, если состояние контента устанавливается непосредственно на свойстве ContentState.
Устанавливать параметр отличным от null значением есть смысл при асинхронной загрузке контента, когда состояние должно быть установлено в потоке UI.