Beispiel #1
0
 public void ReadValueArrayEnd(XmlArrayReader aReader)
 {
     Assert.Check(!iEndOfDict && iCurrentDictReader == null && iCurrentArrayReader != null);
     Assert.Check(aReader.EndOfArray);
     Assert.Check(aReader == iCurrentArrayReader);
     iCurrentArrayReader = null;
     SkipToNextKey();
 }
Beispiel #2
0
        public XmlArrayReader ReadValueArrayBegin()
        {
            Assert.Check(!iEndOfDict && iCurrentDictReader == null && iCurrentArrayReader == null);
            if (iReader.Name != "array")
            {
                throw new Error();
            }

            iCurrentArrayReader = new XmlArrayReader(iReader);
            return(iCurrentArrayReader);
        }
Beispiel #3
0
        private LibraryPlaylist ReadPlaylist(XmlDictReader aReader)
        {
            LibraryPlaylist playlist = new LibraryPlaylist();

            while (!aReader.EndOfDict)
            {
                string propKey = aReader.ReadKey();

                if (propKey == "Name")
                {
                    playlist.Name = aReader.ReadValueString();
                }
                else if (propKey == "Playlist ID")
                {
                    playlist.Id = aReader.ReadValueLong();
                }
                else if (propKey == "Playlist Persistent ID")
                {
                    playlist.PersistentId = aReader.ReadValueString();
                }
                else if (propKey == "Visible")
                {
                    playlist.IsVisible = aReader.ReadValueBool();
                }
                else if (propKey == "Distinguished Kind")
                {
                    playlist.DistinguishedKind = aReader.ReadValueLong();
                }
                else if (propKey == "Smart Info" ||
                         propKey == "Smart Criteria")
                {
                    playlist.IsSmart = true;
                    aReader.SkipValue();
                }
                else if (propKey == "Playlist Items")
                {
                    XmlArrayReader itemListReader = aReader.ReadValueArrayBegin();
                    while (!itemListReader.EndOfArray)
                    {
                        XmlDictReader itemReader = itemListReader.ReadValueDictBegin();
                        itemReader.ReadKey();
                        playlist.Items.Add(itemReader.ReadValueLong());
                        itemListReader.ReadValueDictEnd(itemReader);
                    }
                    aReader.ReadValueArrayEnd(itemListReader);
                }
                else
                {
                    aReader.SkipValue();
                }
            }

            return(playlist);
        }