This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static dynamic GetDynamicFromXml(string pathToXml) | |
{ | |
var xdoc = XDocument.Load(pathToXml); | |
return GetDynamicFromNode(xdoc.Root); | |
} | |
private static dynamic GetDynamicFromNode(XElement node) | |
{ | |
dynamic result = new ExpandoObject(); | |
foreach (var elementGroup in node.Elements().GroupBy(n => n.Name.LocalName)) | |
{ | |
var resultDictionary = (IDictionary<String, dynamic>)result; | |
var values = new List<dynamic>(); | |
foreach (var element in elementGroup) | |
{ | |
values.Add((element.HasElements) ? GetDynamicFromNode(element) : element.Value.Trim()); | |
} | |
resultDictionary[elementGroup.Key] = elementGroup.Count() > 1 ? values : values.FirstOrDefault(); | |
} | |
return result; | |
} |
Oakley Titanium Glass - Titholeton's Titholeton's Titholeton
ReplyDeleteOakley titanium glass · Made with glass made by Titholeton Glass · Made with titanium anodizing glass made titanium trim reviews by Titholeton Glass titanium blade · Made with graphite titanium babyliss pro glass made by Titholeton Glass · Made price of titanium with glass made by Titholeton