/// <summary> /// Parse the section. /// </summary> /// <param name="byteData">The MPEG2 section containing the section.</param> /// <param name="mpeg2Header">The MPEG2 header that preceedes the section.</param> public void Process(byte[] byteData, Mpeg2ExtendedHeader mpeg2Header) { lastIndex = mpeg2Header.Index; protocolVersion = (int)byteData[lastIndex]; lastIndex++; region = new RatingRegion(); region.Process(byteData, lastIndex, mpeg2Header.TableIDExtension & 0xff); Validate(); }
/// <summary> /// Add a new region to the collection. /// </summary> /// <param name="newRegion">The region to be added.</param> public static void AddRegion(RatingRegion newRegion) { foreach (RatingRegion oldRegion in Regions) { if (oldRegion.Region == newRegion.Region) { return; } if (oldRegion.Region > newRegion.Region) { Regions.Insert(Regions.IndexOf(oldRegion), newRegion); return; } } Regions.Add(newRegion); }
/// <summary> /// Add a new region to the collection. /// </summary> /// <param name="newRegion">The region to be added.</param> public static void AddRegion(RatingRegion newRegion) { foreach (RatingRegion oldRegion in Regions) { if (oldRegion.Region == newRegion.Region) return; if (oldRegion.Region > newRegion.Region) { Regions.Insert(Regions.IndexOf(oldRegion), newRegion); return; } } Regions.Add(newRegion); }