Share via


ConnectedServiceGrid.EnumerateServiceInstancesAsync(CancellationToken) Method

Definition

Get a list of all of the service instances for the currently authenticated user, if any.

public:
 abstract System::Threading::Tasks::Task<System::Collections::Generic::IEnumerable<Microsoft::VisualStudio::ConnectedServices::ConnectedServiceInstance ^> ^> ^ EnumerateServiceInstancesAsync(System::Threading::CancellationToken ct);
public abstract System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.VisualStudio.ConnectedServices.ConnectedServiceInstance>> EnumerateServiceInstancesAsync (System.Threading.CancellationToken ct);
abstract member EnumerateServiceInstancesAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<seq<Microsoft.VisualStudio.ConnectedServices.ConnectedServiceInstance>>
Public MustOverride Function EnumerateServiceInstancesAsync (ct As CancellationToken) As Task(Of IEnumerable(Of ConnectedServiceInstance))

Parameters

ct
CancellationToken

CancellationToken used to cancel the enumeration operation.

Returns

Returns a Task that provides the available service instances.

Remarks

This method is guaranteed to not be called from the UI thread. It will only be called on providers that return 'true' from IsAuthenticated if a ConnectedServiceAuthenticator is implemented.

The implementation's Task should complete only once the service instance Enumerable is fully available. The Connected Services code will refresh the UI once the returned Task completes, and the enumeration should not block on any network calls.

Because this is not called on the UI thread, the implementation should not show any errors. If need be, the Task should complete in a Faulted state (such that the Exception member is non-null) and the Connected Services UI will inform the user of the failure.

Applies to