Skip to content

Commit 876aed1

Browse files
committed
Fix more compile errors
1 parent 5603fa3 commit 876aed1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+375
-300
lines changed

UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public Acceleration(double meterpersecondsquared)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public Acceleration(double numericValue, AccelerationUnit unit)
109+
private
110110
#else
111-
public Acceleration(double numericValue, AccelerationUnit unit)
111+
public
112112
#endif
113+
Acceleration(double numericValue, AccelerationUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -659,7 +660,7 @@ public override bool Equals(object obj)
659660
return false;
660661
}
661662

662-
return Value.Equals(((Acceleration) obj).AsBaseNumericType(Unit));
663+
return AsBaseUnitMeterPerSecondSquared().Equals(((Acceleration) obj).AsBaseUnitMeterPerSecondSquared());
663664
}
664665

665666
/// <summary>
@@ -672,7 +673,7 @@ public override bool Equals(object obj)
672673
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
673674
public bool Equals(Acceleration other, Acceleration maxError)
674675
{
675-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
676+
return Math.Abs(AsBaseUnitMeterPerSecondSquared() - other.AsBaseUnitMeterPerSecondSquared()) <= maxError.AsBaseUnitMeterPerSecondSquared();
676677
}
677678

678679
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public AmountOfSubstance(double moles)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public AmountOfSubstance(double numericValue, AmountOfSubstanceUnit unit)
109+
private
110110
#else
111-
public AmountOfSubstance(double numericValue, AmountOfSubstanceUnit unit)
111+
public
112112
#endif
113+
AmountOfSubstance(double numericValue, AmountOfSubstanceUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -791,7 +792,7 @@ public override bool Equals(object obj)
791792
return false;
792793
}
793794

794-
return Value.Equals(((AmountOfSubstance) obj).AsBaseNumericType(Unit));
795+
return AsBaseUnitMoles().Equals(((AmountOfSubstance) obj).AsBaseUnitMoles());
795796
}
796797

797798
/// <summary>
@@ -804,7 +805,7 @@ public override bool Equals(object obj)
804805
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
805806
public bool Equals(AmountOfSubstance other, AmountOfSubstance maxError)
806807
{
807-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
808+
return Math.Abs(AsBaseUnitMoles() - other.AsBaseUnitMoles()) <= maxError.AsBaseUnitMoles();
808809
}
809810

810811
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public AmplitudeRatio(double decibelvolts)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public AmplitudeRatio(double numericValue, AmplitudeRatioUnit unit)
109+
private
110110
#else
111-
public AmplitudeRatio(double numericValue, AmplitudeRatioUnit unit)
111+
public
112112
#endif
113+
AmplitudeRatio(double numericValue, AmplitudeRatioUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -469,7 +470,7 @@ public override bool Equals(object obj)
469470
return false;
470471
}
471472

472-
return Value.Equals(((AmplitudeRatio) obj).AsBaseNumericType(Unit));
473+
return AsBaseUnitDecibelVolts().Equals(((AmplitudeRatio) obj).AsBaseUnitDecibelVolts());
473474
}
474475

475476
/// <summary>
@@ -482,7 +483,7 @@ public override bool Equals(object obj)
482483
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
483484
public bool Equals(AmplitudeRatio other, AmplitudeRatio maxError)
484485
{
485-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
486+
return Math.Abs(AsBaseUnitDecibelVolts() - other.AsBaseUnitDecibelVolts()) <= maxError.AsBaseUnitDecibelVolts();
486487
}
487488

488489
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/Angle.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public Angle(double degrees)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public Angle(double numericValue, AngleUnit unit)
109+
private
110110
#else
111-
public Angle(double numericValue, AngleUnit unit)
111+
public
112112
#endif
113+
Angle(double numericValue, AngleUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -758,7 +759,7 @@ public override bool Equals(object obj)
758759
return false;
759760
}
760761

761-
return Value.Equals(((Angle) obj).AsBaseNumericType(Unit));
762+
return AsBaseUnitDegrees().Equals(((Angle) obj).AsBaseUnitDegrees());
762763
}
763764

764765
/// <summary>
@@ -771,7 +772,7 @@ public override bool Equals(object obj)
771772
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
772773
public bool Equals(Angle other, Angle maxError)
773774
{
774-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
775+
return Math.Abs(AsBaseUnitDegrees() - other.AsBaseUnitDegrees()) <= maxError.AsBaseUnitDegrees();
775776
}
776777

