TnefWriterWriteAttributeAsync(TnefAttributeTag, DateTime, CancellationToken) Method

Asynchronously write an attribute with a date value.

Definition

Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public Task WriteAttributeAsync(
	TnefAttributeTag tag,
	DateTime value,
	CancellationToken cancellationToken = default
)

Parameters

tag  TnefAttributeTag
The attribute tag.
value  DateTime
The value.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

Task
An asynchronous task context.

Remarks

Asynchronously writes an attribute with a Date type.

The date and time components of value are written as-is, without converting them to another time zone.

Exceptions

ArgumentException

tag is not an attribute that can be written.

-or-

The value of tag is not a date.

ObjectDisposedException The writer has been disposed.
InvalidOperationException

The attribute cannot be written at this point in the stream.

-or-

The stream or property writer for the previous attribute has not been disposed.

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

See Also