DispatcherProcessingDisabled DispatcherProcessingDisabled DispatcherProcessingDisabled DispatcherProcessingDisabled Struct

定義

無効な状態のディスパッチャーを表し、ディスパッチャーの処理を再度有効にする手段を提供します。Represents the Dispatcher when it is in a disable state and provides a means to re-enable dispatcher processing.

public value class DispatcherProcessingDisabled : IDisposable
public struct DispatcherProcessingDisabled : IDisposable
type DispatcherProcessingDisabled = struct
    interface IDisposable
Public Structure DispatcherProcessingDisabled
Implements IDisposable
継承
DispatcherProcessingDisabledDispatcherProcessingDisabledDispatcherProcessingDisabledDispatcherProcessingDisabled
実装

次の例では、ディスパッチャー処理を無効にして、ディスパッチャー処理を再度有効にする方法を示します。The following example shows how to disable dispatcher processing and re-enable dispatcher processing. DisableProcessingは、 usingステートメントで呼び出されます。DisableProcessing is called in a using statement. DisableProcessing使用ブロックが終了したときに破棄されるオブジェクトとし**** て使用される構造体を返します。DispatcherProcessingDisabledDisableProcessing returns a DispatcherProcessingDisabled structure which is used as the object to be disposed when the using block finishes. 構造DispatcherProcessingDisabled体でを呼び出すDisposeと、ディスパッチャー処理が再度有効になります。Calling Dispose on the DispatcherProcessingDisabled structure re-enables dispatcher processing.

// 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

注釈

DisableProcessing呼び出されDispatcherProcessingDisabledたときにオブジェクトを返します。DisableProcessing returns a DispatcherProcessingDisabled object when it is called.

ディスパッチャー処理の無効化は、関連性のない再入の可能性を排除することを目的とした高度な手法です。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.

オブジェクトDisposeでをDispatcherProcessingDisabled呼び出すと、ディスパッチャー処理が再び有効になります。Calling Dispose on the DispatcherProcessingDisabled object will re-enable dispatcher processing.

メソッド

Dispose() Dispose() Dispose() Dispose()

ディスパッチャーの処理を再度有効にします。Re-enables dispatcher processing.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定した DispatcherProcessingDisabled オブジェクトがこの DispatcherProcessingDisabled オブジェクトと等しいかどうかを判断します。Determines whether the specified DispatcherProcessingDisabled object is equal to this DispatcherProcessingDisabled object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

このインスタンスのハッシュ コードを取得します。Gets a hash code for this instance.

演算子

Equality(DispatcherProcessingDisabled, DispatcherProcessingDisabled) Equality(DispatcherProcessingDisabled, DispatcherProcessingDisabled) Equality(DispatcherProcessingDisabled, DispatcherProcessingDisabled) Equality(DispatcherProcessingDisabled, DispatcherProcessingDisabled)

2 つの DispatcherProcessingDisabled オブジェクトが等しいかどうかを判断します。Determines whether two DispatcherProcessingDisabled objects are equal.

Inequality(DispatcherProcessingDisabled, DispatcherProcessingDisabled) Inequality(DispatcherProcessingDisabled, DispatcherProcessingDisabled) Inequality(DispatcherProcessingDisabled, DispatcherProcessingDisabled) Inequality(DispatcherProcessingDisabled, DispatcherProcessingDisabled)

2 つの DispatcherProcessingDisabled オブジェクトが等しくないかどうかを判断します。Determines whether two DispatcherProcessingDisabled objects are not equal.

適用対象

こちらもご覧ください