Extensions::InDocumentOrder<T> Method (IEnumerable<T>^)
Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
public: generic<typename T> where T : XNode [ExtensionAttribute] static IEnumerable<T>^ InDocumentOrder( IEnumerable<T>^ source )
Return ValueType: System.Collections.Generic::IEnumerable< >^
The type of the objects in source, constrained to XNode.
This axis method uses deferred execution. However, it first enumerates its source collection, the sorts the nodes in document order, and then yields the results.
The following example creates a collection of nodes that are not in document order, and then uses this axis to create a new collection where the nodes are in document order.
This example produces the following output:
<aaa>1</aaa> <ccc>3</ccc> <ddd>5</ddd>
Available since 8
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1