// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Loads the RssMediaScenes object properties with the contents of the parent XElement /// </summary> /// <param name="parEl">Parent XElement</param> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public void Load(XElement parEl) { if (parEl.Name.Namespace == RSS.MEDIA_NS) { IEnumerable <XElement> lst = parEl.Elements(); foreach (XElement el in lst) { switch (el.Name.LocalName) { case TAG_SCENE: RssMediaScene sc = new RssMediaScene(); sc.Load(el); scenes.Add(sc); break; } } } }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Adds a media scene description /// </summary> /// <param name="title">Scene title</param> /// <param name="description">Scene description</param> /// <param name="startTimeInTicks">start time of scene in ticks (timespan)</param> /// <param name="endTimeInTicks">end time of scene in ticks (timespan)</param> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public void AddMediaScene(string title, string description = "", long startTimeInTicks = 0, long endTimeInTicks = 0) { if (MediaScenes == null) { MediaScenes = new RssMediaScenes(); } RssMediaScene s = new RssMediaScene(); s.sceneTitle = title; s.sceneDescription = description; if (startTimeInTicks > 0) { s.sceneStartTime = new TimeSpan(startTimeInTicks); } if (endTimeInTicks > 0) { s.sceneEndTime = new TimeSpan(endTimeInTicks); } MediaScenes.Add(s); }
// ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- /// <summary> /// Adds a RssMediaScene item to the scenes collection /// </summary> /// <param name="scene">RssMediaScene object</param> // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- public void Add(RssMediaScene scene) { scenes.Add(scene); }