777778
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public ApparentEnergy(double voltamperehours)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public ApparentEnergy(double numericValue, ApparentEnergyUnit unit)
109+
private
110110
#else
111-
public ApparentEnergy(double numericValue, ApparentEnergyUnit unit)
111+
public
112112
#endif
113+
ApparentEnergy(double numericValue, ApparentEnergyUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -428,7 +429,7 @@ public override bool Equals(object obj)
428429
return false;
429430
}
430431

431-
return Value.Equals(((ApparentEnergy) obj).AsBaseNumericType(Unit));
432+
return AsBaseUnitVoltampereHours().Equals(((ApparentEnergy) obj).AsBaseUnitVoltampereHours());
432433
}
433434

434435
/// <summary>
@@ -441,7 +442,7 @@ public override bool Equals(object obj)
441442
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
442443
public bool Equals(ApparentEnergy other, ApparentEnergy maxError)
443444
{
444-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
445+
return Math.Abs(AsBaseUnitVoltampereHours() - other.AsBaseUnitVoltampereHours()) <= maxError.AsBaseUnitVoltampereHours();
445446
}
446447

447448
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public ApparentPower(double voltamperes)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public ApparentPower(double numericValue, ApparentPowerUnit unit)
109+
private
110110
#else
111-
public ApparentPower(double numericValue, ApparentPowerUnit unit)
111+
public
112112
#endif
113+
ApparentPower(double numericValue, ApparentPowerUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -428,7 +429,7 @@ public override bool Equals(object obj)
428429
return false;
429430
}
430431

431-
return Value.Equals(((ApparentPower) obj).AsBaseNumericType(Unit));
432+
return AsBaseUnitVoltamperes().Equals(((ApparentPower) obj).AsBaseUnitVoltamperes());
432433
}
433434

434435
/// <summary>
@@ -441,7 +442,7 @@ public override bool Equals(object obj)
441442
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
442443
public bool Equals(ApparentPower other, ApparentPower maxError)
443444
{
444-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
445+
return Math.Abs(AsBaseUnitVoltamperes() - other.AsBaseUnitVoltamperes()) <= maxError.AsBaseUnitVoltamperes();
445446
}
446447

447448
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/Area.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public Area(double squaremeters)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public Area(double numericValue, AreaUnit unit)
109+
private
110110
#else
111-
public Area(double numericValue, AreaUnit unit)
111+
public
112112
#endif
113+
Area(double numericValue, AreaUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -725,7 +726,7 @@ public override bool Equals(object obj)
725726
return false;
726727
}
727728

728-
return Value.Equals(((Area) obj).AsBaseNumericType(Unit));
729+
return AsBaseUnitSquareMeters().Equals(((Area) obj).AsBaseUnitSquareMeters());
729730
}
730731

731732
/// <summary>
@@ -738,7 +739,7 @@ public override bool Equals(object obj)
738739
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
739740
public bool Equals(Area other, Area maxError)
740741
{
741-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
742+
return Math.Abs(AsBaseUnitSquareMeters() - other.AsBaseUnitSquareMeters()) <= maxError.AsBaseUnitSquareMeters();
742743
}
743744

744745
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public AreaMomentOfInertia(double meterstothefourth)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public AreaMomentOfInertia(double numericValue, AreaMomentOfInertiaUnit unit)
109+
private
110110
#else
111-
public AreaMomentOfInertia(double numericValue, AreaMomentOfInertiaUnit unit)
111+
public
112112
#endif
113+
AreaMomentOfInertia(double numericValue, AreaMomentOfInertiaUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -527,7 +528,7 @@ public override bool Equals(object obj)
527528
return false;
528529
}
529530

530-
return Value.Equals(((AreaMomentOfInertia) obj).AsBaseNumericType(Unit));
531+
return AsBaseUnitMetersToTheFourth().Equals(((AreaMomentOfInertia) obj).AsBaseUnitMetersToTheFourth());
531532
}
532533

533534
/// <summary>
@@ -540,7 +541,7 @@ public override bool Equals(object obj)
540541
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
541542
public bool Equals(AreaMomentOfInertia other, AreaMomentOfInertia maxError)
542543
{
543-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
544+
return Math.Abs(AsBaseUnitMetersToTheFourth() - other.AsBaseUnitMetersToTheFourth()) <= maxError.AsBaseUnitMetersToTheFourth();
544545
}
545546

546547
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/BitRate.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public BitRate(double bitspersecond)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public BitRate(double numericValue, BitRateUnit unit)
109+
private
110110
#else
111-
public BitRate(decimal numericValue, BitRateUnit unit)
111+
public
112112
#endif
113+
BitRate(decimal numericValue, BitRateUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -1184,7 +1185,7 @@ public override bool Equals(object obj)
11841185
return false;
11851186
}
11861187

