// -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// Loads the RssChannel object properties with the contents of the parent XElement
        /// </summary>
        /// <param name="el"></param>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public new void LoadEl(XElement parEl)
        {
            if (parEl.Name.Namespace == XNamespace.None)
            {
                base.LoadEl(parEl);
            }


            else if (parEl.Name.Namespace == RSS.ATOM_NS)
            {
                switch (parEl.Name.LocalName)
                {
                case RssAtomLink.TAG_PARENT:
                    RssAtomLink AtomLink = new RssAtomLink();
                    AtomLink.Load(parEl);
                    AtomLinks.Add(AtomLink);
                    break;
                }
            }

            else if (parEl.Name.Namespace == RSS.CREATIVE_COMMONS_NS)
            {
                switch (parEl.Name.LocalName)
                {
                case RssCreativeCommonsLicense.TAG_PARENT:
                    CreativeCommonsLicense = new RssCreativeCommonsLicense();
                    CreativeCommonsLicense.Load(parEl);
                    break;
                }
            }
            else if (parEl.Name.Namespace == RSS.MEDIA_NS ||
                     parEl.Name.Namespace == RSS.DUBLIN_CORE_TERMS_NS ||
                     parEl.Name.Namespace == RSS.GEORSS_NS ||
                     parEl.Name.Namespace == RSS.GML_NS)
            {
                mediaOptions.LoadEl(parEl);
            }
        }
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a creative commons license
 /// </summary>
 /// <param name="url"></param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddCreativeCommonsLicense(string url)
 {
     CreativeCommonsLicense         = new RssCreativeCommonsLicense();
     CreativeCommonsLicense.license = url;
 }
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a Creative Commons License to the item
 /// </summary>
 /// <param name="obj"></param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddCreativeCommonsLicense(RssCreativeCommonsLicense obj)
 {
     CreativeCommonsLicense = obj;
 }
Beispiel #4
0
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// Loads the RssItem object from the XElement
        /// </summary>
        /// <param name="el">Current Element</param>
        private new void LoadEl(XElement el)
        {
            // if the el is a core element, load from the base
            if (el.Name.Namespace == XNamespace.None)
            {
                base.LoadEl(el);
            }

            // if the el is in the media namespace or the dublin core terms namespace, load what we know.
            else if (el.Name.Namespace == RSS.MEDIA_NS || el.Name.Namespace == RSS.DUBLIN_CORE_TERMS_NS)
            {
                switch (el.Name.LocalName)
                {
                case RssMediaGroup.TAG_PARENT:
                    RssMediaGroup mediaGroup = new RssMediaGroup(this);
                    mediaGroup.Load(el);
                    mediaGroups.Add(mediaGroup);
                    break;


                case RssMediaContent.TAG_PARENT:
                    RssMediaContent mediaContent = new RssMediaContent(this);
                    mediaContent.Load(el);
                    mediaContentItems.Add(mediaContent);
                    break;


                default:
                    mediaOptions.LoadEl(el);
                    break;
                }
            }

            // if the element is in the DublinCoreNS, load what we know
            else if (el.Name.Namespace == RSS.DUBLIN_CORE_NS)
            {
                switch (el.Name.LocalName)
                {
                case RssDublinCoreCreator.TAG_PARENT:
                    RssDublinCoreCreator creator = new RssDublinCoreCreator();
                    creator.Load(el);
                    creators.Add(creator);
                    break;
                }
            }

            // is the element in the Content Namespace, if so, process it
            else if (el.Name.Namespace == RSS.CONTENT_NS)
            {
                switch (el.Name.LocalName)
                {
                case RssContentEncoded.TAG_PARENT:
                    ContentEncoded = new RssContentEncoded();
                    ContentEncoded.Load(el);
                    break;
                }
            }

            else if (el.Name.Namespace == RSS.SLASH_NS)
            {
                switch (el.Name.LocalName)
                {
                case RssSlashComments.TAG_PARENT:
                    SlashComments = new RssSlashComments();
                    SlashComments.Load(el);
                    break;
                }
            }

            else if (el.Name.Namespace == RSS.CREATIVE_COMMONS_NS)
            {
                switch (el.Name.LocalName)
                {
                case RssCreativeCommonsLicense.TAG_PARENT:
                    CreativeCommonsLicense = new RssCreativeCommonsLicense();
                    CreativeCommonsLicense.Load(el);
                    break;
                }
            }
        }