VSProjectItem.ProjectItem 屬性
取得與指定物件關聯的 ProjectItem 物件。
命名空間: VSLangProj
組件: VSLangProj (在 vslangproj.dll 中)
語法
'宣告
'用途
屬性值
傳回 ProjectItem 物件。
範例
Sub PrjItem(ByVal dte As DTE2)
' List the name of the first VSProjectItem.
' Before running, open a VB or C# application in VS.
Dim vsPrj As VSProject = _
CType(dte.Solution.Projects.Item(1).Object, VSProject)
Dim vsPrjItem As VSProjectItem
vsPrjItem = CType(dte.Solution.Projects.Item(1) _
.ProjectItems.Item(1).Object, VSProjectItem)
MsgBox("Proj Item Name: " & vsPrjItem.ProjectItem.Name)
End Sub
public void PrjItem(DTE2 dte)
{
// List the name of the first VSProjectItem.
// Before running, open a VB or C# application in VS.
VSProject vsPrj = (VSProject)dte.Solution.Projects.Item(1).Object;
VSProjectItem vsPrjItem;
vsPrjItem = (VSProjectItem)dte.Solution.Projects.Item(1).
ProjectItems.Item(1).Object;
MessageBox.Show("Proj Item Name: " + vsPrjItem.ProjectItem.Name);
}
請參閱
工作
HOW TO:編譯和執行 Automation 物件模型程式碼範例