다음을 통해 공유


ConnectedServiceGrid.ConfigureServiceInstanceAsync 메서드

정의

대화 상자를 통해 또는 구성 웹 페이지에 연결하여 서비스 instance 구성합니다.

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)

매개 변수

instance
ConnectedServiceInstance

구성할 서비스 instance.

ct
CancellationToken

CancellationToken은 구성 작업을 취소하는 데 사용됩니다.

반환

구성에 대한 작업을 반환합니다. 작업의 결과 값은 instance 변경되었는지 여부를 나타냅니다.

설명

이 메서드는 UI 스레드에서 호출되도록 보장되며 ConnectedServiceAuthenticator가 구현된 경우 에서 'true'를 반환하는 공급자에서 IsAuthenticated 만 호출됩니다.

구현에서 차단/모달 UI를 표시하려는 경우 이를 수행할 수 있습니다. 메서드가 반환되기 전에 서비스 instance 동기적으로 구성된 경우 반환된 작업은 완료된 것으로 표시되어야 합니다(예: Task.FromResult()를 통해).

구현이 백그라운드에서 실행되는 경우 진행 중인 작업을 반환할 수 있으며 연결된 서비스 코드는 태스크가 완료되면 UI를 새로 고칩니다. 이 경우 연결된 서비스 코드는 사용자가 instance 만들기 전에 Conencted Services UI를 닫는 경우 CancellationToken을 통해 작업을 취소할 수 있습니다.

구현이 instance 구성을 모니터링하지 않거나 모니터링할 수 없는 경우 null을 반환할 수 있습니다. 이 경우 연결된 서비스 코드는 아무 작업도 수행하지 않으며 사용자가 구성된 instance 변경 내용을 검사 위해 서비스 인스턴스를 수동으로 새로 고침/열거해야 합니다.

구현에서 오류를 표시/처리하는 경우 태스크는 오류를 발생시키지 않아야 하며 예외로 throw하지 않아야 합니다. 반환된 태스크가 오류 상태(예외 멤버가 null이 아닌 경우)로 완료되면 연결된 서비스 UI가 사용자에게 실패를 알릴 것입니다.

적용 대상