Click or drag to resize

UnitsExtensionsGetUnitInstance Method

Gets the unit instance for a given type.

Namespace: Altaxo.Units
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static IUnit GetUnitInstance(
	Type type
)

Parameters

type  Type
The type of the unit.

Return Value

IUnit
The unit instance with the given type. It is presumed that the unit class has either a static property 'Instance' or a parameterless constructor.
Exceptions
ExceptionCondition
ArgumentExceptionIf the type given in the argument is not derived from IUnit"
See Also