TextSource.GetPrecedingText(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检索指定位置前 TextSource 的文本跨度。
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)
参数
- textSourceCharacterIndexLimit
- Int32
文本检索停止的字符索引位置。
返回
一个 CultureSpecificCharacterBufferRange 值,表示紧邻前 textSourceCharacterIndexLimit的文本范围。
注解
如果文本跨度紧接着GetPrecedingText不包含任何文本(例如内联对象或隐藏的运行),该方法CultureSpecificCharacterBufferRange将返回一个空textSourceCharacterIndexLimit值。
如果没有前面的 textSourceCharacterIndexLimit值,此方法将返回长度为零的文本范围。