public override bool TryGetMember(GetMemberBinder binder, out object result) { result = null; var att = _root.Attribute(binder.Name); if (att != null) { result = att.Value; return true; } var nodes = _root.Elements(binder.Name); if (nodes.Count() > 1) { result = nodes.Select(n => new DynamicXml(n)).ToList(); return true; } var node = _root.Element(binder.Name); if (node != null) { if (node.HasElements) { result = new DynamicXml(node); } else { result = node.Value; } return true; } return true; }
public override bool TryGetMember(GetMemberBinder binder, out object result) { result = null; var att = _root.Attribute(binder.Name); if (att != null) { result = att.Value; return(true); } var nodes = _root.Elements(binder.Name); if (nodes.Count() > 1) { result = nodes.Select(n => new DynamicXml(n)).ToList(); return(true); } var node = _root.Element(binder.Name); if (node != null) { if (node.HasElements) { result = new DynamicXml(node); } else { result = node.Value; } return(true); } return(true); }
public dynamic Parse(string responseText) { return(DynamicXml.Parse(responseText)); }