DispatcherProcessingDisabled DispatcherProcessingDisabled DispatcherProcessingDisabled DispatcherProcessingDisabled Struct

Definición

Representa el distribuidor cuando está en un estado deshabilitado y proporciona un medio para volver a habilitar el procesamiento del distribuidor.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
Herencia
DispatcherProcessingDisabledDispatcherProcessingDisabledDispatcherProcessingDisabledDispatcherProcessingDisabled
Implementaciones

Ejemplos

En el ejemplo siguiente se muestra cómo deshabilitar el procesamiento del distribuidor y volver a habilitar el procesamiento del distribuidor.The following example shows how to disable dispatcher processing and re-enable dispatcher processing. DisableProcessingse llama a en una instrucción using .DisableProcessing is called in a using statement. DisableProcessingDevuelve una DispatcherProcessingDisabled estructura que se utiliza como el objeto que se va a eliminar cuando finalice el bloque using .DisableProcessing returns a DispatcherProcessingDisabled structure which is used as the object to be disposed when the using block finishes. Llamar Dispose a en DispatcherProcessingDisabled la estructura vuelve a habilitar el procesamiento del distribuidor.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

Comentarios

DisableProcessingDevuelve un DispatcherProcessingDisabled objeto cuando se llama a.DisableProcessing returns a DispatcherProcessingDisabled object when it is called.

Deshabilitar el procesamiento del distribuidor es un método avanzado diseñado para eliminar la posibilidad de una reentrada no relacionada.Disabling dispatcher processing is an advanced method that is intended to eliminate the chance of unrelated reentrancy.

Los efectos de deshabilitar el procesamiento son los siguientes:The effects of disabling processing are as follows:

  • Los bloqueos CLR no bombearán mensajes internamente.CLR locks will not pump messages internally.

  • DispatcherFrameno se permite la inserción de objetos.DispatcherFrame objects are not allowed to be pushed.

  • No se permite el procesamiento de mensajes.Message processing is not permitted.

La Dispose llamada a DispatcherProcessingDisabled en el objeto volverá a habilitar el procesamiento del distribuidor.Calling Dispose on the DispatcherProcessingDisabled object will re-enable dispatcher processing.

Métodos

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

Vuelve a habilitar el procesamiento del distribuidor.Re-enables dispatcher processing.

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

Determina si el objeto DispatcherProcessingDisabled especificado es igual a este objeto DispatcherProcessingDisabled.Determines whether the specified DispatcherProcessingDisabled object is equal to this DispatcherProcessingDisabled object.

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

Obtiene un código hash para esta instancia.Gets a hash code for this instance.

Operadores

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

Determina si los dos objetos DispatcherProcessingDisabled son iguales.Determines whether two DispatcherProcessingDisabled objects are equal.

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

Determina si dos objetos DispatcherProcessingDisabled no son iguales.Determines whether two DispatcherProcessingDisabled objects are not equal.

Se aplica a

Consulte también: