Body Part CollectionIndex Of Method
Gets the index of the body part matching the specified URI.
Definition
Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
The index of the part matching the specified URI if found; otherwise -1.
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public int IndexOf(
Uri uri
)Parameters
- uri Uri
- The URI of the body part.
Return Value
Int32The index of the part matching the specified URI if found; otherwise -1.
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.
Exceptions
| ArgumentNullException | uri is . |