@@ -70,7 +70,7 @@ public UnitInfo BaseUnitInfo
70
70
{
71
71
get => GetGenericBaseUnitInfo ( ) ;
72
72
}
73
-
73
+
74
74
/// <inheritdoc cref="BaseUnitInfo" />
75
75
protected internal abstract UnitInfo GetGenericBaseUnitInfo ( ) ;
76
76
@@ -93,13 +93,13 @@ public IReadOnlyList<UnitInfo> UnitInfos
93
93
/// <inheritdoc />
94
94
public UnitInfo GetUnitInfoFor ( BaseUnits baseUnits )
95
95
{
96
- return UnitInfos . GetUnitInfoFor ( baseUnits ) ;
96
+ return UnitInfo . GetUnitWithBase ( UnitInfos , baseUnits ) ;
97
97
}
98
98
99
99
/// <inheritdoc />
100
100
public IEnumerable < UnitInfo > GetUnitInfosFor ( BaseUnits baseUnits )
101
101
{
102
- return UnitInfos . GetUnitInfosFor ( baseUnits ) ;
102
+ return UnitInfo . GetUnitsWithBase ( UnitInfos , baseUnits ) ;
103
103
}
104
104
105
105
/// <summary>
@@ -142,7 +142,7 @@ protected QuantityInfo(string name, Type quantityType, BaseDimensions baseDimens
142
142
{
143
143
get => GetBaseUnitInfo ( ) ;
144
144
}
145
-
145
+
146
146
/// <inheritdoc cref="BaseUnitInfo" />
147
147
protected internal abstract UnitInfo < TUnit > GetBaseUnitInfo ( ) ;
148
148
@@ -179,28 +179,28 @@ public UnitInfo<TUnit> this[TUnit unit]
179
179
/// <returns>An <see cref="UnitInfo{TUnit}" /> instance containing information about the specified unit.</returns>
180
180
/// <exception cref="ArgumentException">Thrown if the specified unit is not valid for this quantity.</exception>
181
181
protected internal abstract UnitInfo < TUnit > GetUnitInfo ( TUnit unit ) ;
182
-
182
+
183
183
// /// <inheritdoc cref="QuantityInfo.TryGetUnitInfo" />
184
184
// public abstract bool TryGetUnitInfo(TUnit unit, [NotNullWhen(true)] out UnitInfo<TUnit>? unitInfo);
185
-
185
+
186
186
/// <inheritdoc cref="QuantityInfo.GetUnitInfoFor" />
187
187
public new UnitInfo < TUnit > GetUnitInfoFor ( BaseUnits baseUnits )
188
188
{
189
- return UnitInfos . GetUnitInfoFor ( baseUnits ) ;
189
+ return UnitInfo . GetUnitWithBase ( UnitInfos , baseUnits ) ;
190
190
}
191
-
191
+
192
192
/// <inheritdoc cref="QuantityInfo.GetUnitInfosFor" />
193
193
public new IEnumerable < UnitInfo < TUnit > > GetUnitInfosFor ( BaseUnits baseUnits )
194
194
{
195
- return UnitInfos . GetUnitInfosFor ( baseUnits ) ;
195
+ return UnitInfo . GetUnitsWithBase ( UnitInfos , baseUnits ) ;
196
196
}
197
-
197
+
198
198
/// <inheritdoc cref="QuantityInfo.From" />
199
199
public IQuantity < TUnit > From ( double value , TUnit unit )
200
200
{
201
201
return CreateGenericQuantity ( value , unit ) ;
202
202
}
203
-
203
+
204
204
/// <inheritdoc cref="From(double,TUnit)" />
205
205
protected internal abstract IQuantity < TUnit > CreateGenericQuantity ( double value , TUnit unit ) ;
206
206
@@ -286,7 +286,7 @@ protected QuantityInfoBase(string name, TQuantity zero, BaseDimensions baseDimen
286
286
287
287
private QuantityFromDelegate < TQuantity , TUnit > FromDelegate { get ; }
288
288
289
-
289
+
290
290
#region Implementation of IQuantityInfo<TQuantity, TUnit>
291
291
292
292
/// <inheritdoc cref="IQuantityInfo.Zero" />
@@ -307,13 +307,13 @@ protected QuantityInfoBase(string name, TQuantity zero, BaseDimensions baseDimen
307
307
/// <inheritdoc cref="IQuantityInfo.GetUnitInfosFor" />
308
308
public new IEnumerable < TUnitInfo > GetUnitInfosFor ( BaseUnits baseUnits )
309
309
{
310
- return UnitInfos . GetUnitInfosFor ( baseUnits ) ;
310
+ return UnitInfo . GetUnitsWithBase ( UnitInfos , baseUnits ) ;
311
311
}
312
312
313
313
/// <inheritdoc cref="IQuantityInfo.GetUnitInfoFor" />
314
314
public new TUnitInfo GetUnitInfoFor ( BaseUnits baseUnits )
315
315
{
316
- return UnitInfos . GetUnitInfoFor ( baseUnits ) ;
316
+ return UnitInfo . GetUnitWithBase ( UnitInfos , baseUnits ) ;
317
317
}
318
318
319
319
/// <summary>
@@ -334,7 +334,7 @@ TQuantity IQuantityInstanceInfo<TQuantity>.Create(double value, UnitKey unitKey)
334
334
}
335
335
336
336
#endregion
337
-
337
+
338
338
#region Overrides of QuantityInfo<TUnit>
339
339
340
340
/// <inheritdoc />
@@ -393,9 +393,9 @@ public class QuantityInfo<TQuantity, TUnit> : QuantityInfoBase<TQuantity, TUnit,
393
393
394
394
[ DebuggerBrowsable ( DebuggerBrowsableState . Never ) ]
395
395
private readonly UnitInfo < TQuantity , TUnit > [ ] _unitInfos ;
396
-
396
+
397
397
#if NET
398
-
398
+
399
399
/// <summary>
400
400
/// Initializes a new instance of the <see cref="QuantityInfo{TQuantity, TUnit}" /> class using the default quantity name.
401
401
/// </summary>
@@ -413,7 +413,7 @@ public QuantityInfo(TUnit baseUnit, IEnumerable<IUnitDefinition<TUnit>> unitMapp
413
413
: this ( typeof ( TQuantity ) . Name , baseUnit , unitMappings , baseDimensions , TQuantity . From , unitAbbreviations )
414
414
{
415
415
}
416
-
416
+
417
417
/// <summary>
418
418
/// Initializes a new instance of the <see cref="QuantityInfo{TQuantity, TUnit}" /> class.
419
419
/// </summary>
@@ -432,7 +432,7 @@ public QuantityInfo(string name, TUnit baseUnit, IEnumerable<IUnitDefinition<TUn
432
432
: this ( name , baseUnit , unitMappings , TQuantity . From ( 0 , baseUnit ) , baseDimensions , TQuantity . From , unitAbbreviations )
433
433
{
434
434
}
435
-
435
+
436
436
#endif
437
437
438
438
/// <summary>
@@ -454,7 +454,7 @@ public QuantityInfo(TUnit baseUnit, IEnumerable<IUnitDefinition<TUnit>> unitMapp
454
454
: this ( typeof ( TQuantity ) . Name , baseUnit , unitMappings , baseDimensions , fromDelegate , unitAbbreviations )
455
455
{
456
456
}
457
-
457
+
458
458
/// <summary>
459
459
/// Initializes a new instance of the <see cref="QuantityInfo{TQuantity, TUnit}" /> class.
460
460
/// </summary>
@@ -554,7 +554,7 @@ public sealed override IReadOnlyList<UnitInfo<TQuantity, TUnit>> UnitInfos
554
554
#endregion
555
555
556
556
#region Explicit implementation of IQuantityInfo<TUnit>
557
-
557
+
558
558
// [DebuggerBrowsable(DebuggerBrowsableState.Never)]
559
559
// IReadOnlyCollection<UnitInfo<TUnit>> IQuantityInfo<TUnit>.UnitInfos
560
560
// {
@@ -605,13 +605,13 @@ public sealed override IReadOnlyList<UnitInfo<TQuantity, TUnit>> UnitInfos
605
605
// get => Zero;
606
606
// }
607
607
608
-
608
+
609
609
// /// <inheritdoc />
610
610
// TQuantity IQuantityInstanceInfo<TQuantity>.Create(QuantityValue value, UnitKey unitKey)
611
611
// {
612
612
// return From(value, unitKey.ToUnit<TUnit>());
613
613
// }
614
-
614
+
615
615
#endregion
616
616
617
617
#region Implementation of IQuantityInfo<TQuantity,TUnit>
0 commit comments