IVsContainedLanguageColorizer.ColorizeLineFragment 方法

定义

着色指定的行片段或文本。

public:
 int ColorizeLineFragment(int iLine, int iIndex, int iLength, System::String ^ pszText, int iState, [Runtime::InteropServices::Out] System::UInt32 % pAttributes, [Runtime::InteropServices::Out] int % piNewState);
int ColorizeLineFragment(int iLine, int iIndex, int iLength, std::wstring const & pszText, int iState, [Runtime::InteropServices::Out] unsigned int & pAttributes, [Runtime::InteropServices::Out] int & piNewState);
public int ColorizeLineFragment (int iLine, int iIndex, int iLength, string pszText, int iState, out uint pAttributes, out int piNewState);
abstract member ColorizeLineFragment : int * int * int * string * int * uint32 * int -> int
Public Function ColorizeLineFragment (iLine As Integer, iIndex As Integer, iLength As Integer, pszText As String, iState As Integer, ByRef pAttributes As UInteger, ByRef piNewState As Integer) As Integer

参数

iLine
Int32

中要着色的行号。

iIndex
Int32

中行段的起始字符索引。

iLength
Int32

中要着色的字符数。

pszText
String

中要着色的实际文本。 iLength参数指定此字符串中的字符数,以着色。

iState
Int32

中Colorizer 使用的状态值,表示行开始处的分析状态。 分析状态对于每个 colorizer 都是自定义的。

pAttributes
UInt32

弄文本的颜色属性。

piNewState
Int32

弄指定文本末尾的分析状态。

返回

Int32

如果成功, S_OK 则返回; 否则返回错误代码。

注解

COM 签名

从 singlefileeditor:

long IVsContainedLanguageColorizer::ColorizeLineFragment(  
   [in]  long         iLine,  
   [in]  long         iIndex,  
   [in]  long         iLength,  
   [in]  const WCHAR *pszText,  
   [in]  long         iState,  
   [out] ULONG *      pAttributes  
);  

适用于