IVsLanguageDebugInfo2.QueryCatchLineSpan 方法

定义

确定指定位置的 try/catch 异常处理程序中 catch 块的范围。

public:
 int QueryCatchLineSpan(Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer ^ pBuffer, int iLine, int iCol, [Runtime::InteropServices::Out] int % pfIsInCatch, cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ ptsCatchLine);
int QueryCatchLineSpan(Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer const & pBuffer, int iLine, int iCol, [Runtime::InteropServices::Out] int & pfIsInCatch, std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & ptsCatchLine);
public int QueryCatchLineSpan (Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer pBuffer, int iLine, int iCol, out int pfIsInCatch, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] ptsCatchLine);
abstract member QueryCatchLineSpan : Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer * int * int * int * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] -> int
Public Function QueryCatchLineSpan (pBuffer As IVsTextBuffer, iLine As Integer, iCol As Integer, ByRef pfIsInCatch As Integer, ptsCatchLine As TextSpan()) As Integer

参数

pBuffer
IVsTextBuffer

中一个 IVsTextBuffer 包含要检查的文本的对象。

iLine
Int32

中要在其中查找 catch 块的行。

iCol
Int32

中要在其中查找 catch 块的列

pfIsInCatch
Int32

弄指示位置是否在 catch 块中的标志。 如果位置在 catch 块本身内,则该值为非零; 否则为。否则,返回零。

ptsCatchLine
TextSpan[]

弄返回一个 TextSpan 描述 catch 块跨度的对象。

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

使用此方法可查找与给定位置相关联的 catch 块。 位置通常在 tryfinallycatch 块中。 此方法不会尝试在另一个方法或另一个文件中查找关联的 catch 块。

适用于