protected static bool TryParseElement(XmlReader reader, ResourceCollectionInfo collection, string version)
 {
     if (collection == null)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("collection");
     }
     return(collection.TryParseElement(reader, version));
 }
示例#2
0
        protected static bool TryParseElement(XmlReader reader, ResourceCollectionInfo collection, string version)
        {
            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }

            return(collection.TryParseElement(XmlReaderWrapper.CreateFromReader(reader), version));
        }
示例#3
0
        protected internal virtual bool TryParseElement(XmlReader reader, string version)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            reader.MoveToContent();
            if (reader.LocalName != "workspace" || reader.NamespaceURI != version)
            {
                return(false);
            }

            bool isEmpty = reader.IsEmptyElement;

            reader.ReadStartElement();
            if (isEmpty)
            {
                return(true);
            }

            for (reader.MoveToContent(); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent())
            {
                if (reader.LocalName == "title" && reader.NamespaceURI == Namespaces.Atom10)
                {
                    Title = Atom10FeedFormatter.ReadTextSyndicationContent(reader);
                    continue;
                }
                else if (reader.LocalName == "collection" && reader.NamespaceURI == version)
                {
                    var rc = new ResourceCollectionInfo();
                    if (rc.TryParseElement(reader, version))
                    {
                        Collections.Add(rc);
                        continue;
                    }
                }
                ElementExtensions.Add(new SyndicationElementExtension(reader));
            }
            return(true);
        }
示例#4
0
        protected internal virtual bool TryParseElement(XmlReader reader, string version)
        {
            if (reader == null)
                throw new ArgumentNullException ("reader");

            reader.MoveToContent ();
            if (reader.LocalName != "workspace" || reader.NamespaceURI != version)
                return false;

            bool isEmpty = reader.IsEmptyElement;

            reader.ReadStartElement ();
            if (isEmpty)
                return true;

            for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
                if (reader.LocalName == "title" && reader.NamespaceURI == Namespaces.Atom10) {
                    Title = Atom10FeedFormatter.ReadTextSyndicationContent (reader);
                    continue;
                } else if (reader.LocalName == "collection" && reader.NamespaceURI == version) {
                    var rc = new ResourceCollectionInfo ();
                    if (rc.TryParseElement (reader, version)) {
                        Collections.Add (rc);
                        continue;
                    }
                }
                ElementExtensions.Add (new SyndicationElementExtension (reader));
            }
            return true;
        }
示例#5
0
 protected static bool TryParseElement(XmlReader reader, ResourceCollectionInfo collection, string version)
 {
     return(collection.TryParseElement(reader, version));
 }
 protected static bool TryParseElement(XmlReader reader, ResourceCollectionInfo collection, string version)
 {
     return collection.TryParseElement (reader, version);
 }
 protected static bool TryParseElement(XmlReader reader, ResourceCollectionInfo collection, string version)
 {
     if (collection == null)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("collection");
     }
     return collection.TryParseElement(reader, version);
 }