IVsService<T>.GetValueAsync(CancellationToken) Method

Definition

Gets an instance of the T service.

public System.Threading.Tasks.Task<T> GetValueAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetValueAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T (requires 'T : null)>
Public Function GetValueAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)

Parameters

cancellationToken
CancellationToken

A cancellation token.

Returns

Task<T>

An instance of the service.

Exceptions

Thrown when the service is not available. This may be because the service is not registered or because of a fault in the service factory. An InnerException may include details about an activation failure.

Throw when cancellationToken is canceled before the request can be satisfied.

Remarks

Repeat calls to this method will return the same instance.

Applies to