Skip to content

Commit 903563c

Browse files
committed
uwp: Add conditionals to unit class generator
Add long/double/decimal constructors and add conditionals * Convenience constructors for all unit classes * If UWP, only expose constructor with double type * Use type alias Culture to represent IFormatProvider vs string
1 parent 325a8d0 commit 903563c

File tree

3 files changed

+200
-23
lines changed

3 files changed

+200
-23
lines changed

UnitsNet/Scripts/Include-GenerateLogarithmicCode.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function GenerateLogarithmicArithmeticOperators([string]$className, [string]$bas
2424
2525
#region Logarithmic Arithmetic Operators
2626
27+
#if !WINDOWS_UWP
2728
public static $className operator -($className right)
2829
{
2930
return new $className(-right.$baseUnitFieldName);
@@ -66,6 +67,7 @@ function GenerateLogarithmicArithmeticOperators([string]$className, [string]$bas
6667
// Logarithmic division = subtraction
6768
return Convert.ToDouble(left.$baseUnitFieldName - right.$baseUnitFieldName);
6869
}
70+
#endif
6971
7072
#endregion
7173
"@;

0 commit comments

Comments
 (0)