ToString() public method

Represents the range as a string, formatted as "[Min,Max]".
public ToString ( ) : string
return string
示例#1
0
        /// <summary>
        /// Checks if the given range is a subrange,
        /// bo.exp.  this.Min &lt;= range.Min and range.Max &lt;= 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 &lt;= range.Min and range.Max &lt;= 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;
        }