Table of Contents

Method InRun

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

InRun(TextRun, int)

Creates a position before character offset of a text run, in the paragraph that holds it (directly or inside an inline content control).

public static DocumentPosition InRun(TextRun run, int offset)

Parameters

run TextRun

The run.

offset int

The character offset in the run, from 0 to its length. For a run a reader synthesized, which counts as one, 0 is before it and anything else after.

Returns

DocumentPosition

The position.

Exceptions

ArgumentNullException

run is null.

ArgumentOutOfRangeException

offset is outside the run's text.

ArgumentException

The run is not in a paragraph, or is part of a field's code, which text editing does not address.