Proprietà Project.ParentProjectItem

Ottiene un oggetto ProjectItem per il progetto annidato nel progetto host.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

'Dichiarazione
ReadOnly Property ParentProjectItem As ProjectItem
ProjectItem ParentProjectItem { get; }
property ProjectItem^ ParentProjectItem {
    ProjectItem^ get ();
}
abstract ParentProjectItem : ProjectItem
function get ParentProjectItem () : ProjectItem

Valore proprietà

Tipo: EnvDTE.ProjectItem
Oggetto ProjectItem.

Note

In Visual Studio alcuni progetti, ad esempio i progetti di Enterprise Templates, possono contenere altri progetti come elementi ovvero come sottoprogetti.Ciascuno di questi progetti è un modello per un'applicazione aziendale e comprende sottoprogetti di Visual Basic e Visual C++.In presenza di questo tipo di interfaccia di progetto o di un progetto di cui è stato eseguito il wrapping, ParentProjectItem restituisce l'oggetto ProjectItem per l'elemento nel progetto modello che rappresenta il progetto di cui è stato eseguito il wrapping.

Esempi

Sub ParentProjectItemExample()
   Dim proj As Project
   Dim projitems As ProjectItems
   Dim msg As String

   ' Reference the current solution and its projects and project items.
   proj = DTE.ActiveSolutionProjects(0)
   projitems = proj.ProjectItems

   ' List properties of the project and its items.
   msg = "Is the item open? " & projitems.Item(1).IsOpen & Chr(13)
   msg = msg & "The project's unique name: " & proj.UniqueName
   ' The following two properties work only if the current project 
   ' contains subprojects. If it does, then uncomment the lines to run 
   ' them.
   ' msg = msg & "The parent project item name: " & proj.ParentProjectItem.Name & Chr(13)
   ' msg = msg & "The subproject name: " & projitems.Item(1).SubProject.Name & Chr(13)
   MsgBox(msg)
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Project Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

Controllo di progetti e soluzioni