Table of Contents

Class LauncherApiBase

Namespace
Hi3Helper.Plugin.Core.Management.Api
Assembly
Hi3Helper.Plugin.Core.dll

A base class for launcher API related instance (such as: Resource, Media, News, etc.)

[GeneratedComClass]
[ComExposedClass<ComClassInformation>]
public abstract class LauncherApiBase : InitializableTask, ILauncherApi, IInitializableTask, IFree
Inheritance
LauncherApiBase
Implements
Derived
Inherited Members

Fields

IsDisposed

protected bool IsDisposed

Field Value

bool

ThisInstanceLock

protected readonly Lock ThisInstanceLock

Field Value

Lock

Properties

ApiResponseBaseUrl

protected virtual string? ApiResponseBaseUrl { get; }

Property Value

string

ApiResponseHttpClient

protected abstract HttpClient ApiResponseHttpClient { get; set; }

Property Value

HttpClient

Methods

Dispose()

public virtual void Dispose()

DownloadAssetAsync(LauncherPathEntry, FileHandle, FileReadProgressDelegate?, in Guid, out nint)

Asynchronously downloads an asset to the specified output stream.

public virtual void DownloadAssetAsync(LauncherPathEntry entry, FileHandle outputStreamHandle, PluginFiles.FileReadProgressDelegate? downloadProgress, in Guid cancelToken, out nint result)

Parameters

entry LauncherPathEntry

LauncherPathEntry struct for the asset's URL to download.

outputStreamHandle FileHandle

A handle to the output stream where the asset will be written.

downloadProgress PluginFiles.FileReadProgressDelegate

An optional callback delegate for reporting download progress.

cancelToken Guid

A Guid used as a cancellation token for the operation.

result nint

A native pointer (nint) to a ComAsyncResult representing the asynchronous operation.

Remarks

This method returns a native pointer (nint) to a ComAsyncResult via result representing the asynchronous operation.

DownloadAssetAsync(string, FileHandle, FileReadProgressDelegate?, in Guid, out nint)

Asynchronously downloads an asset to the specified output stream.

public virtual void DownloadAssetAsync(string fileUrl, FileHandle outputStreamHandle, PluginFiles.FileReadProgressDelegate? downloadProgress, in Guid cancelToken, out nint result)

Parameters

fileUrl string

The asset's URL to download.

outputStreamHandle FileHandle

A handle to the output stream where the asset will be written.

downloadProgress PluginFiles.FileReadProgressDelegate

An optional callback delegate for reporting download progress.

cancelToken Guid

A Guid used as a cancellation token for the operation.

result nint

A native pointer (nint) to a ComAsyncResult representing the asynchronous operation.

Remarks

A native pointer (nint) to a ComAsyncResult representing the asynchronous operation.

DownloadAssetAsyncInner(HttpClient?, string, Stream, PluginDisposableMemory<byte>, FileReadProgressDelegate?, CancellationToken)

Perform inner asynchronous download operation.

protected virtual Task DownloadAssetAsyncInner(HttpClient? client, string fileUrl, Stream outputStream, PluginDisposableMemory<byte> fileChecksum, PluginFiles.FileReadProgressDelegate? downloadProgress, CancellationToken token)

Parameters

client HttpClient
fileUrl string
outputStream Stream
fileChecksum PluginDisposableMemory<byte>
downloadProgress PluginFiles.FileReadProgressDelegate
token CancellationToken

Returns

Task

Exceptions

ArgumentNullException

Free()

Free the resources associated by an instance.

public override void Free()