示例#1
0
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// Adds a globally unique identifier to the item
        /// </summary>
        /// <param name="guid_string">The Globally Unique ID (GUID)</param>
        /// <param name="isPermalink">Flag indicating whether GUID is a permalink</param>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public void AddGuid(string guid_string, bool isPermalink = false)
        {
            RssCoreItemGuid guidObj = new RssCoreItemGuid();

            guidObj.guid        = guid_string;
            guidObj.isPermalink = isPermalink;
            AddGuid(guidObj);
        }
示例#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
        }
示例#3
0
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a guid object to the item
 /// </summary>
 /// <param name="item_guid"></param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddGuid(RssCoreItemGuid item_guid)
 {
     guid = item_guid;
 }