Beispiel #1
0
        /// <summary>
        /// Creates a string representation of this object based on the format string
        /// and IFormatProvider passed in.
        /// If the provider is null, the CurrentCulture is used.
        /// See the documentation for IFormattable for more information.
        /// </summary>
        /// <returns>
        /// A string representation of this object.
        /// </returns>
        private string ConvertToString(string format, IFormatProvider provider)
        {
            string convertedValue;

            if (!FontWeights.FontWeightToString(RealWeight, out convertedValue))
            {
                // This can happen if _weight value is not a multiple of 100.
                return(RealWeight.ToString(provider));
            }
            return(convertedValue);
        }