2using System.Collections.Generic;
21 throw new ArgumentNullException(nameof(Xml));
23 List<RssWarning>
Warnings =
new List<RssWarning>();
24 List<RssItem>
Items =
new List<RssItem>();
25 List<RssCategory>
Categories =
new List<RssCategory>();
26 List<IRssExtension>
Extensions =
new List<IRssExtension>();
28 foreach (XmlNode N
in Xml.ChildNodes)
30 if (!(N is XmlElement E))
33 if (E.NamespaceURI == Xml.NamespaceURI)
38 this.Title = E.InnerText;
42 if (Uri.TryCreate(BaseUri, E.InnerText, out Uri
Link))
49 this.Description = E.InnerText;
53 this.Language = E.InnerText;
57 this.Copyright = E.InnerText;
60 case "managingEditor":
61 this.ManagingEditor = E.InnerText;
65 this.WebMaster = E.InnerText;
70 this.PublicationDate = PubDate;
89 this.Generator = E.InnerText;
93 if (Uri.TryCreate(BaseUri, E.InnerText, out Uri
Documentation))
100 if (
int.TryParse(E.InnerText, out
int Ttl))
101 this.TimeToLive = TimeSpan.FromMinutes(Ttl);
107 if (!(this.
Image is
null))
111 this.Image =
new RssImage(E, BaseUri);
123 if (!(this.
Cloud is
null))
126 this.Cloud =
new RssCloud(E, BaseUri);
141 if (Extension is
null)
149 this.Items =
Items.ToArray();
164 public string Title {
get; } =
null;
169 public Uri
Link {
get; } =
null;
240 public TimeSpan
TimeToLive {
get; } = TimeSpan.FromMinutes(60);
Helps with parsing of commong data types.
static bool TryParseRfc822(string s, out DateTimeOffset Value)
Parses a date and time value encoded according to RFC 822, §5.
Static class that dynamically manages types and interfaces available in the runtime environment.