Partager via


VCProject.AddFilter Method

Adds a folder to the current project or folder.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Syntax

'Declaration
Function AddFilter ( _
    bstrFilterName As String _
) As Object
Object AddFilter(
    string bstrFilterName
)
Object^ AddFilter(
    String^ bstrFilterName
)
abstract AddFilter : 
        bstrFilterName:string -> Object
function AddFilter(
    bstrFilterName : String
) : Object

Parameters

  • bstrFilterName
    Type: System.String

    Required. The name of the folder to add.

Return Value

Type: System.Object
A VCFilter object for the folder (filter) just added.

Remarks

AddFile adds a file to a folder.

Examples

See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.

The following example uses AddFilter on a VCProject object in the integrated development environment (IDE):

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim folder As VCFilter
        prj = DTE.Solution.Projects.Item(1).Object
        folder = prj.AddFilter("NewFolder")
        MsgBox(folder.Name.ToString())
    End Sub
End Module

.NET Framework Security

See Also

Reference

VCProject Interface

Microsoft.VisualStudio.VCProjectEngine Namespace