C# Class ICSharpCode.AvalonEdit.Document.TextUtilities

Static helper methods for working with text.
Show file Open project: kjk/kjkpub Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
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

Method Details

GetControlCharacterName() public static method

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
return string

GetNextCaretPosition() public static method

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.
return int

GetSingleIndentationSegment() public static method

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 .
return ISegment