// -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a media embed parameter
 /// </summary>
 /// <param name="key">Embedded Resource Parameter Key</param>
 /// <param name="value">Embedded Resource Parameter Value</param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddMediaEmbeddedResourceParameter(string key, string value)
 {
     if (MediaEmbed == null)
     {
         MediaEmbed = new RssMediaEmbed();
     }
     MediaEmbed.Add(key, value);
 }
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds an Embedded Resource (media player, etc) to the media options
 /// </summary>
 /// <param name="url">Media Player url location</param>
 /// <param name="width">Media Player Width</param>
 /// <param name="height">Media Player Height</param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddMediaEmbeddedResource(string url, int width = 0, int height = 0)
 {
     if (MediaEmbed == null)
     {
         MediaEmbed = new RssMediaEmbed();
     }
     MediaEmbed.url    = url;
     MediaEmbed.width  = width;
     MediaEmbed.height = height;
 }
示例#3
0
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a media embed object
 /// </summary>
 /// <param name="obj"></param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddMediaEmbed(RssMediaEmbed obj)
 {
     mediaOptions.AddMediaEmbed(obj);
 }
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a media embed object
 /// </summary>
 /// <param name="obj">RssMediaEmbed object</param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddMediaEmbed(RssMediaEmbed obj)
 {
     MediaEmbed = obj;
 }
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// This loads property of the RssMediaExtension object with the contents of the
        /// XElement
        /// </summary>
        /// <param name="el">Parent XElement</param>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public void LoadEl(XElement el)
        {
            // process this switch only if element is in the media namespace


            if (el.Name.Namespace == RSS.MEDIA_NS)
            {
                switch (el.Name.LocalName)
                {
                case RssMediaRating.TAG_PARENT:
                    RssMediaRating rating = new RssMediaRating();
                    rating.Load(el);
                    MediaRatings.Add(rating);
                    break;

                case RssMediaTitle.TAG_PARENT:
                    MediaTitle = new RssMediaTitle();
                    MediaTitle.Load(el);
                    break;

                case RssMediaDescription.TAG_PARENT:
                    MediaDescription = new RssMediaDescription();
                    MediaDescription.Load(el);
                    break;

                case RssMediaKeywords.TAG_PARENT:
                    MediaKeywords = new RssMediaKeywords();
                    MediaKeywords.Load(el);
                    break;

                case RssMediaThumbnail.TAG_PARENT:
                    RssMediaThumbnail thumb = new RssMediaThumbnail(this);
                    thumb.Load(el);
                    MediaThumbnails.Add(thumb);
                    break;

                case RssMediaCategory.TAG_PARENT:
                    RssMediaCategory MediaCategory = new RssMediaCategory();
                    MediaCategory.Load(el);
                    MediaCategories.Add(MediaCategory);
                    break;

                case RssMediaHash.TAG_PARENT:
                    RssMediaHash hash = new RssMediaHash();
                    hash.Load(el);
                    MediaHashes.Add(hash);
                    break;

                case RssMediaPlayer.TAG_PARENT:
                    MediaPlayer = new RssMediaPlayer();
                    MediaPlayer.Load(el);
                    break;

                case RssMediaCredit.TAG_PARENT:
                    RssMediaCredit credit = new RssMediaCredit();
                    credit.Load(el);
                    MediaCredits.Add(credit);
                    break;

                case RssMediaCopyright.TAG_PARENT:
                    MediaCopyright = new RssMediaCopyright();
                    MediaCopyright.Load(el);
                    break;

                case RssMediaText.TAG_PARENT:
                    RssMediaText txt = new RssMediaText();
                    txt.Load(el);
                    MediaTexts.Add(txt);
                    break;

                case RssMediaRestriction.TAG_PARENT:
                    RssMediaRestriction restriction = new RssMediaRestriction();
                    restriction.Load(el);
                    MediaRestrictions.Add(restriction);
                    break;

                case RssMediaCommunity.TAG_PARENT:
                    MediaCommunity = new RssMediaCommunity();
                    MediaCommunity.Load(el);
                    break;

                case RssMediaComments.TAG_PARENT:
                    MediaComments = new RssMediaComments();
                    MediaComments.Load(el);
                    break;

                case RssMediaEmbed.TAG_PARENT:
                    MediaEmbed = new RssMediaEmbed();
                    MediaEmbed.Load(el);
                    break;

                case RssMediaResponses.TAG_PARENT:
                    MediaResponses = new RssMediaResponses();
                    MediaResponses.Load(el);
                    break;

                case RssMediaBacklinks.TAG_PARENT:
                    MediaBacklinks = new RssMediaBacklinks();
                    MediaBacklinks.Load(el);
                    break;


                case RssMediaStatus.TAG_PARENT:
                    MediaStatus = new RssMediaStatus();
                    MediaStatus.Load(el);
                    break;

                case RssMediaPrice.TAG_PARENT:
                    RssMediaPrice price = new RssMediaPrice();
                    price.Load(el);
                    MediaPrices.Add(price);
                    break;

                case RssMediaLicense.TAG_PARENT:
                    MediaLicense = new RssMediaLicense();
                    MediaLicense.Load(el);
                    break;

                case RssMediaSubtitle.TAG_PARENT:
                    RssMediaSubtitle subtitle = new RssMediaSubtitle();
                    subtitle.Load(el);
                    MediaSubtitles.Add(subtitle);
                    break;

                case RssMediaPeerLink.TAG_PARENT:
                    MediaPeerLink = new RssMediaPeerLink();
                    MediaPeerLink.Load(el);
                    break;

                case RssMediaRights.TAG_PARENT:
                    MediaRights = new RssMediaRights();
                    MediaRights.Load(el);
                    break;

                case RssMediaScenes.TAG_PARENT:
                    MediaScenes = new RssMediaScenes();
                    MediaScenes.Load(el);
                    break;

                case RssMediaLocation.TAG_PARENT:
                    RssMediaLocation mediaLocation = new RssMediaLocation();
                    mediaLocation.Load(el);
                    MediaLocations.Add(mediaLocation);
                    break;
                }
            }


            // Dublin core terms namespace
            else if (el.Name.Namespace == RSS.DUBLIN_CORE_TERMS_NS)
            {
                switch (el.Name.LocalName)
                {
                case RssDublinCoreValid.TAG_PARENT:
                    MediaValid = new RssDublinCoreValid();
                    MediaValid.Load(el);
                    break;
                }
            }

            else if (el.Name.Namespace == RSS.GEORSS_NS)
            {
            }

            else if (el.Name.Namespace == RSS.GML_NS)
            {
            }
        }