Example #1
0
        /// <summary>
        /// Returns a <see cref="String"/> that represents the <see cref="ValueTuple{T1,T2,T3}"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="String"/> containing the culture-invariant string representations of the
        /// <see cref="Item1"/>, <see cref="Item2"/>, and <see cref="Item3"/> properties.</returns>

        public override string ToString()
        {
            return(String.Format(CultureInfo.InvariantCulture, "({0}, {1}, {2})",
                                 StringUtility.Validate <T1>(Item1),
                                 StringUtility.Validate <T2>(Item2),
                                 StringUtility.Validate <T3>(Item3)));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyValueException"/> class with the
        /// name and value of the property that caused the exception and with the specified error
        /// message.</summary>
        /// <param name="propertyName">
        /// The name of the property that caused the exception.</param>
        /// <param name="actualValue">
        /// The value of the property that caused the exception.</param>
        /// <param name="message">
        /// The error message that specifies the reason for the exception.</param>
        /// <remarks><para>
        /// The following table shows the initial property values for the new instance of <see
        /// cref="PropertyValueException"/>:
        /// </para><list type="table"><listheader>
        /// <term>Property</term><description>Value</description>
        /// </listheader><item>
        /// <term><see cref="Exception.InnerException"/></term>
        /// <description>A null reference.</description>
        /// </item><item>
        /// <term><see cref="ActualValue"/></term>
        /// <description>The specified <paramref name="actualValue"/>.</description>
        /// </item><item>
        /// <term><see cref="Message"/></term>
        /// <description>The specified <paramref name="message"/>, followed by the specified
        /// <paramref name="propertyName"/> and <paramref name="actualValue"/>.</description>
        /// </item><item>
        /// <term><see cref="PropertyName"/></term>
        /// <description>The specified <paramref name="propertyName"/>.</description>
        /// </item></list><para>
        /// If the specified <paramref name="message"/> is a null reference or an empty string, the
        /// <b>Message</b> property will contain a localized message indicating an invalid property
        /// value.</para></remarks>

        public PropertyValueException(string propertyName, object actualValue, string message) :
            base(StringUtility.Validate(message, Strings.PropertyInvalidValue))
        {
            _actualValue  = actualValue;
            _propertyName = propertyName;
        }
Example #3
0
        /// <summary>
        /// Returns a <see cref="String"/> that represents the <see cref="EventArgs{T}"/> object.
        /// </summary>
        /// <returns>
        /// A <see cref="String"/> containing the culture-invariant string representations of the
        /// instance type <typeparamref name="T"/> and of the <see cref="Value"/> property.
        /// </returns>

        public override string ToString()
        {
            return(String.Format(CultureInfo.InvariantCulture,
                                 "EventArgs<{0}> (Value = {1})", typeof(T), StringUtility.Validate <T>(Value)));
        }
Example #4
0
        /// <summary>
        /// Returns a <see cref="String"/> that represents the <see cref="OrdinalString"/>.
        /// </summary>
        /// <returns>
        /// The result of the <see cref="StringUtility.Validate"/> for the value of the <see
        /// cref="Value"/> property.</returns>

        public override string ToString()
        {
            return(StringUtility.Validate(Value));
        }