Class VolumeUnit
- Namespace
- xFunc.Maths.Expressions.Units.VolumeUnits
- Assembly
- xFunc.Maths.dll
Represents a area unit.
public class VolumeUnit : IEquatable<VolumeUnit>- Inheritance
- 
      
      VolumeUnit
- Implements
- Inherited Members
Fields
Centimeter
The centimeter (cm³) unit.
public static readonly VolumeUnit CentimeterField Value
Foot
The foot (ft³) unit.
public static readonly VolumeUnit FootField Value
Gallon
The gallon (gal) unit.
public static readonly VolumeUnit GallonField Value
Inch
The inch (in³) unit.
public static readonly VolumeUnit InchField Value
Liter
The Liter (l) unit.
public static readonly VolumeUnit LiterField Value
Meter
The meter (m³) unit.
public static readonly VolumeUnit MeterField Value
Yard
The yard (yd³) unit.
public static readonly VolumeUnit YardField 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.
[ExcludeFromCodeCoverage]
public static IEnumerable<VolumeUnit> 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
- objobject
- The object to compare with the current object. 
Returns
Equals(VolumeUnit?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(VolumeUnit? other)Parameters
- otherVolumeUnit
- An object to compare with this object. 
Returns
FromName(string, out VolumeUnit?)
Gets a unit by name.
public static bool FromName(string name, out VolumeUnit? unit)Parameters
- namestring
- The name of unit. 
- unitVolumeUnit
- When 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
- trueif volume units contain an unit with the specified- name; otherwise,- false.
Exceptions
- ArgumentNullException
- nameis- null.
GetHashCode()
Serves as the default hash function.
[ExcludeFromCodeCoverage]
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. 
Operators
operator ==(VolumeUnit, VolumeUnit)
Determines whether two specified instances of AreaValue are equal.
public static bool operator ==(VolumeUnit left, VolumeUnit right)Parameters
- leftVolumeUnit
- The first object to compare. 
- rightVolumeUnit
- The second object to compare. 
Returns
- bool
- trueif- leftis equal to- right; otherwise,- false.
operator !=(VolumeUnit, VolumeUnit)
Determines whether two specified instances of AreaValue are equal.
public static bool operator !=(VolumeUnit left, VolumeUnit right)Parameters
- leftVolumeUnit
- The first object to compare. 
- rightVolumeUnit
- The second object to compare. 
Returns
- bool
- trueif- leftis equal to- right; otherwise,- false.