MailKit.MailSpool.GetStreamAsync C# (CSharp) Метод

GetStreamAsync() публичный Метод

Asynchronously get the message or header stream at the specified index.
Asynchronously gets the message or header stream at the specified index.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetStreamAsync ( int index, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task
index int The index of the message.
headersOnly bool true if only the headers should be retrieved; otherwise, false.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
Результат Task
		public virtual Task<Stream> GetStreamAsync (int index, bool headersOnly = false, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null)
		{
			return Task.Factory.StartNew (() => {
				lock (SyncRoot) {
					return GetStream (index, headersOnly, cancellationToken, progress);
				}
			}, cancellationToken, TaskCreationOptions.None, TaskScheduler.Default);
		}