DispatcherProcessingDisabled Estructura
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
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
- Implementaciones
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
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.
Dispose() |
Vuelve a habilitar el procesamiento del distribuidor. |
Equals(Object) |
Determina si el objeto DispatcherProcessingDisabled especificado es igual a este objeto DispatcherProcessingDisabled. |
Get |
Obtiene un código hash para esta instancia. |
Equality(Dispatcher |
Determina si los dos objetos DispatcherProcessingDisabled son iguales. |
Inequality(Dispatcher |
Determina si dos objetos DispatcherProcessingDisabled no son iguales. |
Producto | Versiones |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Comentarios de .NET
.NET es un proyecto de código abierto. Seleccione un vínculo para proporcionar comentarios: