Partager via


IVsUserContext.GetAttrUsage Method

Definition

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.

public:
 int GetAttrUsage(int index, int fIncludeChildren, cli::array <Microsoft::VisualStudio::Shell::Interop::VSUSERCONTEXTATTRIBUTEUSAGE> ^ pUsage);
public:
 int GetAttrUsage(int index, int fIncludeChildren, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSUSERCONTEXTATTRIBUTEUSAGE> ^ pUsage);
int GetAttrUsage(int index, int fIncludeChildren, std::Array <Microsoft::VisualStudio::Shell::Interop::VSUSERCONTEXTATTRIBUTEUSAGE> const & pUsage);
public int GetAttrUsage (int index, int fIncludeChildren, Microsoft.VisualStudio.Shell.Interop.VSUSERCONTEXTATTRIBUTEUSAGE[] pUsage);
abstract member GetAttrUsage : int * int * Microsoft.VisualStudio.Shell.Interop.VSUSERCONTEXTATTRIBUTEUSAGE[] -> int
Public Function GetAttrUsage (index As Integer, fIncludeChildren As Integer, pUsage As VSUSERCONTEXTATTRIBUTEUSAGE()) As Integer

Parameters

index
Int32

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

fIncludeChildren
Int32

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

pUsage
VSUSERCONTEXTATTRIBUTEUSAGE[]

[out] Specifies whether an attribute or keyword is located at the specified index position in the context bag. For a list of pUsage values, see VSUSERCONTEXTATTRIBUTEUSAGE.

Returns

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.

Applies to