Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic

C#
Visual Basic

Azuki 1.7 Documentation
IHighlighter..::..HookProc Property
IHighlighter Interface See Also Send Feedback

Gets or sets highlighter hook procedure.

Namespace: Sgry.Azuki.Highlighter
Assembly: Azuki (in Azuki.dll) Version: 1.7.13.40248

# Syntax

C#
    HighlightHook HookProc { get; set; }

Visual Basic
    Property HookProc As HighlightHook
    	Get
    	Set

#### Property Value

Type: HighlightHook

# Remarks

This property gets or sets a hook procedure to override highlight logic built into the highlighter object. A delegate object set to this property will be called when a token is highlighted and if the delegate returns true, the highlighter will skip highlighting the token; so the delegate can highlight tokens differently.

It is not needed to implement highlight hook for all highlighters so accessing this property may throw a NotSupportedException depending on implementations. If an implementation of IHighlighter does not provide hook mechanism, its CanHook property SHOULD returns false and accessing this property SHOULD throw a NotSupportedException.

One of the typical usage is changing character class for specific keywords for application specific reason. Another typical usage is expanding logic of a keyword based highlighter to consider language syntax a little more (example of this usage is built-in C/C++ highlighter which uses a hook procedure to expand logic for highlighting preprocessor macros whose '#' and keyword parts are separated with spaces.) Note that since this functionality is a hook, a very little change can be applied to original behavior. If needed highlighting result cannot be easily achieved with a hook, consider implementing a new IHighlighter from a scratch.

# Exceptions

Exception | Condition
--- | ---
System..::..NotSupportedException | This highlighter does not support hook mechanism.

# See Also

IHighlighter Interface
IHighlighter..::..IHighlighter Members
Sgry.Azuki.Highlighter Namespace
IHighlighter.CanUseHook property
HighlightHook delegate