Ejemplo n.º 1
0
        private PlaylistConfirmation ParsePlaylistConfirmation()
        {
            PlaylistConfirmation confirmation = new PlaylistConfirmation();
            string name;

            /* Go to next element and check if it is a start element. */
            this.Next();
            while (this.reader.IsStartElement())
            {
                name = this.reader.LocalName;

                if (name.Equals("rid"))
                {
                    this.GetElementString(); /* Skip. */
                }
                else if (name.Equals("version"))
                {
                    string[] parts = this.GetElementString().Split(',');

                    confirmation.Revision      = long.Parse(parts[0]);
                    confirmation.Checksum      = long.Parse(parts[2]);
                    confirmation.Collaborative = (int.Parse(parts[3]) == 1);
                }
                else
                {
                    throw new XMLParserException("Unexpected element '<" + name + ">'");
                }

                this.Next();
            }

            return(confirmation);
        }
Ejemplo n.º 2
0
        private PlaylistConfirmation ParsePlaylistConfirmation()
        {
            PlaylistConfirmation confirmation = new PlaylistConfirmation();
            string name;

            /* Go to next element and check if it is a start element. */
            this.Next();
            while (this.reader.IsStartElement())
            {
                name = this.reader.LocalName;

                if (name.Equals("rid"))
                {
                    this.GetElementString(); /* Skip. */
                }
                else if (name.Equals("version"))
                {
                    string[] parts = this.GetElementString().Split(',');

                    confirmation.Revision = long.Parse(parts[0]);
                    confirmation.Checksum = long.Parse(parts[2]);
                    confirmation.Collaborative = (int.Parse(parts[3]) == 1);
                }
                else
                    throw new XMLParserException("Unexpected element '<" + name + ">'");

                this.Next();
            }

            return confirmation;
        }