// -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 /// <summary>
 /// Adds a media keyword to the item
 /// </summary>
 /// <param name="keyword">key word</param>
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 public void AddMediaKeyword(string keyword)
 {
     if (MediaKeywords == null)
     {
         MediaKeywords = new RssMediaKeywords();
     }
     MediaKeywords.Add(keyword);
 }
        private void Ok_Click(object sender, System.EventArgs e)
        {
            Album acc = new Album();

            acc.Title   = this.AlbumName.Text;
            acc.Summary = this.AlbumDescription.Text;
            if (this.AlbumLocation.Text.Length > 0)
            {
                acc.Location = this.AlbumLocation.Text;
            }
            if (this.AlbumKeywords.Text.Length > 0)
            {
                acc.PicasaEntry.Media = new MediaGroup();
                MediaKeywords keywords = new MediaKeywords(this.AlbumKeywords.Text);
                acc.PicasaEntry.Media.Keywords = keywords;
            }
            acc.Access            = this.AlbumPublic.Checked ? "public" : "private";
            acc.CommentingEnabled = this.AllowComments.Checked;

            this.newEntry = this.service.Insert(this.feed, acc.PicasaEntry);
            this.Close();
        }
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        /// <summary>
        /// Sets the parent XElement with the contents of the RssMediaExtension object
        /// properties
        /// </summary>
        /// <param name="parEl">Parent element</param>
        // -------------------------------------------------------------------------------
        // -------------------------------------------------------------------------------
        public void SetEl(XElement parEl)
        {
            for (int i = 0; i < MediaRatings.Count; i++)
            {
                parEl.Add(MediaRatings[i].GetEl());
            }

            if (MediaTitle != null)
            {
                parEl.Add(MediaTitle.GetEl());
            }

            if (MediaDescription != null)
            {
                parEl.Add(MediaDescription.GetEl());
            }

            if (MediaKeywords != null)
            {
                parEl.Add(MediaKeywords.GetEl());
            }

            if (MediaThumbnails.Count > 0)
            {
                for (int i = 0; i < MediaThumbnails.Count; i++)
                {
                    parEl.Add(MediaThumbnails[i].GetEl());
                }
            }

            if (MediaCategories.Count > 0)
            {
                for (int i = 0; i < MediaCategories.Count; i++)
                {
                    parEl.Add(MediaCategories[i].GetEl());
                }
            }

            if (MediaHashes.Count > 0)
            {
                for (int i = 0; i < MediaHashes.Count; i++)
                {
                    parEl.Add(MediaHashes[i].GetEl());
                }
            }

            if (MediaPlayer != null)
            {
                parEl.Add(MediaPlayer.GetEl());
            }

            if (MediaCredits.Count > 0)
            {
                for (int i = 0; i < MediaCredits.Count; i++)
                {
                    parEl.Add(MediaCredits[i].GetEl());
                }
            }

            if (MediaCopyright != null)
            {
                parEl.Add(MediaCopyright.GetEl());
            }

            if (MediaTexts.Count > 0)
            {
                // sort the list
                MediaTexts.Sort(new SortMediaText());

                // now iterate
                for (int i = 0; i < MediaTexts.Count; i++)
                {
                    parEl.Add(MediaTexts[i].GetEl());
                }
            }


            if (MediaRestrictions.Count > 0)
            {
                for (int i = 0; i < MediaRestrictions.Count; i++)
                {
                    parEl.Add(MediaRestrictions[i].GetEl());
                }
            }


            if (MediaCommunity != null)
            {
                parEl.Add(MediaCommunity.GetEl());
            }

            if (MediaComments != null)
            {
                parEl.Add(MediaComments.GetEl());
            }


            if (MediaEmbed != null)
            {
                parEl.Add(MediaEmbed.GetEl());
            }

            if (MediaResponses != null)
            {
                parEl.Add(MediaResponses.GetEl());
            }

            if (MediaBacklinks != null)
            {
                parEl.Add(MediaBacklinks.GetEl());
            }

            if (MediaStatus != null)
            {
                parEl.Add(MediaStatus.GetEl());
            }

            if (MediaPrices.Count > 0)
            {
                for (int i = 0; i < MediaPrices.Count; i++)
                {
                    parEl.Add(MediaPrices[i].GetEl());
                }
            }

            if (MediaLicense != null)
            {
                parEl.Add(MediaLicense.GetEl());
            }

            if (MediaSubtitles.Count > 0)
            {
                for (int i = 0; i < MediaSubtitles.Count; i++)
                {
                    parEl.Add(MediaSubtitles[i].GetEl());
                }
            }

            if (MediaPeerLink != null)
            {
                parEl.Add(MediaPeerLink.GetEl());
            }

            if (MediaRights != null)
            {
                parEl.Add(MediaRights.GetEl());
            }

            if (MediaScenes != null)
            {
                parEl.Add(MediaScenes.GetEl());
            }

            if (MediaLocations.Count > 0)
            {
                for (int i = 0; i < MediaLocations.Count; i++)
                {
                    parEl.Add(MediaLocations[i].GetEl());
                }
            }

            if (MediaValid != null)
            {
                parEl.Add(MediaValid.GetEl());
            }
        }