Extensions.DescendantsAndSelf 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳來源集合中每個元素的集合,以及每個來源集合中所有後代元素。
多載
| 名稱 | Description |
|---|---|
| DescendantsAndSelf(IEnumerable<XElement>) |
回傳一組元素,包含來源集合中所有元素,以及來源集合中每個元素的後代元素。 |
| DescendantsAndSelf(IEnumerable<XElement>, XName) |
回傳一個篩選過的元素集合,包含原始集合中的所有元素,以及每個元素的後代。 集合中只會包含具有相符 XName 的專案。 |
備註
雖然 Visual Basic 內建了後代元素的 XML 軸,但沒有整合軸具備此方法的語意。
此方法使用延遲執行。
DescendantsAndSelf(IEnumerable<XElement>)
回傳一組元素,包含來源集合中所有元素,以及來源集合中每個元素的後代元素。
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);
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>
其中 A IEnumerable<T>XElement 包含了原始集合。
傳回
IEnumerable<T> XElement一個包含原始集合中所有元素,以及每個來源集合中每個元素的後代元素。
備註
雖然 Visual Basic 內建了後代元素的 XML 軸,但沒有整合軸具備此方法的語意,因此 Visual Basic 使用者必須明確使用此軸方法。
此方法使用延遲執行。
另請參閱
- DescendantNodesAndSelf()
- DescendantsAndSelf()
- DescendantNodes()
- DescendantNodes<T>(IEnumerable<T>)
- Nodes<T>(IEnumerable<T>)
- System.Xml.Linq.XContainer.Descendants
- System.Xml.Linq.Extensions.後代
- LINQ to XML 概觀
適用於
DescendantsAndSelf(IEnumerable<XElement>, XName)
回傳一個篩選過的元素集合,包含原始集合中的所有元素,以及每個元素的後代。 集合中只會包含具有相符 XName 的專案。
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);
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>
其中 A IEnumerable<T>XElement 包含了原始集合。
傳回
IEnumerable<T> XElement一個包含原始集合中所有元素,以及每個元素的後代。 集合中只會包含具有相符 XName 的專案。
備註
雖然 Visual Basic 內建了後代元素的 XML 軸,但沒有整合軸具備此方法的語意,因此 Visual Basic 使用者必須明確使用此軸方法。
此方法使用延遲執行。
另請參閱
- DescendantNodesAndSelf()
- DescendantsAndSelf()
- DescendantNodes()
- DescendantNodes<T>(IEnumerable<T>)
- Nodes<T>(IEnumerable<T>)
- System.Xml.Linq.XContainer.Descendants
- System.Xml.Linq.Extensions.後代
- LINQ to XML 概觀