03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Writing XML Data ❘ 545<br />

The following table lists the XElement class’s most useful methods.<br />

Method<br />

Add<br />

AddAfterSelf<br />

AddBeforeSelf<br />

AddFirst<br />

Ancestors<br />

Attribute<br />

Attributes<br />

DescendantNodes<br />

Descendants<br />

DescendantsAndSelf<br />

Element<br />

Elements<br />

ElementsAfterSelf<br />

ElementsBeforeSelf<br />

IsAfter<br />

IsBefore<br />

Load<br />

Purpose<br />

Adds an item at the end of the element’s child collection.<br />

Adds an item to the parent’s child collection after this element.<br />

Adds an item to the parent’s child collection before this element.<br />

Adds an item at the beginning of the element’s child collection.<br />

Returns a collection of XElement objects that are ancestors of the element.<br />

If you specify a name, the method returns only elements with<br />

that name.<br />

Returns an attribute with a specific name.<br />

Returns a collection containing this element’s attributes. If you specify<br />

a name, the collection includes only attributes with that name.<br />

Returns a collection of XNode objects that are descendants of the<br />

element.<br />

Returns a collection of XElement objects that are descendants of the<br />

element. If you specify a name, the method returns only elements with<br />

that name.<br />

Returns a collection of XElement objects that includes this element<br />

and its descendants. If you specify a name, the method returns only<br />

elements with that name.<br />

Returns the first child element with a specified name.<br />

Returns a collection holding the element’s children. If you specify a<br />

name, the method returns only elements with that name.<br />

Returns a collection holding the element’s siblings that come after this<br />

element. If you specify a name, the method returns only elements with<br />

that name.<br />

Returns a collection holding the element’s siblings that come before<br />

this element. If you specify a name, the method returns only elements<br />

with that name.<br />

Returns true if this node comes after another specified node in<br />

document.<br />

Returns true if this node comes before another specified node in<br />

document.<br />

Loads the element from a filename, stream, or reader.<br />

continues<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!