// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Adds a location to the media item /// </summary> /// <param name="description">descripton of the location</param> /// <param name="startTimeInTicks">start time in TICKS</param> /// <param name="endTimeInTicks">end time in TICKS</param> /// <param name="latitude">latitude</param> /// <param name="longitude">longitude</param> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public void AddMediaLocation(string description, long startTimeInTicks = 0, long endTimeInTicks = 0, double latitude = 0.0, double longitude = 0.0) { RssMediaLocation mediaLocation = new RssMediaLocation(); mediaLocation.description = description; if (startTimeInTicks != 0) { mediaLocation.start = new TimeSpan(startTimeInTicks); } if (endTimeInTicks != 0) { mediaLocation.end = new TimeSpan(endTimeInTicks); } mediaLocation.latitude = latitude; mediaLocation.longitude = longitude; MediaLocations.Add(mediaLocation); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Adds a media location object /// </summary> /// <param name="obj">RssMediaLocation object</param> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public void AddMediaLocation(RssMediaLocation obj) { MediaLocations.Add(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) { } }