Class AreaUnit
- Namespace
- xFunc.Maths.Expressions.Units.AreaUnits
- Assembly
- xFunc.Maths.dll
Represents a area unit.
public class AreaUnit : IEquatable<AreaUnit>
- Inheritance
-
AreaUnit
- Implements
- Inherited Members
Fields
Acre
The acre (ac) unit.
public static readonly AreaUnit Acre
Field Value
Centimeter
The centimeter (cm²) unit.
public static readonly AreaUnit Centimeter
Field Value
Foot
The foot (ft²) unit.
public static readonly AreaUnit Foot
Field Value
Hectare
The hectare (ha) unit.
public static readonly AreaUnit Hectare
Field Value
Inch
The inch (in²) unit.
public static readonly AreaUnit Inch
Field Value
Kilometer
The kilometer (km²) unit.
public static readonly AreaUnit Kilometer
Field Value
Meter
The meter (m²) unit.
public static readonly AreaUnit Meter
Field Value
Mile
The mile (mi²) unit.
public static readonly AreaUnit Mile
Field Value
Millimeter
The millimeter (mm²) unit.
public static readonly AreaUnit Millimeter
Field Value
Yard
The yard (yd²) unit.
public static readonly AreaUnit Yard
Field Value
Properties
Factor
Gets a factor of conversion from this unit to base unit.
public double Factor { get; }
Property Value
Names
Gets all available unit names.
public static IEnumerable<string> Names { get; }
Property Value
UnitName
Gets a short name of the unit.
public string UnitName { get; }
Property Value
Units
Gets all available units.
public static IEnumerable<AreaUnit> Units { get; }
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
Equals(AreaUnit?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(AreaUnit? other)
Parameters
other
AreaUnitAn object to compare with this object.
Returns
FromName(string, out AreaUnit?)
Gets a unit by name.
public static bool FromName(string name, out AreaUnit? unit)
Parameters
name
stringThe name of unit.
unit
AreaUnitWhen this method returns, the value associated with the specified name, if the unit is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.
Returns
- bool
true
if area units contain an unit with the specifiedname
; otherwise,false
.
Exceptions
- ArgumentNullException
name
isnull
.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToVolumeUnit()
Maps the current area unit to volume unit.
public VolumeUnit ToVolumeUnit()
Returns
- VolumeUnit
The volume unit.
Exceptions
- InvalidOperationException
Cannot convert the current AreaUnit to an VolumeUnit.
- See Also
Operators
operator ==(AreaUnit, AreaUnit)
Determines whether two specified instances of AreaValue are equal.
public static bool operator ==(AreaUnit left, AreaUnit right)
Parameters
Returns
- bool
true
ifleft
is equal toright
; otherwise,false
.
operator !=(AreaUnit, AreaUnit)
Determines whether two specified instances of AreaValue are equal.
public static bool operator !=(AreaUnit left, AreaUnit right)
Parameters
Returns
- bool
true
ifleft
is equal toright
; otherwise,false
.