TaskCompletionSource.TrySetException Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
| TrySetException(IEnumerable<Exception>) | |
| TrySetException(Exception) |
TrySetException(IEnumerable<Exception>)
- Source:
- TaskCompletionSource.cs
- Source:
- TaskCompletionSource.cs
- Source:
- TaskCompletionSource.cs
public:
bool TrySetException(System::Collections::Generic::IEnumerable<Exception ^> ^ exceptions);
public bool TrySetException(System.Collections.Generic.IEnumerable<Exception> exceptions);
member this.TrySetException : seq<Exception> -> bool
Public Function TrySetException (exceptions As IEnumerable(Of Exception)) As Boolean
Paramètres
- exceptions
- IEnumerable<Exception>
Collection d'exceptions à lier à ce Task.
Retours
true si l'opération a réussi ; sinon, false.
Exceptions
exceptions a la valeur null.
Il y a un ou plusieurs éléments null dans exceptions.
La collection exceptions est vide.
Remarques
Cette opération retourne false si le Task est déjà dans l’un des trois états finaux : RanToCompletion, Faultedou Canceled.
S’applique à
TrySetException(Exception)
- Source:
- TaskCompletionSource.cs
- Source:
- TaskCompletionSource.cs
- Source:
- TaskCompletionSource.cs
public:
bool TrySetException(Exception ^ exception);
public bool TrySetException(Exception exception);
member this.TrySetException : Exception -> bool
Public Function TrySetException (exception As Exception) As Boolean
Paramètres
Retours
true si l'opération a réussi ; sinon, false.
Exceptions
exception a la valeur null.
Remarques
Cette opération retourne false si le Task est déjà dans l’un des trois états finaux : RanToCompletion, Faultedou Canceled.