Partager via


DispatcherQueueController Classe

Définition

Gère la durée de vie d’un DispatcherQueue.

public ref class DispatcherQueueController sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DispatcherQueueController final
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
class DispatcherQueueController final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DispatcherQueueController
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
public sealed class DispatcherQueueController
Public NotInheritable Class DispatcherQueueController
Héritage
Object Platform::Object IInspectable DispatcherQueueController
Attributs

Remarques

Durée de vie de l’objet et du thread

DispatcherQueueController et dispatcherQueue associé sont maintenus actifs pendant l’exécution de la boucle d’événements. Une fois l’arrêt terminé, la boucle est terminée et le thread dédié se déroule. Toutefois, DispatcherQueueController et l’objet DispatcherQueue associé peuvent expirer la durée de vie du thread et seront supprimés lorsque toutes leurs références seront libérées.

Propriétés

DispatcherQueue

Obtient le DispatcherQueue associé à ce DispatcherQueueController.

Méthodes

CreateOnCurrentThread()

Sur le thread appelant, crée un DispatcherQueue qui interopera avec une boucle de message USER32.

CreateOnDedicatedThread()

Crée un DispatcherQueue que vous pouvez utiliser pour exécuter des tâches sur un thread dédié.

ShutdownQueue()

Version synchrone de ShutdownQueueAsync. Pour plus d’informations, consultez la documentation, y compris les remarques, pour cette méthode.

Cette méthode retourne une fois l’opération d’arrêt terminée.

ShutdownQueueAsync()

Arrête de façon asynchrone le DispatcherQueue associé à ce DispatcherQueueController et arrête le thread si dispatcherQueueController a été créé par CreateOnDedicatedThread.

Cette méthode retourne (une opération asynchrone) dès que l’opération d’arrêt est démarrée ; mais l’opération asynchrone ne se termine pas tant que l’opération d’arrêt n’est pas terminée.

S’applique à