IVsLanguageBlock.GetCurrentBlock 方法
判斷目前的語言區塊範圍。
命名空間: 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%[retval] out傳回非零如果區塊是可用。 如果目前的游標位置與語言區塊不一致,否則傳回 0。
傳回值
類型: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定義封入或附近的文字區塊和簡短描述區塊的結構。
通常會呼叫這個方法從檢視中,以填入尋找 ] 對話方塊的 「只用於搜尋: < 目前的程序 >"選項 where < 目前的程序 > 是pbstrDescription的文字。 描述應該是有限的空間,在短到對話方塊。
pfBlockAvailable參數必須設為非零可用區塊時,任何區塊外的位置不加零。 值ptsBlockSpan和pbstrDescription參數可能是 null 值,指出這些參數都不想要由呼叫端。
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。