This class can syntax-highlight a document.
It automatically manages invalidating the highlighting when the document changes.

C# | Visual Basic | Visual C++ |
public class DocumentHighlighter : ILineTracker, IHighlighter, IDisposable
Public Class DocumentHighlighter _ Implements ILineTracker, IHighlighter, IDisposable
public ref class DocumentHighlighter : ILineTracker, IHighlighter, IDisposable

All Members | Constructors | Methods | Properties | Events | |
Icon | Member | Description |
---|---|---|
![]() | DocumentHighlighter(TextDocument, IHighlightingDefinition) |
Creates a new DocumentHighlighter instance.
|
![]() | BeginHighlighting()()()() |
Opens a group of HighlightLine(Int32) calls.
It is not necessary to call this method before calling HighlightLine(Int32),
however, doing so can make the highlighting much more performant in some cases
(e.g. the C# semantic highlighter in SharpDevelop will re-use the resolver within a highlighting group).
|
![]() | DefaultTextColor |
Gets the default text color.
|
![]() | Dispose()()()() |
Disposes the document highlighter.
|
![]() | Document |
Gets the document that this DocumentHighlighter is highlighting.
|
![]() | EndHighlighting()()()() |
Closes the currently opened group of HighlightLine(Int32) calls.
|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | Finalize()()()() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetColorStack(Int32) |
Gets the stack of active colors (the colors associated with the active spans) at the end of the specified line.
-> GetColorStack(1) returns the colors at the start of the second line.
|
![]() | GetHashCode()()()() | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetNamedColor(String) |
Retrieves the HighlightingColor with the specified name. Returns null if no color matching the name is found.
|
![]() | GetSpanStack(Int32) |
Gets the span stack at the end of the specified line.
-> GetSpanStack(1) returns the spans at the start of the second line.
|
![]() | GetType()()()() | Gets the Type of the current instance. (Inherited from Object.) |
![]() | HighlightingStateChanged |
Notification when the highlighter detects that the highlighting state at the
beginning of the specified lines has changed.
fromLineNumber and toLineNumber are both inclusive;
the common case of a single-line change is represented by fromLineNumber == toLineNumber.
During highlighting, the highlighting of line X will cause this event to be raised
for line X+1 if the highlighting state at the end of line X has changed from its previous state.
This event may also be raised outside of the highlighting process to signalize that
changes to external data (not the document text; but e.g. semantic information)
require a re-highlighting of the specified lines.
|
![]() | HighlightLine(Int32) |
Highlights the specified document line.
|
![]() | InitialSpanStack |
Gets/sets the the initial span stack of the document. Default value is Empty.
|
![]() | InvalidateHighlighting()()()() |
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.
|
![]() | MemberwiseClone()()()() | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | OnHighlightStateChanged(Int32, Int32) |
Is called when the highlighting state at the end of the specified line has changed.
|
![]() | ToString()()()() | (Inherited from Object.) |
![]() | UpdateHighlightingState(Int32) |
Enforces a highlighting state update (triggering the HighlightingStateChanged event if necessary)
for all lines up to (and inclusive) the specified line number.
|

Object | |
![]() | DocumentHighlighter |
Assembly: ICSharpCode.AvalonEdit (Module: ICSharpCode.AvalonEdit.dll) Version: 5.0.0.4238