Export (0) Print
Expand All

TextPointer.GetTextInRun Method (LogicalDirection, Char[], Int32, Int32)

Copies the specified maximum number of characters from any adjacent text in the specified direction into a caller-supplied character array.

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)

public int GetTextInRun(
	LogicalDirection direction,
	char[] textBuffer,
	int startIndex,
	int count
)

Parameters

direction
Type: System.Windows.Documents.LogicalDirection
One of the LogicalDirection values that specifies the logical direction in which to find and copy any adjacent text.
textBuffer
Type: System.Char[]
A buffer into which any text is copied.
startIndex
Type: System.Int32
An index into textBuffer at which to begin writing copied text.
count
Type: System.Int32
The maximum number of characters to copy.

Return Value

Type: System.Int32
The number of characters actually copied into textBuffer.

ExceptionCondition
ArgumentException

startIndex is less than 0 or greater than the Length property of textBuffer.

-or-

count is less than 0 or greater than the remaining space in textBuffer (textBuffer.Length minus startIndex).

This method returns only uninterrupted runs of text. Nothing is returned if any symbol type other than Text is adjacent to the current TextPointer in the specified direction. Similarly, text is returned only up to the next non-text symbol.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft