IColorizeText.Colorize(String, SourceState) 方法

定义

在类中实现时,扫描指定源代码以查找各个代码单元,并确定每个代码单元应具有的颜色。When implemented in a class, scans the specified source code for individual units of code and identifies the color that each should have.

此 API 支持产品基础结构,不能在代码中直接使用。

public:
 Microsoft::JScript::ITokenEnumerator ^ Colorize(System::String ^ sourceCode, Microsoft::JScript::SourceState state);
public Microsoft.JScript.ITokenEnumerator Colorize (string sourceCode, Microsoft.JScript.SourceState state);
abstract member Colorize : string * Microsoft.JScript.SourceState -> Microsoft.JScript.ITokenEnumerator
Public Function Colorize (sourceCode As String, state As SourceState) As ITokenEnumerator

参数

sourceCode
String

要着色的源代码。The source code to colorize.

state
SourceState

源代码的当前状态(正常、注释、字符串)。The current state (normal, comment, string) of the source code.

返回

ITokenEnumerator

ITokenColorInfo 对象的枚举,表示要着色的代码单元。An enumeration of ITokenColorInfo objects that represent units of code to colorize.

适用于

另请参阅