Dispatcher.DisableProcessing Dispatcher.DisableProcessing Dispatcher.DisableProcessing Dispatcher.DisableProcessing Method

정의

Dispatcher 큐 프로세스를 비활성화합니다.Disables processing of the Dispatcher queue.

public:
 System::Windows::Threading::DispatcherProcessingDisabled DisableProcessing();
public System.Windows.Threading.DispatcherProcessingDisabled DisableProcessing ();
member this.DisableProcessing : unit -> System.Windows.Threading.DispatcherProcessingDisabled
Public Function DisableProcessing () As DispatcherProcessingDisabled

반환

Dispatcher 처리를 다시 활성화하는 데 사용되는 구조체입니다.A structure used to re-enable dispatcher processing.

예제

다음 예제에서는 디스패처 처리를 사용 하지 않도록 설정 하 고 다시 디스패처 처리를 사용 하도록 설정 하는 방법을 보여 줍니다.The following example shows how to disable dispatcher processing and re-enable dispatcher processing. DisableProcessing 호출 되는 를 사용 하 여 문입니다.DisableProcessing is called in a using statement. DisableProcessing 반환를 DispatcherProcessingDisabled 하는 경우 삭제 된 개체와 사용 되는 구조는 를 사용 하 여 완료 차단 합니다.DisableProcessing returns a DispatcherProcessingDisabled structure that is used as the object to be disposed when the using block finishes. Dispose 라고 하는 DispatcherProcessingDisabled 구조 디스패처 처리를 다시 사용할 수 있습니다.When Dispose is called on the DispatcherProcessingDisabled structure, dispatcher processing is re-enabled.

// The Dispose() method is called at the end of the using statement.
// Calling Dispose on the DispatcherProcessingDisabled structure, 
// which is returned from the call to DisableProcessing, will
// re-enalbe Dispatcher processing.
using (Dispatcher.DisableProcessing())
{
    // Do work while the dispatcher processing is disabled.
    Thread.Sleep(2000);
}
' The Dispose() method is called at the end of the using statement.
' Calling Dispose on the DispatcherProcessingDisabled structure, 
' which is returned from the call to DisableProcessing, will
' re-enable Dispatcher processing.
Using Dispatcher.DisableProcessing()
    ' Do work while the dispatcher processing is disabled.
    Thread.Sleep(2000)
End Using

설명

디스패처 처리를 비활성화는 관련 되지 않은 재입력 가능성을 제거 하기 위한 고급 메서드입니다.Disabling dispatcher processing is an advanced method that is intended to eliminate the chance of unrelated reentrancy.

처리를 사용 하지 않도록 설정의 효과 다음과 같습니다.The effects of disabling processing are as follows:

  • CLR 잠금 메시지를 내부적으로 펌프 되지 됩니다.CLR locks will not pump messages internally.

  • DispatcherFrame 개체는 푸시할 수 없습니다.DispatcherFrame objects are not allowed to be pushed.

  • 메시지 처리를 허용 되지 않습니다.Message processing is not permitted.

합니다 DispatcherProcessingDisabled 구조체입니다 DisableProcessing 디스패처 처리를 다시 사용 하도록 호출 될 때 반환을 사용할 수 있습니다.The DispatcherProcessingDisabled structure that DisableProcessing returns when it is called can be used to re-enable dispatcher processing. 호출 DisposeDispatcherProcessingDisabled 구조에는 다시 처리할 수 있도록 합니다.Calling Dispose on the DispatcherProcessingDisabled structure re-enables processing.

DisableProcessing 스레드에서 호출할 수 있습니다는 Dispatcher 연관 됩니다.DisableProcessing can only be called on the thread the Dispatcher is associated with.

적용 대상