IVsUserContext.GetAttrUsage 方法

返回位于在上下文或 subcontext 包中的指定索引位置上下文 (属性、查找关键字或 F1 关键字) 的类型。

命名空间:  Microsoft.VisualStudio.Shell.Interop
程序集:  Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)

语法

声明
Function GetAttrUsage ( _
    index As Integer, _
    fIncludeChildren As Integer, _
    <OutAttribute> pUsage As VSUSERCONTEXTATTRIBUTEUSAGE() _
) As Integer
int GetAttrUsage(
    int index,
    int fIncludeChildren,
    VSUSERCONTEXTATTRIBUTEUSAGE[] pUsage
)

参数

  • index
    类型:System.Int32
    [in] 上下文项的索引位置在上下文包。索引是从零开始的。
  • fIncludeChildren
    类型:System.Int32
    [in] 如果 true,然后 subcontext 与上下文关联的包包括在内。如果 false, subcontext 然后被排除。

返回值

类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 context.idl:

HRESULT IVsUserContext::GetAttrUsage(
   [in] int index,
   [in] BOOL fIncludeChildren,
   [out, retval] VSUSERCONTEXTATTRIBUTEUSAGE * pUsage);

使用 IVsUserContext.GetAttrUsage 方法确定从 GetAttribute 返回的关键字或 GetAttributePri 方法是 F1 或查找关键字。

,如果上下文包没有任何 subcontext, fIncludeChildren 参数的值不起作用。

.NET Framework 安全性

请参见

参考

IVsUserContext 接口

Microsoft.VisualStudio.Shell.Interop 命名空间