/// <summary> /// Converts the value to the given Type using the current CultureInfo and the given <see cref="ConversionOptions">ConversionOptions</see>. /// A return value indicates whether the operation succeeded. /// </summary> /// <typeparam name="T">The Type to which the given value is converted.</typeparam> /// <param name="value">The value which is converted.</param> /// <param name="result">An Object instance of type <typeparamref name="T">T</typeparamref> whose value is equivalent to the given <paramref name="value">value</paramref> if the operation succeeded.</param> /// <param name="options">The options which are used for conversion.</param> /// <returns>true if <paramref name="value"/> was converted successfully; otherwise, false.</returns> public static bool TryConvertTo <T>(this object value, out T result, ConversionOptions options) { return(UniversalTypeConverter.TryConvertTo(value, out result, options)); }
/// <summary> /// Converts the value to the given Type using the given CultureInfo and the <see cref="ConversionOptions">ConversionOptions</see>.<see cref="ConversionOptions.EnhancedTypicalValues">ConvertSpecialValues</see>. /// A return value indicates whether the operation succeeded. /// </summary> /// <typeparam name="T">The Type to which the given value is converted.</typeparam> /// <param name="value">The value which is converted.</param> /// <param name="result">An Object instance of type <typeparamref name="T">T</typeparamref> whose value is equivalent to the given <paramref name="value">value</paramref> if the operation succeeded.</param> /// <param name="culture">The CultureInfo to use as the current culture.</param> /// <returns>true if <paramref name="value"/> was converted successfully; otherwise, false.</returns> public static bool TryConvertTo <T>(this object value, out T result, CultureInfo culture) { return(UniversalTypeConverter.TryConvertTo(value, out result, culture)); }