예제 #1
0
        // Token: 0x060001E4 RID: 484 RVA: 0x00007228 File Offset: 0x00005428
        private static Dictionary <string, object> parseDictionary(XmlNode node)
        {
            XmlNodeList childNodes = node.ChildNodes;

            if (childNodes.Count % 2 != 0)
            {
                throw new DataMisalignedException("Dictionary elements must have an even number of child nodes");
            }
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            checked
            {
                for (int i = 0; i < childNodes.Count; i += 2)
                {
                    XmlNode xmlNode = childNodes[i];
                    XmlNode node2   = childNodes[i + 1];
                    if (Operators.CompareString(xmlNode.Name, "key", false) != 0)
                    {
                        throw new ApplicationException("expected a key node");
                    }
                    object objectValue = RuntimeHelpers.GetObjectValue(Plist.parse(node2));
                    if (objectValue != null)
                    {
                        dictionary.Add(xmlNode.InnerText, RuntimeHelpers.GetObjectValue(objectValue));
                    }
                }
                return(dictionary);
            }
        }
예제 #2
0
        // Token: 0x060001E5 RID: 485 RVA: 0x000072C8 File Offset: 0x000054C8
        private static List <object> parseArray(XmlNode node)
        {
            List <object> list = new List <object>();

            try
            {
                foreach (object obj in node.ChildNodes)
                {
                    XmlNode node2       = (XmlNode)obj;
                    object  objectValue = RuntimeHelpers.GetObjectValue(Plist.parse(node2));
                    if (objectValue != null)
                    {
                        list.Add(RuntimeHelpers.GetObjectValue(objectValue));
                    }
                }
            }
            finally
            {
                IEnumerator enumerator;
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            return(list);
        }
예제 #3
0
        // Token: 0x060001E2 RID: 482 RVA: 0x00007158 File Offset: 0x00005358
        private static object readXml(XmlDocument xml)
        {
            XmlNode node = xml.DocumentElement.ChildNodes[0];

            return((Dictionary <string, object>)Plist.parse(node));
        }