C# Class AvalonStudio.TextEditor.Document.TextUtilities

Afficher le fichier Open project: VitalElement/AvalonStudio

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

ContainsNumber() public static méthode

public static ContainsNumber ( string text ) : bool
text string
Résultat bool

FindNextNewLine() public static méthode

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.
Résultat int

GetControlCharacterName() public static méthode

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
Résultat string

GetNewLineFromDocument() public static méthode

Gets the newline sequence used in the document at the specified line.
public static GetNewLineFromDocument ( IDocument document, int lineNumber ) : string
document IDocument
lineNumber int
Résultat string

GetNextCaretPosition() public static méthode

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.
Résultat int

GetSingleIndentationSegment() public static méthode

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 .
Résultat ISegment

IsNewLine() public static méthode

Gets whether the specified string is a newline sequence.
public static IsNewLine ( string newLine ) : bool
newLine string
Résultat bool

IsSymbol() public static méthode

public static IsSymbol ( string text ) : bool
text string
Résultat bool

NormalizeNewLines() public static méthode

Normalizes all new lines in input to be newLine.
public static NormalizeNewLines ( string input, string newLine ) : string
input string
newLine string
Résultat string