Prev | Current Page 80 | Next

Satheesh, N Kumar

"LINQ Quickly"

Elements("Icecreams"))
{
// Value of Protein element
Console.WriteLine("Protein : " +
node.Element("Protein").Value + "\n");
// Parent to Parent of Protein element
Console.WriteLine("GrandParent of Protein Element : "
+ node.Element("Protein").
Parent.Parent.Name.ToString() + "\n");
// Type of Protein Element
Console.WriteLine("Protein : " + node.Element("protein")
.NodeType.ToString() + "\n");
// Next node to Last Name node
Console.WriteLine("Next node after Protein : " +
node.Element("Protein")
.NextNode.ToString() + "\n");
// Last node in the Icecream
Console.WriteLine(@"Last node in the Icecream element
: " + node.LastNode.ToString() + "\n");
// Value of the type attribute in teh Phone element
Console.WriteLine("Value of the type attribute in the
TotalFat Element : " + node.Element("TotalFat")
.Attribute("SaturatedFat")
.Value.ToString() + "\n");
// Are there any attributes to the Employee element
Console.WriteLine("Icecream Element has any attributes : " +
node.HasAttributes.


Pages:
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
katalog stron Connie Talbot holz fenster pozycjonowanie katalog stron