C# Class ICSharpCode.AvalonEdit.Highlighting.DocumentHighlighter

This class can syntax-highlight a document. It automatically manages invalidating the highlighting when the document changes.
Inheritance: ILineTracker, IHighlighter
Afficher le fichier Open project: kjk/kjkpub Class Usage Examples

Private Properties

Свойство Type Description
AllocateMatchArray System.Text.RegularExpressions.Match[]
CheckIsHighlighting void
HighlightLineAndUpdateTreeList void
HighlightLineInternal void
HighlightNonSpans void
HighlightUpTo void
ILineTracker void
ILineTracker void
ILineTracker void
ILineTracker void
Minimum System.Text.RegularExpressions.Match
PopAllColors void
PopColor void
PushColor void
ResetColorStack void

Méthodes publiques

Méthode Description
DocumentHighlighter ( TextDocument document, ICSharpCode.AvalonEdit.Highlighting.HighlightingRuleSet baseRuleSet ) : System

Creates a new DocumentHighlighter instance.

GetSpanStack ( int lineNumber ) : ICSharpCode.AvalonEdit.Utils.ImmutableStack

Gets the span stack at the end of the specified line. -> GetSpanStack(1) returns the spans at the start of the second line.

GetSpanStack(0) is valid and will always return the empty stack.

HighlightLine ( DocumentLine line ) : HighlightedLine

Highlights the specified document line.

InvalidateHighlighting ( ) : void

Invalidates all stored highlighting info. When the document changes, the highlighting is invalidated automatically, this method needs to be called only when there are changes to the highlighting rule set.

Méthodes protégées

Méthode Description
OnHighlightStateChanged ( DocumentLine line, int lineNumber ) : void

Is called when the highlighting state at the end of the specified line has changed.

This callback must not call HighlightLine or InvalidateHighlighting. It may call GetSpanStack, but only for the changed line and lines above. This method must not modify the document.

Private Methods

Méthode Description
AllocateMatchArray ( int count ) : System.Text.RegularExpressions.Match[]
CheckIsHighlighting ( ) : void
HighlightLineAndUpdateTreeList ( DocumentLine line, int lineNumber ) : void
HighlightLineInternal ( DocumentLine line ) : void
HighlightNonSpans ( int until ) : void
HighlightUpTo ( int targetLineNumber ) : void
ILineTracker ( ) : void
ILineTracker ( DocumentLine line ) : void
ILineTracker ( DocumentLine insertionPos, DocumentLine newLine ) : void
ILineTracker ( DocumentLine line, int newTotalLength ) : void
Minimum ( Match arr, Match endSpanMatch ) : Match

Returns the first match from the array or endSpanMatch.

PopAllColors ( ) : void
PopColor ( ) : void
PushColor ( ICSharpCode.AvalonEdit.Highlighting.HighlightingColor color ) : void
ResetColorStack ( ) : void

Method Details

DocumentHighlighter() public méthode

Creates a new DocumentHighlighter instance.
public DocumentHighlighter ( TextDocument document, ICSharpCode.AvalonEdit.Highlighting.HighlightingRuleSet baseRuleSet ) : System
document ICSharpCode.AvalonEdit.Document.TextDocument
baseRuleSet ICSharpCode.AvalonEdit.Highlighting.HighlightingRuleSet
Résultat System

GetSpanStack() public méthode

Gets the span stack at the end of the specified line. -> GetSpanStack(1) returns the spans at the start of the second line.
GetSpanStack(0) is valid and will always return the empty stack.
public GetSpanStack ( int lineNumber ) : ICSharpCode.AvalonEdit.Utils.ImmutableStack
lineNumber int
Résultat ICSharpCode.AvalonEdit.Utils.ImmutableStack

HighlightLine() public méthode

Highlights the specified document line.
public HighlightLine ( DocumentLine line ) : HighlightedLine
line ICSharpCode.AvalonEdit.Document.DocumentLine The line to highlight.
Résultat HighlightedLine

InvalidateHighlighting() public méthode

Invalidates all stored highlighting info. When the document changes, the highlighting is invalidated automatically, this method needs to be called only when there are changes to the highlighting rule set.
public InvalidateHighlighting ( ) : void
Résultat void

OnHighlightStateChanged() protected méthode

Is called when the highlighting state at the end of the specified line has changed.
This callback must not call HighlightLine or InvalidateHighlighting. It may call GetSpanStack, but only for the changed line and lines above. This method must not modify the document.
protected OnHighlightStateChanged ( DocumentLine line, int lineNumber ) : void
line ICSharpCode.AvalonEdit.Document.DocumentLine
lineNumber int
Résultat void