HaveSameDimensions() public static method

public static HaveSameDimensions ( UnitDimensions dim1, UnitDimensions dim2 ) : bool
dim1 UnitDimensions
dim2 UnitDimensions
return bool
Beispiel #1
0
 public Unit(T type, Unit unitToConvert)
 {
     if (!UnitDimensions.HaveSameDimensions(type.Dimensions, unitToConvert.Dimensions))
     {
         throw new Exception("Units do not have the same Dimensions");
     }
     this.UnitType    = type;
     this.Measurement = unitToConvert.MeasurementIn(type);
 }
Beispiel #2
0
 protected static bool _HaveTheSameDimensions(Unit unit1, Unit unit2)
 {
     return(UnitDimensions.HaveSameDimensions(unit1.UnitType.Dimensions, unit2.UnitType.Dimensions));
 }