共用方式為


IVsFilterAddProjectItemDlg2.FilterListItemByCategory Method

Filters files by category.

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

Syntax

'宣告
Function FilterListItemByCategory ( _
    ByRef rguidProjectItemTemplates As Guid, _
    pszCategoryName As String, _
    <OutAttribute> ByRef pfFilter As Integer _
) As Integer
'用途
Dim instance As IVsFilterAddProjectItemDlg2
Dim rguidProjectItemTemplates As Guid
Dim pszCategoryName As String
Dim pfFilter As Integer
Dim returnValue As Integer

returnValue = instance.FilterListItemByCategory(rguidProjectItemTemplates, _
    pszCategoryName, pfFilter)
int FilterListItemByCategory(
    ref Guid rguidProjectItemTemplates,
    string pszCategoryName,
    out int pfFilter
)
int FilterListItemByCategory(
    [InAttribute] Guid% rguidProjectItemTemplates, 
    [InAttribute] String^ pszCategoryName, 
    [OutAttribute] int% pfFilter
)
abstract FilterListItemByCategory : 
        rguidProjectItemTemplates:Guid byref * 
        pszCategoryName:string * 
        pfFilter:int byref -> int 
function FilterListItemByCategory(
    rguidProjectItemTemplates : Guid, 
    pszCategoryName : String, 
    pfFilter : int
) : int

Parameters

  • rguidProjectItemTemplates
    Type: System.Guid%
    [in] GUID of the project supplying the item templates.
  • pszCategoryName
    Type: System.String
    [in] Pointer to a null terminated string containing the category template name.
  • pfFilter
    Type: System.Int32%
    [out] Set to true to filter out the specified item. Set to false to display the item.

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 vsshell.idl:

HRESULT IVsFilterAddProjectItemDlg2::FilterListItemByCategory(
   [in] REFGUID rguidProjectItemTemplates,
   [in] LPCOLESTR pszCategoryName,
   [out] BOOL *pfFilter
);

The environment passes in a project GUID and a category name. Return false to display items in the category and true to filter the category. You specify categories in your Template Directory Description (.Vsdir) Files.

.NET Framework Security

See Also

Reference

IVsFilterAddProjectItemDlg2 Interface

IVsFilterAddProjectItemDlg2 Members

Microsoft.VisualStudio.Shell.Interop Namespace