internal static Dictionary<string, object> GetMethodStructMember( XmlRpcRequest request, XmlNode node) { var xpath = node.GetXPath(); var values = node.SelectNodes(string.Concat(xpath, "/member")); if (values != null) { var dictionary = new Dictionary<string, object>(); foreach (XmlNode value in values) { var memberNameNode = value["name"]; var memberValueNode = value["value"]; if (memberNameNode == null || memberValueNode == null) { continue; } var memberName = memberNameNode.InnerText; dictionary.Add( memberName, GetMethodMember( request, memberValueNode.FirstChild)); } return dictionary; } return null; }
internal static object GetMethodArrayMember( XmlRpcRequest request, XmlNode node) { var xpath = node.GetXPath(); var values = node.SelectNodes(string.Concat(xpath, "/data/value")); var results = new List<object>(); if (values != null) { results.AddRange( values.Cast<XmlNode>().Select( value => value.FirstChild.Name.Equals("struct") ? GetMethodMember(request, value.FirstChild) : value.InnerText.ConvertTo(value.FirstChild.Name))); //if (values // .Cast<XmlNode>() // .Any(x => x.FirstChild.Name.Equals("struct"))) //{ // return values // .Cast<XmlNode>() // .Select( // value => // GetMethodStructMember( // request, // value.FirstChild)) // .ToArray(); //} //return values.Cast<XmlNode>() // .Select( // value => // (string) value.InnerText.ConvertTo(value.FirstChild.Name)) // .ToArray(); // This works!!! //return values.Cast<XmlNode>() // .Select( // value => // (string)value.InnerText.ConvertTo(value.FirstChild.Name)) // .ToArray(); return results.ToArray(); } return null; }