Class Unit
Last update: 09.03.2026Namespace: VM
Assembly: VM.dll
This class is to represent the Unit.
public sealed class Unit
Inheritance
object ← Unit
Constructors
Unit()
Initializes a new instance of the
public Unit()
Unit(Unit)
Initializes a new instance of the
public Unit(Unit unitValue)
Parameters
unitValue Unit
The unit
Unit(UnitType)
Initializes a new instance of the
public Unit(UnitType type)
Parameters
type UnitType
The type of unit
Unit(SerializationInfo, StreamingContext)
Initializes a new instance of the
public Unit(SerializationInfo information, StreamingContext context)
Parameters
information SerializationInfo
The info.
context StreamingContext
The context
Properties
Angle
Gets or sets the angle.
public string Angle { get; set; }
Property Value
string
Force
Gets or sets the force.
public string Force { get; set; }
Property Value
string
Handle
Gets the handle.
public IntPtr Handle { get; }
Property Value
IntPtr
Length
Gets or sets the length.
public string Length { get; set; }
Property Value
string
Mass
Gets or sets the mass.
public string Mass { get; set; }
Property Value
string
Power
Gets or sets the power
public string Power { get; set; }
Property Value
string
Temperature
Gets or sets the temperature
public string Temperature { get; set; }
Property Value
string
Time
Gets or sets the time.
public string Time { get; set; }
Property Value
string
Work
Gets or sets the work
public string Work { get; set; }
Property Value
string
this[string]
Gets or sets the unit by indexer.
public string this[string type] { get; set; }
Property Value
string
Methods
ConvertTo(Unit, string)
Convert to.
public double ConvertTo(Unit referenceUnit, string stringType)
Parameters
referenceUnit Unit
The reference unit
stringType string
The type
Returns
double
The convert data
Dispose()
public void Dispose()
Equals(object)
public override bool Equals(object obj)
Parameters
obj object
Returns
bool
GetFactor(string)
Get factor for unit type
public double GetFactor(string type)
Parameters
type string
The unit type
Returns
double
The factor
GetHashCode()
public override int GetHashCode()
Returns
int
Initialize(string)
Initializes a instance.
public static void Initialize(string stringUnitPath)
Parameters
stringUnitPath string
The path of unit.
IsContain(string)
Contains unit.
public bool IsContain(string stringType)
Parameters
stringType string
The type of unit.
Returns
bool
true if contains unit type, otherwise false.
Operators
operator ==(Unit, Unit)
Compare two units
public static bool operator ==(Unit left, Unit right)
Parameters
left Unit
The unit
right Unit
The unit to compare
Returns
bool
true if two units are equal, otherwise false.
operator !=(Unit, Unit)
Compare two units
public static bool operator !=(Unit left, Unit right)
Parameters
left Unit
The unit
right Unit
The unit to compare
Returns
bool
true if two units are not equal, otherwise false.