Reference.ContainingProject Özellik

Tanım

Seçilen öğenin bir parçası olduğu projeyi alır. Salt okunur.

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

Özellik Değeri

Project

Bir proje nesnesi döndürür.

Öznitelikler

Örnekler

Bu örnek, seçilen proje öğesinin bir parçası olduğu projenin adını almak için özel bir makro işlevi kullanmayı gösterir. İşlevi kullanmak için bir test yöntemi oluşturulur.

' 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  

Açıklamalar

Öğeyi içeren nesneyi almak için bu özelliği kullanın Project .

Şunlara uygulanır