Class PluginSelfUpdateBase
A plugin self-updater instance which is used to perform update check and update download.
[GeneratedComClass]
[ComExposedClass<ComClassInformation>]
public abstract class PluginSelfUpdateBase : IPluginSelfUpdate, IFree
- Inheritance
-
PluginSelfUpdateBase
- Implements
- Inherited Members
Properties
BaseCdnUrlSpan
A Span/Array of the CDN URL to use for getting the update.
protected abstract ReadOnlySpan<string> BaseCdnUrlSpan { get; }
Property Value
UpdateHttpClient
An HttpClient client to be used to perform download for update operations.
protected abstract HttpClient UpdateHttpClient { get; }
Property Value
Methods
Dispose()
public void Dispose()
Free()
Free the resources associated by an instance.
public void Free()
TryGetAvailableCdn(CancellationToken)
Try to get the available CDN for the update routine to use.
protected virtual Task<(PluginManifest? Info, string? BaseUrl)> TryGetAvailableCdn(CancellationToken token)
Parameters
tokenCancellationTokenThe cancellation token for the asynchronous operation.
Returns
- Task<(PluginManifest Info, string BaseUrl)>
A ValueTuple of Info PluginManifest and BaseUrl string
Remarks
Both Info PluginManifest and BaseUrl string will return null if no CDN is available.
TryPerformUpdateAsync(string?, bool, InstallProgressDelegate?, in Guid, out nint)
Asynchronously perform update on the plugin.
public void TryPerformUpdateAsync(string? outputDir, bool checkForUpdatesOnly, InstallProgressDelegate? progressDelegate, in Guid cancelToken, out nint result)
Parameters
outputDirstringAn output directory which the new version of library will be downloaded to.
checkForUpdatesOnlyboolWhether to perform the check only or also to perform the update at the same time.
progressDelegateInstallProgressDelegateA delegate which pass InstallProgress to indicate update progress into the callback.
cancelTokenGuidGuid instance for cancellation token.
resultnintA pointer to ComAsyncResult.
Remarks
This method returns a pointer to ComAsyncResult via result. This method has a return value of the pointer of SelfUpdateReturnInfo.
Please use AsTask<T>(nint) to get the return value.
While checkForUpdatesOnly is set to true, the status will only contain UpdateIsAvailable or NoAvailableUpdate inside of ReturnCode and the update won't be performed.
TryPerformUpdateAsync(string?, bool, InstallProgressDelegate?, CancellationToken)
Asynchronously perform update on the plugin.
protected virtual Task<nint> TryPerformUpdateAsync(string? outputDir, bool checkForUpdatesOnly, InstallProgressDelegate? progressDelegate, CancellationToken token)
Parameters
outputDirstringAn output directory which the new version of library will be downloaded to.
checkForUpdatesOnlyboolWhether to perform the check only or also to perform the update at the same time.
progressDelegateInstallProgressDelegateA delegate which pass InstallProgress to indicate update progress into the callback.
tokenCancellationTokenA token for cancelling asynchronous update operation