Share via


IVsUserContext.CountAttributes Method

Returns the number of attributes or keywords present 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 CountAttributes ( _
    pszName As String, _
    fIncludeChildren As Integer, _
    <OutAttribute> ByRef pc As Integer _
) As Integer
int CountAttributes(
    string pszName,
    int fIncludeChildren,
    out int pc
)
int CountAttributes(
    [InAttribute] String^ pszName, 
    [InAttribute] int fIncludeChildren, 
    [OutAttribute] int% pc
)
abstract CountAttributes : 
        pszName:string * 
        fIncludeChildren:int * 
        pc:int byref -> int 
function CountAttributes(
    pszName : String, 
    fIncludeChildren : int, 
    pc : int
) : int

Parameters

  • pszName
    Type: System.String
    [in] Attribute name or keyword. Specify the attribute name to determine the number of attributes of a given name in the context bag. Specify "keyword" to determine the number of F1 or lookup keywords in the context or subcontext bag.
  • fIncludeChildren
    Type: System.Int32
    [in] If true, then the number of subcontext attributes or keywords are also returned in the count. If false, then the subcontext is excluded from the count.
  • pc
    Type: System.Int32%
    [out, retval] Pointer to an integer that indicates the number of attributes of a specific name or the number of keywords.

Return Value

Type: System.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::CountAttributes(
   [in] LPCOLESTR pszName,
   [in] BOOL fIncludeChildren,
   [out, retval] int * pc
);

Use this method to determine the number of attributes of a specific name, or the number of keywords present in the context or subcontext bag. If you set the fIncludeChildren parameter to true, then this method also includes in the count the number of attributes or keywords present in any subcontext bags associated with the context bag. 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