C# Класс AvalonStudio.TextEditor.Document.TextUtilities

Показать файл Открыть проект

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

Метод Описание
ContainsNumber ( string text ) : bool
FindNextNewLine ( ITextSource text, int offset, string &newLineType ) : int

Finds the next new line character starting at offset.

GetControlCharacterName ( char controlCharacter ) : string

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

GetNewLineFromDocument ( IDocument document, int lineNumber ) : string

Gets the newline sequence used in the document at the specified line.

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. This method treats linefeeds as simple whitespace.

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

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

IsNewLine ( string newLine ) : bool

Gets whether the specified string is a newline sequence.

IsSymbol ( string text ) : bool
NormalizeNewLines ( string input, string newLine ) : string

Normalizes all new lines in input to be newLine.

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

Метод Описание
GetCharacterClass ( UnicodeCategory c ) : CharacterClass
GetCharacterClass ( char c ) : CharacterClass
GetCharacterClass ( char highSurrogate, char lowSurrogate ) : CharacterClass
GetLeadingWhitespace ( TextDocument document, DocumentLine documentLine ) : ISegment
GetTrailingWhitespace ( TextDocument document, DocumentLine documentLine ) : ISegment
GetWhitespaceAfter ( ITextSource textSource, int offset ) : ISegment
GetWhitespaceBefore ( ITextSource textSource, int offset ) : ISegment
IsNormal ( CaretPositioningMode mode ) : bool
StopBetweenCharacters ( CaretPositioningMode mode, CharacterClass charBefore, CharacterClass charAfter ) : bool

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

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

public static ContainsNumber ( string text ) : bool
text string
Результат bool

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

Finds the next new line character starting at offset.
public static FindNextNewLine ( ITextSource text, int offset, string &newLineType ) : int
text ITextSource The text source to search in.
offset int The starting offset for the search.
newLineType string The string representing the new line that was found, or null if no new line was found.
Результат int

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

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

Gets the newline sequence used in the document at the specified line.
public static GetNewLineFromDocument ( IDocument document, int lineNumber ) : string
document IDocument
lineNumber int
Результат 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. This method treats linefeeds as simple whitespace.
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

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

Gets whether the specified string is a newline sequence.
public static IsNewLine ( string newLine ) : bool
newLine string
Результат bool

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

public static IsSymbol ( string text ) : bool
text string
Результат bool

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

Normalizes all new lines in input to be newLine.
public static NormalizeNewLines ( string input, string newLine ) : string
input string
newLine string
Результат string