IVsPropertyPage.CategoryTitle Method

Returns the category under which your property pages should be displayed in the tree view.

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

Syntax

'Declaration
Function CategoryTitle ( _
    iLevel As UInteger, _
    <OutAttribute> ByRef pbstrCategory As String _
) As Integer
int CategoryTitle(
    uint iLevel,
    out string pbstrCategory
)
int CategoryTitle(
    [InAttribute] unsigned int iLevel, 
    [OutAttribute] String^% pbstrCategory
)
abstract CategoryTitle : 
        iLevel:uint32 * 
        pbstrCategory:string byref -> int
function CategoryTitle(
    iLevel : uint, 
    pbstrCategory : String
) : int

Parameters

  • iLevel
    Type: UInt32

    [in] Integer containing the level.

  • pbstrCategory
    Type: String%

    [out, retval] Pointer to the category (folder) under which you want your property page to be displayed.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsPropertyPage::CategoryTitle(
   [in]UINT iLevel,
   [out, retval]BSTR *pbstrCategory
);

If your property page does not have a category and you would prefer it to show on the top level of the tree view directly under the appropriate top-level category, then either implement IPropertyPage alone, or return E_NOTIMPL from this method.

  1. Otherwise, the environment first calls this method with an iLevel value of zero.

  2. You can then return the name of the category that should be the closest direct ancestor of this page in the tree.

  3. The environment will then call you with an iLevel value of one.

  4. If you want your page to be indented one level, then return S_FALSE.

  5. The environment continues to call this method, increasing the value of iLevel by one each time, until you return something other than S_OK, or you reach the environment's internal limit of what it supports.

Returning E_NOTIMPL and S_FALSE stops processing without showing an error to the user. Any value other than S_OK can cause error information to be shown to the user.

Currently the environment only supports two levels of categories:

CatLevel1

CatLevel0

PageName

The Visual Studio categories, Common Properties and Configuration Properties, are above CatLevel1 in the hierarchy. The Visual Studio categories do not count as part of the two levels. You do not return them from get_CategoryTitle.

.NET Framework Security

See Also

Reference

IVsPropertyPage Interface

Microsoft.VisualStudio.Shell.Interop Namespace