Dispatcher.InvokeAsync 메서드

정의

Dispatcher가 연결된 스레드에서 지정된 대리자를 비동기적으로 실행합니다.

오버로드

InvokeAsync(Action)

Action가 연결된 스레드에서 지정된 Dispatcher를 비동기적으로 실행합니다.

InvokeAsync(Action, DispatcherPriority)

Action가 연결된 스레드에서 지정된 우선 순위에 있는 지정된 Dispatcher를 비동기적으로 실행합니다.

InvokeAsync(Action, DispatcherPriority, CancellationToken)

Action가 연결된 스레드에서 지정된 우선 순위에 있는 지정된 Dispatcher를 비동기적으로 실행합니다.

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken)

Func<TResult>가 연결된 스레드에서 지정된 우선 순위에 있는 지정된 Dispatcher를 비동기적으로 실행합니다.

InvokeAsync<TResult>(Func<TResult>)

Func<TResult>가 연결된 스레드에서 지정된 Dispatcher를 비동기적으로 실행합니다.

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority)

Func<TResult>가 연결된 스레드에서 지정된 우선 순위에 있는 지정된 Dispatcher를 비동기적으로 실행합니다.

InvokeAsync(Action)

Action가 연결된 스레드에서 지정된 Dispatcher를 비동기적으로 실행합니다.

public:
 System::Windows::Threading::DispatcherOperation ^ InvokeAsync(Action ^ callback);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback);
member this.InvokeAsync : Action -> System.Windows.Threading.DispatcherOperation
Public Function InvokeAsync (callback As Action) As DispatcherOperation

매개 변수

callback
Action

디스패처를 통해 호출할 대리자입니다.

반환

InvokeAsync(Action)가 호출된 후 즉시 반환되며, 이벤트 큐에서 실행 보류 중일 때 대리자와 상호 작용하는 데 사용할 수 있는 개체입니다.

설명

기본 우선 순위는 입니다 DispatcherPriority.Normal.

이 메서드는 메서드의 동기 대응에서 throw할 수 있는 모든 비사용 예외를 반환하는 태스크에 저장됩니다. 예외가 반환된 작업에 저장되면 작업이 대기될 때 해당 예외가 throw됩니다. 와 같은 ArgumentException사용 예외는 여전히 동기적으로 throw됩니다. 저장된 예외는 에서 throw Invoke(Action)된 예외를 참조하세요.

적용 대상

InvokeAsync(Action, DispatcherPriority)

Action가 연결된 스레드에서 지정된 우선 순위에 있는 지정된 Dispatcher를 비동기적으로 실행합니다.

public:
 System::Windows::Threading::DispatcherOperation ^ InvokeAsync(Action ^ callback, System::Windows::Threading::DispatcherPriority priority);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback, System.Windows.Threading.DispatcherPriority priority);
member this.InvokeAsync : Action * System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherOperation
Public Function InvokeAsync (callback As Action, priority As DispatcherPriority) As DispatcherOperation

매개 변수

callback
Action

디스패처를 통해 호출할 대리자입니다.

priority
DispatcherPriority

의 다른 보류 중인 작업을 Dispatcher기준으로 지정된 콜백이 호출되는 순서를 결정하는 우선 순위입니다.

반환

InvokeAsync(Action, DispatcherPriority)가 호출된 후 즉시 반환되며, 이벤트 큐에서 실행 보류 중일 때 대리자와 상호 작용하는 데 사용할 수 있는 개체입니다.

설명

이 메서드는 메서드의 동기 대응에서 throw할 수 있는 모든 비사용 예외를 반환하는 태스크에 저장됩니다. 예외가 반환된 작업에 저장되면 작업이 대기될 때 해당 예외가 throw됩니다. 와 같은 ArgumentException사용 예외는 여전히 동기적으로 throw됩니다. 저장된 예외는 에서 throw Invoke(Action, DispatcherPriority)된 예외를 참조하세요.

적용 대상

InvokeAsync(Action, DispatcherPriority, CancellationToken)

Action가 연결된 스레드에서 지정된 우선 순위에 있는 지정된 Dispatcher를 비동기적으로 실행합니다.

public:
 System::Windows::Threading::DispatcherOperation ^ InvokeAsync(Action ^ callback, System::Windows::Threading::DispatcherPriority priority, System::Threading::CancellationToken cancellationToken);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken);
member this.InvokeAsync : Action * System.Windows.Threading.DispatcherPriority * System.Threading.CancellationToken -> System.Windows.Threading.DispatcherOperation
Public Function InvokeAsync (callback As Action, priority As DispatcherPriority, cancellationToken As CancellationToken) As DispatcherOperation

