共用方式為


VCFile.ItemName Property

Definition

Gets the name of the current item in the collection.

public:
 property System::String ^ ItemName { System::String ^ get(); };
public:
 property Platform::String ^ ItemName { Platform::String ^ get(); };
[System.Runtime.InteropServices.DispId(678)]
public string ItemName { [System.Runtime.InteropServices.DispId(678)] get; }
[<System.Runtime.InteropServices.DispId(678)>]
[<get: System.Runtime.InteropServices.DispId(678)>]
member this.ItemName : string
Public ReadOnly Property ItemName As String

Property Value

The name of the current item in the collection.

Implements

Attributes

Examples

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

' 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