Colorizes 特定文本。
命名空间: Microsoft.VisualStudio.TextManager.Interop
程序集: Microsoft.VisualStudio.TextManager.Interop(在 Microsoft.VisualStudio.TextManager.Interop.dll 中)
语法
声明
Function ColorizeLine ( _
iLine As Integer, _
iLength As Integer, _
pszText As IntPtr, _
iState As Integer, _
<OutAttribute> pAttributes As UInteger() _
) As Integer
int ColorizeLine(
int iLine,
int iLength,
IntPtr pszText,
int iState,
uint[] pAttributes
)
int ColorizeLine(
[InAttribute] int iLine,
[InAttribute] int iLength,
[InAttribute] IntPtr pszText,
[InAttribute] int iState,
[OutAttribute] array<unsigned int>^ pAttributes
)
abstract ColorizeLine :
iLine:int *
iLength:int *
pszText:IntPtr *
iState:int *
pAttributes:uint32[] byref -> int
function ColorizeLine(
iLine : int,
iLength : int,
pszText : IntPtr,
iState : int,
pAttributes : uint[]
) : int
参数
iLine
类型:Int32[in] colorized 的行。
iLength
类型:Int32[in] 行的长度减去行尾标记 (符, LF, CRLF 对或 0 (EOF)。
pszText
类型:IntPtr[in] 行文本 (请检查到 iLength 字符)。
iState
类型:Int32[in] 在行首的 colorizer 的状态。
pAttributes
类型:array<UInt32[][out] 将针对文本的颜色属性。 该数组在 colorized 的行包含每个字符的成员和在最后一个字符右边表示空间的背景色的一个元素。 此数组是 iLength + 1 个字符长度。
pAttributes 数组的成员可能包含可屏蔽与 COLORIZER_ATTRIBUTE 枚举获取提供的各种值信息需要的位。 有关更多信息,请参见 COLORIZER_ATTRIBUTE。
返回值
类型:Int32
返回 colorizer 的状态在行尾。
备注
COM 签名
从 textmgr.idl:
HRESULT IVsColorizer::ColorizeLine(
[in] long iLine,
[in] long iLength,
[in] const WCHAR *pszText,
[in] long iState,
[out] ULONG * pAttributes
);
此方法的所有实现必须分析输入行 (pszText) 标记的可以 colorize。
对于给定行的每个字符,在 pAttributes 返回相应的数组元素中包含一个索引。语言服务的某些 colorizable 项目,如注释、标识符和数字。
在 pAttributes 数组中返回的值是索引。 Visual Studio 提供的默认可着色项或到语言服务提供的自定义可着色项 (参见中 IVsProvideColorableItems 接口的 GetColorableItem )。 始终是指默认文本颜色如 Visual Studio提供索引为 0。
colorizer 在提供的状态应开始,并返回其当前状态,之后缓存并提供,当启动状态,在下一行 colorized 时。 给定的索引数组比字符的数量长确保为一个元素的行上。 最后一个元素用于在行中最后一个字符右侧确定空间的背景色。
colorizer 应指示将人力自然语言文本文本与 HUMAN_TEXT_ATTR 位。 应为注释和字符串内容将此位,不包括分隔符和使用获取双向文本正确的格式。 HUMAN_TEXT_ATTR 位时还用于确定将自然语言规则而不是编程语言规则,例如,拼写检查和字边界。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。