public override void AddSubElement(ScheduleElement element) { if (element.ElementType == ScheduleElementType.Impression) { base.AddSubElement(element); } else { throw new NotSupportedNestingException(this, element); } }
public override void AddSubElement(ScheduleElement element) { if (element.ElementType == ScheduleElementType.ProgramPart || element.ElementType == ScheduleElementType.Break) { base.AddSubElement(element); } else { throw new NotSupportedNestingException(this, element); } }
public virtual void AddSubElement(ScheduleElement element) { if (!IsContainter) { throw new NotAContainerException(this); } if (_subElements.Count == 0) { element.StartOffset = TimeValue.Zero; element.Position = 0; } else { element.StartOffset = _subElements[_subElements.Count - 1].EndOffset; element.Position = _subElements[_subElements.Count - 1].Position + 1; } element.ParentID = this.ID; _subElements.Add(element); }
public ScheduleElement(int id, ScheduleElementType type, TimeValue offset, TimeValue duration, bool isContainter, int position = 0, string externalID = null, ScheduleElement parentElement = null, int?parentID = null, ScheduleElement[] subElements = null) { this.ID = id; this.ElementType = type; this.StartOffset = offset; this.Duration = duration; this.IsContainter = isContainter; this.Position = position; this.ExternalID = externalID; this.ParentID = (parentElement == null) ? parentID : (int?)parentElement.ID; this.Parent = parentElement; if (isContainter) { _subElements = new List <ScheduleElement>(); if (subElements != null) { AddSubElement(subElements); } } }
public ProgramPart(int id, TimeValue offset, TimeValue duration, int position = 0, string externalID = null, ScheduleElement parentElement = null, int?parentID = null) : base(id, ScheduleElementType.ProgramPart, offset, duration, false, position, externalID, parentElement, parentID) { }
public ScheduleAvail(int id, SchduleAvailType availType, TimeValue offset, TimeValue duration, int position = 0, string externalID = null, ScheduleElement parentElement = null, int?parentID = null) : base(id, ScheduleElementType.Avail, offset, duration, true, position, externalID, parentElement, parentID) { this.AvailType = availType; }
public ScheduleBreak(int id, TimeValue offset, TimeValue duration, int position = 0, string externalID = null, ScheduleElement parentElement = null, int?parentID = null, ScheduleAvail[] subElements = null) : base(id, ScheduleElementType.Break, offset, duration, true, position, externalID, parentElement, parentID, subElements) { }