using System.Globalization; using Connected.Interop.Reflection; namespace Connected.Interop; public static class TypeConversion { public static bool TryConvertInvariant(object? value, out T? result) { return TypeConverter.TryConvertInvariant(value, out result); } public static bool TryConvertInvariant(object? value, out object? result, Type destinationType) { return TypeConverter.TryConvert(value, destinationType, out result, CultureInfo.InvariantCulture); } public static bool TryConvert(object? value, out object? result, Type destinationType) { return TypeConverter.TryConvert(value, destinationType, out result); } public static bool TryConvert(object? value, out T? result) { return TypeConverter.TryConvertTo(value, out result); } public static bool TryConvert(object? value, out T? result, CultureInfo culture) { return TypeConverter.TryConvertTo(value, out result, culture); } public static T? Convert(object? value) { return TypeConverter.ConvertTo(value); } public static object? Convert(object? value, Type destinationType) { return TypeConverter.Convert(value, destinationType); } public static T? Convert(object? value, CultureInfo culture) { return TypeConverter.ConvertTo(value, culture); } }