Exemplo n.º 1
0
        PlistDictionary LoadDictionaryContents(XmlReader reader, PlistDictionary dict)
        {
            Debug.Assert(reader.NodeType == XmlNodeType.Element && reader.LocalName == "key");
            while (!reader.EOF && reader.NodeType == XmlNodeType.Element)
            {
                //string key = reader.ReadElementString ();
                string key = reader.ReadElementContentAsString();
                while (reader.NodeType != XmlNodeType.Element && reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.EndElement)
                    {
                        throw new Exception(String.Format("No value found for key {0}", key));
                    }
                }
                PlistObjectBase result = LoadFromNode(reader);
                if (result != null)
                {
                    dict.Add(key, result);
                }

                // when there is no whitespace between nodes, we might already be at
                // the next key element, so reading to next sibling would jump over
                // the next (current) key element
                if (!"key".Equals(reader.Name))
                {
                    reader.ReadToNextSibling("key");
                }
            }
            return(dict);
        }
Exemplo n.º 2
0
 public PlistDocument(PlistObjectBase root)
 {
     this.Root = root;
 }