VCReference.ItemName 属性

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

命名空间:  Microsoft.VisualStudio.VCProjectEngine
程序集:  Microsoft.VisualStudio.VCProjectEngine(在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

语法

声明
ReadOnly Property ItemName As String
string ItemName { get; }
property String^ ItemName {
    String^ get ();
}
abstract ItemName : string with get
function get ItemName () : String

属性值

类型:System.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

.NET Framework 安全性

请参见

参考

VCReference 接口

Microsoft.VisualStudio.VCProjectEngine 命名空间