La méthode System.Threading.CancellationToken.ThrowIfCancellationRequested de C# vérifie si une demande d'annulation a été effectuée et lève une exception si c'est le cas. Cela permet de contrôler l'exécution d'une opération asynchrone et de la terminer de manière propre en cas d'annulation. Cela peut être utile, par exemple, lorsqu'un utilisateur souhaite annuler une tâche en cours d'exécution.
C# (CSharp) System.Threading CancellationToken.ThrowIfCancellationRequested - 41 exemples trouvés. Ce sont les exemples réels les mieux notés de System.Threading.CancellationToken.ThrowIfCancellationRequested extraits de projets open source. Vous pouvez noter les exemples pour nous aider à en améliorer la qualité.