共用方式為


ProjectElement.AllParents Property

All parent elements of this element, going up to the ProjectRootElement.

None if this is a ProjectRootElement.

None if this has not been attached to a parent yet.

MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Namespace:  Microsoft.Build.Construction
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

Syntax

'Declaration
Public ReadOnly Property AllParents As IEnumerable(Of ProjectElementContainer)
public IEnumerable<ProjectElementContainer> AllParents { get; }
public:
property IEnumerable<ProjectElementContainer^>^ AllParents {
    IEnumerable<ProjectElementContainer^>^ get ();
}
member AllParents : IEnumerable<ProjectElementContainer> with get
function get AllParents () : IEnumerable<ProjectElementContainer>

Property Value

Type: IEnumerable<ProjectElementContainer>
Returns an enumerator over all parent elements. There are no parents elements if the project element is a ProjectRootElement or if this is not yet attached to a parent element.

.NET Framework Security

See Also

Reference

ProjectElement Class

Microsoft.Build.Construction Namespace