예제 #1
0
        // Exceptions:
        //   System.ArgumentNullException:
        //     The source was provided as null.
        //
        //   System.ArgumentException:
        //     The source was not null, but was not of the expected System.String type.
        /// <summary>
        /// Converts the specified value to the System.Windows.PropertyPath type.
        /// </summary>
        /// <param name="context">An System.ComponentModel.ITypeDescriptorContext that provides a format context.</param>
        /// <param name="culture">The System.Globalization.CultureInfo to use as the current culture.</param>
        /// <param name="value">
        /// The object to convert to a System.Windows.PropertyPath. This is expected
        /// to be a string.
        /// </param>
        /// <returns>The converted System.Windows.PropertyPath.</returns>
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            if (value == null)
            {
                throw GetConvertFromException(value);
            }

            if (value is string)
            {
                return(PropertyPath.INTERNAL_ConvertFromString((string)value));
            }

            return(base.ConvertFrom(context, culture, value));
        }