// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <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 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 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 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 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 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); }