1187-
return Value.Equals(((BitRate) obj).AsBaseNumericType(Unit));
1188+
return AsBaseUnitBitsPerSecond().Equals(((BitRate) obj).AsBaseUnitBitsPerSecond());
11881189
}
11891190

11901191
/// <summary>
@@ -1197,7 +1198,7 @@ public override bool Equals(object obj)
11971198
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
11981199
public bool Equals(BitRate other, BitRate maxError)
11991200
{
1200-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
1201+
return Math.Abs(AsBaseUnitBitsPerSecond() - other.AsBaseUnitBitsPerSecond()) <= maxError.AsBaseUnitBitsPerSecond();
12011202
}
12021203

12031204
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public BrakeSpecificFuelConsumption(double kilogramsperjoule)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public BrakeSpecificFuelConsumption(double numericValue, BrakeSpecificFuelConsumptionUnit unit)
109+
private
110110
#else
111-
public BrakeSpecificFuelConsumption(double numericValue, BrakeSpecificFuelConsumptionUnit unit)
111+
public
112112
#endif
113+
BrakeSpecificFuelConsumption(double numericValue, BrakeSpecificFuelConsumptionUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -428,7 +429,7 @@ public override bool Equals(object obj)
428429
return false;
429430
}
430431

431-
return Value.Equals(((BrakeSpecificFuelConsumption) obj).AsBaseNumericType(Unit));
432+
return AsBaseUnitKilogramsPerJoule().Equals(((BrakeSpecificFuelConsumption) obj).AsBaseUnitKilogramsPerJoule());
432433
}
433434

434435
/// <summary>
@@ -441,7 +442,7 @@ public override bool Equals(object obj)
441442
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
442443
public bool Equals(BrakeSpecificFuelConsumption other, BrakeSpecificFuelConsumption maxError)
443444
{
444-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
445+
return Math.Abs(AsBaseUnitKilogramsPerJoule() - other.AsBaseUnitKilogramsPerJoule()) <= maxError.AsBaseUnitKilogramsPerJoule();
445446
}
446447

447448
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/Density.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public Density(double kilogramspercubicmeter)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public Density(double numericValue, DensityUnit unit)
109+
private
110110
#else
111-
public Density(double numericValue, DensityUnit unit)
111+
public
112112
#endif
113+
Density(double numericValue, DensityUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -1484,7 +1485,7 @@ public override bool Equals(object obj)
14841485
return false;
14851486
}
14861487

1487-
return Value.Equals(((Density) obj).AsBaseNumericType(Unit));
1488+
return AsBaseUnitKilogramsPerCubicMeter().Equals(((Density) obj).AsBaseUnitKilogramsPerCubicMeter());
14881489
}
14891490

14901491
/// <summary>
@@ -1497,7 +1498,7 @@ public override bool Equals(object obj)
14971498
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
14981499
public bool Equals(Density other, Density maxError)
14991500
{
1500-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
1501+
return Math.Abs(AsBaseUnitKilogramsPerCubicMeter() - other.AsBaseUnitKilogramsPerCubicMeter()) <= maxError.AsBaseUnitKilogramsPerCubicMeter();
15011502
}
15021503

15031504
public override int GetHashCode()

UnitsNet/GeneratedCode/Quantities/Duration.g.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ public Duration(double seconds)
106106
/// <param name="unit">Unit representation.</param>
107107
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
108108
#if WINDOWS_UWP
109-
public Duration(double numericValue, DurationUnit unit)
109+
private
110110
#else
111-
public Duration(double numericValue, DurationUnit unit)
111+
public
112112
#endif
113+
Duration(double numericValue, DurationUnit unit)
113114
{
114115
_value = numericValue;
115116
Unit = unit;
@@ -659,7 +660,7 @@ public override bool Equals(object obj)
659660
return false;
660661
}
661662

662-
return Value.Equals(((Duration) obj).AsBaseNumericType(Unit));
663+
return AsBaseUnitSeconds().Equals(((Duration) obj).AsBaseUnitSeconds());
663664
}
664665

665666
/// <summary>
@@ -672,7 +673,7 @@ public override bool Equals(object obj)
672673
/// <returns>True if the difference between the two values is not greater than the specified max.</returns>
673674
public bool Equals(Duration other, Duration maxError)
674675
{
675-
return Math.Abs(Value - other.AsBaseNumericType(Unit)) <= maxError.AsBaseNumericType(Unit);
676+
return Math.Abs(AsBaseUnitSeconds() - other.AsBaseUnitSeconds()) <= maxError.AsBaseUnitSeconds();
676677
}
677678

678679
public override int GetHashCode()

0 commit comments

Comments
 (0)