public ContentRange(RangeUnit unit, ContentSubRange range, InstanceLength instanceLength) { if (unit == null) { throw new ArgumentNullException("unit"); } if (range == null) { throw new ArgumentNullException("range"); } if (instanceLength == null) { throw new ArgumentNullException("instanceLength"); } this.unit = unit; this.range = range; this.instanceLength = instanceLength; }
public Range(RangeUnit unit, params SubRange[] ranges) { if (unit == null) { throw new ArgumentNullException("unit"); } if (ranges == null) { throw new ArgumentNullException("ranges"); } if (!ranges.Any()) { throw new ArgumentException("ranges cannot be empty", "ranges"); } if (ranges.Any(r => r == null)) { throw new ArgumentException("ranges cannot contain null elements", "ranges"); } this.unit = unit; this.ranges = ranges.ToArray(); }