SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 275 | Next

Scott Klein

"Professional LINQ"

DescendantsAndSelf("Employee")
select el;
foreach (XElement el in des)
listBox1.Items.Add(el.Name);
In this case, only the Employee element would be returned.
ElementsAfterSelf and ElementsBeforeSelf
The ElementsAfterSelf and ElementsBeforeSelf methods return the elements that come after the
specified element and the elements that come before the specified element, respectively. Each method
takes an overload that returns the elements after, or before, the current element that match the specified
element name.
Here??™s code that defines an XML tree with a root node and six child elements, and then queries the XML
tree for those elements whose elements are after Element4:
XElement root = new XElement("Root",
new XElement("Element1", "Value1"),
new XElement("Element2", "Value2"),
new XElement("Element3", "Value3"),
new XElement("Element4", "Value4"),
new XElement("Element5", "Value5"),
new XElement("Element6", "Value6")
);
textBox1.Text = root.ToString();
XElement re = root.Element("Element4");
IEnumerable els = re.


Pages:
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6