Click or drag to resize
MimeKit

BodyPartCollectionIndexOf Method

Gets the index of the body part matching the specified URI.

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 4.7.1
Syntax
C#
public int IndexOf(
	Uri uri
)

Parameters

uri  Uri
The URI of the body part.

Return Value

Int32
The index of the part matching the specified URI if found; otherwise -1.
Exceptions
ExceptionCondition
ArgumentNullExceptionuri is null.
Remarks

Finds the index of the body part matching the specified URI, if it exists.

If the URI scheme is "cid", then matching is performed based on the Content-Id header values, otherwise the Content-Location headers are used. If the provided URI is absolute and a child part's Content-Location is relative, then then the child part's Content-Location URI will be combined with the value of its Content-Base header, if available, otherwise it will be combined with the multipart/related part's Content-Base header in order to produce an absolute URI that can be compared with the provided absolute URI.

See Also