// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Adds a category to the item /// </summary> /// <param name="item_category">category</param> /// <param name="item_category domain">category domain</param> /// <returns>bool (True if added, False if not added)</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public void AddCategory(string item_category, string item_category_domain = "") { RssCoreItemCategory obj = new RssCoreItemCategory(); obj.category = item_category; obj.domain = item_category_domain; categories.Add(obj); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Loads the properties of the RssCoreItem class with the contents of the parent element /// </summary> /// <param name="el">XElement</param> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public void LoadEl(XElement el) { RssRfc822DateTimeConverter dtConvert = new RssRfc822DateTimeConverter(); switch (el.Name.LocalName) { case TAG_TITLE: title = xUtil.GetStr(el); break; case TAG_LINK: link = xUtil.GetStr(el); break; case TAG_DESCRIPTION: description = xUtil.GetStr(el); break; case TAG_AUTHOR: author = xUtil.GetStr(el); break; case TAG_CATEGORY: RssCoreItemCategory ctg = new RssCoreItemCategory(); ctg.Load(el); categories.Add(ctg); break; case TAG_COMMENTS: comments = xUtil.GetStr(el); break; case TAG_ENCLOSURE: RssCoreItemEnclosure enc = new RssCoreItemEnclosure(); enc.Load(el); enclosures.Add(enc); break; case TAG_GUID: guid = new RssCoreItemGuid(); guid.Load(el); break; case TAG_PUBDATE: pubDate = dtConvert.ParseRfc822(xUtil.GetStr(el)); break; case TAG_SOURCE: source = new RssCoreItemSource(); source.Load(el); break; } // end switch }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Adds a category to the item /// </summary> /// <param name="obj"></param> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public void AddCategory(RssCoreItemCategory obj) { categories.Add(obj); }