Imports.ContainingProject Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient le projet qui contient l'élément sélectionné. Lecture seule.
public:
property EnvDTE::Project ^ ContainingProject { EnvDTE::Project ^ get(); };
public:
property EnvDTE::Project ^ ContainingProject { EnvDTE::Project ^ get(); };
[System.Runtime.InteropServices.DispId(3)]
public EnvDTE.Project ContainingProject { [System.Runtime.InteropServices.DispId(3)] get; }
[<System.Runtime.InteropServices.DispId(3)>]
[<get: System.Runtime.InteropServices.DispId(3)>]
member this.ContainingProject : EnvDTE.Project
Public ReadOnly Property ContainingProject As Project
Valeur de propriété
Retourne un objet Project.
- Attributs
Exemples
Cet exemple illustre l’utilisation d’une fonction de macro privée pour récupérer le nom du projet qui contient l’élément de projet sélectionné. Une méthode de test est créée pour utiliser la fonction.
' Macro Editor
Imports VSLangProj
Private Function GetProjectName(ByVal refs As References) _
As String
Return refs.ContainingProject.Name
End Function
Sub TestGetProjectName()
' First project is a Visual Basic or C# project.
Dim theVSProject As VSProject = _
CType(DTE.Solution.Projects.Item(1).Object, VSProject)
Dim refs As References = theVSProject.References
MsgBox(GetProjectName(refs))
End Sub
Remarques
Utilisez cette propriété pour récupérer l' Project objet qui contient l’élément.