Udostępnij za pośrednictwem


HotReloadHelper<T>.CreateAsync<THelper,TArgs> Method

Definition

Creates an instance of THelper and initializes it with the provided TArgs.

public static System.Threading.Tasks.Task<THelper> CreateAsync<THelper,TArgs> (TArgs args, Func<TArgs,THelper> creator, System.Threading.CancellationToken cancellationToken) where THelper : Microsoft.Internal.VisualStudio.Extensibility.Framework.HotReloadHelper<TArgs> where TArgs : Microsoft.Internal.VisualStudio.Extensibility.Framework.HotReloadHelperInitializationArgs;
static member CreateAsync : 'Args * Func<'Args, 'Helper (requires 'Args :> Microsoft.Internal.VisualStudio.Extensibility.Framework.HotReloadHelperInitializationArgs and 'Helper :> Microsoft.Internal.VisualStudio.Extensibility.Framework.HotReloadHelper<'Args>)> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Helper (requires 'Helper :> Microsoft.Internal.VisualStudio.Extensibility.Framework.HotReloadHelper<'Args>)> (requires 'Helper :> Microsoft.Internal.VisualStudio.Extensibility.Framework.HotReloadHelper<'Args> and 'Args :> Microsoft.Internal.VisualStudio.Extensibility.Framework.HotReloadHelperInitializationArgs)
Public Shared Function CreateAsync(Of THelper As HotReloadHelper(Of TArgs), TArgs As HotReloadHelper(Of TArgs)) (args As TArgs, creator As Func(Of TArgs, THelper), cancellationToken As CancellationToken) As Task(Of THelper)

Type Parameters

THelper

The type of HotReloadHelper<T> to create.

TArgs

The type of HotReloadHelperInitializationArgs that the helper expects as initialization arguments.

Parameters

args
TArgs

The arguments to pass into the HotReloadHelper<T> during initialization.

creator
Func<TArgs,THelper>

A delegate that should call the constructor of the helper but not call InitializeAsync(CancellationToken).

cancellationToken
CancellationToken

A token to signal cancellation.

Returns

Task<THelper>

An initialized HotReloadHelper<T>.

Applies to