Compartilhar via


IVsUserContext.GetAttrUsage Method

Returns the type of context (attribute, lookup keyword, or F1 keyword) that is present at a specified index position in the context or subcontext bag.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function GetAttrUsage ( _
    index As Integer, _
    fIncludeChildren As Integer, _
    <OutAttribute> pUsage As VSUSERCONTEXTATTRIBUTEUSAGE() _
) As Integer
int GetAttrUsage(
    int index,
    int fIncludeChildren,
    VSUSERCONTEXTATTRIBUTEUSAGE[] pUsage
)
int GetAttrUsage(
    [InAttribute] int index, 
    [InAttribute] int fIncludeChildren, 
    [OutAttribute] array<VSUSERCONTEXTATTRIBUTEUSAGE>^ pUsage
)
abstract GetAttrUsage : 
        index:int * 
        fIncludeChildren:int * 
        pUsage:VSUSERCONTEXTATTRIBUTEUSAGE[] byref -> int
function GetAttrUsage(
    index : int, 
    fIncludeChildren : int, 
    pUsage : VSUSERCONTEXTATTRIBUTEUSAGE[]
) : int

Parameters

  • index
    Type: Int32

    [in] Index position of the context item in the context bag. The index is zero based.

  • fIncludeChildren
    Type: Int32

    [in] If true, then the subcontext associated with the context bag is included. If false, then the subcontext is excluded.

Return Value

Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From context.idl:

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

Use the IVsUserContext.GetAttrUsage method to determine whether keywords returned from the GetAttribute or GetAttributePri methods are F1 or lookup keywords.

The value of the fIncludeChildren parameter has no effect if the context bag does not have any subcontext.

.NET Framework Security

See Also

Reference

IVsUserContext Interface

Microsoft.VisualStudio.Shell.Interop Namespace