¡@

Home 

c# Programming Glossary: xelem

How to serialize/deserialize to `Dictionary<int, string>` from custom XML not using XElement?

http://stackoverflow.com/questions/12554186/how-to-serialize-deserialize-to-dictionaryint-string-from-custom-xml-not-us

XElement if you change your mind. Serialization XElement xElem new XElement items dict.Select x new XElement item new XAttribute.. XAttribute id x.Key new XAttribute value x.Value var xml xElem.ToString xElem.Save ... Deserialization XElement xElem2 XElement.Parse.. x.Key new XAttribute value x.Value var xml xElem.ToString xElem.Save ... Deserialization XElement xElem2 XElement.Parse xml..

LINQ to XML Newbie: Moving Nodes From One Node To Another

http://stackoverflow.com/questions/927350/linq-to-xml-newbie-moving-nodes-from-one-node-to-another

on the tree. Here's a complete solution var foos from xElem in xDoc.Root.Descendants Foo where xElem.Attribute id .Value.. var foos from xElem in xDoc.Root.Descendants Foo where xElem.Attribute id .Value 2 xElem.Attribute id .Value 3 select xElem.. Foo where xElem.Attribute id .Value 2 xElem.Attribute id .Value 3 select xElem .ToList var newParentElem..