Skip to content

Commit f13d5f8

Browse files
committed
♻️ Multi-line interface list for quantities
1 parent 1d642a6 commit f13d5f8

File tree

119 files changed

+842
-125
lines changed

Some content is hidden

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

119 files changed

+842
-125
lines changed

CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,21 @@ namespace UnitsNet
6262
/// </remarks>");
6363

6464
Writer.WLIfText(1, GetObsoleteAttributeOrNull(_quantity));
65-
Writer.W(@$"
65+
Writer.WL(@$"
6666
[DataContract]
67-
public readonly partial struct {_quantity.Name} : {(_quantity.GenerateArithmetic ? "IArithmeticQuantity" : "IQuantity")}<{_quantity.Name}, {_unitEnumName}, {_quantity.ValueType}>, ");
68-
if (_quantity.ValueType == "decimal")
69-
{
70-
Writer.W("IDecimalQuantity, ");
71-
}
67+
public readonly partial struct {_quantity.Name} :
68+
{(_quantity.GenerateArithmetic ? "IArithmeticQuantity" : "IQuantity")}<{_quantity.Name}, {_unitEnumName}, {_quantity.ValueType}>,");
69+
70+
if (_quantity.ValueType == "decimal") Writer.WL(@$"
71+
IDecimalQuantity,");
72+
73+
Writer.WL(@$"
74+
IComparable,
75+
IComparable<{_quantity.Name}>,
76+
IConvertible,
77+
IEquatable<{_quantity.Name}>,
78+
IFormattable");
7279

73-
Writer.WL($"IEquatable<{_quantity.Name}>, IComparable, IComparable<{_quantity.Name}>, IConvertible, IFormattable");
7480
Writer.WL($@"
7581
{{
7682
/// <summary>

UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Angle.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Area.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)