ConnectedServiceGrid.ConfigureServiceInstanceAsync Method

Definition

Configures a service instance either through a dialog or linking to the configure web page.

public:
 virtual System::Threading::Tasks::Task<bool> ^ ConfigureServiceInstanceAsync(Microsoft::VisualStudio::ConnectedServices::ConnectedServiceInstance ^ instance, System::Threading::CancellationToken ct);
public virtual System.Threading.Tasks.Task<bool> ConfigureServiceInstanceAsync (Microsoft.VisualStudio.ConnectedServices.ConnectedServiceInstance instance, System.Threading.CancellationToken ct);
abstract member ConfigureServiceInstanceAsync : Microsoft.VisualStudio.ConnectedServices.ConnectedServiceInstance * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
override this.ConfigureServiceInstanceAsync : Microsoft.VisualStudio.ConnectedServices.ConnectedServiceInstance * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Overridable Function ConfigureServiceInstanceAsync (instance As ConnectedServiceInstance, ct As CancellationToken) As Task(Of Boolean)

Parameters

instance
ConnectedServiceInstance

The service instance to configure.

Returns

Returns a Task<TResult> The Task's result value indicates whether any changes were made to the instance..

Remarks

This method is guaranteed to be called from the UI thread, and only on providers that return true from IsAuthenticated if a ConnectedServiceAuthenticator is implemented.

An implementation can use a blocking or modal UI. If the service is configured synchronously before the method returns, the returned task should be marked as completed (for example, by using FromResult).

If the implementation runs in the background, it may return an in-progress Task, and the Connected Services code will refresh the UI once the Task completes. In this case, the Connected Services code may cancel the task via the CancellationToken if the user closes the Conencted Services UI before the instance has been created.

If the implementation runs in the background, it may return an in-progress Task, and the Connected Services code will refresh the UI once the Task completes. In this case, the Connected Services code may cancel the task via the CancellationToken if the user closes the Conencted Services UI before the instance has been created.

If the implementation does not or cannot monitor the configuration of the instance, it may return null. In this case, the Connected Services code will do nothing, and requires the user to manually refresh or enumerate the service instances to check for changes to the configured instance.

If the implementation shows/handles any errors, the Task should not fault on them, nor throw them as Exceptions. If the returned Task completes in a Faulted state (such that the Exception member is non-null) the Connected Services UI will inform the user of the failure.

Applies to