Beispiel #1
0
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// Adds an item source to the item.  The item source is
        /// where the item initially originated from.
        /// </summary>
        /// <param name="item_source_url">location </param>
        /// <param name="item_source_src"></param>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public void AddSource(string item_source_url, string item_source_src = "")
        {
            RssCoreItemSource objSource = new RssCoreItemSource();

            objSource.source = item_source_src;
            objSource.url    = item_source_url;
            AddSource(objSource);
        }
Beispiel #2
0
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <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
        }
Beispiel #3
0
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a source object
 /// </summary>
 /// <param name="obj"></param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddSource(RssCoreItemSource obj)
 {
     source = obj;
 }