Projects.Parent Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the immediate parent object of a Projects collection.
public:
property EnvDTE::DTE ^ Parent { EnvDTE::DTE ^ get(); };
public:
property EnvDTE::DTE ^ Parent { EnvDTE::DTE ^ get(); };
[System.Runtime.InteropServices.DispId(2)]
public EnvDTE.DTE Parent { [System.Runtime.InteropServices.DispId(2)] get; }
[<System.Runtime.InteropServices.DispId(2)>]
[<get: System.Runtime.InteropServices.DispId(2)>]
member this.Parent : EnvDTE.DTE
Public ReadOnly Property Parent As DTE
Property Value
A DTE object.
- Attributes
Examples
public void CodeExample(DTE2 dte)
{
try
{ // Open a project before running this sample
Projects prjs = dte.Solution.Projects;
string msg = "There are " + prjs.Count.ToString() + " projects in this collection.";
msg += "\nThe application containing this Projects collection: " + prjs.DTE.Name;
msg += "\nThe parent object of the Projects collection: " + prjs.Parent.Name;
msg += "\nThe GUID representing the Projects type: " + prjs.Kind;
if (prjs.Properties != null)
{
msg += "\nProperties:";
foreach (Property prop in prjs.Properties)
{
msg += "\n " + prop.Name;
}
}
MessageBox.Show(msg, "Projects Collection");
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Remarks
The Parent property returns the immediate parent to the Projects collection.