Method At
- Namespace
- MailFathom.Application.Emails.Extraction.Attachments
- Assembly
- MailFathom.Application.dll
At(IReadOnlyList<AttachmentTextSegment>, int)
Finds the place a passage beginning at an offset was read from.
public static AttachmentTextSegment? At(IReadOnlyList<AttachmentTextSegment> segments, int startOffset)
Parameters
segmentsIReadOnlyList<AttachmentTextSegment>One attachment's boundaries, in the ascending order the reading wrote them.
startOffsetintWhere the passage begins in that attachment's extracted text.
Returns
- AttachmentTextSegment
The place, or null where the attachment records none.
Remarks
The last boundary at or before the offset rather than the first at or after it: a passage opening halfway down page four was read from page four, and citing page five would send a reader past the words they were looking for. An attachment carrying no boundaries answers with nothing, which is a citation naming the file and not a place inside it — what an honest reading of a row written before boundaries existed supports.
Exceptions
- ArgumentNullException
Thrown when
segmentsis null.