매개 변수

callback
Action

디스패처를 통해 호출할 대리자입니다.

priority
DispatcherPriority

의 다른 보류 중인 작업을 Dispatcher기준으로 지정된 콜백이 호출되는 순서를 결정하는 우선 순위입니다.

cancellationToken
CancellationToken

동작을 취소할지 여부를 나타내는 개체입니다.

반환

InvokeAsync(Action, DispatcherPriority, CancellationToken)가 호출된 후 즉시 반환되며, 이벤트 큐에서 실행 보류 중일 때 대리자와 상호 작용하는 데 사용할 수 있는 개체입니다.

예외

취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.

설명

이 메서드는 메서드의 동기 대응에서 throw할 수 있는 모든 비사용 예외를 반환하는 태스크에 저장됩니다. 예외가 반환된 작업에 저장되면 작업이 대기될 때 해당 예외가 throw됩니다. 와 같은 ArgumentException사용 예외는 여전히 동기적으로 throw됩니다. 저장된 예외는 에서 throw Invoke(Action, DispatcherPriority)된 예외를 참조하세요.

적용 대상

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken)

Func<TResult>가 연결된 스레드에서 지정된 우선 순위에 있는 지정된 Dispatcher를 비동기적으로 실행합니다.

public:
generic <typename TResult>
 System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback, System::Windows::Threading::DispatcherPriority priority, System::Threading::CancellationToken cancellationToken);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken);
member this.InvokeAsync : Func<'Result> * System.Windows.Threading.DispatcherPriority * System.Threading.CancellationToken -> System.Windows.Threading.DispatcherOperation<'Result>
Public Function InvokeAsync(Of TResult) (callback As Func(Of TResult), priority As DispatcherPriority, cancellationToken As CancellationToken) As DispatcherOperation(Of TResult)

형식 매개 변수

TResult

지정된 대리자의 반환 값 형식입니다.

매개 변수

callback
Func<TResult>

디스패처를 통해 호출할 대리자입니다.

priority
DispatcherPriority

의 다른 보류 중인 작업을 Dispatcher기준으로 지정된 콜백이 호출되는 순서를 결정하는 우선 순위입니다.

cancellationToken
CancellationToken

작업을 취소할지 여부를 나타내는 개체입니다.

반환

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken)가 호출된 후 즉시 반환되며, 이벤트 큐에서 실행 보류 중일 때 대리자와 상호 작용하는 데 사용할 수 있는 개체입니다.

예외

취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.

적용 대상

InvokeAsync<TResult>(Func<TResult>)

Func<TResult>가 연결된 스레드에서 지정된 Dispatcher를 비동기적으로 실행합니다.

public:
generic <typename TResult>
 System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback);
member this.InvokeAsync : Func<'Result> -> System.Windows.Threading.DispatcherOperation<'Result>
Public Function InvokeAsync(Of TResult) (callback As Func(Of TResult)) As DispatcherOperation(Of TResult)

형식 매개 변수

TResult

지정된 대리자의 반환 값 형식입니다.

매개 변수

callback
Func<TResult>

디스패처를 통해 호출할 대리자입니다.

반환

InvokeAsync<TResult>(Func<TResult>)가 호출된 후 즉시 반환되며, 이벤트 큐에서 실행 보류 중일 때 대리자와 상호 작용하는 데 사용할 수 있는 개체입니다.

적용 대상

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority)

Func<TResult>가 연결된 스레드에서 지정된 우선 순위에 있는 지정된 Dispatcher를 비동기적으로 실행합니다.

public:
generic <typename TResult>
 System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback, System::Windows::Threading::DispatcherPriority priority);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback, System.Windows.Threading.DispatcherPriority priority);
member this.InvokeAsync : Func<'Result> * System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherOperation<'Result>
Public Function InvokeAsync(Of TResult) (callback As Func(Of TResult), priority As DispatcherPriority) As DispatcherOperation(Of TResult)

형식 매개 변수

TResult

지정된 대리자의 반환 값 형식입니다.

매개 변수

callback
Func<TResult>

디스패처를 통해 호출할 대리자입니다.

priority
DispatcherPriority

의 다른 보류 중인 작업을 Dispatcher기준으로 지정된 콜백이 호출되는 순서를 결정하는 우선 순위입니다.

반환

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority)가 호출된 후 즉시 반환되며, 이벤트 큐에서 실행 보류 중일 때 대리자와 상호 작용하는 데 사용할 수 있는 개체입니다.

적용 대상