Click or drag to resize
MimeKit

MimePartGetBestEncoding Method (EncodingConstraint, CancellationToken)

Calculates the most efficient content encoding given the specified constraint.

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 2.14.0
Syntax
C#
public ContentEncoding GetBestEncoding(
	EncodingConstraint constraint,
	CancellationToken cancellationToken = default
)

Parameters

constraint
Type: MimeKitEncodingConstraint
The encoding constraint.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: ContentEncoding
The most efficient content encoding.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionconstraint is not a valid value.
OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.
Remarks
If no Content is set, SevenBit will be returned.
See Also