DispatcherProcessingDisabled Yapı

Tanım

Devre dışı bırakma durumundayken Dağıtıcıyı temsil eder ve dağıtıcı işlemeyi yeniden etkinleştirmek için bir araç sağlar.

public value class DispatcherProcessingDisabled : IDisposable
public struct DispatcherProcessingDisabled : IDisposable
type DispatcherProcessingDisabled = struct
    interface IDisposable
Public Structure DispatcherProcessingDisabled
Implements IDisposable
Devralma
DispatcherProcessingDisabled
Uygulamalar

Örnekler

Aşağıdaki örnekte dağıtıcı işlemeyi devre dışı bırakma ve dağıtıcı işlemeyi yeniden etkinleştirme işlemleri gösterilmektedir. DisableProcessingusing deyiminde çağrılır. DisableProcessing, kullanma bloğu tamamlandığında atılacak nesne olarak kullanılan bir DispatcherProcessingDisabled yapı döndürür. Yapı üzerinde çağrılması Dispose dağıtıcı işlemeyi DispatcherProcessingDisabled yeniden etkinleştirir.

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

Açıklamalar

DisableProcessing çağrıldığında bir DispatcherProcessingDisabled nesne döndürür.

Dağıtıcı işlemini devre dışı bırakmak, ilgisiz yeniden giriş olasılığını ortadan kaldırmaya yönelik gelişmiş bir yöntemdir.

İşlemeyi devre dışı bırakmanın etkileri şunlardır:

  • CLR kilitleri iletileri dahili olarak pompalamayacak.

  • DispatcherFrame nesnelerin gönderilmesine izin verilmez.

  • İleti işlemeye izin verilmiyor.

nesnesinde çağrılması Dispose dağıtıcı işlemeyi DispatcherProcessingDisabled yeniden etkinleştirir.

Yöntemler

Dispose()

Dağıtıcı işlemeyi yeniden etkinleştirir.

Equals(Object)

Belirtilen DispatcherProcessingDisabled nesnenin bu DispatcherProcessingDisabled nesneye eşit olup olmadığını belirler.

GetHashCode()

Bu örnek için bir karma kodu alır.

İşleçler

Equality(DispatcherProcessingDisabled, DispatcherProcessingDisabled)

İki DispatcherProcessingDisabled nesnenin eşit olup olmadığını belirler.

Inequality(DispatcherProcessingDisabled, DispatcherProcessingDisabled)

İki DispatcherProcessingDisabled nesnenin eşit olup olmadığını belirler.

Şunlara uygulanır

Ayrıca bkz.