static SegmentBase LoadSegmentBase(XElement element) { var result = new SegmentBase(); PopulateSegmentBase(element, result); return(result); }
static void PopulateSegmentBase(XElement element, SegmentBase result) { var ns = element.GetDefaultNamespace().NamespaceName; result.Timescale = element.Attribute("timescale").GetNullableUInt(); result.PresentationTimeOffset = element.Attribute("presentationTimeOffset").GetNullableULong(); result.IndexRange = (string)element.Attribute("indexRange"); result.IndexRangeExact = element.Attribute("indexRangeExact").GetNullableBool(); result.AnyAttr.AddRange(element.Attributes()); result.Initialization = element.Elements(XName.Get("Initialisation", ns)).Concat(element.Elements(XName.Get("Initialization", ns))).Select(LoadURL).SingleOrDefault(); result.RepresentationIndex = element.Elements(XName.Get("RepresentationIndex", ns)).Select(LoadURL).SingleOrDefault(); result.Any.AddRange(element.Elements()); }
static SegmentBase LoadSegmentBase(XElement element) { var result = new SegmentBase(); PopulateSegmentBase(element, result); return result; }