确定该语言的当前范围块。
命名空间: Microsoft.VisualStudio.TextManager.Interop
程序集: Microsoft.VisualStudio.TextManager.Interop(在 Microsoft.VisualStudio.TextManager.Interop.dll 中)
语法
声明
Function GetCurrentBlock ( _
pTextLines As IVsTextLines, _
iCurrentLine As Integer, _
iCurrentChar As Integer, _
<OutAttribute> ptsBlockSpan As TextSpan(), _
<OutAttribute> ByRef pbstrDescription As String, _
<OutAttribute> ByRef pfBlockAvailable As Integer _
) As Integer
int GetCurrentBlock(
IVsTextLines pTextLines,
int iCurrentLine,
int iCurrentChar,
TextSpan[] ptsBlockSpan,
out string pbstrDescription,
out int pfBlockAvailable
)
int GetCurrentBlock(
[InAttribute] IVsTextLines^ pTextLines,
[InAttribute] int iCurrentLine,
[InAttribute] int iCurrentChar,
[OutAttribute] array<TextSpan>^ ptsBlockSpan,
[OutAttribute] String^% pbstrDescription,
[OutAttribute] int% pfBlockAvailable
)
abstract GetCurrentBlock :
pTextLines:IVsTextLines *
iCurrentLine:int *
iCurrentChar:int *
ptsBlockSpan:TextSpan[] byref *
pbstrDescription:string byref *
pfBlockAvailable:int byref -> int
function GetCurrentBlock(
pTextLines : IVsTextLines,
iCurrentLine : int,
iCurrentChar : int,
ptsBlockSpan : TextSpan[],
pbstrDescription : String,
pfBlockAvailable : int
) : int
参数
pTextLines
类型:Microsoft.VisualStudio.TextManager.Interop.IVsTextLines[in] 包含文本的 IVsTextLines 对象检查。
iCurrentLine
类型:Int32[in] 光标的当前行位置。
iCurrentChar
类型:Int32[in] 游标的当前字符位置在行内。
ptsBlockSpan
类型:array<Microsoft.VisualStudio.TextManager.Interop.TextSpan[][out] 指定表示当前语言的文本范围块。 有关更多信息,请参见 TextSpan。
pbstrDescription
类型:String%[out] 返回包含该语言声明的字符串块。
pfBlockAvailable
类型:Int32%[out, retval] ,如果块可用,返回非零。 否则,因此,如果当前光标位置与语言不匹配块,则返回零。
返回值
类型:Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。
备注
COM 签名
从 textmgr.idl:
HRESULT IVsLanguageBlock::GetCurrentBlock(
[in] IVsTextLines * pTextLines,
[in] LONG iCurrentLine,
[in] LONG iCurrentChar,
[out] TextSpan * ptsBlockSpan,
[out] BSTR * pbstrDescription
);
如果当前位置,此方法返回定义封闭 TextSpan 结构或周围文本块和块的简短说明。
此方法从视图通常会调用填充 pbstrDescription 文本的 查找 对话框的 current procedure “只搜索: current procedure”选项。 该声明应为 short 由于在 查找 对话框的有限空间。
必须设置 pfBlockAvailable 参数到非零,则块可用时,而零,则该位置是外部的任何块。 ptsBlockSpan 和 pbstrDescription 参数的值可以是指示一个空值这些参数对于调用方希望。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。