Exemplo n.º 1
0
 internal void AddSource(AtomFeedBase source)
 {
     _source.Add(source);
 }
Exemplo n.º 2
0
        private static void VisitLogoElement(XmlReader reader, AtomFeedBase feed)
        {
            if (reader.IsEmptyElement)
                return;

            while (reader.Read())
            {
                if (reader.Name.Equals("logo") && reader.NodeType == XmlNodeType.EndElement)
                    break;

                if (reader.NodeType != XmlNodeType.Text)
                    continue;

                Uri u;
                Uri.TryCreate(reader.Value, UriKind.Absolute, out u);
                feed.AddLogo(u);
            }
        }
Exemplo n.º 3
0
        private static void VisitSourceElement(XmlReader reader, AtomEntry entry)
        {
            if (reader.IsEmptyElement)
                return;

            var source = new AtomFeedBase();

            while (reader.Read())
            {
                if (reader.Name.Equals("source") && reader.NodeType == XmlNodeType.EndElement)
                    break;

                TryReadCommonProperties(reader, source);
            }

            entry.AddSource(source);
        }
Exemplo n.º 4
0
        private static void VisitGeneratorElement(XmlReader reader, AtomFeedBase feed)
        {
            Uri uri;
            Uri.TryCreate(reader.GetAttribute("uri"), UriKind.Absolute, out uri);
            Single version;
            Single.TryParse(reader.GetAttribute("version"), out version);

            feed.Generator = new AtomGenerator
                {
                    Version = version,
                    Uri = uri
                };

            if (reader.IsEmptyElement)
                return;

            while (reader.Read())
            {
                if (reader.Name.Equals("generator") && reader.NodeType == XmlNodeType.EndElement)
                    break;

                if (reader.NodeType == XmlNodeType.Text)
                    feed.Generator.Value = reader.Value;
            }
        }