VCFilter.ItemName Property

Definition

Gets the name of the current item in the collection.

C++/CX
public:
 property Platform::String ^ ItemName { Platform::String ^ get(); };

Property Value

A string representing the name of the item.

Implements

Attributes

Examples

The following example uses ItemName property in the integrated development environment (IDE):

VB
' Macro code.  
' add reference to Microsoft.VisualStudio.VCProjectEngine  
Imports EnvDTE  
Imports Microsoft.VisualStudio.VCProjectEngine  

Public Module Module1  
    Sub Test()  
        Dim mycollection As IVCCollection  
        Dim file As VCFile  
        Dim prj As VCProject  
        prj = DTE.Solution.Projects.Item(1).Object  
        mycollection = prj.Files  
        'mycollection.Count has count of files  
        file = mycollection.Item(1)  
        ' file.ItemName has file name  
    End Sub  
End Module  

Remarks

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

Applies to

Proizvod Verzije
Visual Studio SDK 2015, 2017, 2019, 2022