TnefReaderReadValueAsDateTimeAsync Method

Asynchronously read the current attribute's value as a date and time.

Definition

Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public Task<DateTime> ReadValueAsDateTimeAsync(
	CancellationToken cancellationToken = default
)

Parameters

cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskDateTime
The value.

Remarks

Asynchronously reads the current attribute's value as a date and time.

If the value is not a valid date, a InvalidDate issue is reported and default (DateTime) is returned.

The value may be read any number of times.

Exceptions

ObjectDisposedException The reader has been disposed.
InvalidOperationException

The reader is not positioned on an attribute.

-or-

The attribute's value cannot be read as a date.

-or-

The attribute's value has already been consumed in some other way.

OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.

See Also