FileStream.FlushAsync(CancellationToken) Metodo
Definizione
Cancella in modo asincrono i dati di tutti i buffer del flusso, determina la scrittura dei dati memorizzati nel buffer nel dispositivo sottostante e monitora le richieste di annullamento.Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.
public:
override System::Threading::Tasks::Task ^ FlushAsync(System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.Task FlushAsync (System.Threading.CancellationToken cancellationToken);
[System.Runtime.InteropServices.ComVisible(false)]
public override System.Threading.Tasks.Task FlushAsync (System.Threading.CancellationToken cancellationToken);
override this.FlushAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
[<System.Runtime.InteropServices.ComVisible(false)>]
override this.FlushAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overrides Function FlushAsync (cancellationToken As CancellationToken) As Task
Parametri
- cancellationToken
- CancellationToken
Token da monitorare per le richieste di annullamento.The token to monitor for cancellation requests.
Restituisce
Attività che rappresenta l'operazione di scaricamento asincrona.A task that represents the asynchronous flush operation.
- Attributi
Eccezioni
Il flusso è stato eliminato.The stream has been disposed.
Commenti
Se l'operazione viene annullata prima del completamento, l'attività restituita contiene il Canceled valore per la Status Proprietà.If the operation is canceled before it completes, the returned task contains the Canceled value for the Status property. Se l'handle del file viene eliminato, l'attività restituita contiene l' ObjectDisposedException eccezione nella Exception Proprietà.If the handle to the file is disposed, the returned task contains the ObjectDisposedException exception in the Exception property.