C# 클래스 LitDev.LDUnits

파일 보기 프로젝트 열기: litdev1/LitDev

공개 메소드들

메소드 설명
AddBaseUnit ( Primitive dimension, Primitive name ) : void

Add a base unit to the system.

AddConstant ( Primitive description, Primitive name, Primitive value ) : void

Add a dimensionless constant to the system.

AddDerivedUnit ( Primitive description, Primitive name, Primitive units, Primitive add ) : void

Add a derived unit to the system.

Convert ( Primitive value, Primitive fromUnit, Primitive toUnit ) : Primitive

Convert a value from one unit to another.

Export ( ) : void

Export the current unit system to a file (units.txt in the current program folder).

GetBaseUnits ( ) : Primitive

Get a list of current base units.

GetConstants ( ) : Primitive

Get a list of current constants.

GetDerivedUnits ( ) : Primitive

Get a list of current derived units.

GetDimensions ( Primitive unit ) : Primitive

Get an array of dimensions for a unit.

GetErrors ( ) : Primitive

Get an array of error messages if a Convert fails or conflicts are found for added units or constants.

GetPrefixes ( ) : Primitive

Get a list of current prefixes.

Import ( ) : void

Import a unit system from a file (units.txt in the current program folder).

메소드 상세

AddBaseUnit() 공개 정적인 메소드

Add a base unit to the system.
public static AddBaseUnit ( Primitive dimension, Primitive name ) : void
dimension Primitive The base unit dimension (e.g. TEMPERATURE).
name Primitive The unit name (be careful it doesn't confict with existing unit names).
리턴 void

AddConstant() 공개 정적인 메소드

Add a dimensionless constant to the system.
public static AddConstant ( Primitive description, Primitive name, Primitive value ) : void
description Primitive An optional long name or description of the constant.
name Primitive The constant name (be careful it doesn't confict with existing constant names).
value Primitive The derived constant value.
리턴 void

AddDerivedUnit() 공개 정적인 메소드

Add a derived unit to the system.
public static AddDerivedUnit ( Primitive description, Primitive name, Primitive units, Primitive add ) : void
description Primitive An optional long name or description of the derived unit.
name Primitive The unit name (be careful it doesn't confict with existing unit names).
units Primitive The derived unit definition.
add Primitive An optional addition term.
리턴 void

Convert() 공개 정적인 메소드

Convert a value from one unit to another.
public static Convert ( Primitive value, Primitive fromUnit, Primitive toUnit ) : Primitive
value Primitive The value to convert.
fromUnit Primitive The units to convert from.
toUnit Primitive The units to convert to.
리턴 Primitive

Export() 공개 정적인 메소드

Export the current unit system to a file (units.txt in the current program folder).
public static Export ( ) : void
리턴 void

GetBaseUnits() 공개 정적인 메소드

Get a list of current base units.
public static GetBaseUnits ( ) : Primitive
리턴 Primitive

GetConstants() 공개 정적인 메소드

Get a list of current constants.
public static GetConstants ( ) : Primitive
리턴 Primitive

GetDerivedUnits() 공개 정적인 메소드

Get a list of current derived units.
public static GetDerivedUnits ( ) : Primitive
리턴 Primitive

GetDimensions() 공개 정적인 메소드

Get an array of dimensions for a unit.
public static GetDimensions ( Primitive unit ) : Primitive
unit Primitive The unit to get dimensins of.
리턴 Primitive

GetErrors() 공개 정적인 메소드

Get an array of error messages if a Convert fails or conflicts are found for added units or constants.
public static GetErrors ( ) : Primitive
리턴 Primitive

GetPrefixes() 공개 정적인 메소드

Get a list of current prefixes.
public static GetPrefixes ( ) : Primitive
리턴 Primitive

Import() 공개 정적인 메소드

Import a unit system from a file (units.txt in the current program folder).
public static Import ( ) : void
리턴 void