@@ -60,14 +60,32 @@ public static class UnitConverter
60
60
/// <param name="fromUnitValue">From unit enum value.</param>
61
61
/// <param name="toUnitValue">To unit enum value, must be compatible with <paramref name="fromUnitValue" />.</param>
62
62
/// <returns>The converted value in the new unit representation.</returns>
63
- internal static double Convert ( FromValue fromValue , Enum fromUnitValue , Enum toUnitValue )
63
+ #if WINDOWS_UWP
64
+ internal
65
+ #else
66
+ public
67
+ #endif
68
+ static double Convert ( FromValue fromValue , Enum fromUnitValue , Enum toUnitValue )
64
69
{
65
70
return Quantity
66
71
. From ( fromValue , fromUnitValue )
67
72
. As ( toUnitValue ) ;
68
73
}
69
74
70
- internal static bool TryConvert ( FromValue fromValue , Enum fromUnitValue , Enum toUnitValue , out double convertedValue )
75
+ /// <summary>
76
+ /// Try to convert between any two quantity units given a numeric value and two unit enum values.
77
+ /// </summary>
78
+ /// <param name="fromValue">Numeric value.</param>
79
+ /// <param name="fromUnitValue">From unit enum value.</param>
80
+ /// <param name="toUnitValue">To unit enum value, must be compatible with <paramref name="fromUnitValue" />.</param>
81
+ /// <param name="convertedValue">The converted value, if successful. Otherwise default.</param>
82
+ /// <returns>True if successful.</returns>
83
+ #if WINDOWS_UWP
84
+ internal
85
+ #else
86
+ public
87
+ #endif
88
+ static bool TryConvert ( FromValue fromValue , Enum fromUnitValue , Enum toUnitValue , out double convertedValue )
71
89
{
72
90
convertedValue = 0 ;
73
91
if ( ! Quantity . TryFrom ( fromValue , fromUnitValue , out IQuantity from ) ) return false ;
0 commit comments