Op Englesch liesen

Deelen iwwer


ProjectItem.ContainingProject Property

Definition

Gets the project hosting the ProjectItem.

C++/CX
public:
 property EnvDTE::Project ^ ContainingProject { EnvDTE::Project ^ get(); };

Property Value

A Project object.

Attributes

Examples

VB
Sub ContainingProjectExample(ByVal dte As DTE2)  

    ' Before running this example, open a code document from a project.  
    Try  
        ' Create a new namespace.  
        Dim projItem As ProjectItem = dte.ActiveDocument.ProjectItem  
        Dim cm As CodeModel = projItem.ContainingProject.CodeModel  
        cm.AddNamespace("TestNamespace", projItem.Name)  
    Catch ex As Exception  
        MsgBox(ex.Message)  
    End Try  

End Sub  

Applies to

Produkt Versiounen
Visual Studio SDK 2015, 2017, 2019, 2022