public MetaData Read(XmlStreamReader inputStream)
        {
            MetaData metaData;

            if (inputStream.SeekFromEnd(string.Format("<c type=\"{0}\"", typeof(MetaData).FullName)))
            {
                using (var nodeReader = new XmlElementReaderFactory(inputStream).Create())
                {
                    metaData = (MetaData)objectReader.Get(nodeReader);
                }
            }
            else
            {
                throw new UnableToReadXMLTextException("Missing metadata.");
            }

            return(metaData);
        }
Exemple #2
0
        public Payload Read(XmlStreamReader inputStream)
        {
            Payload payload;

            inputStream.Seek(0, SeekOrigin.Begin);
            if (inputStream.Seek("<c type=\"!0\""))
            {
                using (var nodeReader = new XmlElementReaderFactory(inputStream).Create())
                {
                    payload = (Payload)objectReader.Get(nodeReader);
                }
            }
            else
            {
                throw new UnableToReadXMLTextException("Missing payload.");
            }

            return(payload);
        }
 public NXmlElementReader(XmlStreamReader inputStream, NXmlNodeAttributes attributes, string name)
 {
     this.inputStream = inputStream;
     Attributes       = attributes;
     Name             = name;
 }
 public XmlElementReaderFactory(XmlStreamReader inputStream)
 {
     this.inputStream = inputStream;
 }