Exemplo n.º 1
0
        /// <summary>
        /// parses the current position in the xml reader and fills
        /// the provided GDataEntryBatch property on the entry object
        /// </summary>
        /// <param name="reader">the xmlreader positioned at a batch element</param>
        /// <param name="entry">the atomentry object to fill in</param>
        protected void ParseBatch(XmlReader reader, AtomEntry entry)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            if (entry == null)
            {
                throw new ArgumentNullException("entry");
            }

            if (IsCurrentNameSpace(reader, BaseNameTable.gBatchNamespace))
            {
                object elementName = reader.LocalName;

                if (entry.BatchData == null)
                {
                    entry.BatchData = new GDataBatchEntryData();
                }

                GDataBatchEntryData batch = entry.BatchData;

                if (elementName.Equals(this.nameTable.BatchId))
                {
                    batch.Id = Utilities.DecodedValue(reader.ReadString());
                }
                else if (elementName.Equals(this.nameTable.BatchOperation))
                {
                    batch.Type = ParseOperationType(reader);
                }
                else if (elementName.Equals(this.nameTable.BatchStatus))
                {
                    batch.Status = GDataBatchStatus.ParseBatchStatus(reader, this);
                }
                else if (elementName.Equals(this.nameTable.BatchInterrupt))
                {
                    batch.Interrupt = GDataBatchInterrupt.ParseBatchInterrupt(reader, this);
                }
                else
                {
                    //Tracing.TraceInfo("got an unknown batch element: "  + elementName.ToString());
                    // default extension parsing
                    ParseExtensionElements(reader, entry);
                }
            }
        }