You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Create an instance of the cache and load all the abbreviations defined in the library.
39
40
/// </summary>
41
+
// TODO Change this to create an empty cache in v6: https://github.com/angularsen/UnitsNet/issues/1200
42
+
[Obsolete("Use CreateDefault() instead to create an instance that loads the built-in units. The default ctor will change to create an empty cache in UnitsNet v6.")]
/// Adds one or more unit abbreviation for the given unit enum value.
52
77
/// This is used to dynamically add abbreviations for existing unit enums such as <see cref="UnitsNet.Units.LengthUnit"/> or to extend with third-party unit enums
/// Create a parser using the given unit abbreviations cache.
30
31
/// </summary>
31
32
/// <param name="unitAbbreviationsCache"></param>
33
+
// TODO Change this to not fallback to built-in units abbreviations when given null, in v6: https://github.com/angularsen/UnitsNet/issues/1200
:thrownewUnitNotFoundException($"Unit value {unit} of type {unit.GetType()} is not a known unit enum type. Expected types like UnitsNet.Units.LengthUnit. Did you pass in a custom enum type defined outside the UnitsNet library?");
@@ -93,6 +97,7 @@ public bool TryFrom(double value, Enum unit, [NotNullWhen(true)] out IQuantity?
93
97
returnfalse;
94
98
}
95
99
100
+
// TODO Support custom units, currently only hardcoded built-in quantities are supported.
0 commit comments