BinaryUnitInfo Class

Provides culture-specific information on how to format and parse multiple-byte units.

Definition

Namespace: Ookii
Assembly: Ookii.BinarySize (in Ookii.BinarySize.dll) Version: 1.1.0+e86ae44c345422a1011f7fa7b6b715bf3d1a34ce
C#
public class BinaryUnitInfo : ICloneable, 
	IFormatProvider
Inheritance
Object    BinaryUnitInfo
Implements
ICloneable, IFormatProvider

Remarks

The properties of this class are used by the BinarySize structure to determine how to format and parse multiple-byte units, including their IEC and SI prefixes.

Only an invariant version of this structure is provided by default; you can create your own to localize or customize the units. Pass a custom BinaryUnitInfo instance to the BinarySizeToString(String, IFormatProvider) or Parse(ReadOnlySpanChar, BinarySizeOptions, NumberStyles, IFormatProvider) method, or combine it with a CultureInfo class using the CultureInfoExtensionsWithBinaryUnitInfo(CultureInfo, BinaryUnitInfo) method.

Constructors

BinaryUnitInfoInitializes a new instance of the BinaryUnitInfo class

Properties

CompareOptions Gets or sets the options to use for string comparisons when parsing BinarySize values.
InvariantInfo Gets a read-only BinaryUnitInfo object that is culture-independent (invariant).
IsReadOnly Gets a value that indicates whether this BinaryUnitInfo object is read-only.
LongByte Gets or sets the full version of the byte unit, singular.
LongBytes Gets or sets the full version of the bytes unit, plural.
LongConnector Gets or sets a string that can be used between a full prefix (e.g. LongKibi) and a unit (e.g. LongByte).
LongExa Gets or sets the full version of the exa prefix.
LongExbi Gets or sets the full version of the exbi prefix.
LongGibi Gets or sets the full version of the gibi prefix.
LongGiga Gets or sets the full version of the giga prefix.
LongKibi Gets or sets the full version of the kibi prefix.
LongKilo Gets or sets the full version of the kilo prefix.
LongMebi Gets or sets the full version of the mebi prefix.
LongMega Gets or sets the full version of the mega prefix.
LongPebi Gets or sets the full version of the pebi prefix.
LongPeta Gets or sets the full version of the peta prefix.
LongTebi Gets or sets the full version of the tebi prefix.
LongTera Gets or sets the full version of the tera prefix.
ShortByte Gets or sets the abbreviated version of the byte unit, singular.
ShortBytes Gets or sets the abbreviated version of the bytes unit, plural.
ShortConnector Gets or sets a string that can be used between an abbreviated prefix (e.g. ShortKibi) and a unit (e.g. ShortByte).
ShortDecimalKilo Gets or sets the abbreviated version of the kilo prefix, when interpreted as powers of ten (1,000 bytes).
ShortExa Gets or sets the abbreviated version of the exa prefix.
ShortExbi Gets or sets the abbreviated version of the exbi prefix.
ShortGibi Gets or sets the abbreviated version of the gibi prefix.
ShortGiga Gets or sets the abbreviated version of the giga prefix.
ShortKibi Gets or sets the abbreviated version of the kibi prefix.
ShortKilo Gets or sets the abbreviated version of the kilo prefix, when interpreted as powers of two (1,024 bytes).
ShortMebi Gets or sets the abbreviated version of the mebi prefix.
ShortMega Gets or sets the abbreviated version of the mega prefix.
ShortPebi Gets or sets the abbreviated version of the pebi prefix.
ShortPeta Gets or sets the abbreviated version of the peta prefix.
ShortTebi Gets or sets the abbreviated version of the tebi prefix.
ShortTera Gets or sets the abbreviated version of the tera prefix.

Methods

Clone Creates a shallow copy of the BinaryUnitInfo object.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetFormat Gets an object of the specified type that provides a formatting service.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ReadOnly Creates a read-only copy of this BinaryUnitInfo object.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also