Beispiel #1
0
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a skip hours object to the channel
 /// </summary>
 /// <param name="obj">RssCoreChannelSkipHours</param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddSkipHours(RssCoreChannelSkipHours obj)
 {
     skipHours = obj;
 }
Beispiel #2
0
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// Sets the property based upon the tag name of the provided XElement
        /// </summary>
        /// <param name="el">XElement</param>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public void LoadEl(XElement el)
        {
            RssRfc822DateTimeConverter dtConvert = new RssRfc822DateTimeConverter();

            if (el.Name.Namespace == XNamespace.None)
            {
                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_LANGUAGE:
                    language = xUtil.GetStr(el);
                    break;

                case TAG_COPYRIGHT:
                    copyright = xUtil.GetStr(el);
                    break;

                case TAG_MANAGINGEDITOR:
                    managingEditor = xUtil.GetStr(el);
                    break;

                case TAG_WEBMASTER:
                    webMaster = xUtil.GetStr(el);
                    break;

                case TAG_PUBDATE:
                    pubDate = dtConvert.ParseRfc822(xUtil.GetStr(el));
                    break;

                case TAG_LASTBUILDDATE:
                    lastBuildDate = dtConvert.ParseRfc822(xUtil.GetStr(el));
                    break;

                case TAG_CATEGORY:
                    RssCoreChannelCategory ctg = new RssCoreChannelCategory();
                    ctg.Load(el);
                    categories.Add(ctg);
                    break;

                case TAG_GENERATOR:
                    generator = xUtil.GetStr(el);
                    break;

                case TAG_DOCS:
                    docs = xUtil.GetStr(el);
                    break;

                case TAG_CLOUD:
                    RssCoreChannelCloud c = new RssCoreChannelCloud();
                    c.Load(el);
                    cloud.Add(c);
                    break;

                case TAG_TTL:
                    ttl = xUtil.GetInt(el);
                    break;

                case TAG_IMAGE:
                    image = new RssCoreChannelImage();
                    image.Load(el);
                    break;

                case TAG_TEXTINPUT:
                    textInput = new RssCoreChannelTextInput();
                    textInput.Load(el);
                    break;

                case TAG_SKIPHOURS:
                    skipHours = new RssCoreChannelSkipHours();
                    skipHours.Load(el);
                    break;

                case TAG_SKIPDAYS:
                    skipDays = new RssCoreChannelSkipDays();
                    skipDays.Load(el);
                    break;
                } // end switch
            }     // end if namespace
        }