Class UnitFactory
Factory methods for unit creation
Assembly: Meadow.Units.dll
View Source
Declaration
public class UnitFactory
Methods
CreateUnitFromCanonicalValue(double, string)
Method to create a unit from its canonical value.
View Source
Declaration
public static object CreateUnitFromCanonicalValue(double value, string unitTypeName)
Returns
System.Object
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The canonical value to use for creation |
System.String | unitTypeName | The name of the Unit to be created |
FromCelsius(double)
Creates a Temperature unit from a Celsius value
View Source
Declaration
public static Temperature FromCelsius(double celsius)
Returns
Parameters
Type | Name |
---|---|
System.Double | celsius |
FromVolts(double)
Creates a Voltage unit from a Volts value
View Source
Declaration
public static Voltage FromVolts(double volts)
Returns
Parameters
Type | Name |
---|---|
System.Double | volts |
FromMeters(double)
Creates a Length unit from a Meters value
View Source
Declaration
public static Length FromMeters(double meters)
Returns
Parameters
Type | Name |
---|---|
System.Double | meters |