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

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

Asynchronously get the message or header streams at the specified indexes.
Asynchronously get the message or header streams at the specified indexes.
/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// 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 GetStreamsAsync ( IList indexes, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>
indexes IList The indexes of the messages.
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<IList<Stream>> GetStreamsAsync (IList<int> indexes, bool headersOnly = false, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null)
		{
			if (indexes == null)
				throw new ArgumentNullException (nameof (indexes));

			if (indexes.Count == 0)
				throw new ArgumentException ("No indexes specified.", nameof (indexes));

			return Task.Factory.StartNew (() => {
				lock (SyncRoot) {
					return GetStreams (indexes, headersOnly, cancellationToken, progress);
				}
			}, cancellationToken, TaskCreationOptions.None, TaskScheduler.Default);
		}

Same methods

MailSpool::GetStreamsAsync ( int startIndex, int count, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>