From f6e3aaa93567bf25745cdc74a7f02d12157da9a0 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Wed, 7 Nov 2018 14:41:58 -0500 Subject: [PATCH] Adding equality methods/operators back --- .../GeneratedCode/InformationTestsBase.g.cs | 33 ++++++++++++++++++- .../GeneratedCode/LengthTestsBase.g.cs | 33 ++++++++++++++++++- .../GeneratedCode/LevelTestsBase.g.cs | 33 ++++++++++++++++++- .../Acceleration.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ntOfSubstance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...mplitudeRatio.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Angle.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...pparentEnergy.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ApparentPower.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Area.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../AreaDensity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...mentOfInertia.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../BitRate.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...elConsumption.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Capacitance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...rmalExpansion.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Density.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Duration.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...amicViscosity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ricAdmittance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...lectricCharge.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ChargeDensity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...icConductance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...cConductivity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ectricCurrent.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...urrentDensity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...rrentGradient.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ElectricField.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ricInductance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...tricPotential.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...icPotentialAc.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...icPotentialDc.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ricResistance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...icResistivity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Energy.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Entropy.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Force.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...rceChangeRate.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...orcePerLength.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Frequency.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../HeatFlux.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...erCoefficient.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Illuminance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Information.WindowsRuntimeComponent.g.cs | 18 ++++++++-- .../Irradiance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Irradiation.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...aticViscosity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../LapseRate.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Length.WindowsRuntimeComponent.g.cs | 18 ++++++++-- .../Level.WindowsRuntimeComponent.g.cs | 18 ++++++++-- ...LinearDensity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../LuminousFlux.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...nousIntensity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...MagneticField.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../MagneticFlux.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...Magnetization.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Mass.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../MassFlow.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../MassFlux.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...mentOfInertia.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../MolarEnergy.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../MolarEntropy.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../MolarMass.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Molarity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Permeability.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Permittivity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Power.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../PowerDensity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../PowerRatio.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Pressure.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ureChangeRate.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Ratio.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...eactiveEnergy.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ReactivePower.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...lAcceleration.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...tationalSpeed.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...onalStiffness.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...nessPerLength.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../SolidAngle.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...pecificEnergy.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ecificEntropy.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...pecificVolume.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...pecificWeight.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Speed.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Temperature.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...ureChangeRate.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...peratureDelta.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...lConductivity.WindowsRuntimeComponent.g.cs | 20 +++++++++-- ...malResistance.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Torque.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../VitaminA.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Volume.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../VolumeFlow.WindowsRuntimeComponent.g.cs | 20 +++++++++-- .../Quantities/Acceleration.NetFramework.g.cs | 31 ++++++++++++++--- .../AmountOfSubstance.NetFramework.g.cs | 31 ++++++++++++++--- .../AmplitudeRatio.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Angle.NetFramework.g.cs | 31 ++++++++++++++--- .../ApparentEnergy.NetFramework.g.cs | 31 ++++++++++++++--- .../ApparentPower.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Area.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/AreaDensity.NetFramework.g.cs | 31 ++++++++++++++--- .../AreaMomentOfInertia.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/BitRate.NetFramework.g.cs | 31 ++++++++++++++--- ...eSpecificFuelConsumption.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Capacitance.NetFramework.g.cs | 31 ++++++++++++++--- ...icientOfThermalExpansion.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Density.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Duration.NetFramework.g.cs | 31 ++++++++++++++--- .../DynamicViscosity.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricAdmittance.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricCharge.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricChargeDensity.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricConductance.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricConductivity.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricCurrent.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricCurrentDensity.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricCurrentGradient.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricField.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricInductance.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricPotential.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricPotentialAc.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricPotentialDc.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricResistance.NetFramework.g.cs | 31 ++++++++++++++--- .../ElectricResistivity.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Energy.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Entropy.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Force.NetFramework.g.cs | 31 ++++++++++++++--- .../ForceChangeRate.NetFramework.g.cs | 31 ++++++++++++++--- .../ForcePerLength.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Frequency.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/HeatFlux.NetFramework.g.cs | 31 ++++++++++++++--- .../HeatTransferCoefficient.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Illuminance.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Information.NetFramework.g.cs | 29 ++++++++++++++-- .../Quantities/Irradiance.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Irradiation.NetFramework.g.cs | 31 ++++++++++++++--- .../KinematicViscosity.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/LapseRate.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Length.NetFramework.g.cs | 29 ++++++++++++++-- .../Quantities/Level.NetFramework.g.cs | 29 ++++++++++++++-- .../LinearDensity.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/LuminousFlux.NetFramework.g.cs | 31 ++++++++++++++--- .../LuminousIntensity.NetFramework.g.cs | 31 ++++++++++++++--- .../MagneticField.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/MagneticFlux.NetFramework.g.cs | 31 ++++++++++++++--- .../Magnetization.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Mass.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/MassFlow.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/MassFlux.NetFramework.g.cs | 31 ++++++++++++++--- .../MassMomentOfInertia.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/MolarEnergy.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/MolarEntropy.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/MolarMass.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Molarity.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Permeability.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Permittivity.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Power.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/PowerDensity.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/PowerRatio.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Pressure.NetFramework.g.cs | 31 ++++++++++++++--- .../PressureChangeRate.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Ratio.NetFramework.g.cs | 31 ++++++++++++++--- .../ReactiveEnergy.NetFramework.g.cs | 31 ++++++++++++++--- .../ReactivePower.NetFramework.g.cs | 31 ++++++++++++++--- .../RotationalAcceleration.NetFramework.g.cs | 31 ++++++++++++++--- .../RotationalSpeed.NetFramework.g.cs | 31 ++++++++++++++--- .../RotationalStiffness.NetFramework.g.cs | 31 ++++++++++++++--- ...tionalStiffnessPerLength.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/SolidAngle.NetFramework.g.cs | 31 ++++++++++++++--- .../SpecificEnergy.NetFramework.g.cs | 31 ++++++++++++++--- .../SpecificEntropy.NetFramework.g.cs | 31 ++++++++++++++--- .../SpecificVolume.NetFramework.g.cs | 31 ++++++++++++++--- .../SpecificWeight.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Speed.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Temperature.NetFramework.g.cs | 31 ++++++++++++++--- .../TemperatureChangeRate.NetFramework.g.cs | 31 ++++++++++++++--- .../TemperatureDelta.NetFramework.g.cs | 31 ++++++++++++++--- .../ThermalConductivity.NetFramework.g.cs | 31 ++++++++++++++--- .../ThermalResistance.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Torque.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/VitaminA.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/Volume.NetFramework.g.cs | 31 ++++++++++++++--- .../Quantities/VolumeFlow.NetFramework.g.cs | 31 ++++++++++++++--- ...GenerateQuantitySourceCodeNetFramework.ps1 | 33 +++++++++++++++++-- ...de-GenerateUnitTestBaseClassSourceCode.ps1 | 33 ++++++++++++++++++- 185 files changed, 4112 insertions(+), 631 deletions(-) diff --git a/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs index 5551e3aa76..bab9608cbc 100644 --- a/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs @@ -406,10 +406,41 @@ public void CompareToThrowsOnNull() Assert.Throws(() => bit.CompareTo(null)); } + [Fact] + public void EqualityOperators() + { + var a = Information.FromBits(1); + var b = Information.FromBits(2); + + // ReSharper disable EqualExpressionComparison + + Assert.True(a == a); + Assert.False(a != a); + + Assert.True(a != b); + Assert.False(a == b); + + Assert.False(a == null); + Assert.False(null == a); + +// ReSharper restore EqualExpressionComparison + } + [Fact] public void EqualsIsImplemented() { - Information v = Information.FromBits(1); + var a = Information.FromBits(1); + var b = Information.FromBits(2); + + Assert.True(a.Equals(a)); + Assert.False(a.Equals(b)); + Assert.False(a.Equals(null)); + } + + [Fact] + public void EqualsRelativeToleranceIsImplemented() + { + var v = Information.FromBits(1); Assert.True(v.Equals(Information.FromBits(1), BitsTolerance, ComparisonType.Relative)); Assert.False(v.Equals(Information.Zero, BitsTolerance, ComparisonType.Relative)); } diff --git a/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs index fdbfd6a231..18228172a5 100644 --- a/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs @@ -390,10 +390,41 @@ public void CompareToThrowsOnNull() Assert.Throws(() => meter.CompareTo(null)); } + [Fact] + public void EqualityOperators() + { + var a = Length.FromMeters(1); + var b = Length.FromMeters(2); + + // ReSharper disable EqualExpressionComparison + + Assert.True(a == a); + Assert.False(a != a); + + Assert.True(a != b); + Assert.False(a == b); + + Assert.False(a == null); + Assert.False(null == a); + +// ReSharper restore EqualExpressionComparison + } + [Fact] public void EqualsIsImplemented() { - Length v = Length.FromMeters(1); + var a = Length.FromMeters(1); + var b = Length.FromMeters(2); + + Assert.True(a.Equals(a)); + Assert.False(a.Equals(b)); + Assert.False(a.Equals(null)); + } + + [Fact] + public void EqualsRelativeToleranceIsImplemented() + { + var v = Length.FromMeters(1); Assert.True(v.Equals(Length.FromMeters(1), MetersTolerance, ComparisonType.Relative)); Assert.False(v.Equals(Length.Zero, MetersTolerance, ComparisonType.Relative)); } diff --git a/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs index f2c485b3c4..2f9bfd5f11 100644 --- a/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs @@ -195,10 +195,41 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decibel.CompareTo(null)); } + [Fact] + public void EqualityOperators() + { + var a = Level.FromDecibels(1); + var b = Level.FromDecibels(2); + + // ReSharper disable EqualExpressionComparison + + Assert.True(a == a); + Assert.False(a != a); + + Assert.True(a != b); + Assert.False(a == b); + + Assert.False(a == null); + Assert.False(null == a); + +// ReSharper restore EqualExpressionComparison + } + [Fact] public void EqualsIsImplemented() { - Level v = Level.FromDecibels(1); + var a = Level.FromDecibels(1); + var b = Level.FromDecibels(2); + + Assert.True(a.Equals(a)); + Assert.False(a.Equals(b)); + Assert.False(a.Equals(null)); + } + + [Fact] + public void EqualsRelativeToleranceIsImplemented() + { + var v = Level.FromDecibels(1); Assert.True(v.Equals(Level.FromDecibels(1), DecibelsTolerance, ComparisonType.Relative)); Assert.False(v.Equals(Level.Zero, DecibelsTolerance, ComparisonType.Relative)); } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs index eb339e199a..683d1e5f9f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -554,9 +554,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Acceleration)) throw new ArgumentException("Expected type Acceleration.", nameof(obj)); + if(!(obj is Acceleration objAcceleration)) throw new ArgumentException("Expected type Acceleration.", nameof(obj)); - return CompareTo((Acceleration)obj); + return CompareTo(objAcceleration); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -565,6 +565,20 @@ internal int CompareTo(Acceleration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Acceleration objAcceleration)) + return false; + + return Equals(objAcceleration); + } + + public bool Equals(Acceleration other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Acceleration within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs index ce290025ca..892ce2ab01 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -569,9 +569,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is AmountOfSubstance)) throw new ArgumentException("Expected type AmountOfSubstance.", nameof(obj)); + if(!(obj is AmountOfSubstance objAmountOfSubstance)) throw new ArgumentException("Expected type AmountOfSubstance.", nameof(obj)); - return CompareTo((AmountOfSubstance)obj); + return CompareTo(objAmountOfSubstance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -580,6 +580,20 @@ internal int CompareTo(AmountOfSubstance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is AmountOfSubstance objAmountOfSubstance)) + return false; + + return Equals(objAmountOfSubstance); + } + + public bool Equals(AmountOfSubstance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another AmountOfSubstance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs index ce45c7407c..fd7bcd0813 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -419,9 +419,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is AmplitudeRatio)) throw new ArgumentException("Expected type AmplitudeRatio.", nameof(obj)); + if(!(obj is AmplitudeRatio objAmplitudeRatio)) throw new ArgumentException("Expected type AmplitudeRatio.", nameof(obj)); - return CompareTo((AmplitudeRatio)obj); + return CompareTo(objAmplitudeRatio); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -430,6 +430,20 @@ internal int CompareTo(AmplitudeRatio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is AmplitudeRatio objAmplitudeRatio)) + return false; + + return Equals(objAmplitudeRatio); + } + + public bool Equals(AmplitudeRatio other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another AmplitudeRatio within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs index d721fd78bb..00d0b13620 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -569,9 +569,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Angle)) throw new ArgumentException("Expected type Angle.", nameof(obj)); + if(!(obj is Angle objAngle)) throw new ArgumentException("Expected type Angle.", nameof(obj)); - return CompareTo((Angle)obj); + return CompareTo(objAngle); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -580,6 +580,20 @@ internal int CompareTo(Angle other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Angle objAngle)) + return false; + + return Equals(objAngle); + } + + public bool Equals(Angle other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Angle within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs index 6af6c3626d..cbc5a659c1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ApparentEnergy)) throw new ArgumentException("Expected type ApparentEnergy.", nameof(obj)); + if(!(obj is ApparentEnergy objApparentEnergy)) throw new ArgumentException("Expected type ApparentEnergy.", nameof(obj)); - return CompareTo((ApparentEnergy)obj); + return CompareTo(objApparentEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(ApparentEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ApparentEnergy objApparentEnergy)) + return false; + + return Equals(objApparentEnergy); + } + + public bool Equals(ApparentEnergy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ApparentEnergy within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs index 3f17f61de0..daaf46e2cd 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -419,9 +419,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ApparentPower)) throw new ArgumentException("Expected type ApparentPower.", nameof(obj)); + if(!(obj is ApparentPower objApparentPower)) throw new ArgumentException("Expected type ApparentPower.", nameof(obj)); - return CompareTo((ApparentPower)obj); + return CompareTo(objApparentPower); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -430,6 +430,20 @@ internal int CompareTo(ApparentPower other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ApparentPower objApparentPower)) + return false; + + return Equals(objApparentPower); + } + + public bool Equals(ApparentPower other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ApparentPower within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs index 7ea98e2ea6..a586b76c29 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -554,9 +554,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Area)) throw new ArgumentException("Expected type Area.", nameof(obj)); + if(!(obj is Area objArea)) throw new ArgumentException("Expected type Area.", nameof(obj)); - return CompareTo((Area)obj); + return CompareTo(objArea); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -565,6 +565,20 @@ internal int CompareTo(Area other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Area objArea)) + return false; + + return Equals(objArea); + } + + public bool Equals(Area other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Area within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs index f13fa07cad..10bf58c368 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -374,9 +374,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is AreaDensity)) throw new ArgumentException("Expected type AreaDensity.", nameof(obj)); + if(!(obj is AreaDensity objAreaDensity)) throw new ArgumentException("Expected type AreaDensity.", nameof(obj)); - return CompareTo((AreaDensity)obj); + return CompareTo(objAreaDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -385,6 +385,20 @@ internal int CompareTo(AreaDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is AreaDensity objAreaDensity)) + return false; + + return Equals(objAreaDensity); + } + + public bool Equals(AreaDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another AreaDensity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs index 40ba8402c8..88e609fde3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -449,9 +449,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is AreaMomentOfInertia)) throw new ArgumentException("Expected type AreaMomentOfInertia.", nameof(obj)); + if(!(obj is AreaMomentOfInertia objAreaMomentOfInertia)) throw new ArgumentException("Expected type AreaMomentOfInertia.", nameof(obj)); - return CompareTo((AreaMomentOfInertia)obj); + return CompareTo(objAreaMomentOfInertia); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -460,6 +460,20 @@ internal int CompareTo(AreaMomentOfInertia other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is AreaMomentOfInertia objAreaMomentOfInertia)) + return false; + + return Equals(objAreaMomentOfInertia); + } + + public bool Equals(AreaMomentOfInertia other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another AreaMomentOfInertia within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs index 550439140c..9f94b2b184 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -752,9 +752,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is BitRate)) throw new ArgumentException("Expected type BitRate.", nameof(obj)); + if(!(obj is BitRate objBitRate)) throw new ArgumentException("Expected type BitRate.", nameof(obj)); - return CompareTo((BitRate)obj); + return CompareTo(objBitRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -763,6 +763,20 @@ internal int CompareTo(BitRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is BitRate objBitRate)) + return false; + + return Equals(objBitRate); + } + + public bool Equals(BitRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another BitRate within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs index 63ab43d231..7951122f05 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is BrakeSpecificFuelConsumption)) throw new ArgumentException("Expected type BrakeSpecificFuelConsumption.", nameof(obj)); + if(!(obj is BrakeSpecificFuelConsumption objBrakeSpecificFuelConsumption)) throw new ArgumentException("Expected type BrakeSpecificFuelConsumption.", nameof(obj)); - return CompareTo((BrakeSpecificFuelConsumption)obj); + return CompareTo(objBrakeSpecificFuelConsumption); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(BrakeSpecificFuelConsumption other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is BrakeSpecificFuelConsumption objBrakeSpecificFuelConsumption)) + return false; + + return Equals(objBrakeSpecificFuelConsumption); + } + + public bool Equals(BrakeSpecificFuelConsumption other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another BrakeSpecificFuelConsumption within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs index e420af6a62..022cbca3ac 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Capacitance)) throw new ArgumentException("Expected type Capacitance.", nameof(obj)); + if(!(obj is Capacitance objCapacitance)) throw new ArgumentException("Expected type Capacitance.", nameof(obj)); - return CompareTo((Capacitance)obj); + return CompareTo(objCapacitance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(Capacitance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Capacitance objCapacitance)) + return false; + + return Equals(objCapacitance); + } + + public bool Equals(Capacitance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Capacitance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs index 1173f6f511..5fbf89f4fa 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is CoefficientOfThermalExpansion)) throw new ArgumentException("Expected type CoefficientOfThermalExpansion.", nameof(obj)); + if(!(obj is CoefficientOfThermalExpansion objCoefficientOfThermalExpansion)) throw new ArgumentException("Expected type CoefficientOfThermalExpansion.", nameof(obj)); - return CompareTo((CoefficientOfThermalExpansion)obj); + return CompareTo(objCoefficientOfThermalExpansion); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(CoefficientOfThermalExpansion other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is CoefficientOfThermalExpansion objCoefficientOfThermalExpansion)) + return false; + + return Equals(objCoefficientOfThermalExpansion); + } + + public bool Equals(CoefficientOfThermalExpansion other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another CoefficientOfThermalExpansion within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs index ccd0e18225..ef5d5855f4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -932,9 +932,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Density)) throw new ArgumentException("Expected type Density.", nameof(obj)); + if(!(obj is Density objDensity)) throw new ArgumentException("Expected type Density.", nameof(obj)); - return CompareTo((Density)obj); + return CompareTo(objDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -943,6 +943,20 @@ internal int CompareTo(Density other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Density objDensity)) + return false; + + return Equals(objDensity); + } + + public bool Equals(Density other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Density within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs index d6da3f36c3..e57ea85bbd 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -509,9 +509,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Duration)) throw new ArgumentException("Expected type Duration.", nameof(obj)); + if(!(obj is Duration objDuration)) throw new ArgumentException("Expected type Duration.", nameof(obj)); - return CompareTo((Duration)obj); + return CompareTo(objDuration); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -520,6 +520,20 @@ internal int CompareTo(Duration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Duration objDuration)) + return false; + + return Equals(objDuration); + } + + public bool Equals(Duration other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Duration within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs index 4faa9c6a73..20534fd15c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -452,9 +452,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is DynamicViscosity)) throw new ArgumentException("Expected type DynamicViscosity.", nameof(obj)); + if(!(obj is DynamicViscosity objDynamicViscosity)) throw new ArgumentException("Expected type DynamicViscosity.", nameof(obj)); - return CompareTo((DynamicViscosity)obj); + return CompareTo(objDynamicViscosity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -463,6 +463,20 @@ internal int CompareTo(DynamicViscosity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is DynamicViscosity objDynamicViscosity)) + return false; + + return Equals(objDynamicViscosity); + } + + public bool Equals(DynamicViscosity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another DynamicViscosity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs index 42f0c6faaa..f22a5da97d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -419,9 +419,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricAdmittance)) throw new ArgumentException("Expected type ElectricAdmittance.", nameof(obj)); + if(!(obj is ElectricAdmittance objElectricAdmittance)) throw new ArgumentException("Expected type ElectricAdmittance.", nameof(obj)); - return CompareTo((ElectricAdmittance)obj); + return CompareTo(objElectricAdmittance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -430,6 +430,20 @@ internal int CompareTo(ElectricAdmittance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricAdmittance objElectricAdmittance)) + return false; + + return Equals(objElectricAdmittance); + } + + public bool Equals(ElectricAdmittance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricAdmittance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs index a3f707e4d3..bb6f5726f4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricCharge)) throw new ArgumentException("Expected type ElectricCharge.", nameof(obj)); + if(!(obj is ElectricCharge objElectricCharge)) throw new ArgumentException("Expected type ElectricCharge.", nameof(obj)); - return CompareTo((ElectricCharge)obj); + return CompareTo(objElectricCharge); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(ElectricCharge other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricCharge objElectricCharge)) + return false; + + return Equals(objElectricCharge); + } + + public bool Equals(ElectricCharge other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricCharge within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs index 0e81c2f40b..1bc6aa4bd2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricChargeDensity)) throw new ArgumentException("Expected type ElectricChargeDensity.", nameof(obj)); + if(!(obj is ElectricChargeDensity objElectricChargeDensity)) throw new ArgumentException("Expected type ElectricChargeDensity.", nameof(obj)); - return CompareTo((ElectricChargeDensity)obj); + return CompareTo(objElectricChargeDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(ElectricChargeDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricChargeDensity objElectricChargeDensity)) + return false; + + return Equals(objElectricChargeDensity); + } + + public bool Equals(ElectricChargeDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricChargeDensity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs index 17b4739907..a8ea454d26 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -407,9 +407,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricConductance)) throw new ArgumentException("Expected type ElectricConductance.", nameof(obj)); + if(!(obj is ElectricConductance objElectricConductance)) throw new ArgumentException("Expected type ElectricConductance.", nameof(obj)); - return CompareTo((ElectricConductance)obj); + return CompareTo(objElectricConductance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -418,6 +418,20 @@ internal int CompareTo(ElectricConductance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricConductance objElectricConductance)) + return false; + + return Equals(objElectricConductance); + } + + public bool Equals(ElectricConductance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricConductance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs index 5f0854098d..843805c29e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricConductivity)) throw new ArgumentException("Expected type ElectricConductivity.", nameof(obj)); + if(!(obj is ElectricConductivity objElectricConductivity)) throw new ArgumentException("Expected type ElectricConductivity.", nameof(obj)); - return CompareTo((ElectricConductivity)obj); + return CompareTo(objElectricConductivity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(ElectricConductivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricConductivity objElectricConductivity)) + return false; + + return Equals(objElectricConductivity); + } + + public bool Equals(ElectricConductivity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricConductivity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs index 922de73b93..31c19ff2db 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -479,9 +479,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricCurrent)) throw new ArgumentException("Expected type ElectricCurrent.", nameof(obj)); + if(!(obj is ElectricCurrent objElectricCurrent)) throw new ArgumentException("Expected type ElectricCurrent.", nameof(obj)); - return CompareTo((ElectricCurrent)obj); + return CompareTo(objElectricCurrent); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -490,6 +490,20 @@ internal int CompareTo(ElectricCurrent other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricCurrent objElectricCurrent)) + return false; + + return Equals(objElectricCurrent); + } + + public bool Equals(ElectricCurrent other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricCurrent within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs index 43963d75d5..ba1566386b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricCurrentDensity)) throw new ArgumentException("Expected type ElectricCurrentDensity.", nameof(obj)); + if(!(obj is ElectricCurrentDensity objElectricCurrentDensity)) throw new ArgumentException("Expected type ElectricCurrentDensity.", nameof(obj)); - return CompareTo((ElectricCurrentDensity)obj); + return CompareTo(objElectricCurrentDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(ElectricCurrentDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricCurrentDensity objElectricCurrentDensity)) + return false; + + return Equals(objElectricCurrentDensity); + } + + public bool Equals(ElectricCurrentDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricCurrentDensity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs index 88ea70ce25..79a90f05ca 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -374,9 +374,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricCurrentGradient)) throw new ArgumentException("Expected type ElectricCurrentGradient.", nameof(obj)); + if(!(obj is ElectricCurrentGradient objElectricCurrentGradient)) throw new ArgumentException("Expected type ElectricCurrentGradient.", nameof(obj)); - return CompareTo((ElectricCurrentGradient)obj); + return CompareTo(objElectricCurrentGradient); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -385,6 +385,20 @@ internal int CompareTo(ElectricCurrentGradient other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricCurrentGradient objElectricCurrentGradient)) + return false; + + return Equals(objElectricCurrentGradient); + } + + public bool Equals(ElectricCurrentGradient other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricCurrentGradient within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs index 7fc78e14f1..758928d9bf 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricField)) throw new ArgumentException("Expected type ElectricField.", nameof(obj)); + if(!(obj is ElectricField objElectricField)) throw new ArgumentException("Expected type ElectricField.", nameof(obj)); - return CompareTo((ElectricField)obj); + return CompareTo(objElectricField); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(ElectricField other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricField objElectricField)) + return false; + + return Equals(objElectricField); + } + + public bool Equals(ElectricField other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricField within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs index 903a89b9d4..7deb755050 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricInductance)) throw new ArgumentException("Expected type ElectricInductance.", nameof(obj)); + if(!(obj is ElectricInductance objElectricInductance)) throw new ArgumentException("Expected type ElectricInductance.", nameof(obj)); - return CompareTo((ElectricInductance)obj); + return CompareTo(objElectricInductance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(ElectricInductance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricInductance objElectricInductance)) + return false; + + return Equals(objElectricInductance); + } + + public bool Equals(ElectricInductance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricInductance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs index d908ead398..546af6e12b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -434,9 +434,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricPotential)) throw new ArgumentException("Expected type ElectricPotential.", nameof(obj)); + if(!(obj is ElectricPotential objElectricPotential)) throw new ArgumentException("Expected type ElectricPotential.", nameof(obj)); - return CompareTo((ElectricPotential)obj); + return CompareTo(objElectricPotential); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -445,6 +445,20 @@ internal int CompareTo(ElectricPotential other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricPotential objElectricPotential)) + return false; + + return Equals(objElectricPotential); + } + + public bool Equals(ElectricPotential other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricPotential within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs index 449568468e..153a1e0aa2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -434,9 +434,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricPotentialAc)) throw new ArgumentException("Expected type ElectricPotentialAc.", nameof(obj)); + if(!(obj is ElectricPotentialAc objElectricPotentialAc)) throw new ArgumentException("Expected type ElectricPotentialAc.", nameof(obj)); - return CompareTo((ElectricPotentialAc)obj); + return CompareTo(objElectricPotentialAc); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -445,6 +445,20 @@ internal int CompareTo(ElectricPotentialAc other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricPotentialAc objElectricPotentialAc)) + return false; + + return Equals(objElectricPotentialAc); + } + + public bool Equals(ElectricPotentialAc other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricPotentialAc within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs index 8d64cf696e..adf9532fd1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -434,9 +434,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricPotentialDc)) throw new ArgumentException("Expected type ElectricPotentialDc.", nameof(obj)); + if(!(obj is ElectricPotentialDc objElectricPotentialDc)) throw new ArgumentException("Expected type ElectricPotentialDc.", nameof(obj)); - return CompareTo((ElectricPotentialDc)obj); + return CompareTo(objElectricPotentialDc); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -445,6 +445,20 @@ internal int CompareTo(ElectricPotentialDc other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricPotentialDc objElectricPotentialDc)) + return false; + + return Equals(objElectricPotentialDc); + } + + public bool Equals(ElectricPotentialDc other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricPotentialDc within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs index 7978859d3d..0141bf3a16 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -419,9 +419,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricResistance)) throw new ArgumentException("Expected type ElectricResistance.", nameof(obj)); + if(!(obj is ElectricResistance objElectricResistance)) throw new ArgumentException("Expected type ElectricResistance.", nameof(obj)); - return CompareTo((ElectricResistance)obj); + return CompareTo(objElectricResistance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -430,6 +430,20 @@ internal int CompareTo(ElectricResistance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricResistance objElectricResistance)) + return false; + + return Equals(objElectricResistance); + } + + public bool Equals(ElectricResistance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricResistance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs index 62a12c9d78..92d978ba66 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -422,9 +422,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricResistivity)) throw new ArgumentException("Expected type ElectricResistivity.", nameof(obj)); + if(!(obj is ElectricResistivity objElectricResistivity)) throw new ArgumentException("Expected type ElectricResistivity.", nameof(obj)); - return CompareTo((ElectricResistivity)obj); + return CompareTo(objElectricResistivity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -433,6 +433,20 @@ internal int CompareTo(ElectricResistivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricResistivity objElectricResistivity)) + return false; + + return Equals(objElectricResistivity); + } + + public bool Equals(ElectricResistivity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricResistivity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs index 1a019820bd..6003594404 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -689,9 +689,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Energy)) throw new ArgumentException("Expected type Energy.", nameof(obj)); + if(!(obj is Energy objEnergy)) throw new ArgumentException("Expected type Energy.", nameof(obj)); - return CompareTo((Energy)obj); + return CompareTo(objEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -700,6 +700,20 @@ internal int CompareTo(Energy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Energy objEnergy)) + return false; + + return Equals(objEnergy); + } + + public bool Equals(Energy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Energy within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs index 5314156dfd..3bb85a46fd 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -464,9 +464,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Entropy)) throw new ArgumentException("Expected type Entropy.", nameof(obj)); + if(!(obj is Entropy objEntropy)) throw new ArgumentException("Expected type Entropy.", nameof(obj)); - return CompareTo((Entropy)obj); + return CompareTo(objEntropy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -475,6 +475,20 @@ internal int CompareTo(Entropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Entropy objEntropy)) + return false; + + return Equals(objEntropy); + } + + public bool Equals(Entropy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Entropy within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs index bbeb01758b..f681bc23b8 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -554,9 +554,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Force)) throw new ArgumentException("Expected type Force.", nameof(obj)); + if(!(obj is Force objForce)) throw new ArgumentException("Expected type Force.", nameof(obj)); - return CompareTo((Force)obj); + return CompareTo(objForce); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -565,6 +565,20 @@ internal int CompareTo(Force other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Force objForce)) + return false; + + return Equals(objForce); + } + + public bool Equals(Force other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Force within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs index 0c46661ff2..130bbaaab2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -524,9 +524,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ForceChangeRate)) throw new ArgumentException("Expected type ForceChangeRate.", nameof(obj)); + if(!(obj is ForceChangeRate objForceChangeRate)) throw new ArgumentException("Expected type ForceChangeRate.", nameof(obj)); - return CompareTo((ForceChangeRate)obj); + return CompareTo(objForceChangeRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -535,6 +535,20 @@ internal int CompareTo(ForceChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ForceChangeRate objForceChangeRate)) + return false; + + return Equals(objForceChangeRate); + } + + public bool Equals(ForceChangeRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ForceChangeRate within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs index 05c3e249b4..0d349719e1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -494,9 +494,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ForcePerLength)) throw new ArgumentException("Expected type ForcePerLength.", nameof(obj)); + if(!(obj is ForcePerLength objForcePerLength)) throw new ArgumentException("Expected type ForcePerLength.", nameof(obj)); - return CompareTo((ForcePerLength)obj); + return CompareTo(objForcePerLength); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -505,6 +505,20 @@ internal int CompareTo(ForcePerLength other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ForcePerLength objForcePerLength)) + return false; + + return Equals(objForcePerLength); + } + + public bool Equals(ForcePerLength other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ForcePerLength within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs index 5822efad71..91e1b46e3d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -479,9 +479,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Frequency)) throw new ArgumentException("Expected type Frequency.", nameof(obj)); + if(!(obj is Frequency objFrequency)) throw new ArgumentException("Expected type Frequency.", nameof(obj)); - return CompareTo((Frequency)obj); + return CompareTo(objFrequency); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -490,6 +490,20 @@ internal int CompareTo(Frequency other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Frequency objFrequency)) + return false; + + return Equals(objFrequency); + } + + public bool Equals(Frequency other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Frequency within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs index 408b7d2c64..f95d55565e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -599,9 +599,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is HeatFlux)) throw new ArgumentException("Expected type HeatFlux.", nameof(obj)); + if(!(obj is HeatFlux objHeatFlux)) throw new ArgumentException("Expected type HeatFlux.", nameof(obj)); - return CompareTo((HeatFlux)obj); + return CompareTo(objHeatFlux); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -610,6 +610,20 @@ internal int CompareTo(HeatFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is HeatFlux objHeatFlux)) + return false; + + return Equals(objHeatFlux); + } + + public bool Equals(HeatFlux other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another HeatFlux within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs index 49fa0395d2..40413dc114 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -389,9 +389,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is HeatTransferCoefficient)) throw new ArgumentException("Expected type HeatTransferCoefficient.", nameof(obj)); + if(!(obj is HeatTransferCoefficient objHeatTransferCoefficient)) throw new ArgumentException("Expected type HeatTransferCoefficient.", nameof(obj)); - return CompareTo((HeatTransferCoefficient)obj); + return CompareTo(objHeatTransferCoefficient); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -400,6 +400,20 @@ internal int CompareTo(HeatTransferCoefficient other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is HeatTransferCoefficient objHeatTransferCoefficient)) + return false; + + return Equals(objHeatTransferCoefficient); + } + + public bool Equals(HeatTransferCoefficient other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another HeatTransferCoefficient within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs index 87cc96ecbd..a5f6ee518a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -422,9 +422,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Illuminance)) throw new ArgumentException("Expected type Illuminance.", nameof(obj)); + if(!(obj is Illuminance objIlluminance)) throw new ArgumentException("Expected type Illuminance.", nameof(obj)); - return CompareTo((Illuminance)obj); + return CompareTo(objIlluminance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -433,6 +433,20 @@ internal int CompareTo(Illuminance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Illuminance objIlluminance)) + return false; + + return Equals(objIlluminance); + } + + public bool Equals(Illuminance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Illuminance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs index b10f5f09ab..8e51a2ef3f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs @@ -749,9 +749,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Information)) throw new ArgumentException("Expected type Information.", nameof(obj)); + if(!(obj is Information objInformation)) throw new ArgumentException("Expected type Information.", nameof(obj)); - return CompareTo((Information)obj); + return CompareTo(objInformation); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -760,6 +760,20 @@ internal int CompareTo(Information other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Information objInformation)) + return false; + + return Equals(objInformation); + } + + public bool Equals(Information other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Information within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs index 87bee65bf0..b5bed9e0bc 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -389,9 +389,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Irradiance)) throw new ArgumentException("Expected type Irradiance.", nameof(obj)); + if(!(obj is Irradiance objIrradiance)) throw new ArgumentException("Expected type Irradiance.", nameof(obj)); - return CompareTo((Irradiance)obj); + return CompareTo(objIrradiance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -400,6 +400,20 @@ internal int CompareTo(Irradiance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Irradiance objIrradiance)) + return false; + + return Equals(objIrradiance); + } + + public bool Equals(Irradiance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Irradiance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs index 9478a879a7..3edbfea3ef 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -407,9 +407,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Irradiation)) throw new ArgumentException("Expected type Irradiation.", nameof(obj)); + if(!(obj is Irradiation objIrradiation)) throw new ArgumentException("Expected type Irradiation.", nameof(obj)); - return CompareTo((Irradiation)obj); + return CompareTo(objIrradiation); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -418,6 +418,20 @@ internal int CompareTo(Irradiation other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Irradiation objIrradiation)) + return false; + + return Equals(objIrradiation); + } + + public bool Equals(Irradiation other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Irradiation within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs index cfc7afe804..f2944f61d5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -482,9 +482,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is KinematicViscosity)) throw new ArgumentException("Expected type KinematicViscosity.", nameof(obj)); + if(!(obj is KinematicViscosity objKinematicViscosity)) throw new ArgumentException("Expected type KinematicViscosity.", nameof(obj)); - return CompareTo((KinematicViscosity)obj); + return CompareTo(objKinematicViscosity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -493,6 +493,20 @@ internal int CompareTo(KinematicViscosity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is KinematicViscosity objKinematicViscosity)) + return false; + + return Equals(objKinematicViscosity); + } + + public bool Equals(KinematicViscosity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another KinematicViscosity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs index f622b8d710..1242a38c3d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -374,9 +374,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is LapseRate)) throw new ArgumentException("Expected type LapseRate.", nameof(obj)); + if(!(obj is LapseRate objLapseRate)) throw new ArgumentException("Expected type LapseRate.", nameof(obj)); - return CompareTo((LapseRate)obj); + return CompareTo(objLapseRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -385,6 +385,20 @@ internal int CompareTo(LapseRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is LapseRate objLapseRate)) + return false; + + return Equals(objLapseRate); + } + + public bool Equals(LapseRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another LapseRate within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs index d72e687bfe..c3caf25b5d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs @@ -689,9 +689,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Length)) throw new ArgumentException("Expected type Length.", nameof(obj)); + if(!(obj is Length objLength)) throw new ArgumentException("Expected type Length.", nameof(obj)); - return CompareTo((Length)obj); + return CompareTo(objLength); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -700,6 +700,20 @@ internal int CompareTo(Length other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Length objLength)) + return false; + + return Equals(objLength); + } + + public bool Equals(Length other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Length within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs index 105411344a..67f61d03d0 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs @@ -389,9 +389,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Level)) throw new ArgumentException("Expected type Level.", nameof(obj)); + if(!(obj is Level objLevel)) throw new ArgumentException("Expected type Level.", nameof(obj)); - return CompareTo((Level)obj); + return CompareTo(objLevel); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -400,6 +400,20 @@ internal int CompareTo(Level other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Level objLevel)) + return false; + + return Equals(objLevel); + } + + public bool Equals(Level other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Level within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs index 7cfa3a7f33..7dad64c701 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -407,9 +407,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is LinearDensity)) throw new ArgumentException("Expected type LinearDensity.", nameof(obj)); + if(!(obj is LinearDensity objLinearDensity)) throw new ArgumentException("Expected type LinearDensity.", nameof(obj)); - return CompareTo((LinearDensity)obj); + return CompareTo(objLinearDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -418,6 +418,20 @@ internal int CompareTo(LinearDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is LinearDensity objLinearDensity)) + return false; + + return Equals(objLinearDensity); + } + + public bool Equals(LinearDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another LinearDensity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs index 7188f7cd59..9d867e79a5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is LuminousFlux)) throw new ArgumentException("Expected type LuminousFlux.", nameof(obj)); + if(!(obj is LuminousFlux objLuminousFlux)) throw new ArgumentException("Expected type LuminousFlux.", nameof(obj)); - return CompareTo((LuminousFlux)obj); + return CompareTo(objLuminousFlux); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(LuminousFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is LuminousFlux objLuminousFlux)) + return false; + + return Equals(objLuminousFlux); + } + + public bool Equals(LuminousFlux other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another LuminousFlux within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs index 0ae059bf84..6ba10e506e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is LuminousIntensity)) throw new ArgumentException("Expected type LuminousIntensity.", nameof(obj)); + if(!(obj is LuminousIntensity objLuminousIntensity)) throw new ArgumentException("Expected type LuminousIntensity.", nameof(obj)); - return CompareTo((LuminousIntensity)obj); + return CompareTo(objLuminousIntensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(LuminousIntensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is LuminousIntensity objLuminousIntensity)) + return false; + + return Equals(objLuminousIntensity); + } + + public bool Equals(LuminousIntensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another LuminousIntensity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs index 543d738511..86a8cb29e6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MagneticField)) throw new ArgumentException("Expected type MagneticField.", nameof(obj)); + if(!(obj is MagneticField objMagneticField)) throw new ArgumentException("Expected type MagneticField.", nameof(obj)); - return CompareTo((MagneticField)obj); + return CompareTo(objMagneticField); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(MagneticField other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is MagneticField objMagneticField)) + return false; + + return Equals(objMagneticField); + } + + public bool Equals(MagneticField other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MagneticField within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs index bc7a0ff539..ba0b4d1bb1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MagneticFlux)) throw new ArgumentException("Expected type MagneticFlux.", nameof(obj)); + if(!(obj is MagneticFlux objMagneticFlux)) throw new ArgumentException("Expected type MagneticFlux.", nameof(obj)); - return CompareTo((MagneticFlux)obj); + return CompareTo(objMagneticFlux); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(MagneticFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is MagneticFlux objMagneticFlux)) + return false; + + return Equals(objMagneticFlux); + } + + public bool Equals(MagneticFlux other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MagneticFlux within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs index ba3a41139d..0c3a26cf2d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Magnetization)) throw new ArgumentException("Expected type Magnetization.", nameof(obj)); + if(!(obj is Magnetization objMagnetization)) throw new ArgumentException("Expected type Magnetization.", nameof(obj)); - return CompareTo((Magnetization)obj); + return CompareTo(objMagnetization); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(Magnetization other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Magnetization objMagnetization)) + return false; + + return Equals(objMagnetization); + } + + public bool Equals(Magnetization other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Magnetization within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs index 30fb8adb4f..f6b75df0f3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -689,9 +689,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Mass)) throw new ArgumentException("Expected type Mass.", nameof(obj)); + if(!(obj is Mass objMass)) throw new ArgumentException("Expected type Mass.", nameof(obj)); - return CompareTo((Mass)obj); + return CompareTo(objMass); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -700,6 +700,20 @@ internal int CompareTo(Mass other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Mass objMass)) + return false; + + return Equals(objMass); + } + + public bool Equals(Mass other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Mass within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs index b4fd71ac29..2acd71db31 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -614,9 +614,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MassFlow)) throw new ArgumentException("Expected type MassFlow.", nameof(obj)); + if(!(obj is MassFlow objMassFlow)) throw new ArgumentException("Expected type MassFlow.", nameof(obj)); - return CompareTo((MassFlow)obj); + return CompareTo(objMassFlow); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -625,6 +625,20 @@ internal int CompareTo(MassFlow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is MassFlow objMassFlow)) + return false; + + return Equals(objMassFlow); + } + + public bool Equals(MassFlow other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MassFlow within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs index c8a81c7e16..32a8c1697c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -389,9 +389,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MassFlux)) throw new ArgumentException("Expected type MassFlux.", nameof(obj)); + if(!(obj is MassFlux objMassFlux)) throw new ArgumentException("Expected type MassFlux.", nameof(obj)); - return CompareTo((MassFlux)obj); + return CompareTo(objMassFlux); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -400,6 +400,20 @@ internal int CompareTo(MassFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is MassFlux objMassFlux)) + return false; + + return Equals(objMassFlux); + } + + public bool Equals(MassFlux other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MassFlux within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs index 9e86954cad..39191b30f7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -779,9 +779,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MassMomentOfInertia)) throw new ArgumentException("Expected type MassMomentOfInertia.", nameof(obj)); + if(!(obj is MassMomentOfInertia objMassMomentOfInertia)) throw new ArgumentException("Expected type MassMomentOfInertia.", nameof(obj)); - return CompareTo((MassMomentOfInertia)obj); + return CompareTo(objMassMomentOfInertia); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -790,6 +790,20 @@ internal int CompareTo(MassMomentOfInertia other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is MassMomentOfInertia objMassMomentOfInertia)) + return false; + + return Equals(objMassMomentOfInertia); + } + + public bool Equals(MassMomentOfInertia other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MassMomentOfInertia within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs index c3627ad5c0..e52392f58c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MolarEnergy)) throw new ArgumentException("Expected type MolarEnergy.", nameof(obj)); + if(!(obj is MolarEnergy objMolarEnergy)) throw new ArgumentException("Expected type MolarEnergy.", nameof(obj)); - return CompareTo((MolarEnergy)obj); + return CompareTo(objMolarEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(MolarEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is MolarEnergy objMolarEnergy)) + return false; + + return Equals(objMolarEnergy); + } + + public bool Equals(MolarEnergy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MolarEnergy within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs index e242f67383..8aeef88d13 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MolarEntropy)) throw new ArgumentException("Expected type MolarEntropy.", nameof(obj)); + if(!(obj is MolarEntropy objMolarEntropy)) throw new ArgumentException("Expected type MolarEntropy.", nameof(obj)); - return CompareTo((MolarEntropy)obj); + return CompareTo(objMolarEntropy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(MolarEntropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is MolarEntropy objMolarEntropy)) + return false; + + return Equals(objMolarEntropy); + } + + public bool Equals(MolarEntropy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MolarEntropy within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs index 6721889a8b..3c1d4158ed 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -539,9 +539,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MolarMass)) throw new ArgumentException("Expected type MolarMass.", nameof(obj)); + if(!(obj is MolarMass objMolarMass)) throw new ArgumentException("Expected type MolarMass.", nameof(obj)); - return CompareTo((MolarMass)obj); + return CompareTo(objMolarMass); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -550,6 +550,20 @@ internal int CompareTo(MolarMass other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is MolarMass objMolarMass)) + return false; + + return Equals(objMolarMass); + } + + public bool Equals(MolarMass other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MolarMass within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs index 9906d6cc14..f84d42c175 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -482,9 +482,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Molarity)) throw new ArgumentException("Expected type Molarity.", nameof(obj)); + if(!(obj is Molarity objMolarity)) throw new ArgumentException("Expected type Molarity.", nameof(obj)); - return CompareTo((Molarity)obj); + return CompareTo(objMolarity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -493,6 +493,20 @@ internal int CompareTo(Molarity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Molarity objMolarity)) + return false; + + return Equals(objMolarity); + } + + public bool Equals(Molarity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Molarity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs index 0cc81c667b..2916a7cc26 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Permeability)) throw new ArgumentException("Expected type Permeability.", nameof(obj)); + if(!(obj is Permeability objPermeability)) throw new ArgumentException("Expected type Permeability.", nameof(obj)); - return CompareTo((Permeability)obj); + return CompareTo(objPermeability); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(Permeability other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Permeability objPermeability)) + return false; + + return Equals(objPermeability); + } + + public bool Equals(Permeability other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Permeability within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs index 4b244f0049..8ddb1a058e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Permittivity)) throw new ArgumentException("Expected type Permittivity.", nameof(obj)); + if(!(obj is Permittivity objPermittivity)) throw new ArgumentException("Expected type Permittivity.", nameof(obj)); - return CompareTo((Permittivity)obj); + return CompareTo(objPermittivity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(Permittivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Permittivity objPermittivity)) + return false; + + return Equals(objPermittivity); + } + + public bool Equals(Permittivity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Permittivity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs index b63ecedc49..142abfee8c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -659,9 +659,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Power)) throw new ArgumentException("Expected type Power.", nameof(obj)); + if(!(obj is Power objPower)) throw new ArgumentException("Expected type Power.", nameof(obj)); - return CompareTo((Power)obj); + return CompareTo(objPower); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -670,6 +670,20 @@ internal int CompareTo(Power other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Power objPower)) + return false; + + return Equals(objPower); + } + + public bool Equals(Power other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Power within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs index 0d0deb8f35..47ea186351 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -1019,9 +1019,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is PowerDensity)) throw new ArgumentException("Expected type PowerDensity.", nameof(obj)); + if(!(obj is PowerDensity objPowerDensity)) throw new ArgumentException("Expected type PowerDensity.", nameof(obj)); - return CompareTo((PowerDensity)obj); + return CompareTo(objPowerDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -1030,6 +1030,20 @@ internal int CompareTo(PowerDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is PowerDensity objPowerDensity)) + return false; + + return Equals(objPowerDensity); + } + + public bool Equals(PowerDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another PowerDensity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs index 3f6834c004..e603267b0e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -389,9 +389,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is PowerRatio)) throw new ArgumentException("Expected type PowerRatio.", nameof(obj)); + if(!(obj is PowerRatio objPowerRatio)) throw new ArgumentException("Expected type PowerRatio.", nameof(obj)); - return CompareTo((PowerRatio)obj); + return CompareTo(objPowerRatio); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -400,6 +400,20 @@ internal int CompareTo(PowerRatio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is PowerRatio objPowerRatio)) + return false; + + return Equals(objPowerRatio); + } + + public bool Equals(PowerRatio other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another PowerRatio within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs index 33cd62bf6a..c3f2397f4d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -959,9 +959,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Pressure)) throw new ArgumentException("Expected type Pressure.", nameof(obj)); + if(!(obj is Pressure objPressure)) throw new ArgumentException("Expected type Pressure.", nameof(obj)); - return CompareTo((Pressure)obj); + return CompareTo(objPressure); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -970,6 +970,20 @@ internal int CompareTo(Pressure other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Pressure objPressure)) + return false; + + return Equals(objPressure); + } + + public bool Equals(Pressure other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Pressure within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs index d9d49c8ca4..50ac7e13a5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -419,9 +419,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is PressureChangeRate)) throw new ArgumentException("Expected type PressureChangeRate.", nameof(obj)); + if(!(obj is PressureChangeRate objPressureChangeRate)) throw new ArgumentException("Expected type PressureChangeRate.", nameof(obj)); - return CompareTo((PressureChangeRate)obj); + return CompareTo(objPressureChangeRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -430,6 +430,20 @@ internal int CompareTo(PressureChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is PressureChangeRate objPressureChangeRate)) + return false; + + return Equals(objPressureChangeRate); + } + + public bool Equals(PressureChangeRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another PressureChangeRate within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs index 28e40e140f..8eb8809246 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -449,9 +449,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Ratio)) throw new ArgumentException("Expected type Ratio.", nameof(obj)); + if(!(obj is Ratio objRatio)) throw new ArgumentException("Expected type Ratio.", nameof(obj)); - return CompareTo((Ratio)obj); + return CompareTo(objRatio); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -460,6 +460,20 @@ internal int CompareTo(Ratio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Ratio objRatio)) + return false; + + return Equals(objRatio); + } + + public bool Equals(Ratio other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Ratio within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs index 893f7b32dc..4416fafce4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ReactiveEnergy)) throw new ArgumentException("Expected type ReactiveEnergy.", nameof(obj)); + if(!(obj is ReactiveEnergy objReactiveEnergy)) throw new ArgumentException("Expected type ReactiveEnergy.", nameof(obj)); - return CompareTo((ReactiveEnergy)obj); + return CompareTo(objReactiveEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(ReactiveEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ReactiveEnergy objReactiveEnergy)) + return false; + + return Equals(objReactiveEnergy); + } + + public bool Equals(ReactiveEnergy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ReactiveEnergy within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs index 6cdb0d0f9b..586c4fba33 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -419,9 +419,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ReactivePower)) throw new ArgumentException("Expected type ReactivePower.", nameof(obj)); + if(!(obj is ReactivePower objReactivePower)) throw new ArgumentException("Expected type ReactivePower.", nameof(obj)); - return CompareTo((ReactivePower)obj); + return CompareTo(objReactivePower); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -430,6 +430,20 @@ internal int CompareTo(ReactivePower other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ReactivePower objReactivePower)) + return false; + + return Equals(objReactivePower); + } + + public bool Equals(ReactivePower other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ReactivePower within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs index 8b9c1aea4c..f8b24a5ec0 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is RotationalAcceleration)) throw new ArgumentException("Expected type RotationalAcceleration.", nameof(obj)); + if(!(obj is RotationalAcceleration objRotationalAcceleration)) throw new ArgumentException("Expected type RotationalAcceleration.", nameof(obj)); - return CompareTo((RotationalAcceleration)obj); + return CompareTo(objRotationalAcceleration); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(RotationalAcceleration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is RotationalAcceleration objRotationalAcceleration)) + return false; + + return Equals(objRotationalAcceleration); + } + + public bool Equals(RotationalAcceleration other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another RotationalAcceleration within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs index da8191f564..9a2c78e98a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -554,9 +554,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is RotationalSpeed)) throw new ArgumentException("Expected type RotationalSpeed.", nameof(obj)); + if(!(obj is RotationalSpeed objRotationalSpeed)) throw new ArgumentException("Expected type RotationalSpeed.", nameof(obj)); - return CompareTo((RotationalSpeed)obj); + return CompareTo(objRotationalSpeed); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -565,6 +565,20 @@ internal int CompareTo(RotationalSpeed other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is RotationalSpeed objRotationalSpeed)) + return false; + + return Equals(objRotationalSpeed); + } + + public bool Equals(RotationalSpeed other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another RotationalSpeed within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs index b335fe2018..61fc5c97dd 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is RotationalStiffness)) throw new ArgumentException("Expected type RotationalStiffness.", nameof(obj)); + if(!(obj is RotationalStiffness objRotationalStiffness)) throw new ArgumentException("Expected type RotationalStiffness.", nameof(obj)); - return CompareTo((RotationalStiffness)obj); + return CompareTo(objRotationalStiffness); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(RotationalStiffness other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is RotationalStiffness objRotationalStiffness)) + return false; + + return Equals(objRotationalStiffness); + } + + public bool Equals(RotationalStiffness other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another RotationalStiffness within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs index e537623e26..2e47b2cfe3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -404,9 +404,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is RotationalStiffnessPerLength)) throw new ArgumentException("Expected type RotationalStiffnessPerLength.", nameof(obj)); + if(!(obj is RotationalStiffnessPerLength objRotationalStiffnessPerLength)) throw new ArgumentException("Expected type RotationalStiffnessPerLength.", nameof(obj)); - return CompareTo((RotationalStiffnessPerLength)obj); + return CompareTo(objRotationalStiffnessPerLength); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -415,6 +415,20 @@ internal int CompareTo(RotationalStiffnessPerLength other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is RotationalStiffnessPerLength objRotationalStiffnessPerLength)) + return false; + + return Equals(objRotationalStiffnessPerLength); + } + + public bool Equals(RotationalStiffnessPerLength other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another RotationalStiffnessPerLength within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs index a2734f7231..77bdb7da20 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -377,9 +377,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SolidAngle)) throw new ArgumentException("Expected type SolidAngle.", nameof(obj)); + if(!(obj is SolidAngle objSolidAngle)) throw new ArgumentException("Expected type SolidAngle.", nameof(obj)); - return CompareTo((SolidAngle)obj); + return CompareTo(objSolidAngle); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -388,6 +388,20 @@ internal int CompareTo(SolidAngle other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is SolidAngle objSolidAngle)) + return false; + + return Equals(objSolidAngle); + } + + public bool Equals(SolidAngle other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SolidAngle within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs index c526b4488b..54b8293db5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -482,9 +482,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SpecificEnergy)) throw new ArgumentException("Expected type SpecificEnergy.", nameof(obj)); + if(!(obj is SpecificEnergy objSpecificEnergy)) throw new ArgumentException("Expected type SpecificEnergy.", nameof(obj)); - return CompareTo((SpecificEnergy)obj); + return CompareTo(objSpecificEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -493,6 +493,20 @@ internal int CompareTo(SpecificEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is SpecificEnergy objSpecificEnergy)) + return false; + + return Equals(objSpecificEnergy); + } + + public bool Equals(SpecificEnergy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SpecificEnergy within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs index ebc52aea2a..2b5bad71d1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -479,9 +479,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SpecificEntropy)) throw new ArgumentException("Expected type SpecificEntropy.", nameof(obj)); + if(!(obj is SpecificEntropy objSpecificEntropy)) throw new ArgumentException("Expected type SpecificEntropy.", nameof(obj)); - return CompareTo((SpecificEntropy)obj); + return CompareTo(objSpecificEntropy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -490,6 +490,20 @@ internal int CompareTo(SpecificEntropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is SpecificEntropy objSpecificEntropy)) + return false; + + return Equals(objSpecificEntropy); + } + + public bool Equals(SpecificEntropy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SpecificEntropy within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs index dab2338cc9..5ec24394c6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -389,9 +389,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SpecificVolume)) throw new ArgumentException("Expected type SpecificVolume.", nameof(obj)); + if(!(obj is SpecificVolume objSpecificVolume)) throw new ArgumentException("Expected type SpecificVolume.", nameof(obj)); - return CompareTo((SpecificVolume)obj); + return CompareTo(objSpecificVolume); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -400,6 +400,20 @@ internal int CompareTo(SpecificVolume other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is SpecificVolume objSpecificVolume)) + return false; + + return Equals(objSpecificVolume); + } + + public bool Equals(SpecificVolume other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SpecificVolume within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs index e4fa1ed151..6d8f47f547 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -617,9 +617,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SpecificWeight)) throw new ArgumentException("Expected type SpecificWeight.", nameof(obj)); + if(!(obj is SpecificWeight objSpecificWeight)) throw new ArgumentException("Expected type SpecificWeight.", nameof(obj)); - return CompareTo((SpecificWeight)obj); + return CompareTo(objSpecificWeight); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -628,6 +628,20 @@ internal int CompareTo(SpecificWeight other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is SpecificWeight objSpecificWeight)) + return false; + + return Equals(objSpecificWeight); + } + + public bool Equals(SpecificWeight other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SpecificWeight within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs index 2580e57b88..c7b3ec280e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -839,9 +839,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Speed)) throw new ArgumentException("Expected type Speed.", nameof(obj)); + if(!(obj is Speed objSpeed)) throw new ArgumentException("Expected type Speed.", nameof(obj)); - return CompareTo((Speed)obj); + return CompareTo(objSpeed); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -850,6 +850,20 @@ internal int CompareTo(Speed other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Speed objSpeed)) + return false; + + return Equals(objSpeed); + } + + public bool Equals(Speed other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Speed within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs index d938c21971..77796a121f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -479,9 +479,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Temperature)) throw new ArgumentException("Expected type Temperature.", nameof(obj)); + if(!(obj is Temperature objTemperature)) throw new ArgumentException("Expected type Temperature.", nameof(obj)); - return CompareTo((Temperature)obj); + return CompareTo(objTemperature); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -490,6 +490,20 @@ internal int CompareTo(Temperature other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Temperature objTemperature)) + return false; + + return Equals(objTemperature); + } + + public bool Equals(Temperature other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Temperature within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs index e27815d279..0c244aa4d8 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -509,9 +509,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is TemperatureChangeRate)) throw new ArgumentException("Expected type TemperatureChangeRate.", nameof(obj)); + if(!(obj is TemperatureChangeRate objTemperatureChangeRate)) throw new ArgumentException("Expected type TemperatureChangeRate.", nameof(obj)); - return CompareTo((TemperatureChangeRate)obj); + return CompareTo(objTemperatureChangeRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -520,6 +520,20 @@ internal int CompareTo(TemperatureChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is TemperatureChangeRate objTemperatureChangeRate)) + return false; + + return Equals(objTemperatureChangeRate); + } + + public bool Equals(TemperatureChangeRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another TemperatureChangeRate within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs index 85bef47194..f5343b234c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -479,9 +479,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is TemperatureDelta)) throw new ArgumentException("Expected type TemperatureDelta.", nameof(obj)); + if(!(obj is TemperatureDelta objTemperatureDelta)) throw new ArgumentException("Expected type TemperatureDelta.", nameof(obj)); - return CompareTo((TemperatureDelta)obj); + return CompareTo(objTemperatureDelta); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -490,6 +490,20 @@ internal int CompareTo(TemperatureDelta other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is TemperatureDelta objTemperatureDelta)) + return false; + + return Equals(objTemperatureDelta); + } + + public bool Equals(TemperatureDelta other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another TemperatureDelta within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs index 1cfdd85421..aaa091df43 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -392,9 +392,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ThermalConductivity)) throw new ArgumentException("Expected type ThermalConductivity.", nameof(obj)); + if(!(obj is ThermalConductivity objThermalConductivity)) throw new ArgumentException("Expected type ThermalConductivity.", nameof(obj)); - return CompareTo((ThermalConductivity)obj); + return CompareTo(objThermalConductivity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -403,6 +403,20 @@ internal int CompareTo(ThermalConductivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ThermalConductivity objThermalConductivity)) + return false; + + return Equals(objThermalConductivity); + } + + public bool Equals(ThermalConductivity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ThermalConductivity within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs index c4e9a2caf2..ba41692a9b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -434,9 +434,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ThermalResistance)) throw new ArgumentException("Expected type ThermalResistance.", nameof(obj)); + if(!(obj is ThermalResistance objThermalResistance)) throw new ArgumentException("Expected type ThermalResistance.", nameof(obj)); - return CompareTo((ThermalResistance)obj); + return CompareTo(objThermalResistance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -445,6 +445,20 @@ internal int CompareTo(ThermalResistance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is ThermalResistance objThermalResistance)) + return false; + + return Equals(objThermalResistance); + } + + public bool Equals(ThermalResistance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ThermalResistance within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs index 5f5be9e35a..b94c2afb09 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -674,9 +674,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Torque)) throw new ArgumentException("Expected type Torque.", nameof(obj)); + if(!(obj is Torque objTorque)) throw new ArgumentException("Expected type Torque.", nameof(obj)); - return CompareTo((Torque)obj); + return CompareTo(objTorque); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -685,6 +685,20 @@ internal int CompareTo(Torque other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Torque objTorque)) + return false; + + return Equals(objTorque); + } + + public bool Equals(Torque other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Torque within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs index 0d41dea4cf..ae58a1d057 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -374,9 +374,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is VitaminA)) throw new ArgumentException("Expected type VitaminA.", nameof(obj)); + if(!(obj is VitaminA objVitaminA)) throw new ArgumentException("Expected type VitaminA.", nameof(obj)); - return CompareTo((VitaminA)obj); + return CompareTo(objVitaminA); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -385,6 +385,20 @@ internal int CompareTo(VitaminA other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is VitaminA objVitaminA)) + return false; + + return Equals(objVitaminA); + } + + public bool Equals(VitaminA other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another VitaminA within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs index 4696c60bdd..c6aa7afafe 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -1004,9 +1004,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Volume)) throw new ArgumentException("Expected type Volume.", nameof(obj)); + if(!(obj is Volume objVolume)) throw new ArgumentException("Expected type Volume.", nameof(obj)); - return CompareTo((Volume)obj); + return CompareTo(objVolume); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -1015,6 +1015,20 @@ internal int CompareTo(Volume other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is Volume objVolume)) + return false; + + return Equals(objVolume); + } + + public bool Equals(Volume other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Volume within the given absolute or relative tolerance. diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs index 4b90abd00c..9da54b5bca 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -749,9 +749,9 @@ public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is VolumeFlow)) throw new ArgumentException("Expected type VolumeFlow.", nameof(obj)); + if(!(obj is VolumeFlow objVolumeFlow)) throw new ArgumentException("Expected type VolumeFlow.", nameof(obj)); - return CompareTo((VolumeFlow)obj); + return CompareTo(objVolumeFlow); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -760,6 +760,20 @@ internal int CompareTo(VolumeFlow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + [Windows.Foundation.Metadata.DefaultOverload] + public override bool Equals(object obj) + { + if(obj is null || !(obj is VolumeFlow objVolumeFlow)) + return false; + + return Equals(objVolumeFlow); + } + + public bool Equals(VolumeFlow other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another VolumeFlow within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 571ee22b18..84ccd613a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Acceleration, in physics, is the rate at which the velocity of an object changes over time. An object's acceleration is the net result of any and all forces acting on the object, as described by Newton's Second Law. The SI unit for acceleration is the Meter per second squared (m/s²). Accelerations are vector quantities (they have magnitude and direction) and add according to the parallelogram law. As a vector, the calculated net force is equal to the product of the object's mass (a scalar quantity) and the acceleration. /// - public partial struct Acceleration : IQuantity, IComparable, IComparable + public partial struct Acceleration : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -576,12 +576,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Accele return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Acceleration left, Acceleration right) + { + return left.Equals(right); + } + + public static bool operator !=(Acceleration left, Acceleration right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Acceleration)) throw new ArgumentException("Expected type Acceleration.", nameof(obj)); + if(!(obj is Acceleration objAcceleration)) throw new ArgumentException("Expected type Acceleration.", nameof(obj)); - return CompareTo((Acceleration)obj); + return CompareTo(objAcceleration); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -590,6 +600,19 @@ public int CompareTo(Acceleration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Acceleration objAcceleration)) + return false; + + return Equals(objAcceleration); + } + + public bool Equals(Acceleration other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Acceleration within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index c73bbd675f..0c444e8343 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Mole is the amount of substance containing Avagadro's Number (6.02 x 10 ^ 23) of real particles such as molecules,atoms, ions or radicals. /// - public partial struct AmountOfSubstance : IQuantity, IComparable, IComparable + public partial struct AmountOfSubstance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -590,12 +590,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Amount return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(AmountOfSubstance left, AmountOfSubstance right) + { + return left.Equals(right); + } + + public static bool operator !=(AmountOfSubstance left, AmountOfSubstance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is AmountOfSubstance)) throw new ArgumentException("Expected type AmountOfSubstance.", nameof(obj)); + if(!(obj is AmountOfSubstance objAmountOfSubstance)) throw new ArgumentException("Expected type AmountOfSubstance.", nameof(obj)); - return CompareTo((AmountOfSubstance)obj); + return CompareTo(objAmountOfSubstance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -604,6 +614,19 @@ public int CompareTo(AmountOfSubstance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is AmountOfSubstance objAmountOfSubstance)) + return false; + + return Equals(objAmountOfSubstance); + } + + public bool Equals(AmountOfSubstance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another AmountOfSubstance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 0996a6c36c..5c92424eee 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The strength of a signal expressed in decibels (dB) relative to one volt RMS. /// - public partial struct AmplitudeRatio : IQuantity, IComparable, IComparable + public partial struct AmplitudeRatio : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -458,12 +458,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Amplit return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(AmplitudeRatio left, AmplitudeRatio right) + { + return left.Equals(right); + } + + public static bool operator !=(AmplitudeRatio left, AmplitudeRatio right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is AmplitudeRatio)) throw new ArgumentException("Expected type AmplitudeRatio.", nameof(obj)); + if(!(obj is AmplitudeRatio objAmplitudeRatio)) throw new ArgumentException("Expected type AmplitudeRatio.", nameof(obj)); - return CompareTo((AmplitudeRatio)obj); + return CompareTo(objAmplitudeRatio); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -472,6 +482,19 @@ public int CompareTo(AmplitudeRatio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is AmplitudeRatio objAmplitudeRatio)) + return false; + + return Equals(objAmplitudeRatio); + } + + public bool Equals(AmplitudeRatio other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another AmplitudeRatio within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 5c05c6b4b2..da67ba174f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In geometry, an angle is the figure formed by two rays, called the sides of the angle, sharing a common endpoint, called the vertex of the angle. /// - public partial struct Angle : IQuantity, IComparable, IComparable + public partial struct Angle : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -590,12 +590,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out AngleU return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Angle left, Angle right) + { + return left.Equals(right); + } + + public static bool operator !=(Angle left, Angle right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Angle)) throw new ArgumentException("Expected type Angle.", nameof(obj)); + if(!(obj is Angle objAngle)) throw new ArgumentException("Expected type Angle.", nameof(obj)); - return CompareTo((Angle)obj); + return CompareTo(objAngle); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -604,6 +614,19 @@ public int CompareTo(Angle other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Angle objAngle)) + return false; + + return Equals(objAngle); + } + + public bool Equals(Angle other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Angle within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 472ad59e8f..d9ffd9f485 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules. /// - public partial struct ApparentEnergy : IQuantity, IComparable, IComparable + public partial struct ApparentEnergy : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Appare return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ApparentEnergy left, ApparentEnergy right) + { + return left.Equals(right); + } + + public static bool operator !=(ApparentEnergy left, ApparentEnergy right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ApparentEnergy)) throw new ArgumentException("Expected type ApparentEnergy.", nameof(obj)); + if(!(obj is ApparentEnergy objApparentEnergy)) throw new ArgumentException("Expected type ApparentEnergy.", nameof(obj)); - return CompareTo((ApparentEnergy)obj); + return CompareTo(objApparentEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(ApparentEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ApparentEnergy objApparentEnergy)) + return false; + + return Equals(objApparentEnergy); + } + + public bool Equals(ApparentEnergy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ApparentEnergy within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 97b13fdfb4..339f0a85ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Power engineers measure apparent power as the magnitude of the vector sum of active and reactive power. Apparent power is the product of the root-mean-square of voltage and current. /// - public partial struct ApparentPower : IQuantity, IComparable, IComparable + public partial struct ApparentPower : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -450,12 +450,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Appare return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ApparentPower left, ApparentPower right) + { + return left.Equals(right); + } + + public static bool operator !=(ApparentPower left, ApparentPower right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ApparentPower)) throw new ArgumentException("Expected type ApparentPower.", nameof(obj)); + if(!(obj is ApparentPower objApparentPower)) throw new ArgumentException("Expected type ApparentPower.", nameof(obj)); - return CompareTo((ApparentPower)obj); + return CompareTo(objApparentPower); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -464,6 +474,19 @@ public int CompareTo(ApparentPower other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ApparentPower objApparentPower)) + return false; + + return Equals(objApparentPower); + } + + public bool Equals(ApparentPower other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ApparentPower within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 328946fdad..834ca4aa2e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Area is a quantity that expresses the extent of a two-dimensional surface or shape, or planar lamina, in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat.[1] It is the two-dimensional analog of the length of a curve (a one-dimensional concept) or the volume of a solid (a three-dimensional concept). /// - public partial struct Area : IQuantity, IComparable, IComparable + public partial struct Area : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -576,12 +576,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out AreaUn return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Area left, Area right) + { + return left.Equals(right); + } + + public static bool operator !=(Area left, Area right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Area)) throw new ArgumentException("Expected type Area.", nameof(obj)); + if(!(obj is Area objArea)) throw new ArgumentException("Expected type Area.", nameof(obj)); - return CompareTo((Area)obj); + return CompareTo(objArea); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -590,6 +600,19 @@ public int CompareTo(Area other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Area objArea)) + return false; + + return Equals(objArea); + } + + public bool Equals(Area other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Area within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index c288aa6440..4d2aa8e3c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The area density of a two-dimensional object is calculated as the mass per unit area. /// - public partial struct AreaDensity : IQuantity, IComparable, IComparable + public partial struct AreaDensity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -408,12 +408,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out AreaDe return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(AreaDensity left, AreaDensity right) + { + return left.Equals(right); + } + + public static bool operator !=(AreaDensity left, AreaDensity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is AreaDensity)) throw new ArgumentException("Expected type AreaDensity.", nameof(obj)); + if(!(obj is AreaDensity objAreaDensity)) throw new ArgumentException("Expected type AreaDensity.", nameof(obj)); - return CompareTo((AreaDensity)obj); + return CompareTo(objAreaDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -422,6 +432,19 @@ public int CompareTo(AreaDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is AreaDensity objAreaDensity)) + return false; + + return Equals(objAreaDensity); + } + + public bool Equals(AreaDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another AreaDensity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 83b7e00bb2..df5403d431 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A geometric property of an area that reflects how its points are distributed with regard to an axis. /// - public partial struct AreaMomentOfInertia : IQuantity, IComparable, IComparable + public partial struct AreaMomentOfInertia : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -478,12 +478,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out AreaMo return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(AreaMomentOfInertia left, AreaMomentOfInertia right) + { + return left.Equals(right); + } + + public static bool operator !=(AreaMomentOfInertia left, AreaMomentOfInertia right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is AreaMomentOfInertia)) throw new ArgumentException("Expected type AreaMomentOfInertia.", nameof(obj)); + if(!(obj is AreaMomentOfInertia objAreaMomentOfInertia)) throw new ArgumentException("Expected type AreaMomentOfInertia.", nameof(obj)); - return CompareTo((AreaMomentOfInertia)obj); + return CompareTo(objAreaMomentOfInertia); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -492,6 +502,19 @@ public int CompareTo(AreaMomentOfInertia other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is AreaMomentOfInertia objAreaMomentOfInertia)) + return false; + + return Equals(objAreaMomentOfInertia); + } + + public bool Equals(AreaMomentOfInertia other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another AreaMomentOfInertia within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 60d0bbce91..bc9a4ed598 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Bit_rate /// - public partial struct BitRate : IQuantity, IComparable, IComparable + public partial struct BitRate : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -761,12 +761,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out BitRat return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(BitRate left, BitRate right) + { + return left.Equals(right); + } + + public static bool operator !=(BitRate left, BitRate right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is BitRate)) throw new ArgumentException("Expected type BitRate.", nameof(obj)); + if(!(obj is BitRate objBitRate)) throw new ArgumentException("Expected type BitRate.", nameof(obj)); - return CompareTo((BitRate)obj); + return CompareTo(objBitRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -775,6 +785,19 @@ public int CompareTo(BitRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is BitRate objBitRate)) + return false; + + return Equals(objBitRate); + } + + public bool Equals(BitRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another BitRate within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 167b27987d..24001bf446 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Brake specific fuel consumption (BSFC) is a measure of the fuel efficiency of any prime mover that burns fuel and produces rotational, or shaft, power. It is typically used for comparing the efficiency of internal combustion engines with a shaft output. /// - public partial struct BrakeSpecificFuelConsumption : IQuantity, IComparable, IComparable + public partial struct BrakeSpecificFuelConsumption : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out BrakeS return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) + { + return left.Equals(right); + } + + public static bool operator !=(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is BrakeSpecificFuelConsumption)) throw new ArgumentException("Expected type BrakeSpecificFuelConsumption.", nameof(obj)); + if(!(obj is BrakeSpecificFuelConsumption objBrakeSpecificFuelConsumption)) throw new ArgumentException("Expected type BrakeSpecificFuelConsumption.", nameof(obj)); - return CompareTo((BrakeSpecificFuelConsumption)obj); + return CompareTo(objBrakeSpecificFuelConsumption); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(BrakeSpecificFuelConsumption other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is BrakeSpecificFuelConsumption objBrakeSpecificFuelConsumption)) + return false; + + return Equals(objBrakeSpecificFuelConsumption); + } + + public bool Equals(BrakeSpecificFuelConsumption other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another BrakeSpecificFuelConsumption within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 55ac3cd742..fb834ff5cc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Capacitance /// - public partial struct Capacitance : IQuantity, IComparable, IComparable + public partial struct Capacitance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Capaci return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Capacitance left, Capacitance right) + { + return left.Equals(right); + } + + public static bool operator !=(Capacitance left, Capacitance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Capacitance)) throw new ArgumentException("Expected type Capacitance.", nameof(obj)); + if(!(obj is Capacitance objCapacitance)) throw new ArgumentException("Expected type Capacitance.", nameof(obj)); - return CompareTo((Capacitance)obj); + return CompareTo(objCapacitance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(Capacitance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Capacitance objCapacitance)) + return false; + + return Equals(objCapacitance); + } + + public bool Equals(Capacitance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Capacitance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index d27cca70a7..f0f973ddc0 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A unit that represents a fractional change in size in response to a change in temperature. /// - public partial struct CoefficientOfThermalExpansion : IQuantity, IComparable, IComparable + public partial struct CoefficientOfThermalExpansion : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Coeffi return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(CoefficientOfThermalExpansion left, CoefficientOfThermalExpansion right) + { + return left.Equals(right); + } + + public static bool operator !=(CoefficientOfThermalExpansion left, CoefficientOfThermalExpansion right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is CoefficientOfThermalExpansion)) throw new ArgumentException("Expected type CoefficientOfThermalExpansion.", nameof(obj)); + if(!(obj is CoefficientOfThermalExpansion objCoefficientOfThermalExpansion)) throw new ArgumentException("Expected type CoefficientOfThermalExpansion.", nameof(obj)); - return CompareTo((CoefficientOfThermalExpansion)obj); + return CompareTo(objCoefficientOfThermalExpansion); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(CoefficientOfThermalExpansion other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is CoefficientOfThermalExpansion objCoefficientOfThermalExpansion)) + return false; + + return Equals(objCoefficientOfThermalExpansion); + } + + public bool Equals(CoefficientOfThermalExpansion other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another CoefficientOfThermalExpansion within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 79b9788d67..a1bc4cec77 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// http://en.wikipedia.org/wiki/Density /// - public partial struct Density : IQuantity, IComparable, IComparable + public partial struct Density : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -929,12 +929,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Densit return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Density left, Density right) + { + return left.Equals(right); + } + + public static bool operator !=(Density left, Density right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Density)) throw new ArgumentException("Expected type Density.", nameof(obj)); + if(!(obj is Density objDensity)) throw new ArgumentException("Expected type Density.", nameof(obj)); - return CompareTo((Density)obj); + return CompareTo(objDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -943,6 +953,19 @@ public int CompareTo(Density other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Density objDensity)) + return false; + + return Equals(objDensity); + } + + public bool Equals(Density other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Density within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 9d60580fcb..a492045fa3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Time is a dimension in which events can be ordered from the past through the present into the future, and also the measure of durations of events and the intervals between them. /// - public partial struct Duration : IQuantity, IComparable, IComparable + public partial struct Duration : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -534,12 +534,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Durati return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Duration left, Duration right) + { + return left.Equals(right); + } + + public static bool operator !=(Duration left, Duration right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Duration)) throw new ArgumentException("Expected type Duration.", nameof(obj)); + if(!(obj is Duration objDuration)) throw new ArgumentException("Expected type Duration.", nameof(obj)); - return CompareTo((Duration)obj); + return CompareTo(objDuration); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -548,6 +558,19 @@ public int CompareTo(Duration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Duration objDuration)) + return false; + + return Equals(objDuration); + } + + public bool Equals(Duration other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Duration within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index f92c2d2e61..c6f68cbcb4 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Viscosity#Dynamic_.28shear.29_viscosity /// - public partial struct DynamicViscosity : IQuantity, IComparable, IComparable + public partial struct DynamicViscosity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -481,12 +481,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Dynami return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(DynamicViscosity left, DynamicViscosity right) + { + return left.Equals(right); + } + + public static bool operator !=(DynamicViscosity left, DynamicViscosity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is DynamicViscosity)) throw new ArgumentException("Expected type DynamicViscosity.", nameof(obj)); + if(!(obj is DynamicViscosity objDynamicViscosity)) throw new ArgumentException("Expected type DynamicViscosity.", nameof(obj)); - return CompareTo((DynamicViscosity)obj); + return CompareTo(objDynamicViscosity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -495,6 +505,19 @@ public int CompareTo(DynamicViscosity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is DynamicViscosity objDynamicViscosity)) + return false; + + return Equals(objDynamicViscosity); + } + + public bool Equals(DynamicViscosity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another DynamicViscosity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 56c568d5aa..0aa8614684 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Electric admittance is a measure of how easily a circuit or device will allow a current to flow. It is defined as the inverse of impedance. The SI unit of admittance is the siemens (symbol S). /// - public partial struct ElectricAdmittance : IQuantity, IComparable, IComparable + public partial struct ElectricAdmittance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -450,12 +450,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricAdmittance left, ElectricAdmittance right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricAdmittance left, ElectricAdmittance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricAdmittance)) throw new ArgumentException("Expected type ElectricAdmittance.", nameof(obj)); + if(!(obj is ElectricAdmittance objElectricAdmittance)) throw new ArgumentException("Expected type ElectricAdmittance.", nameof(obj)); - return CompareTo((ElectricAdmittance)obj); + return CompareTo(objElectricAdmittance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -464,6 +474,19 @@ public int CompareTo(ElectricAdmittance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricAdmittance objElectricAdmittance)) + return false; + + return Equals(objElectricAdmittance); + } + + public bool Equals(ElectricAdmittance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricAdmittance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index 14b5a81345..ad8c89f4e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electric_charge /// - public partial struct ElectricCharge : IQuantity, IComparable, IComparable + public partial struct ElectricCharge : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricCharge left, ElectricCharge right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricCharge left, ElectricCharge right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricCharge)) throw new ArgumentException("Expected type ElectricCharge.", nameof(obj)); + if(!(obj is ElectricCharge objElectricCharge)) throw new ArgumentException("Expected type ElectricCharge.", nameof(obj)); - return CompareTo((ElectricCharge)obj); + return CompareTo(objElectricCharge); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(ElectricCharge other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricCharge objElectricCharge)) + return false; + + return Equals(objElectricCharge); + } + + public bool Equals(ElectricCharge other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricCharge within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 0a16178af6..c7f07b4c82 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Charge_density /// - public partial struct ElectricChargeDensity : IQuantity, IComparable, IComparable + public partial struct ElectricChargeDensity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricChargeDensity left, ElectricChargeDensity right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricChargeDensity left, ElectricChargeDensity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricChargeDensity)) throw new ArgumentException("Expected type ElectricChargeDensity.", nameof(obj)); + if(!(obj is ElectricChargeDensity objElectricChargeDensity)) throw new ArgumentException("Expected type ElectricChargeDensity.", nameof(obj)); - return CompareTo((ElectricChargeDensity)obj); + return CompareTo(objElectricChargeDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(ElectricChargeDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricChargeDensity objElectricChargeDensity)) + return false; + + return Equals(objElectricChargeDensity); + } + + public bool Equals(ElectricChargeDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricChargeDensity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index cf63700d7a..055e85ca6e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electrical_resistance_and_conductance /// - public partial struct ElectricConductance : IQuantity, IComparable, IComparable + public partial struct ElectricConductance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -439,12 +439,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricConductance left, ElectricConductance right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricConductance left, ElectricConductance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricConductance)) throw new ArgumentException("Expected type ElectricConductance.", nameof(obj)); + if(!(obj is ElectricConductance objElectricConductance)) throw new ArgumentException("Expected type ElectricConductance.", nameof(obj)); - return CompareTo((ElectricConductance)obj); + return CompareTo(objElectricConductance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -453,6 +463,19 @@ public int CompareTo(ElectricConductance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricConductance objElectricConductance)) + return false; + + return Equals(objElectricConductance); + } + + public bool Equals(ElectricConductance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricConductance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 07b04d69e2..2bf2645bb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity /// - public partial struct ElectricConductivity : IQuantity, IComparable, IComparable + public partial struct ElectricConductivity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricConductivity left, ElectricConductivity right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricConductivity left, ElectricConductivity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricConductivity)) throw new ArgumentException("Expected type ElectricConductivity.", nameof(obj)); + if(!(obj is ElectricConductivity objElectricConductivity)) throw new ArgumentException("Expected type ElectricConductivity.", nameof(obj)); - return CompareTo((ElectricConductivity)obj); + return CompareTo(objElectricConductivity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(ElectricConductivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricConductivity objElectricConductivity)) + return false; + + return Equals(objElectricConductivity); + } + + public bool Equals(ElectricConductivity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricConductivity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 546bca6c60..297cf7cb67 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// An electric current is a flow of electric charge. In electric circuits this charge is often carried by moving electrons in a wire. It can also be carried by ions in an electrolyte, or by both ions and electrons such as in a plasma. /// - public partial struct ElectricCurrent : IQuantity, IComparable, IComparable + public partial struct ElectricCurrent : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -506,12 +506,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricCurrent left, ElectricCurrent right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricCurrent left, ElectricCurrent right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricCurrent)) throw new ArgumentException("Expected type ElectricCurrent.", nameof(obj)); + if(!(obj is ElectricCurrent objElectricCurrent)) throw new ArgumentException("Expected type ElectricCurrent.", nameof(obj)); - return CompareTo((ElectricCurrent)obj); + return CompareTo(objElectricCurrent); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -520,6 +530,19 @@ public int CompareTo(ElectricCurrent other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricCurrent objElectricCurrent)) + return false; + + return Equals(objElectricCurrent); + } + + public bool Equals(ElectricCurrent other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricCurrent within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 59306fe6ac..454421c96a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Current_density /// - public partial struct ElectricCurrentDensity : IQuantity, IComparable, IComparable + public partial struct ElectricCurrentDensity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricCurrentDensity left, ElectricCurrentDensity right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricCurrentDensity left, ElectricCurrentDensity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricCurrentDensity)) throw new ArgumentException("Expected type ElectricCurrentDensity.", nameof(obj)); + if(!(obj is ElectricCurrentDensity objElectricCurrentDensity)) throw new ArgumentException("Expected type ElectricCurrentDensity.", nameof(obj)); - return CompareTo((ElectricCurrentDensity)obj); + return CompareTo(objElectricCurrentDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(ElectricCurrentDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricCurrentDensity objElectricCurrentDensity)) + return false; + + return Equals(objElectricCurrentDensity); + } + + public bool Equals(ElectricCurrentDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricCurrentDensity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 8a71720550..45c50ff74e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In electromagnetism, the current gradient describes how the current changes in time. /// - public partial struct ElectricCurrentGradient : IQuantity, IComparable, IComparable + public partial struct ElectricCurrentGradient : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -408,12 +408,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricCurrentGradient left, ElectricCurrentGradient right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricCurrentGradient left, ElectricCurrentGradient right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricCurrentGradient)) throw new ArgumentException("Expected type ElectricCurrentGradient.", nameof(obj)); + if(!(obj is ElectricCurrentGradient objElectricCurrentGradient)) throw new ArgumentException("Expected type ElectricCurrentGradient.", nameof(obj)); - return CompareTo((ElectricCurrentGradient)obj); + return CompareTo(objElectricCurrentGradient); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -422,6 +432,19 @@ public int CompareTo(ElectricCurrentGradient other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricCurrentGradient objElectricCurrentGradient)) + return false; + + return Equals(objElectricCurrentGradient); + } + + public bool Equals(ElectricCurrentGradient other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricCurrentGradient within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 1abc713686..92ad660991 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electric_field /// - public partial struct ElectricField : IQuantity, IComparable, IComparable + public partial struct ElectricField : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricField left, ElectricField right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricField left, ElectricField right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricField)) throw new ArgumentException("Expected type ElectricField.", nameof(obj)); + if(!(obj is ElectricField objElectricField)) throw new ArgumentException("Expected type ElectricField.", nameof(obj)); - return CompareTo((ElectricField)obj); + return CompareTo(objElectricField); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(ElectricField other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricField objElectricField)) + return false; + + return Equals(objElectricField); + } + + public bool Equals(ElectricField other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricField within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index c7c7f24382..f16d5ea0be 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Inductance /// - public partial struct ElectricInductance : IQuantity, IComparable, IComparable + public partial struct ElectricInductance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricInductance left, ElectricInductance right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricInductance left, ElectricInductance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricInductance)) throw new ArgumentException("Expected type ElectricInductance.", nameof(obj)); + if(!(obj is ElectricInductance objElectricInductance)) throw new ArgumentException("Expected type ElectricInductance.", nameof(obj)); - return CompareTo((ElectricInductance)obj); + return CompareTo(objElectricInductance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(ElectricInductance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricInductance objElectricInductance)) + return false; + + return Equals(objElectricInductance); + } + + public bool Equals(ElectricInductance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricInductance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index b28667c840..94bb36db61 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In classical electromagnetism, the electric potential (a scalar quantity denoted by Φ, ΦE or V and also called the electric field potential or the electrostatic potential) at a point is the amount of electric potential energy that a unitary point charge would have when located at that point. /// - public partial struct ElectricPotential : IQuantity, IComparable, IComparable + public partial struct ElectricPotential : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -464,12 +464,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricPotential left, ElectricPotential right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricPotential left, ElectricPotential right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricPotential)) throw new ArgumentException("Expected type ElectricPotential.", nameof(obj)); + if(!(obj is ElectricPotential objElectricPotential)) throw new ArgumentException("Expected type ElectricPotential.", nameof(obj)); - return CompareTo((ElectricPotential)obj); + return CompareTo(objElectricPotential); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -478,6 +488,19 @@ public int CompareTo(ElectricPotential other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricPotential objElectricPotential)) + return false; + + return Equals(objElectricPotential); + } + + public bool Equals(ElectricPotential other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricPotential within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index a172668d60..decd51b7f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The Electric Potential of a system known to use Alternating Current. /// - public partial struct ElectricPotentialAc : IQuantity, IComparable, IComparable + public partial struct ElectricPotentialAc : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -464,12 +464,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricPotentialAc left, ElectricPotentialAc right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricPotentialAc left, ElectricPotentialAc right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricPotentialAc)) throw new ArgumentException("Expected type ElectricPotentialAc.", nameof(obj)); + if(!(obj is ElectricPotentialAc objElectricPotentialAc)) throw new ArgumentException("Expected type ElectricPotentialAc.", nameof(obj)); - return CompareTo((ElectricPotentialAc)obj); + return CompareTo(objElectricPotentialAc); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -478,6 +488,19 @@ public int CompareTo(ElectricPotentialAc other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricPotentialAc objElectricPotentialAc)) + return false; + + return Equals(objElectricPotentialAc); + } + + public bool Equals(ElectricPotentialAc other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricPotentialAc within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 8f1cf03d97..8e52d3a11f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The Electric Potential of a system known to use Direct Current. /// - public partial struct ElectricPotentialDc : IQuantity, IComparable, IComparable + public partial struct ElectricPotentialDc : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -464,12 +464,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricPotentialDc left, ElectricPotentialDc right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricPotentialDc left, ElectricPotentialDc right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricPotentialDc)) throw new ArgumentException("Expected type ElectricPotentialDc.", nameof(obj)); + if(!(obj is ElectricPotentialDc objElectricPotentialDc)) throw new ArgumentException("Expected type ElectricPotentialDc.", nameof(obj)); - return CompareTo((ElectricPotentialDc)obj); + return CompareTo(objElectricPotentialDc); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -478,6 +488,19 @@ public int CompareTo(ElectricPotentialDc other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricPotentialDc objElectricPotentialDc)) + return false; + + return Equals(objElectricPotentialDc); + } + + public bool Equals(ElectricPotentialDc other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricPotentialDc within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index f70db6dcc1..39977abb4c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The electrical resistance of an electrical conductor is the opposition to the passage of an electric current through that conductor. /// - public partial struct ElectricResistance : IQuantity, IComparable, IComparable + public partial struct ElectricResistance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -450,12 +450,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricResistance left, ElectricResistance right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricResistance left, ElectricResistance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricResistance)) throw new ArgumentException("Expected type ElectricResistance.", nameof(obj)); + if(!(obj is ElectricResistance objElectricResistance)) throw new ArgumentException("Expected type ElectricResistance.", nameof(obj)); - return CompareTo((ElectricResistance)obj); + return CompareTo(objElectricResistance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -464,6 +474,19 @@ public int CompareTo(ElectricResistance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricResistance objElectricResistance)) + return false; + + return Equals(objElectricResistance); + } + + public bool Equals(ElectricResistance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricResistance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 4233c05f13..9a5659af14 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity /// - public partial struct ElectricResistivity : IQuantity, IComparable, IComparable + public partial struct ElectricResistivity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -453,12 +453,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Electr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ElectricResistivity left, ElectricResistivity right) + { + return left.Equals(right); + } + + public static bool operator !=(ElectricResistivity left, ElectricResistivity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ElectricResistivity)) throw new ArgumentException("Expected type ElectricResistivity.", nameof(obj)); + if(!(obj is ElectricResistivity objElectricResistivity)) throw new ArgumentException("Expected type ElectricResistivity.", nameof(obj)); - return CompareTo((ElectricResistivity)obj); + return CompareTo(objElectricResistivity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -467,6 +477,19 @@ public int CompareTo(ElectricResistivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ElectricResistivity objElectricResistivity)) + return false; + + return Equals(objElectricResistivity); + } + + public bool Equals(ElectricResistivity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ElectricResistivity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 7feddd4041..70dd0022b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second. Many other units of energy are included. Please do not confuse this definition of the calorie with the one colloquially used by the food industry, the large calorie, which is equivalent to 1 kcal. Thermochemical definition of the calorie is used. For BTU, the IT definition is used. /// - public partial struct Energy : IQuantity, IComparable, IComparable + public partial struct Energy : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -702,12 +702,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Energy return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Energy left, Energy right) + { + return left.Equals(right); + } + + public static bool operator !=(Energy left, Energy right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Energy)) throw new ArgumentException("Expected type Energy.", nameof(obj)); + if(!(obj is Energy objEnergy)) throw new ArgumentException("Expected type Energy.", nameof(obj)); - return CompareTo((Energy)obj); + return CompareTo(objEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -716,6 +726,19 @@ public int CompareTo(Energy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Energy objEnergy)) + return false; + + return Equals(objEnergy); + } + + public bool Equals(Energy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Energy within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index efa316a1f4..d70b0e10ea 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Entropy is an important concept in the branch of science known as thermodynamics. The idea of "irreversibility" is central to the understanding of entropy. It is often said that entropy is an expression of the disorder, or randomness of a system, or of our lack of information about it. Entropy is an extensive property. It has the dimension of energy divided by temperature, which has a unit of joules per kelvin (J/K) in the International System of Units /// - public partial struct Entropy : IQuantity, IComparable, IComparable + public partial struct Entropy : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -492,12 +492,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Entrop return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Entropy left, Entropy right) + { + return left.Equals(right); + } + + public static bool operator !=(Entropy left, Entropy right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Entropy)) throw new ArgumentException("Expected type Entropy.", nameof(obj)); + if(!(obj is Entropy objEntropy)) throw new ArgumentException("Expected type Entropy.", nameof(obj)); - return CompareTo((Entropy)obj); + return CompareTo(objEntropy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -506,6 +516,19 @@ public int CompareTo(Entropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Entropy objEntropy)) + return false; + + return Equals(objEntropy); + } + + public bool Equals(Entropy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Entropy within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 9bf4cbd0a1..be24f8f69e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In physics, a force is any influence that causes an object to undergo a certain change, either concerning its movement, direction, or geometrical construction. In other words, a force can cause an object with mass to change its velocity (which includes to begin moving from a state of rest), i.e., to accelerate, or a flexible object to deform, or both. Force can also be described by intuitive concepts such as a push or a pull. A force has both magnitude and direction, making it a vector quantity. It is measured in the SI unit of newtons and represented by the symbol F. /// - public partial struct Force : IQuantity, IComparable, IComparable + public partial struct Force : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -576,12 +576,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out ForceU return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Force left, Force right) + { + return left.Equals(right); + } + + public static bool operator !=(Force left, Force right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Force)) throw new ArgumentException("Expected type Force.", nameof(obj)); + if(!(obj is Force objForce)) throw new ArgumentException("Expected type Force.", nameof(obj)); - return CompareTo((Force)obj); + return CompareTo(objForce); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -590,6 +600,19 @@ public int CompareTo(Force other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Force objForce)) + return false; + + return Equals(objForce); + } + + public bool Equals(Force other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Force within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 20dc3630b2..0d6065acc8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Force change rate is the ratio of the force change to the time during which the change occurred (value of force changes per unit time). /// - public partial struct ForceChangeRate : IQuantity, IComparable, IComparable + public partial struct ForceChangeRate : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -548,12 +548,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out ForceC return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ForceChangeRate left, ForceChangeRate right) + { + return left.Equals(right); + } + + public static bool operator !=(ForceChangeRate left, ForceChangeRate right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ForceChangeRate)) throw new ArgumentException("Expected type ForceChangeRate.", nameof(obj)); + if(!(obj is ForceChangeRate objForceChangeRate)) throw new ArgumentException("Expected type ForceChangeRate.", nameof(obj)); - return CompareTo((ForceChangeRate)obj); + return CompareTo(objForceChangeRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -562,6 +572,19 @@ public int CompareTo(ForceChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ForceChangeRate objForceChangeRate)) + return false; + + return Equals(objForceChangeRate); + } + + public bool Equals(ForceChangeRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ForceChangeRate within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 201b21a8c9..1cf9184c55 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The magnitude of force per unit length. /// - public partial struct ForcePerLength : IQuantity, IComparable, IComparable + public partial struct ForcePerLength : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -520,12 +520,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out ForceP return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ForcePerLength left, ForcePerLength right) + { + return left.Equals(right); + } + + public static bool operator !=(ForcePerLength left, ForcePerLength right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ForcePerLength)) throw new ArgumentException("Expected type ForcePerLength.", nameof(obj)); + if(!(obj is ForcePerLength objForcePerLength)) throw new ArgumentException("Expected type ForcePerLength.", nameof(obj)); - return CompareTo((ForcePerLength)obj); + return CompareTo(objForcePerLength); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -534,6 +544,19 @@ public int CompareTo(ForcePerLength other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ForcePerLength objForcePerLength)) + return false; + + return Equals(objForcePerLength); + } + + public bool Equals(ForcePerLength other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ForcePerLength within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 49959d51ca..b3a24c9827 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The number of occurrences of a repeating event per unit time. /// - public partial struct Frequency : IQuantity, IComparable, IComparable + public partial struct Frequency : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -506,12 +506,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Freque return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Frequency left, Frequency right) + { + return left.Equals(right); + } + + public static bool operator !=(Frequency left, Frequency right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Frequency)) throw new ArgumentException("Expected type Frequency.", nameof(obj)); + if(!(obj is Frequency objFrequency)) throw new ArgumentException("Expected type Frequency.", nameof(obj)); - return CompareTo((Frequency)obj); + return CompareTo(objFrequency); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -520,6 +530,19 @@ public int CompareTo(Frequency other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Frequency objFrequency)) + return false; + + return Equals(objFrequency); + } + + public bool Equals(Frequency other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Frequency within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 8005e0e610..d236d8de5a 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Heat flux is the flow of energy per unit of area per unit of time /// - public partial struct HeatFlux : IQuantity, IComparable, IComparable + public partial struct HeatFlux : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -618,12 +618,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out HeatFl return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(HeatFlux left, HeatFlux right) + { + return left.Equals(right); + } + + public static bool operator !=(HeatFlux left, HeatFlux right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is HeatFlux)) throw new ArgumentException("Expected type HeatFlux.", nameof(obj)); + if(!(obj is HeatFlux objHeatFlux)) throw new ArgumentException("Expected type HeatFlux.", nameof(obj)); - return CompareTo((HeatFlux)obj); + return CompareTo(objHeatFlux); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -632,6 +642,19 @@ public int CompareTo(HeatFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is HeatFlux objHeatFlux)) + return false; + + return Equals(objHeatFlux); + } + + public bool Equals(HeatFlux other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another HeatFlux within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 6c6624f9ed..c355fb90d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The heat transfer coefficient or film coefficient, or film effectiveness, in thermodynamics and in mechanics is the proportionality constant between the heat flux and the thermodynamic driving force for the flow of heat (i.e., the temperature difference, ΔT) /// - public partial struct HeatTransferCoefficient : IQuantity, IComparable, IComparable + public partial struct HeatTransferCoefficient : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -422,12 +422,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out HeatTr return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(HeatTransferCoefficient left, HeatTransferCoefficient right) + { + return left.Equals(right); + } + + public static bool operator !=(HeatTransferCoefficient left, HeatTransferCoefficient right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is HeatTransferCoefficient)) throw new ArgumentException("Expected type HeatTransferCoefficient.", nameof(obj)); + if(!(obj is HeatTransferCoefficient objHeatTransferCoefficient)) throw new ArgumentException("Expected type HeatTransferCoefficient.", nameof(obj)); - return CompareTo((HeatTransferCoefficient)obj); + return CompareTo(objHeatTransferCoefficient); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -436,6 +446,19 @@ public int CompareTo(HeatTransferCoefficient other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is HeatTransferCoefficient objHeatTransferCoefficient)) + return false; + + return Equals(objHeatTransferCoefficient); + } + + public bool Equals(HeatTransferCoefficient other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another HeatTransferCoefficient within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index e565b6477a..c5da84031f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Illuminance /// - public partial struct Illuminance : IQuantity, IComparable, IComparable + public partial struct Illuminance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -453,12 +453,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Illumi return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Illuminance left, Illuminance right) + { + return left.Equals(right); + } + + public static bool operator !=(Illuminance left, Illuminance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Illuminance)) throw new ArgumentException("Expected type Illuminance.", nameof(obj)); + if(!(obj is Illuminance objIlluminance)) throw new ArgumentException("Expected type Illuminance.", nameof(obj)); - return CompareTo((Illuminance)obj); + return CompareTo(objIlluminance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -467,6 +477,19 @@ public int CompareTo(Illuminance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Illuminance objIlluminance)) + return false; + + return Equals(objIlluminance); + } + + public bool Equals(Illuminance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Illuminance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 70b19de0c1..d713e80770 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In computing and telecommunications, a unit of information is the capacity of some standard data storage system or communication channel, used to measure the capacities of other systems and channels. In information theory, units of information are also used to measure the information contents or entropy of random variables. /// - public partial struct Information : IQuantity, IComparable, IComparable + public partial struct Information : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -758,12 +758,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Inform return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Information left, Information right) + { + return left.Equals(right); + } + + public static bool operator !=(Information left, Information right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Information)) throw new ArgumentException("Expected type Information.", nameof(obj)); + if(!(obj is Information objInformation)) throw new ArgumentException("Expected type Information.", nameof(obj)); - return CompareTo((Information)obj); + return CompareTo(objInformation); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -772,6 +782,19 @@ public int CompareTo(Information other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Information objInformation)) + return false; + + return Equals(objInformation); + } + + public bool Equals(Information other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Information within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 285b42268a..8a216b2374 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Irradiance is the intensity of ultraviolet (UV) or visible light incident on a surface. /// - public partial struct Irradiance : IQuantity, IComparable, IComparable + public partial struct Irradiance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -422,12 +422,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Irradi return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Irradiance left, Irradiance right) + { + return left.Equals(right); + } + + public static bool operator !=(Irradiance left, Irradiance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Irradiance)) throw new ArgumentException("Expected type Irradiance.", nameof(obj)); + if(!(obj is Irradiance objIrradiance)) throw new ArgumentException("Expected type Irradiance.", nameof(obj)); - return CompareTo((Irradiance)obj); + return CompareTo(objIrradiance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -436,6 +446,19 @@ public int CompareTo(Irradiance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Irradiance objIrradiance)) + return false; + + return Equals(objIrradiance); + } + + public bool Equals(Irradiance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Irradiance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 60a18e3ee3..9661a629eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Irradiation /// - public partial struct Irradiation : IQuantity, IComparable, IComparable + public partial struct Irradiation : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -439,12 +439,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Irradi return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Irradiation left, Irradiation right) + { + return left.Equals(right); + } + + public static bool operator !=(Irradiation left, Irradiation right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Irradiation)) throw new ArgumentException("Expected type Irradiation.", nameof(obj)); + if(!(obj is Irradiation objIrradiation)) throw new ArgumentException("Expected type Irradiation.", nameof(obj)); - return CompareTo((Irradiation)obj); + return CompareTo(objIrradiation); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -453,6 +463,19 @@ public int CompareTo(Irradiation other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Irradiation objIrradiation)) + return false; + + return Equals(objIrradiation); + } + + public bool Equals(Irradiation other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Irradiation within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 27c4a59d9a..7f291dac8a 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// http://en.wikipedia.org/wiki/Viscosity /// - public partial struct KinematicViscosity : IQuantity, IComparable, IComparable + public partial struct KinematicViscosity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -509,12 +509,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Kinema return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(KinematicViscosity left, KinematicViscosity right) + { + return left.Equals(right); + } + + public static bool operator !=(KinematicViscosity left, KinematicViscosity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is KinematicViscosity)) throw new ArgumentException("Expected type KinematicViscosity.", nameof(obj)); + if(!(obj is KinematicViscosity objKinematicViscosity)) throw new ArgumentException("Expected type KinematicViscosity.", nameof(obj)); - return CompareTo((KinematicViscosity)obj); + return CompareTo(objKinematicViscosity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -523,6 +533,19 @@ public int CompareTo(KinematicViscosity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is KinematicViscosity objKinematicViscosity)) + return false; + + return Equals(objKinematicViscosity); + } + + public bool Equals(KinematicViscosity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another KinematicViscosity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 26d834afad..be4066d7f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Lapse rate is the rate at which Earth's atmospheric temperature decreases with an increase in altitude, or increases with the decrease in altitude. /// - public partial struct LapseRate : IQuantity, IComparable, IComparable + public partial struct LapseRate : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -408,12 +408,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out LapseR return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(LapseRate left, LapseRate right) + { + return left.Equals(right); + } + + public static bool operator !=(LapseRate left, LapseRate right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is LapseRate)) throw new ArgumentException("Expected type LapseRate.", nameof(obj)); + if(!(obj is LapseRate objLapseRate)) throw new ArgumentException("Expected type LapseRate.", nameof(obj)); - return CompareTo((LapseRate)obj); + return CompareTo(objLapseRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -422,6 +432,19 @@ public int CompareTo(LapseRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is LapseRate objLapseRate)) + return false; + + return Equals(objLapseRate); + } + + public bool Equals(LapseRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another LapseRate within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 51e7126158..e03e322247 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Many different units of length have been used around the world. The main units in modern use are U.S. customary units in the United States and the Metric system elsewhere. British Imperial units are still used for some purposes in the United Kingdom and some other countries. The metric system is sub-divided into SI and non-SI units. /// - public partial struct Length : IQuantity, IComparable, IComparable + public partial struct Length : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -702,12 +702,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Length return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Length left, Length right) + { + return left.Equals(right); + } + + public static bool operator !=(Length left, Length right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Length)) throw new ArgumentException("Expected type Length.", nameof(obj)); + if(!(obj is Length objLength)) throw new ArgumentException("Expected type Length.", nameof(obj)); - return CompareTo((Length)obj); + return CompareTo(objLength); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -716,6 +726,19 @@ public int CompareTo(Length other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Length objLength)) + return false; + + return Equals(objLength); + } + + public bool Equals(Length other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Length within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index e1dda31785..e35db5d5c1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Level is the logarithm of the ratio of a quantity Q to a reference value of that quantity, Q₀, expressed in dimensionless units. /// - public partial struct Level : IQuantity, IComparable, IComparable + public partial struct Level : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -430,12 +430,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out LevelU return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Level left, Level right) + { + return left.Equals(right); + } + + public static bool operator !=(Level left, Level right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Level)) throw new ArgumentException("Expected type Level.", nameof(obj)); + if(!(obj is Level objLevel)) throw new ArgumentException("Expected type Level.", nameof(obj)); - return CompareTo((Level)obj); + return CompareTo(objLevel); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -444,6 +454,19 @@ public int CompareTo(Level other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Level objLevel)) + return false; + + return Equals(objLevel); + } + + public bool Equals(Level other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Level within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index 96e9b0c092..cbf5870f3b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// http://en.wikipedia.org/wiki/Linear_density /// - public partial struct LinearDensity : IQuantity, IComparable, IComparable + public partial struct LinearDensity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -439,12 +439,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Linear return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(LinearDensity left, LinearDensity right) + { + return left.Equals(right); + } + + public static bool operator !=(LinearDensity left, LinearDensity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is LinearDensity)) throw new ArgumentException("Expected type LinearDensity.", nameof(obj)); + if(!(obj is LinearDensity objLinearDensity)) throw new ArgumentException("Expected type LinearDensity.", nameof(obj)); - return CompareTo((LinearDensity)obj); + return CompareTo(objLinearDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -453,6 +463,19 @@ public int CompareTo(LinearDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is LinearDensity objLinearDensity)) + return false; + + return Equals(objLinearDensity); + } + + public bool Equals(LinearDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another LinearDensity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index d7aaa86a5f..a7ee796bb5 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Luminous_flux /// - public partial struct LuminousFlux : IQuantity, IComparable, IComparable + public partial struct LuminousFlux : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Lumino return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(LuminousFlux left, LuminousFlux right) + { + return left.Equals(right); + } + + public static bool operator !=(LuminousFlux left, LuminousFlux right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is LuminousFlux)) throw new ArgumentException("Expected type LuminousFlux.", nameof(obj)); + if(!(obj is LuminousFlux objLuminousFlux)) throw new ArgumentException("Expected type LuminousFlux.", nameof(obj)); - return CompareTo((LuminousFlux)obj); + return CompareTo(objLuminousFlux); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(LuminousFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is LuminousFlux objLuminousFlux)) + return false; + + return Equals(objLuminousFlux); + } + + public bool Equals(LuminousFlux other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another LuminousFlux within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 2f70b17d03..ebfd3b327e 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Luminous_intensity /// - public partial struct LuminousIntensity : IQuantity, IComparable, IComparable + public partial struct LuminousIntensity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Lumino return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(LuminousIntensity left, LuminousIntensity right) + { + return left.Equals(right); + } + + public static bool operator !=(LuminousIntensity left, LuminousIntensity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is LuminousIntensity)) throw new ArgumentException("Expected type LuminousIntensity.", nameof(obj)); + if(!(obj is LuminousIntensity objLuminousIntensity)) throw new ArgumentException("Expected type LuminousIntensity.", nameof(obj)); - return CompareTo((LuminousIntensity)obj); + return CompareTo(objLuminousIntensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(LuminousIntensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is LuminousIntensity objLuminousIntensity)) + return false; + + return Equals(objLuminousIntensity); + } + + public bool Equals(LuminousIntensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another LuminousIntensity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 2e4ced2daf..53efad53e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Magnetic_field /// - public partial struct MagneticField : IQuantity, IComparable, IComparable + public partial struct MagneticField : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Magnet return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(MagneticField left, MagneticField right) + { + return left.Equals(right); + } + + public static bool operator !=(MagneticField left, MagneticField right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MagneticField)) throw new ArgumentException("Expected type MagneticField.", nameof(obj)); + if(!(obj is MagneticField objMagneticField)) throw new ArgumentException("Expected type MagneticField.", nameof(obj)); - return CompareTo((MagneticField)obj); + return CompareTo(objMagneticField); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(MagneticField other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is MagneticField objMagneticField)) + return false; + + return Equals(objMagneticField); + } + + public bool Equals(MagneticField other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MagneticField within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 9a5151b38c..6758122032 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Magnetic_flux /// - public partial struct MagneticFlux : IQuantity, IComparable, IComparable + public partial struct MagneticFlux : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Magnet return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(MagneticFlux left, MagneticFlux right) + { + return left.Equals(right); + } + + public static bool operator !=(MagneticFlux left, MagneticFlux right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MagneticFlux)) throw new ArgumentException("Expected type MagneticFlux.", nameof(obj)); + if(!(obj is MagneticFlux objMagneticFlux)) throw new ArgumentException("Expected type MagneticFlux.", nameof(obj)); - return CompareTo((MagneticFlux)obj); + return CompareTo(objMagneticFlux); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(MagneticFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is MagneticFlux objMagneticFlux)) + return false; + + return Equals(objMagneticFlux); + } + + public bool Equals(MagneticFlux other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MagneticFlux within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 9c4be74aac..fb03bce307 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Magnetization /// - public partial struct Magnetization : IQuantity, IComparable, IComparable + public partial struct Magnetization : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Magnet return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Magnetization left, Magnetization right) + { + return left.Equals(right); + } + + public static bool operator !=(Magnetization left, Magnetization right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Magnetization)) throw new ArgumentException("Expected type Magnetization.", nameof(obj)); + if(!(obj is Magnetization objMagnetization)) throw new ArgumentException("Expected type Magnetization.", nameof(obj)); - return CompareTo((Magnetization)obj); + return CompareTo(objMagnetization); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(Magnetization other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Magnetization objMagnetization)) + return false; + + return Equals(objMagnetization); + } + + public bool Equals(Magnetization other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Magnetization within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index 0f35914d2b..f68c7a731b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In physics, mass (from Greek μᾶζα "barley cake, lump [of dough]") is a property of a physical system or body, giving rise to the phenomena of the body's resistance to being accelerated by a force and the strength of its mutual gravitational attraction with other bodies. Instruments such as mass balances or scales use those phenomena to measure mass. The SI unit of mass is the kilogram (kg). /// - public partial struct Mass : IQuantity, IComparable, IComparable + public partial struct Mass : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -702,12 +702,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out MassUn return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Mass left, Mass right) + { + return left.Equals(right); + } + + public static bool operator !=(Mass left, Mass right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Mass)) throw new ArgumentException("Expected type Mass.", nameof(obj)); + if(!(obj is Mass objMass)) throw new ArgumentException("Expected type Mass.", nameof(obj)); - return CompareTo((Mass)obj); + return CompareTo(objMass); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -716,6 +726,19 @@ public int CompareTo(Mass other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Mass objMass)) + return false; + + return Equals(objMass); + } + + public bool Equals(Mass other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Mass within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 940552ccff..1b21e02463 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Mass flow is the ratio of the mass change to the time during which the change occurred (value of mass changes per unit time). /// - public partial struct MassFlow : IQuantity, IComparable, IComparable + public partial struct MassFlow : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -632,12 +632,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out MassFl return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(MassFlow left, MassFlow right) + { + return left.Equals(right); + } + + public static bool operator !=(MassFlow left, MassFlow right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MassFlow)) throw new ArgumentException("Expected type MassFlow.", nameof(obj)); + if(!(obj is MassFlow objMassFlow)) throw new ArgumentException("Expected type MassFlow.", nameof(obj)); - return CompareTo((MassFlow)obj); + return CompareTo(objMassFlow); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -646,6 +656,19 @@ public int CompareTo(MassFlow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is MassFlow objMassFlow)) + return false; + + return Equals(objMassFlow); + } + + public bool Equals(MassFlow other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MassFlow within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index 3e0c9b3650..6e77cad9f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Mass flux is the mass flow rate per unit area. /// - public partial struct MassFlux : IQuantity, IComparable, IComparable + public partial struct MassFlux : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -422,12 +422,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out MassFl return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(MassFlux left, MassFlux right) + { + return left.Equals(right); + } + + public static bool operator !=(MassFlux left, MassFlux right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MassFlux)) throw new ArgumentException("Expected type MassFlux.", nameof(obj)); + if(!(obj is MassFlux objMassFlux)) throw new ArgumentException("Expected type MassFlux.", nameof(obj)); - return CompareTo((MassFlux)obj); + return CompareTo(objMassFlux); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -436,6 +446,19 @@ public int CompareTo(MassFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is MassFlux objMassFlux)) + return false; + + return Equals(objMassFlux); + } + + public bool Equals(MassFlux other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MassFlux within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 2f4abcf978..8a99f8e914 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A property of body reflects how its mass is distributed with regard to an axis. /// - public partial struct MassMomentOfInertia : IQuantity, IComparable, IComparable + public partial struct MassMomentOfInertia : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -786,12 +786,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out MassMo return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(MassMomentOfInertia left, MassMomentOfInertia right) + { + return left.Equals(right); + } + + public static bool operator !=(MassMomentOfInertia left, MassMomentOfInertia right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MassMomentOfInertia)) throw new ArgumentException("Expected type MassMomentOfInertia.", nameof(obj)); + if(!(obj is MassMomentOfInertia objMassMomentOfInertia)) throw new ArgumentException("Expected type MassMomentOfInertia.", nameof(obj)); - return CompareTo((MassMomentOfInertia)obj); + return CompareTo(objMassMomentOfInertia); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -800,6 +810,19 @@ public int CompareTo(MassMomentOfInertia other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is MassMomentOfInertia objMassMomentOfInertia)) + return false; + + return Equals(objMassMomentOfInertia); + } + + public bool Equals(MassMomentOfInertia other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MassMomentOfInertia within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 00b21fdd99..a1e0c9befd 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Molar energy is the amount of energy stored in 1 mole of a substance. /// - public partial struct MolarEnergy : IQuantity, IComparable, IComparable + public partial struct MolarEnergy : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out MolarE return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(MolarEnergy left, MolarEnergy right) + { + return left.Equals(right); + } + + public static bool operator !=(MolarEnergy left, MolarEnergy right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MolarEnergy)) throw new ArgumentException("Expected type MolarEnergy.", nameof(obj)); + if(!(obj is MolarEnergy objMolarEnergy)) throw new ArgumentException("Expected type MolarEnergy.", nameof(obj)); - return CompareTo((MolarEnergy)obj); + return CompareTo(objMolarEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(MolarEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is MolarEnergy objMolarEnergy)) + return false; + + return Equals(objMolarEnergy); + } + + public bool Equals(MolarEnergy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MolarEnergy within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 5ef2ea0fe3..807f2ef8b4 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Molar entropy is amount of energy required to increase temperature of 1 mole substance by 1 Kelvin. /// - public partial struct MolarEntropy : IQuantity, IComparable, IComparable + public partial struct MolarEntropy : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out MolarE return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(MolarEntropy left, MolarEntropy right) + { + return left.Equals(right); + } + + public static bool operator !=(MolarEntropy left, MolarEntropy right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MolarEntropy)) throw new ArgumentException("Expected type MolarEntropy.", nameof(obj)); + if(!(obj is MolarEntropy objMolarEntropy)) throw new ArgumentException("Expected type MolarEntropy.", nameof(obj)); - return CompareTo((MolarEntropy)obj); + return CompareTo(objMolarEntropy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(MolarEntropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is MolarEntropy objMolarEntropy)) + return false; + + return Equals(objMolarEntropy); + } + + public bool Equals(MolarEntropy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MolarEntropy within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 8ff5fe548c..a9ac972482 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In chemistry, the molar mass M is a physical property defined as the mass of a given substance (chemical element or chemical compound) divided by the amount of substance. /// - public partial struct MolarMass : IQuantity, IComparable, IComparable + public partial struct MolarMass : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -562,12 +562,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out MolarM return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(MolarMass left, MolarMass right) + { + return left.Equals(right); + } + + public static bool operator !=(MolarMass left, MolarMass right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is MolarMass)) throw new ArgumentException("Expected type MolarMass.", nameof(obj)); + if(!(obj is MolarMass objMolarMass)) throw new ArgumentException("Expected type MolarMass.", nameof(obj)); - return CompareTo((MolarMass)obj); + return CompareTo(objMolarMass); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -576,6 +586,19 @@ public int CompareTo(MolarMass other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is MolarMass objMolarMass)) + return false; + + return Equals(objMolarMass); + } + + public bool Equals(MolarMass other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another MolarMass within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index adff096d47..c3bb500b58 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Molar_concentration /// - public partial struct Molarity : IQuantity, IComparable, IComparable + public partial struct Molarity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -509,12 +509,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Molari return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Molarity left, Molarity right) + { + return left.Equals(right); + } + + public static bool operator !=(Molarity left, Molarity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Molarity)) throw new ArgumentException("Expected type Molarity.", nameof(obj)); + if(!(obj is Molarity objMolarity)) throw new ArgumentException("Expected type Molarity.", nameof(obj)); - return CompareTo((Molarity)obj); + return CompareTo(objMolarity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -523,6 +533,19 @@ public int CompareTo(Molarity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Molarity objMolarity)) + return false; + + return Equals(objMolarity); + } + + public bool Equals(Molarity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Molarity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 9717d459d4..c837854442 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Permeability_(electromagnetism) /// - public partial struct Permeability : IQuantity, IComparable, IComparable + public partial struct Permeability : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Permea return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Permeability left, Permeability right) + { + return left.Equals(right); + } + + public static bool operator !=(Permeability left, Permeability right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Permeability)) throw new ArgumentException("Expected type Permeability.", nameof(obj)); + if(!(obj is Permeability objPermeability)) throw new ArgumentException("Expected type Permeability.", nameof(obj)); - return CompareTo((Permeability)obj); + return CompareTo(objPermeability); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(Permeability other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Permeability objPermeability)) + return false; + + return Equals(objPermeability); + } + + public bool Equals(Permeability other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Permeability within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 134e7e4745..0135c92d4c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Permittivity /// - public partial struct Permittivity : IQuantity, IComparable, IComparable + public partial struct Permittivity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Permit return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Permittivity left, Permittivity right) + { + return left.Equals(right); + } + + public static bool operator !=(Permittivity left, Permittivity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Permittivity)) throw new ArgumentException("Expected type Permittivity.", nameof(obj)); + if(!(obj is Permittivity objPermittivity)) throw new ArgumentException("Expected type Permittivity.", nameof(obj)); - return CompareTo((Permittivity)obj); + return CompareTo(objPermittivity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(Permittivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Permittivity objPermittivity)) + return false; + + return Equals(objPermittivity); + } + + public bool Equals(Permittivity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Permittivity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 43441207ae..5af1aba2d9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In physics, power is the rate of doing work. It is equivalent to an amount of energy consumed per unit time. /// - public partial struct Power : IQuantity, IComparable, IComparable + public partial struct Power : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -674,12 +674,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out PowerU return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Power left, Power right) + { + return left.Equals(right); + } + + public static bool operator !=(Power left, Power right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Power)) throw new ArgumentException("Expected type Power.", nameof(obj)); + if(!(obj is Power objPower)) throw new ArgumentException("Expected type Power.", nameof(obj)); - return CompareTo((Power)obj); + return CompareTo(objPower); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -688,6 +698,19 @@ public int CompareTo(Power other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Power objPower)) + return false; + + return Equals(objPower); + } + + public bool Equals(Power other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Power within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index 470d8945ea..0561b93c66 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The amount of power in a volume. /// - public partial struct PowerDensity : IQuantity, IComparable, IComparable + public partial struct PowerDensity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -1010,12 +1010,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out PowerD return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(PowerDensity left, PowerDensity right) + { + return left.Equals(right); + } + + public static bool operator !=(PowerDensity left, PowerDensity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is PowerDensity)) throw new ArgumentException("Expected type PowerDensity.", nameof(obj)); + if(!(obj is PowerDensity objPowerDensity)) throw new ArgumentException("Expected type PowerDensity.", nameof(obj)); - return CompareTo((PowerDensity)obj); + return CompareTo(objPowerDensity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -1024,6 +1034,19 @@ public int CompareTo(PowerDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is PowerDensity objPowerDensity)) + return false; + + return Equals(objPowerDensity); + } + + public bool Equals(PowerDensity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another PowerDensity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index ff7d700a7a..3173544500 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The strength of a signal expressed in decibels (dB) relative to one watt. /// - public partial struct PowerRatio : IQuantity, IComparable, IComparable + public partial struct PowerRatio : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -430,12 +430,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out PowerR return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(PowerRatio left, PowerRatio right) + { + return left.Equals(right); + } + + public static bool operator !=(PowerRatio left, PowerRatio right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is PowerRatio)) throw new ArgumentException("Expected type PowerRatio.", nameof(obj)); + if(!(obj is PowerRatio objPowerRatio)) throw new ArgumentException("Expected type PowerRatio.", nameof(obj)); - return CompareTo((PowerRatio)obj); + return CompareTo(objPowerRatio); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -444,6 +454,19 @@ public int CompareTo(PowerRatio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is PowerRatio objPowerRatio)) + return false; + + return Equals(objPowerRatio); + } + + public bool Equals(PowerRatio other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another PowerRatio within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index bb9c25858d..3071a864d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Pressure (symbol: P or p) is the ratio of force to the area over which that force is distributed. Pressure is force per unit area applied in a direction perpendicular to the surface of an object. Gauge pressure (also spelled gage pressure)[a] is the pressure relative to the local atmospheric or ambient pressure. Pressure is measured in any unit of force divided by any unit of area. The SI unit of pressure is the newton per square metre, which is called the pascal (Pa) after the seventeenth-century philosopher and scientist Blaise Pascal. A pressure of 1 Pa is small; it approximately equals the pressure exerted by a dollar bill resting flat on a table. Everyday pressures are often stated in kilopascals (1 kPa = 1000 Pa). /// - public partial struct Pressure : IQuantity, IComparable, IComparable + public partial struct Pressure : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -954,12 +954,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Pressu return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Pressure left, Pressure right) + { + return left.Equals(right); + } + + public static bool operator !=(Pressure left, Pressure right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Pressure)) throw new ArgumentException("Expected type Pressure.", nameof(obj)); + if(!(obj is Pressure objPressure)) throw new ArgumentException("Expected type Pressure.", nameof(obj)); - return CompareTo((Pressure)obj); + return CompareTo(objPressure); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -968,6 +978,19 @@ public int CompareTo(Pressure other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Pressure objPressure)) + return false; + + return Equals(objPressure); + } + + public bool Equals(Pressure other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Pressure within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 4fc0a607da..eebe52221b 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Pressure change rate is the ratio of the pressure change to the time during which the change occurred (value of pressure changes per unit time). /// - public partial struct PressureChangeRate : IQuantity, IComparable, IComparable + public partial struct PressureChangeRate : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -450,12 +450,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Pressu return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(PressureChangeRate left, PressureChangeRate right) + { + return left.Equals(right); + } + + public static bool operator !=(PressureChangeRate left, PressureChangeRate right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is PressureChangeRate)) throw new ArgumentException("Expected type PressureChangeRate.", nameof(obj)); + if(!(obj is PressureChangeRate objPressureChangeRate)) throw new ArgumentException("Expected type PressureChangeRate.", nameof(obj)); - return CompareTo((PressureChangeRate)obj); + return CompareTo(objPressureChangeRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -464,6 +474,19 @@ public int CompareTo(PressureChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is PressureChangeRate objPressureChangeRate)) + return false; + + return Equals(objPressureChangeRate); + } + + public bool Equals(PressureChangeRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another PressureChangeRate within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 4a462f93b7..3162555801 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In mathematics, a ratio is a relationship between two numbers of the same kind (e.g., objects, persons, students, spoonfuls, units of whatever identical dimension), usually expressed as "a to b" or a:b, sometimes expressed arithmetically as a dimensionless quotient of the two that explicitly indicates how many times the first number contains the second (not necessarily an integer). /// - public partial struct Ratio : IQuantity, IComparable, IComparable + public partial struct Ratio : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -478,12 +478,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out RatioU return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Ratio left, Ratio right) + { + return left.Equals(right); + } + + public static bool operator !=(Ratio left, Ratio right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Ratio)) throw new ArgumentException("Expected type Ratio.", nameof(obj)); + if(!(obj is Ratio objRatio)) throw new ArgumentException("Expected type Ratio.", nameof(obj)); - return CompareTo((Ratio)obj); + return CompareTo(objRatio); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -492,6 +502,19 @@ public int CompareTo(Ratio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Ratio objRatio)) + return false; + + return Equals(objRatio); + } + + public bool Equals(Ratio other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Ratio within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 6e45a16399..11a5edac93 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The Volt-ampere reactive hour (expressed as varh) is the reactive power of one Volt-ampere reactive produced in one hour. /// - public partial struct ReactiveEnergy : IQuantity, IComparable, IComparable + public partial struct ReactiveEnergy : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Reacti return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ReactiveEnergy left, ReactiveEnergy right) + { + return left.Equals(right); + } + + public static bool operator !=(ReactiveEnergy left, ReactiveEnergy right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ReactiveEnergy)) throw new ArgumentException("Expected type ReactiveEnergy.", nameof(obj)); + if(!(obj is ReactiveEnergy objReactiveEnergy)) throw new ArgumentException("Expected type ReactiveEnergy.", nameof(obj)); - return CompareTo((ReactiveEnergy)obj); + return CompareTo(objReactiveEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(ReactiveEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ReactiveEnergy objReactiveEnergy)) + return false; + + return Equals(objReactiveEnergy); + } + + public bool Equals(ReactiveEnergy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ReactiveEnergy within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 7cb2597718..aa09b88dd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Volt-ampere reactive (var) is a unit by which reactive power is expressed in an AC electric power system. Reactive power exists in an AC circuit when the current and voltage are not in phase. /// - public partial struct ReactivePower : IQuantity, IComparable, IComparable + public partial struct ReactivePower : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -450,12 +450,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Reacti return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ReactivePower left, ReactivePower right) + { + return left.Equals(right); + } + + public static bool operator !=(ReactivePower left, ReactivePower right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ReactivePower)) throw new ArgumentException("Expected type ReactivePower.", nameof(obj)); + if(!(obj is ReactivePower objReactivePower)) throw new ArgumentException("Expected type ReactivePower.", nameof(obj)); - return CompareTo((ReactivePower)obj); + return CompareTo(objReactivePower); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -464,6 +474,19 @@ public int CompareTo(ReactivePower other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ReactivePower objReactivePower)) + return false; + + return Equals(objReactivePower); + } + + public bool Equals(ReactivePower other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ReactivePower within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index fa98eebef2..687e2d4e0e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Angular acceleration is the rate of change of rotational speed. /// - public partial struct RotationalAcceleration : IQuantity, IComparable, IComparable + public partial struct RotationalAcceleration : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Rotati return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(RotationalAcceleration left, RotationalAcceleration right) + { + return left.Equals(right); + } + + public static bool operator !=(RotationalAcceleration left, RotationalAcceleration right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is RotationalAcceleration)) throw new ArgumentException("Expected type RotationalAcceleration.", nameof(obj)); + if(!(obj is RotationalAcceleration objRotationalAcceleration)) throw new ArgumentException("Expected type RotationalAcceleration.", nameof(obj)); - return CompareTo((RotationalAcceleration)obj); + return CompareTo(objRotationalAcceleration); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(RotationalAcceleration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is RotationalAcceleration objRotationalAcceleration)) + return false; + + return Equals(objRotationalAcceleration); + } + + public bool Equals(RotationalAcceleration other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another RotationalAcceleration within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 1c5a6bca8d..9757bcca37 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Rotational speed (sometimes called speed of revolution) is the number of complete rotations, revolutions, cycles, or turns per time unit. Rotational speed is a cyclic frequency, measured in radians per second or in hertz in the SI System by scientists, or in revolutions per minute (rpm or min-1) or revolutions per second in everyday life. The symbol for rotational speed is ω (the Greek lowercase letter "omega"). /// - public partial struct RotationalSpeed : IQuantity, IComparable, IComparable + public partial struct RotationalSpeed : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -576,12 +576,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Rotati return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(RotationalSpeed left, RotationalSpeed right) + { + return left.Equals(right); + } + + public static bool operator !=(RotationalSpeed left, RotationalSpeed right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is RotationalSpeed)) throw new ArgumentException("Expected type RotationalSpeed.", nameof(obj)); + if(!(obj is RotationalSpeed objRotationalSpeed)) throw new ArgumentException("Expected type RotationalSpeed.", nameof(obj)); - return CompareTo((RotationalSpeed)obj); + return CompareTo(objRotationalSpeed); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -590,6 +600,19 @@ public int CompareTo(RotationalSpeed other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is RotationalSpeed objRotationalSpeed)) + return false; + + return Equals(objRotationalSpeed); + } + + public bool Equals(RotationalSpeed other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another RotationalSpeed within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 621019cb7e..083edb31ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Stiffness#Rotational_stiffness /// - public partial struct RotationalStiffness : IQuantity, IComparable, IComparable + public partial struct RotationalStiffness : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Rotati return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(RotationalStiffness left, RotationalStiffness right) + { + return left.Equals(right); + } + + public static bool operator !=(RotationalStiffness left, RotationalStiffness right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is RotationalStiffness)) throw new ArgumentException("Expected type RotationalStiffness.", nameof(obj)); + if(!(obj is RotationalStiffness objRotationalStiffness)) throw new ArgumentException("Expected type RotationalStiffness.", nameof(obj)); - return CompareTo((RotationalStiffness)obj); + return CompareTo(objRotationalStiffness); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(RotationalStiffness other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is RotationalStiffness objRotationalStiffness)) + return false; + + return Equals(objRotationalStiffness); + } + + public bool Equals(RotationalStiffness other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another RotationalStiffness within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index e8684b1465..7c0d807bcc 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Stiffness#Rotational_stiffness /// - public partial struct RotationalStiffnessPerLength : IQuantity, IComparable, IComparable + public partial struct RotationalStiffnessPerLength : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -436,12 +436,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Rotati return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) + { + return left.Equals(right); + } + + public static bool operator !=(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is RotationalStiffnessPerLength)) throw new ArgumentException("Expected type RotationalStiffnessPerLength.", nameof(obj)); + if(!(obj is RotationalStiffnessPerLength objRotationalStiffnessPerLength)) throw new ArgumentException("Expected type RotationalStiffnessPerLength.", nameof(obj)); - return CompareTo((RotationalStiffnessPerLength)obj); + return CompareTo(objRotationalStiffnessPerLength); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -450,6 +460,19 @@ public int CompareTo(RotationalStiffnessPerLength other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is RotationalStiffnessPerLength objRotationalStiffnessPerLength)) + return false; + + return Equals(objRotationalStiffnessPerLength); + } + + public bool Equals(RotationalStiffnessPerLength other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another RotationalStiffnessPerLength within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index dbaac8e546..d8f03d8b08 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Solid_angle /// - public partial struct SolidAngle : IQuantity, IComparable, IComparable + public partial struct SolidAngle : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -411,12 +411,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out SolidA return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(SolidAngle left, SolidAngle right) + { + return left.Equals(right); + } + + public static bool operator !=(SolidAngle left, SolidAngle right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SolidAngle)) throw new ArgumentException("Expected type SolidAngle.", nameof(obj)); + if(!(obj is SolidAngle objSolidAngle)) throw new ArgumentException("Expected type SolidAngle.", nameof(obj)); - return CompareTo((SolidAngle)obj); + return CompareTo(objSolidAngle); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -425,6 +435,19 @@ public int CompareTo(SolidAngle other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is SolidAngle objSolidAngle)) + return false; + + return Equals(objSolidAngle); + } + + public bool Equals(SolidAngle other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SolidAngle within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index e62ab6fd6d..d72c3d329b 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Specific_energy /// - public partial struct SpecificEnergy : IQuantity, IComparable, IComparable + public partial struct SpecificEnergy : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -509,12 +509,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Specif return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(SpecificEnergy left, SpecificEnergy right) + { + return left.Equals(right); + } + + public static bool operator !=(SpecificEnergy left, SpecificEnergy right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SpecificEnergy)) throw new ArgumentException("Expected type SpecificEnergy.", nameof(obj)); + if(!(obj is SpecificEnergy objSpecificEnergy)) throw new ArgumentException("Expected type SpecificEnergy.", nameof(obj)); - return CompareTo((SpecificEnergy)obj); + return CompareTo(objSpecificEnergy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -523,6 +533,19 @@ public int CompareTo(SpecificEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is SpecificEnergy objSpecificEnergy)) + return false; + + return Equals(objSpecificEnergy); + } + + public bool Equals(SpecificEnergy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SpecificEnergy within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index e5b949a084..b91712cb2e 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Specific entropy is an amount of energy required to raise temperature of a substance by 1 Kelvin per unit mass. /// - public partial struct SpecificEntropy : IQuantity, IComparable, IComparable + public partial struct SpecificEntropy : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -506,12 +506,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Specif return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(SpecificEntropy left, SpecificEntropy right) + { + return left.Equals(right); + } + + public static bool operator !=(SpecificEntropy left, SpecificEntropy right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SpecificEntropy)) throw new ArgumentException("Expected type SpecificEntropy.", nameof(obj)); + if(!(obj is SpecificEntropy objSpecificEntropy)) throw new ArgumentException("Expected type SpecificEntropy.", nameof(obj)); - return CompareTo((SpecificEntropy)obj); + return CompareTo(objSpecificEntropy); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -520,6 +530,19 @@ public int CompareTo(SpecificEntropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is SpecificEntropy objSpecificEntropy)) + return false; + + return Equals(objSpecificEntropy); + } + + public bool Equals(SpecificEntropy other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SpecificEntropy within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index fe365194bb..04e161eb6a 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In thermodynamics, the specific volume of a substance is the ratio of the substance's volume to its mass. It is the reciprocal of density and an intrinsic property of matter as well. /// - public partial struct SpecificVolume : IQuantity, IComparable, IComparable + public partial struct SpecificVolume : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -422,12 +422,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Specif return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(SpecificVolume left, SpecificVolume right) + { + return left.Equals(right); + } + + public static bool operator !=(SpecificVolume left, SpecificVolume right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SpecificVolume)) throw new ArgumentException("Expected type SpecificVolume.", nameof(obj)); + if(!(obj is SpecificVolume objSpecificVolume)) throw new ArgumentException("Expected type SpecificVolume.", nameof(obj)); - return CompareTo((SpecificVolume)obj); + return CompareTo(objSpecificVolume); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -436,6 +446,19 @@ public int CompareTo(SpecificVolume other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is SpecificVolume objSpecificVolume)) + return false; + + return Equals(objSpecificVolume); + } + + public bool Equals(SpecificVolume other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SpecificVolume within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 9a751b0820..ce31c9bb27 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// http://en.wikipedia.org/wiki/Specificweight /// - public partial struct SpecificWeight : IQuantity, IComparable, IComparable + public partial struct SpecificWeight : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -635,12 +635,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Specif return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(SpecificWeight left, SpecificWeight right) + { + return left.Equals(right); + } + + public static bool operator !=(SpecificWeight left, SpecificWeight right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is SpecificWeight)) throw new ArgumentException("Expected type SpecificWeight.", nameof(obj)); + if(!(obj is SpecificWeight objSpecificWeight)) throw new ArgumentException("Expected type SpecificWeight.", nameof(obj)); - return CompareTo((SpecificWeight)obj); + return CompareTo(objSpecificWeight); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -649,6 +659,19 @@ public int CompareTo(SpecificWeight other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is SpecificWeight objSpecificWeight)) + return false; + + return Equals(objSpecificWeight); + } + + public bool Equals(SpecificWeight other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another SpecificWeight within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 319cd59327..a557138fe8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In everyday use and in kinematics, the speed of an object is the magnitude of its velocity (the rate of change of its position); it is thus a scalar quantity.[1] The average speed of an object in an interval of time is the distance travelled by the object divided by the duration of the interval;[2] the instantaneous speed is the limit of the average speed as the duration of the time interval approaches zero. /// - public partial struct Speed : IQuantity, IComparable, IComparable + public partial struct Speed : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -842,12 +842,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out SpeedU return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Speed left, Speed right) + { + return left.Equals(right); + } + + public static bool operator !=(Speed left, Speed right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Speed)) throw new ArgumentException("Expected type Speed.", nameof(obj)); + if(!(obj is Speed objSpeed)) throw new ArgumentException("Expected type Speed.", nameof(obj)); - return CompareTo((Speed)obj); + return CompareTo(objSpeed); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -856,6 +866,19 @@ public int CompareTo(Speed other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Speed objSpeed)) + return false; + + return Equals(objSpeed); + } + + public bool Equals(Speed other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Speed within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 354a364071..6f4ad8306c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A temperature is a numerical measure of hot or cold. Its measurement is by detection of heat radiation or particle velocity or kinetic energy, or by the bulk behavior of a thermometric material. It may be calibrated in any of various temperature scales, Celsius, Fahrenheit, Kelvin, etc. The fundamental physical definition of temperature is provided by thermodynamics. /// - public partial struct Temperature : IQuantity, IComparable, IComparable + public partial struct Temperature : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -467,12 +467,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Temper return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Temperature left, Temperature right) + { + return left.Equals(right); + } + + public static bool operator !=(Temperature left, Temperature right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Temperature)) throw new ArgumentException("Expected type Temperature.", nameof(obj)); + if(!(obj is Temperature objTemperature)) throw new ArgumentException("Expected type Temperature.", nameof(obj)); - return CompareTo((Temperature)obj); + return CompareTo(objTemperature); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -481,6 +491,19 @@ public int CompareTo(Temperature other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Temperature objTemperature)) + return false; + + return Equals(objTemperature); + } + + public bool Equals(Temperature other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Temperature within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index b9bb26d9ed..40a63cb355 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Temperature change rate is the ratio of the temperature change to the time during which the change occurred (value of temperature changes per unit time). /// - public partial struct TemperatureChangeRate : IQuantity, IComparable, IComparable + public partial struct TemperatureChangeRate : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -534,12 +534,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Temper return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(TemperatureChangeRate left, TemperatureChangeRate right) + { + return left.Equals(right); + } + + public static bool operator !=(TemperatureChangeRate left, TemperatureChangeRate right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is TemperatureChangeRate)) throw new ArgumentException("Expected type TemperatureChangeRate.", nameof(obj)); + if(!(obj is TemperatureChangeRate objTemperatureChangeRate)) throw new ArgumentException("Expected type TemperatureChangeRate.", nameof(obj)); - return CompareTo((TemperatureChangeRate)obj); + return CompareTo(objTemperatureChangeRate); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -548,6 +558,19 @@ public int CompareTo(TemperatureChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is TemperatureChangeRate objTemperatureChangeRate)) + return false; + + return Equals(objTemperatureChangeRate); + } + + public bool Equals(TemperatureChangeRate other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another TemperatureChangeRate within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 3b482dcc03..b30f38b0c6 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Difference between two temperatures. The conversions are different than for Temperature. /// - public partial struct TemperatureDelta : IQuantity, IComparable, IComparable + public partial struct TemperatureDelta : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -506,12 +506,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Temper return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(TemperatureDelta left, TemperatureDelta right) + { + return left.Equals(right); + } + + public static bool operator !=(TemperatureDelta left, TemperatureDelta right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is TemperatureDelta)) throw new ArgumentException("Expected type TemperatureDelta.", nameof(obj)); + if(!(obj is TemperatureDelta objTemperatureDelta)) throw new ArgumentException("Expected type TemperatureDelta.", nameof(obj)); - return CompareTo((TemperatureDelta)obj); + return CompareTo(objTemperatureDelta); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -520,6 +530,19 @@ public int CompareTo(TemperatureDelta other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is TemperatureDelta objTemperatureDelta)) + return false; + + return Equals(objTemperatureDelta); + } + + public bool Equals(TemperatureDelta other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another TemperatureDelta within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 95b434ca49..77ee8a8895 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Thermal_Conductivity /// - public partial struct ThermalConductivity : IQuantity, IComparable, IComparable + public partial struct ThermalConductivity : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -425,12 +425,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Therma return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ThermalConductivity left, ThermalConductivity right) + { + return left.Equals(right); + } + + public static bool operator !=(ThermalConductivity left, ThermalConductivity right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ThermalConductivity)) throw new ArgumentException("Expected type ThermalConductivity.", nameof(obj)); + if(!(obj is ThermalConductivity objThermalConductivity)) throw new ArgumentException("Expected type ThermalConductivity.", nameof(obj)); - return CompareTo((ThermalConductivity)obj); + return CompareTo(objThermalConductivity); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -439,6 +449,19 @@ public int CompareTo(ThermalConductivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ThermalConductivity objThermalConductivity)) + return false; + + return Equals(objThermalConductivity); + } + + public bool Equals(ThermalConductivity other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ThermalConductivity within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index ecb20bd412..1c7fd72572 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Heat Transfer Coefficient or Thermal conductivity - indicates a materials ability to conduct heat. /// - public partial struct ThermalResistance : IQuantity, IComparable, IComparable + public partial struct ThermalResistance : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -464,12 +464,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Therma return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(ThermalResistance left, ThermalResistance right) + { + return left.Equals(right); + } + + public static bool operator !=(ThermalResistance left, ThermalResistance right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is ThermalResistance)) throw new ArgumentException("Expected type ThermalResistance.", nameof(obj)); + if(!(obj is ThermalResistance objThermalResistance)) throw new ArgumentException("Expected type ThermalResistance.", nameof(obj)); - return CompareTo((ThermalResistance)obj); + return CompareTo(objThermalResistance); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -478,6 +488,19 @@ public int CompareTo(ThermalResistance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is ThermalResistance objThermalResistance)) + return false; + + return Equals(objThermalResistance); + } + + public bool Equals(ThermalResistance other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another ThermalResistance within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 1870282761..a73e74b5fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Torque, moment or moment of force (see the terminology below), is the tendency of a force to rotate an object about an axis,[1] fulcrum, or pivot. Just as a force is a push or a pull, a torque can be thought of as a twist to an object. Mathematically, torque is defined as the cross product of the lever-arm distance and force, which tends to produce rotation. Loosely speaking, torque is a measure of the turning force on an object such as a bolt or a flywheel. For example, pushing or pulling the handle of a wrench connected to a nut or bolt produces a torque (turning force) that loosens or tightens the nut or bolt. /// - public partial struct Torque : IQuantity, IComparable, IComparable + public partial struct Torque : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -688,12 +688,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Torque return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Torque left, Torque right) + { + return left.Equals(right); + } + + public static bool operator !=(Torque left, Torque right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Torque)) throw new ArgumentException("Expected type Torque.", nameof(obj)); + if(!(obj is Torque objTorque)) throw new ArgumentException("Expected type Torque.", nameof(obj)); - return CompareTo((Torque)obj); + return CompareTo(objTorque); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -702,6 +712,19 @@ public int CompareTo(Torque other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Torque objTorque)) + return false; + + return Equals(objTorque); + } + + public bool Equals(Torque other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Torque within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 25837bf80d..e27bca2e83 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Vitamin A: 1 IU is the biological equivalent of 0.3 µg retinol, or of 0.6 µg beta-carotene. /// - public partial struct VitaminA : IQuantity, IComparable, IComparable + public partial struct VitaminA : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -408,12 +408,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Vitami return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(VitaminA left, VitaminA right) + { + return left.Equals(right); + } + + public static bool operator !=(VitaminA left, VitaminA right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is VitaminA)) throw new ArgumentException("Expected type VitaminA.", nameof(obj)); + if(!(obj is VitaminA objVitaminA)) throw new ArgumentException("Expected type VitaminA.", nameof(obj)); - return CompareTo((VitaminA)obj); + return CompareTo(objVitaminA); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -422,6 +432,19 @@ public int CompareTo(VitaminA other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is VitaminA objVitaminA)) + return false; + + return Equals(objVitaminA); + } + + public bool Equals(VitaminA other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another VitaminA within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index f7fe76f379..5dfddc94db 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Volume is the quantity of three-dimensional space enclosed by some closed boundary, for example, the space that a substance (solid, liquid, gas, or plasma) or shape occupies or contains.[1] Volume is often quantified numerically using the SI derived unit, the cubic metre. The volume of a container is generally understood to be the capacity of the container, i. e. the amount of fluid (gas or liquid) that the container could hold, rather than the amount of space the container itself displaces. /// - public partial struct Volume : IQuantity, IComparable, IComparable + public partial struct Volume : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -996,12 +996,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Volume return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(Volume left, Volume right) + { + return left.Equals(right); + } + + public static bool operator !=(Volume left, Volume right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Volume)) throw new ArgumentException("Expected type Volume.", nameof(obj)); + if(!(obj is Volume objVolume)) throw new ArgumentException("Expected type Volume.", nameof(obj)); - return CompareTo((Volume)obj); + return CompareTo(objVolume); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -1010,6 +1020,19 @@ public int CompareTo(Volume other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is Volume objVolume)) + return false; + + return Equals(objVolume); + } + + public bool Equals(Volume other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another Volume within the given absolute or relative tolerance. diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index 4d4755793d..c43ad13b3c 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -9,7 +9,7 @@ // See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. // // Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. // // //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In physics and engineering, in particular fluid dynamics and hydrometry, the volumetric flow rate, (also known as volume flow rate, rate of fluid flow or volume velocity) is the volume of fluid which passes through a given surface per unit time. The SI unit is m³/s (cubic meters per second). In US Customary Units and British Imperial Units, volumetric flow rate is often expressed as ft³/s (cubic feet per second). It is usually represented by the symbol Q. /// - public partial struct VolumeFlow : IQuantity, IComparable, IComparable + public partial struct VolumeFlow : IQuantity, IEquatable, IComparable, IComparable { /// /// The numeric value this quantity was constructed with. @@ -758,12 +758,22 @@ public static bool TryParseUnit(string str, IFormatProvider provider, out Volume return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==(VolumeFlow left, VolumeFlow right) + { + return left.Equals(right); + } + + public static bool operator !=(VolumeFlow left, VolumeFlow right) + { + return !(left == right); + } + public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is VolumeFlow)) throw new ArgumentException("Expected type VolumeFlow.", nameof(obj)); + if(!(obj is VolumeFlow objVolumeFlow)) throw new ArgumentException("Expected type VolumeFlow.", nameof(obj)); - return CompareTo((VolumeFlow)obj); + return CompareTo(objVolumeFlow); } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods @@ -772,6 +782,19 @@ public int CompareTo(VolumeFlow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } + public override bool Equals(object obj) + { + if(obj is null || !(obj is VolumeFlow objVolumeFlow)) + return false; + + return Equals(objVolumeFlow); + } + + public bool Equals(VolumeFlow other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another VolumeFlow within the given absolute or relative tolerance. diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 index 1fef8c2596..d876ece7bb 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 @@ -99,7 +99,7 @@ if ($obsoleteAttribute) // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. public sealed partial class $quantityName : IQuantity "@; } else {@" - public partial struct $quantityName : IQuantity<$unitEnumName>, IComparable, IComparable<$quantityName> + public partial struct $quantityName : IQuantity<$unitEnumName>, IEquatable<$quantityName>, IComparable, IComparable<$quantityName> "@; }@" { /// @@ -812,13 +812,23 @@ function GenerateEqualityAndComparison([GeneratorArgs]$genArgs) return left.Value > right.AsBaseNumericType(left.Unit); } + public static bool operator ==($quantityName left, $quantityName right) + { + return left.Equals(right); + } + + public static bool operator !=($quantityName left, $quantityName right) + { + return !(left == right); + } + "@; }@" public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is $quantityName)) throw new ArgumentException("Expected type $quantityName.", nameof(obj)); + if(!(obj is $quantityName obj$quantityName)) throw new ArgumentException("Expected type $quantityName.", nameof(obj)); - return CompareTo(($quantityName)obj); + return CompareTo(obj$quantityName); } "@; # Windows Runtime Component does not support overloads with same number of parameters @@ -829,6 +839,23 @@ $accessModifier = if ($wrc) { "internal" } else { "public" } @" return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } +"@; + if ($wrc) {@" + [Windows.Foundation.Metadata.DefaultOverload] +"@; }@" + public override bool Equals(object obj) + { + if(obj is null || !(obj is $quantityName obj$quantityName)) + return false; + + return Equals(obj$quantityName); + } + + public bool Equals($quantityName other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + /// /// /// Compare equality to another $quantityName within the given absolute or relative tolerance. diff --git a/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 index fc13976f38..2529555d72 100644 --- a/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 @@ -235,10 +235,41 @@ namespace UnitsNet.Tests Assert.Throws(() => $baseUnitVariableName.CompareTo(null)); } + [Fact] + public void EqualityOperators() + { + var a = $quantityName.From$baseUnitPluralName(1); + var b = $quantityName.From$baseUnitPluralName(2); + + // ReSharper disable EqualExpressionComparison + + Assert.True(a == a); + Assert.False(a != a); + + Assert.True(a != b); + Assert.False(a == b); + + Assert.False(a == null); + Assert.False(null == a); + +// ReSharper restore EqualExpressionComparison + } + [Fact] public void EqualsIsImplemented() { - $quantityName v = $quantityName.From$baseUnitPluralName(1); + var a = $quantityName.From$baseUnitPluralName(1); + var b = $quantityName.From$baseUnitPluralName(2); + + Assert.True(a.Equals(a)); + Assert.False(a.Equals(b)); + Assert.False(a.Equals(null)); + } + + [Fact] + public void EqualsRelativeToleranceIsImplemented() + { + var v = $quantityName.From$baseUnitPluralName(1); Assert.True(v.Equals($quantityName.From$baseUnitPluralName(1), $($baseUnitPluralName)Tolerance, ComparisonType.Relative)); Assert.False(v.Equals($quantityName.Zero, $($baseUnitPluralName)Tolerance, ComparisonType.Relative)); }