C# Класс ICSharpCode.AvalonEdit.Document.TextUtilities

Static helper methods for working with text.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetControlCharacterName ( char controlCharacter ) : string

Gets the name of the control character. For unknown characters, the unicode codepoint is returned as 4-digit hexadecimal value.

GetNextCaretPosition ( ITextSource textSource, int offset, LogicalDirection direction, CaretPositioningMode mode ) : int

Gets the next caret position.

This method is NOT equivalent to the actual caret movement when using VisualLine.GetNextCaretPosition. In real caret movement, there are additional caret stops at line starts and ends. However, this method doesn't know anything about lines: it is often called with a textSource that represents only a single VisualTextElement.

GetSingleIndentationSegment ( ITextSource textSource, int offset, int indentationSize ) : ISegment

Gets a single indentation segment starting at offset - at most one tab or indentationSize spaces.

Приватные методы

Метод Описание
GetCharacterClass ( char c ) : CharacterClass
GetLeadingWhitespace ( DocumentLine documentLine ) : ISegment
GetLeadingWhitespace ( TextDocument document, DocumentLine documentLine ) : ISegment
GetTrailingWhitespace ( DocumentLine documentLine ) : ISegment
GetTrailingWhitespace ( TextDocument document, DocumentLine documentLine ) : ISegment
GetWhitespaceAfter ( ITextSource textSource, int offset ) : ISegment
GetWhitespaceBefore ( ITextSource textSource, int offset ) : ISegment

Описание методов

GetControlCharacterName() публичный статический Метод

Gets the name of the control character. For unknown characters, the unicode codepoint is returned as 4-digit hexadecimal value.
public static GetControlCharacterName ( char controlCharacter ) : string
controlCharacter char
Результат string

GetNextCaretPosition() публичный статический Метод

Gets the next caret position.
This method is NOT equivalent to the actual caret movement when using VisualLine.GetNextCaretPosition. In real caret movement, there are additional caret stops at line starts and ends. However, this method doesn't know anything about lines: it is often called with a textSource that represents only a single VisualTextElement.
public static GetNextCaretPosition ( ITextSource textSource, int offset, LogicalDirection direction, CaretPositioningMode mode ) : int
textSource ITextSource The text source.
offset int The start offset inside the text source.
direction LogicalDirection The search direction (forwards or backwards).
mode CaretPositioningMode The mode for caret positioning.
Результат int

GetSingleIndentationSegment() публичный статический Метод

Gets a single indentation segment starting at offset - at most one tab or indentationSize spaces.
public static GetSingleIndentationSegment ( ITextSource textSource, int offset, int indentationSize ) : ISegment
textSource ITextSource The text source.
offset int The offset where the indentation segment starts.
indentationSize int The size of an indentation unit. See .
Результат ISegment