Extensions.DescendantsAndSelf 方法

定義

傳回來源集合中每個項目的集合,以及來源集合中每個項目的所有子代項目。Returns a collection of every element in the source collection, and all descendant elements for every element in the source collection.

多載

DescendantsAndSelf(IEnumerable<XElement>)

傳回包含來源集合中每個項目的項目集合,以及來源集合中每個項目的子代項目。Returns a collection of elements that contains every element in the source collection, and the descendent elements of every element in the source collection.

DescendantsAndSelf(IEnumerable<XElement>, XName)

傳回包含來源集合中每個項目的已篩選項目集合,以及來源集合中每個項目的子代。Returns a filtered collection of elements that contains every element in the source collection, and the descendents of every element in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

備註

雖然 Visual Basic 具有子系專案的整合式 XML 軸,但沒有整合的軸具有此方法的語義。Although Visual Basic has an integrated XML axis for descendant elements, there is no integrated axis that has the semantics of this method.

這個方法會使用延後的執行。This method uses deferred execution.

DescendantsAndSelf(IEnumerable<XElement>)

傳回包含來源集合中每個項目的項目集合,以及來源集合中每個項目的子代項目。Returns a collection of elements that contains every element in the source collection, and the descendent elements of every element in the source collection.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<System::Xml::Linq::XElement ^> ^ DescendantsAndSelf(System::Collections::Generic::IEnumerable<System::Xml::Linq::XElement ^> ^ source);
public static System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> DescendantsAndSelf (this System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> source);
static member DescendantsAndSelf : seq<System.Xml.Linq.XElement> -> seq<System.Xml.Linq.XElement>
<Extension()>
Public Function DescendantsAndSelf (source As IEnumerable(Of XElement)) As IEnumerable(Of XElement)

參數

source
IEnumerable<XElement>

IEnumerable<T>XElement,其中包含來源集合。An IEnumerable<T> of XElement that contains the source collection.

傳回

IEnumerable<T>XElement,包含來源集合中的每個項目,以及來源集合中每個項目的子代項目。An IEnumerable<T> of XElement that contains every element in the source collection, and the descendent elements of every element in the source collection.

備註

雖然 Visual Basic 具有子系專案的整合式 XML 軸,但沒有整合的軸具有此方法的語義,因此 Visual Basic 的使用者必須明確使用此 axis 方法。Although Visual Basic has an integrated XML axis for descendant elements, there is no integrated axis that has the semantics of this method, so Visual Basic users must use this axis method explicitly.

這個方法會使用延後的執行。This method uses deferred execution.

另請參閱

DescendantsAndSelf(IEnumerable<XElement>, XName)

傳回包含來源集合中每個項目的已篩選項目集合,以及來源集合中每個項目的子代。Returns a filtered collection of elements that contains every element in the source collection, and the descendents of every element in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<System::Xml::Linq::XElement ^> ^ DescendantsAndSelf(System::Collections::Generic::IEnumerable<System::Xml::Linq::XElement ^> ^ source, System::Xml::Linq::XName ^ name);
public static System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> DescendantsAndSelf (this System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> source, System.Xml.Linq.XName name);
static member DescendantsAndSelf : seq<System.Xml.Linq.XElement> * System.Xml.Linq.XName -> seq<System.Xml.Linq.XElement>
<Extension()>
Public Function DescendantsAndSelf (source As IEnumerable(Of XElement), name As XName) As IEnumerable(Of XElement)

參數

source
IEnumerable<XElement>

IEnumerable<T>XElement,其中包含來源集合。An IEnumerable<T> of XElement that contains the source collection.

name
XName

要比對的 XNameThe XName to match.

傳回

IEnumerable<T>XElement,包含來源集合中每個項目的項目集合,以及來源集合中每個項目的子代。An IEnumerable<T> of XElement that contains every element in the source collection, and the descendents of every element in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

備註

雖然 Visual Basic 具有子系專案的整合式 XML 軸,但沒有整合的軸具有此方法的語義,因此 Visual Basic 的使用者必須明確使用此 axis 方法。Although Visual Basic has an integrated XML axis for descendant elements, there is no integrated axis that has the semantics of this method, so Visual Basic users must use this axis method explicitly.

這個方法會使用延後的執行。This method uses deferred execution.

另請參閱

適用於