DispatcherObject.VerifyAccess 메서드

정의

호출 스레드에서 이 DispatcherObject에 액세스할 수 있는지 확인합니다.

public:
 void VerifyAccess();
public void VerifyAccess ();
member this.VerifyAccess : unit -> unit
Public Sub VerifyAccess ()

예외

호출 스레드에서 이 DispatcherObject에 액세스할 수 없는 경우

예제

다음 예제에서는 VerifyAccess 스레드가 스레드에 액세스할 수 있는지 여부를 결정 하는 Button 만들어진 합니다. 호출 스레드에서 액세스 되지 않은 경우는 InvalidOperationException throw 됩니다.

// Check if this thread has access to this object.
theButton.VerifyAccess();

// Thread has access to the object, so update the UI.
UpdateButtonUI(theButton);
' Check if this thread has access to this object.
theButton.VerifyAccess()

' Thread has access to the object, so update the UI.
UpdateButtonUI(theButton)

설명

스레드만 합니다 Dispatcher 만들어진에 액세스할 수 있습니다는 DispatcherObject합니다.

스레드에 대 한이 있는지를 확인할 수 있습니다 DispatcherObject합니다.

간의 차이점 CheckAccess 하 고 VerifyAccessCheckAccess 호출 스레드에서이에 대 한 액세스에 있는지 여부를 지정 하는 부울 값을 반환 DispatcherObjectVerifyAccess 호출 스레드를 권한이 없는 경우 예외를 throw 합니다 이 DispatcherObject합니다.

적용 대상