IColorSink::Colorize Method
Sets the color and trigger information for a range of characters.
HRESULT Colorize (
long startIdx,
long endIdx,
ColorClass colorClass,
CharClass charClass,
TriggerClass trigger
);
Parameters
startIdx
[in] Index position of the first character to colorize in the line. This index is zero based.endIdx
[in] Index position of the last character to colorize in the line. This index is zero based.colorClass
[in] Specifies the color class of the character, for example, keyword, identifier, and so on. See ColorClass.charClass
[in] The class of the current character. This value is used to determine the word extent and search ranges. See CharClass.trigger
[in] Associates a character with a specific trigger, for example brace matching, method tip, method information, and so on. See TriggerClass.
Return Value
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
This method is primarily used to set the color class of each character, but is also used to pass in character class and trigger information. The startIdx and endIdx parameters specify the character index in the line. In contrast to columns, this means that TAB characters are treated as a single character. The indices are zero based; that is, the first character has index zero.
Since the IColorSink Interface must be implemented on the same class that implements the IVsColorizer interface, the array of attributes that is returned by the IVsColorizer interface is filled in by the Colorize method. Your implementation of the Colorize method can choose to translate the ColorClass value to a color index (typically an index into a list of colorable items that the GetColorableItem method in the IVsProvideColorableItems interface supplies) or the Colorize method can treat the ColorClass value as a final index into a list of colorable items and store the value directly in the attribute array (the default Babel implementation classes use this second approach).