Пример #1
0
 public TItem(TItem item)
 {
     Link        = new TUri(item.Link);
     Title       = item.Title;
     Description = item.Description;
     PubDate     = item.PubDate;
     Enclosure   = new TEnclosure(item.Enclosure);
     IsRead      = item.IsRead;
 }
Пример #2
0
 public TItem()
 {
     Link        = new TUri();
     Title       = "";
     Description = "";
     PubDate     = DateTime.MinValue;
     Enclosure   = new TEnclosure();
     IsRead      = false;
 }
Пример #3
0
 public TEnclosure(TEnclosure enclosure)
     : this()
 {
     if (enclosure != null)
     {
         Url      = new TUri(enclosure.Url);
         Length   = enclosure.Length;
         Mimetype = enclosure.Mimetype;
     }
 }
Пример #4
0
 public TItem(XElement item)
 {
     Link        = new TUri(item.SafeReadElementValue <string>("link", ""));
     Title       = item.SafeReadElementValue <string>("title", "");
     Description = item.SafeReadElementValue <string>("description", "");
     PubDate     = item.SafeReadElementValue <DateTime>("pubDate", DateTime.MinValue, CultureInfo.InvariantCulture);
     if (item.Attributes().Any(x => x.Name == "isread"))
     {
         IsRead = item.SafeReadAttribute <bool>("isread", false);
     }
     if (item.Elements().Any(x => x.Name == "enclosure"))
     {
         Enclosure = new TEnclosure(item.SafeReadElement("enclosure"));
     }
 }