DispatcherProcessingDisabled Estructura

Definición

Representa el distribuidor cuando está en un estado deshabilitado y proporciona un medio para volver a habilitar el procesamiento del distribuidor.

public value class DispatcherProcessingDisabled : IDisposable
public struct DispatcherProcessingDisabled : IDisposable
type DispatcherProcessingDisabled = struct
    interface IDisposable
Public Structure DispatcherProcessingDisabled
Implements IDisposable
Herencia
DispatcherProcessingDisabled
Implementaciones

Ejemplos

En el ejemplo siguiente se muestra cómo deshabilitar el procesamiento del distribuidor y volver a habilitar el procesamiento del distribuidor. DisableProcessing se llama a en una instrucción using . DisableProcessing devuelve una DispatcherProcessingDisabled estructura que se usa como objeto que se va a eliminar cuando finaliza el bloque using . La llamada a en la estructura vuelve a Dispose habilitar el DispatcherProcessingDisabled procesamiento del distribuidor.

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

Comentarios

DisableProcessing devuelve un DispatcherProcessingDisabled objeto cuando se llama a .

Deshabilitar el procesamiento del distribuidor es un método avanzado destinado a eliminar la posibilidad de reentrada no relacionada.

Los efectos de deshabilitar el procesamiento son los siguientes:

  • Los bloqueos CLR no bombean mensajes internamente.

  • DispatcherFrame No se permite insertar objetos.

  • No se permite el procesamiento de mensajes.

Al llamar Dispose a en el objeto, se volverá a habilitar el DispatcherProcessingDisabled procesamiento del distribuidor.

Métodos

Dispose()

Vuelve a habilitar el procesamiento del distribuidor.

Equals(Object)

Determina si el objeto DispatcherProcessingDisabled especificado es igual a este objeto DispatcherProcessingDisabled.

GetHashCode()

Obtiene un código hash para esta instancia.

Operadores

Equality(DispatcherProcessingDisabled, DispatcherProcessingDisabled)

Determina si los dos objetos DispatcherProcessingDisabled son iguales.

Inequality(DispatcherProcessingDisabled, DispatcherProcessingDisabled)

Determina si dos objetos DispatcherProcessingDisabled no son iguales.

Se aplica a

Consulte también