Extensions.DescendantsAndSelf 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回來源集合中每個項目的集合,以及來源集合中每個項目的所有子代項目。
DescendantsAndSelf(IEnumerable<XElement>) |
傳回包含來源集合中每個項目的項目集合,以及來源集合中每個項目的子代項目。 |
DescendantsAndSelf(IEnumerable<XElement>, XName) |
傳回包含來源集合中每個項目的已篩選項目集合,以及來源集合中每個項目的子代。 集合中只會包含具有相符之 XName 的項目。 |
雖然 Visual Basic 具有子代元素的整合式 XML 軸,但沒有具有此方法語意的整合式座標軸。
這個方法會使用延後的執行。
傳回包含來源集合中每個項目的項目集合,以及來源集合中每個項目的子代項目。
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>
IEnumerable<T> 的 XElement,其中包含來源集合。
傳回
IEnumerable<T> 的 XElement,包含來源集合中的每個項目,以及來源集合中每個項目的子代項目。
備註
雖然 Visual Basic 具有子代元素的整合式 XML 軸,但沒有具有此方法語意的整合式座標軸,因此 Visual Basic 使用者必須明確使用此軸方法。
這個方法會使用延後的執行。
另請參閱
- DescendantNodesAndSelf()
- DescendantsAndSelf()
- DescendantNodes()
- Descendants()
- DescendantNodes<T>(IEnumerable<T>)
- Descendants
- Nodes<T>(IEnumerable<T>)
- LINQ to XML 概觀
適用於
.NET 9 和其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
傳回包含來源集合中每個項目的已篩選項目集合,以及來源集合中每個項目的子代。 集合中只會包含具有相符之 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>
IEnumerable<T> 的 XElement,其中包含來源集合。
傳回
IEnumerable<T> 的 XElement,包含來源集合中每個項目的項目集合,以及來源集合中每個項目的子代。 集合中只會包含具有相符之 XName 的項目。
備註
雖然 Visual Basic 具有子代元素的整合式 XML 軸,但沒有具有此方法語意的整合式座標軸,因此 Visual Basic 使用者必須明確使用此軸方法。
這個方法會使用延後的執行。
另請參閱
- DescendantNodesAndSelf()
- DescendantsAndSelf()
- DescendantNodes()
- Descendants()
- DescendantNodes<T>(IEnumerable<T>)
- Descendants
- Nodes<T>(IEnumerable<T>)
- LINQ to XML 概觀
適用於
.NET 9 和其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |