/// <summary> /// Checks if the given range is a subrange, /// bo.exp. this.Min <= range.Min and range.Max <= this.Max. /// If the range ist not contained an ArgumentOutOfRangeException /// will be raised. </summary> /// <param name="range">The range to be checked.</param> /// <returns>True, if the given range lies within the bounds /// of this range, false otherwise.</returns> public bool ContainsOrFail(PositiveRange range) { if (!((this.Min <= range.Min) && (range.Max <= this.Max))) { throw new System.ArgumentOutOfRangeException( new System.Text.StringBuilder(64).Append(this.ToString()). Append(" does not contain ").Append(range.ToString()).ToString()); } return(true); }
/// <summary> /// Checks if the given range is a subrange, /// bo.exp. this.Min <= range.Min and range.Max <= this.Max. /// If the range ist not contained an ArgumentOutOfRangeException /// will be raised. </summary> /// <param name="range">The range to be checked.</param> /// <returns>True, if the given range lies within the bounds /// of this range, false otherwise.</returns> public bool ContainsOrFail(PositiveRange range) { if (!((this.Min <= range.Min) && (range.Max <= this.Max))) { throw new System.ArgumentOutOfRangeException( new System.Text.StringBuilder(64).Append(this.ToString()). Append(" does not contain ").Append(range.ToString()).ToString()); } return true; }