Udostępnij za pośrednictwem


TextSource.GetPrecedingText(Int32) Metoda

Definicja

Pobiera zakres tekstu bezpośrednio przed określoną TextSource pozycją.

public:
 abstract System::Windows::Media::TextFormatting::TextSpan<System::Windows::Media::TextFormatting::CultureSpecificCharacterBufferRange ^> ^ GetPrecedingText(int textSourceCharacterIndexLimit);
public abstract System.Windows.Media.TextFormatting.TextSpan<System.Windows.Media.TextFormatting.CultureSpecificCharacterBufferRange> GetPrecedingText (int textSourceCharacterIndexLimit);
abstract member GetPrecedingText : int -> System.Windows.Media.TextFormatting.TextSpan<System.Windows.Media.TextFormatting.CultureSpecificCharacterBufferRange>
Public MustOverride Function GetPrecedingText (textSourceCharacterIndexLimit As Integer) As TextSpan(Of CultureSpecificCharacterBufferRange)

Parametry

textSourceCharacterIndexLimit
Int32

Położenie indeksu znaków, w którym pobieranie tekstu zatrzymuje się.

Zwraca

TextSpan<CultureSpecificCharacterBufferRange>

CultureSpecificCharacterBufferRange Wartość reprezentująca zakres tekstu bezpośrednio przed textSourceCharacterIndexLimit.

Uwagi

Metoda GetPrecedingText zwraca wartość pustą CultureSpecificCharacterBufferRange , jeśli zakres tekstu bezpośrednio przed textSourceCharacterIndexLimit nie zawiera żadnego tekstu, takiego jak obiekt wbudowany lub ukryty przebieg.

Ta metoda zwraca zakres tekstowy o zerowej długości, jeśli nie ma wartości poprzedzających textSourceCharacterIndexLimit.

Dotyczy