Class Unit
Last update: 16.07.2025Namespace: VM
Assembly: VM.dll
This class is to represent the Unit.
public sealed class Unit
Inheritance
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
Force
Gets or sets the force.
public string Force { get; set; }
Property Value
Handle
Gets the handle.
public IntPtr Handle { get; }
Property Value
Length
Gets or sets the length.
public string Length { get; set; }
Property Value
Mass
Gets or sets the mass.
public string Mass { get; set; }
Property Value
Power
Gets or sets the power
public string Power { get; set; }
Property Value
Temperature
Gets or sets the temperature
public string Temperature { get; set; }
Property Value
Time
Gets or sets the time.
public string Time { get; set; }
Property Value
Work
Gets or sets the work
public string Work { get; set; }
Property Value
this[string]
Gets or sets the unit by indexer.
public string this[string type] { get; set; }
Property Value
Methods
ConvertTo(Unit, string)
Convert to.
public double ConvertTo(Unit referenceUnit, string stringType)
Parameters
referenceUnit Unit
The reference unit
stringType string
The type
Returns
The convert data
Dispose()
public void Dispose()
Equals(object)
public override bool Equals(object obj)
Parameters
obj object
Returns
GetFactor(string)
Get factor for unit type
public double GetFactor(string type)
Parameters
type string
The unit type
Returns
The factor
GetHashCode()
public override int GetHashCode()
Returns
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
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
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
true if two units are not equal, otherwise false.