VCProjectReference.ItemName 属性

定义

获取集合中当前项的名称。

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

属性值

String

集合中当前项的名称。

实现

属性

示例

有关如何编译和运行此示例的信息,请参阅 如何:编译项目模型扩展性的示例代码

下面的示例使用 ItemName 开发环境中的属性:

' 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  

适用于