Tnef Property ReaderRead Property Method
Definition
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
public TnefProperty ReadProperty(
CancellationToken cancellationToken = default
)Parameters
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
TnefPropertyThe property.
Remarks
Reads all of the values of the current property into a TnefProperty whose values can be read any number of times.
This method must be called before any of the property's variable-length values have been read and before the reader has been advanced to any of its other values.
Binary values are read into memory. Use OpenValueStream to read large values, such as attachment data, without buffering them.
If any value is larger than MaxPropertyValueLength or the remaining MaxTotalDataBytes allow, a DataSizeLimitExceeded issue is reported and the property is returned without any values (its Count is 0).
Exceptions
| ObjectDisposedException | The TnefReader has been disposed. |
| InvalidOperationException |
The TnefReader has been advanced to another attribute. -or- The reader is not positioned on a property. -or- Some of the property's values have already been read. |
| OperationCanceledException | The operation was canceled via the cancellation token. |
| IOException | An I/O error occurred. |