Export (0) Print
Expand All

TextSource.GetPrecedingText Method

Retrieves the text span immediately before the specified TextSource position.

Namespace:  System.Windows.Media.TextFormatting
Assembly:  PresentationCore (in PresentationCore.dll)

public abstract TextSpan<CultureSpecificCharacterBufferRange> GetPrecedingText(
	int textSourceCharacterIndexLimit
)

Parameters

textSourceCharacterIndexLimit
Type: System.Int32

An Int32 value that specifies the character index position where text retrieval stops.

Return Value

Type: System.Windows.Media.TextFormatting.TextSpan<CultureSpecificCharacterBufferRange>
A CultureSpecificCharacterBufferRange value that represents the text span immediately before textSourceCharacterIndexLimit.

The GetPrecedingText method returns an empty CultureSpecificCharacterBufferRange if the text span immediately before textSourceCharacterIndexLimit does not contain any text, such as inline object or a hidden run.

This method returns a zero-length text span if there are no values preceding textSourceCharacterIndexLimit.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft