TextSource.GetPrecedingText Method (Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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


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
Available since 3.0
Return to top