// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssDublinCoreValid properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { const string DFMT = "yyyy-MM-ddTHH:mm:sszzz"; // build string string tmp = ""; string sep = ""; if (start > DateTime.MinValue) { tmp += sep + "start=" + start.ToString(DFMT); sep = ";"; } if (end > DateTime.MinValue) { tmp += sep + "end=" + end.ToString(DFMT); sep = ";"; } if (scheme.Length > 0) { tmp += sep + "scheme=" + scheme; sep = ";"; } XElement parEl = xUtil.CreateNSEl(TAG_PARENT, tmp, RSS.DUBLIN_CORE_TERMS_NS); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets RssMediaLocation object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); if (description.Length > 0) { xUtil.AddAttr(parEl, ATTR_DESCRIPTION, description); } if (start > TimeSpan.MinValue) { xUtil.AddAttr(parEl, ATTR_START, start.ToString("hh\\:mm\\:ss")); } if (end > TimeSpan.MinValue) { xUtil.AddAttr(parEl, ATTR_END, end.ToString("hh\\:mm\\:ss")); } XElement whereEl = xUtil.AddNsEl(parEl, RSS.GEORSS_NS, TAG_WHERE); XElement pointEl = xUtil.AddNsEl(whereEl, RSS.GML_NS, TAG_POINT); string latlong = latitude.ToString("0.0000") + " " + longitude.ToString("0.0000"); XElement posEl = xUtil.AddNsEl(pointEl, RSS.GML_NS, TAG_POS, latlong); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaText object's properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, text, RSS.MEDIA_NS); if (type.Length > 0) { xUtil.AddAttr(parEl, ATTR_TYPE, type); } if (lang.Length > 0) { xUtil.AddAttr(parEl, ATTR_LANG, lang); } if (start > TimeSpan.MinValue) { xUtil.AddAttr(parEl, ATTR_START, start.ToString("hh\\:mm\\:ss\\.fff")); } if (end > TimeSpan.MinValue) { xUtil.AddAttr(parEl, ATTR_END, end.ToString("hh\\:mm\\:ss\\.fff")); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssAtomLink object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.ATOM_NS); xUtil.AddAttr(parEl, ATTR_HREF, href); if (rel.Length > 0) { xUtil.AddAttr(parEl, ATTR_REL, rel); } if (type.Length > 0) { xUtil.AddAttr(parEl, ATTR_TYPE, type); } if (hreflang.Length > 0) { xUtil.AddAttr(parEl, ATTR_HREFLANG, hreflang); } if (title.Length > 0) { xUtil.AddAttr(parEl, ATTR_TITLE, title); } if (length > 0) { xUtil.AddAttr(parEl, ATTR_LENGTH, length); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaPrice object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); if (type.Length > 0) { xUtil.AddAttr(parEl, ATTR_TYPE, type); } if (info.Length > 0) { xUtil.AddAttr(parEl, ATTR_INFO, info); } if (price >= 0M) { xUtil.AddAttr(parEl, ATTR_PRICE, price.ToString("0.00")); } if (currency.Length > 0) { xUtil.AddAttr(parEl, ATTR_CURRENCY, currency); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the content of the RssMediaEmbed object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); if (url.Length > 0) { xUtil.AddAttr(parEl, ATTR_URL, url); } if (width >= 0) { xUtil.AddAttr(parEl, ATTR_WIDTH, width.ToString()); } if (height > 0) { xUtil.AddAttr(parEl, ATTR_HEIGHT, height.ToString()); } for (int i = 0; i < lstParams.Count; i++) { XElement el = xUtil.AddNsEl(parEl, RSS.MEDIA_NS, TAG_PARAM, lstParams[i].Value); xUtil.AddAttr(el, ATTR_NAME, lstParams[i].Key); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaCopyright object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, copyright, RSS.MEDIA_NS); if (url.Length > 0) { xUtil.AddAttr(parEl, ATTR_URL, url); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the properties of the RssMediaRating object as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, rating, RSS.MEDIA_NS); if (scheme.Length > 0) { xUtil.AddAttr(parEl, ATTR_SCHEME, scheme); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the properties of the RssMediaTitle object as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, title, RSS.MEDIA_NS); if (type.Length > 0) { xUtil.AddAttr(parEl, ATTR_TYPE, type); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the properties of the RssMediaHash object as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, hash, RSS.MEDIA_NS); if (algo.Length > 0) { xUtil.AddAttr(parEl, ATTR_ALGO, algo); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaCommunity object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); XElement el = xUtil.CreateNSEl(TAG_STARRATING, RSS.MEDIA_NS); if (starRatingAverage >= 0) { xUtil.AddAttr(el, ATTR_STARRATING_AVERAGE, starRatingAverage.ToString("0.00")); } if (starRatingCount >= 0) { xUtil.AddAttr(el, ATTR_STARRATING_COUNT, starRatingCount.ToString()); } if (starRatingMin >= 0) { xUtil.AddAttr(el, ATTR_STARRATING_MIN, starRatingMin.ToString()); } if (starRatingMax >= 0) { xUtil.AddAttr(el, ATTR_STARRATING_MAX, starRatingMax); } parEl.Add(el); el = xUtil.CreateNSEl(TAG_STATISTICS, RSS.MEDIA_NS); if (statisticsViews >= 0) { xUtil.AddAttr(el, ATTR_STATISTICS_VIEWS, statisticsViews); } if (statisticsFavorites >= 0) { xUtil.AddAttr(el, ATTR_STATISTICS_FAVORITES, statisticsFavorites); } parEl.Add(el); el = xUtil.CreateNSEl(TAG_TAGS, Concatenate(), RSS.MEDIA_NS); parEl.Add(el); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// gets the RssMediaRights object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); if (status.Length > 0) { xUtil.AddAttr(parEl, ATTR_STATUS, status); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaScenes object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); for (int i = 0; i < scenes.Count; i++) { XElement recEl = scenes[i].GetEl(); parEl.Add(recEl); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaComment object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); for (int i = 0; i < comments.Count; i++) { xUtil.AddNsEl(parEl, RSS.MEDIA_NS, TAG_COMMENT, comments[i]); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaResponse object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); for (int i = 0; i < responses.Count; i++) { xUtil.AddNsEl(parEl, RSS.MEDIA_NS, TAG_RESPONSE, responses[i]); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RSSMediaBacklinks object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); for (int i = 0; i < backLinks.Count; i++) { xUtil.AddNsEl(parEl, RSS.MEDIA_NS, TAG_BACKLINK, backLinks[i]); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaRestriction object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, restriction, RSS.MEDIA_NS); xUtil.AddAttr(parEl, ATTR_RELATIONSHIP, relationship); if (type.Length > 0) { xUtil.AddAttr(parEl, ATTR_TYPE, type); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the properties of the RssMediaCategory object as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, category, RSS.MEDIA_NS); if (scheme.Length > 0) { xUtil.AddAttr(parEl, ATTR_SCHEME, scheme); } if (label.Length > 0) { xUtil.AddAttr(parEl, ATTR_LABEL, label); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the media group properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); for (int i = 0; i < mediaContentItems.Count; i++) { mediaContentItems[i].Parent = this; XElement recEl = mediaContentItems[i].GetEl(); parEl.Add(recEl); } mediaOptions.SetEl(parEl); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaStatus object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); if (state.Length > 0) { xUtil.AddAttr(parEl, ATTR_STATE, state); } if (reason.Length > 0) { xUtil.AddAttr(parEl, ATTR_REASON, reason); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaPlayer object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); xUtil.AddAttr(parEl, ATTR_URL, url); if (width > 0) { xUtil.AddAttr(parEl, ATTR_WIDTH, width.ToString()); } if (height > 0) { xUtil.AddAttr(parEl, ATTR_HEIGHT, height.ToString()); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaSubtitle object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); if (type.Length > 0) { xUtil.AddAttr(parEl, ATTR_TYPE, type); } if (lang.Length > 0) { xUtil.AddAttr(parEl, ATTR_LANG, lang); } if (href.Length > 0) { xUtil.AddAttr(parEl, ATTR_HREF, href); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssMediaScene object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); if (sceneTitle.Length > 0) { xUtil.AddNsEl(parEl, RSS.MEDIA_NS, TAG_SCENE_TITLE, sceneTitle); } if (sceneDescription.Length > 0) { xUtil.AddNsEl(parEl, RSS.MEDIA_NS, TAG_SCENE_DESCRIPTION, sceneDescription); } if (sceneStartTime > TimeSpan.MinValue) { xUtil.AddNsEl(parEl, RSS.MEDIA_NS, TAG_SCENE_STARTTIME, sceneStartTime); } if (sceneEndTime > TimeSpan.MinValue) { xUtil.AddNsEl(parEl, RSS.MEDIA_NS, TAG_SCENE_ENDTIME, sceneEndTime); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the properties of the RssMediaThumbnail object as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); xUtil.AddAttr(parEl, ATTR_URL, url); if (width > 0) { xUtil.AddAttr(parEl, ATTR_WIDTH, width.ToString()); } if (height > 0) { xUtil.AddAttr(parEl, ATTR_HEIGHT, height.ToString()); } if (time > TimeSpan.MinValue) { string time_string = time.ToString("hh\\:mm\\:ss\\.fff"); xUtil.AddAttr(parEl, ATTR_TIME, time_string); } return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssContentEncoded object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, encoded, RSS.CONTENT_NS); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// gets the RssMediaLicense object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, license, RSS.CREATIVE_COMMONS_NS); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssDblinCoreCreator properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, creator, RSS.DUBLIN_CORE_NS); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the RssSlashComments object properties as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, comments.ToString(), RSS.SLASH_NS); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the properties of the RssMediaKeywords object as an XElement /// </summary> /// <returns>XElement</returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, Concatenate(), RSS.MEDIA_NS); return(parEl); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Gets the Media Content Properties as an XElement /// </summary> /// <returns></returns> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public XElement GetEl() { XElement parEl = xUtil.CreateNSEl(TAG_PARENT, RSS.MEDIA_NS); if (url.Length > 0) { xUtil.AddAttr(parEl, ATTR_URL, url); } if (fileSize > 0) { xUtil.AddAttr(parEl, ATTR_FILESIZE, fileSize.ToString()); } if (type.Length > 0) { xUtil.AddAttr(parEl, ATTR_TYPE, type); } if (medium.Length > 0) { xUtil.AddAttr(parEl, ATTR_MEDIUM, medium); } if (isDefault) { xUtil.AddAttr(parEl, ATTR_ISDEFAULT, "true"); } if (expression.Length > 0) { xUtil.AddAttr(parEl, ATTR_EXPRESSION, expression); } if (bitrate > 0) { xUtil.AddAttr(parEl, ATTR_BITRATE, bitrate.ToString()); } if (samplingrate > 0.0) { xUtil.AddAttr(parEl, ATTR_SAMPLINGRATE, samplingrate.ToString("0.0")); } if (channels > 0) { xUtil.AddAttr(parEl, ATTR_CHANNELS, channels); } if (duration > 0) { xUtil.AddAttr(parEl, ATTR_DURATION, duration.ToString()); } if (height > 0) { xUtil.AddAttr(parEl, ATTR_HEIGHT, height); } if (width > 0) { xUtil.AddAttr(parEl, ATTR_WIDTH, width); } if (lang.Length > 0) { xUtil.AddAttr(parEl, ATTR_LANG, lang); } mediaOptions.Parent = this; mediaOptions.SetEl(parEl); return(parEl); }