示例#1
0
        // Token: 0x060001E7 RID: 487 RVA: 0x000073B4 File Offset: 0x000055B4
        private static object parse(XmlNode node)
        {
            string name = node.Name;
            object result;

            if (Operators.CompareString(name, "dict", false) == 0)
            {
                result = Plist.parseDictionary(node);
            }
            else if (Operators.CompareString(name, "array", false) == 0)
            {
                result = Plist.parseArray(node);
            }
            else if (Operators.CompareString(name, "string", false) == 0)
            {
                result = node.InnerText;
            }
            else if (Operators.CompareString(name, "integer", false) == 0)
            {
                result = Convert.ToInt32(node.InnerText, NumberFormatInfo.InvariantInfo);
            }
            else if (Operators.CompareString(name, "real", false) == 0)
            {
                result = Convert.ToDouble(node.InnerText, NumberFormatInfo.InvariantInfo);
            }
            else if (Operators.CompareString(name, "false", false) == 0)
            {
                result = false;
            }
            else if (Operators.CompareString(name, "true", false) == 0)
            {
                result = true;
            }
            else if (Operators.CompareString(name, "null", false) == 0)
            {
                result = null;
            }
            else if (Operators.CompareString(name, "date", false) == 0)
            {
                result = XmlConvert.ToDateTime(node.InnerText, XmlDateTimeSerializationMode.Utc);
            }
            else
            {
                if (Operators.CompareString(name, "data", false) != 0)
                {
                    throw new ApplicationException(string.Format("Plist Node `{0}' is not supported", node.Name));
                }
                result = Convert.FromBase64String(node.InnerText);
            }
            return(result);
        }