Show / Hide Table of Contents

Class PrefixUnit

Represents the base class from which all implementations of a unit of measurement should derive. Implements the IPrefixUnit

Inheritance
Object
PrefixUnit
BitUnit
ByteUnit
Implements
IPrefixUnit
IUnit
IEquatable<IUnit>
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public abstract class PrefixUnit : IPrefixUnit, IUnit, IEquatable<IUnit>

Constructors

| Improve this Doc View Source

PrefixUnit(String, String, Double, IPrefixMultiple, Action<UnitFormatOptions>)

Initializes a new instance of the ByteUnit struct.

Declaration
protected PrefixUnit(string name, string symbol, double value, IPrefixMultiple prefix, Action<UnitFormatOptions> setup = null)
Parameters
Type Name Description
String name

The name of the unit.

String symbol

The symbol of the unit.

Double value

The value of this unit expressed as bytes.

IPrefixMultiple prefix

The prefix to associate with this unit.

Action<UnitFormatOptions> setup

The UnitFormatOptions which may be configured.

Exceptions
Type Condition
ArgumentNullException

name cannot be null -or- symbol cannot be null.

ArgumentException

name cannot be empty or consist only of white-space characters -or- symbol cannot be empty or consist only of white-space characters.

ArgumentOutOfRangeException

value is lower than 0.

Properties

| Improve this Doc View Source

Prefix

Gets the prefix multiple to this unit.

Declaration
public IPrefixMultiple Prefix { get; }
Property Value
Type Description
IPrefixMultiple

The prefix multiple to this unit.

| Improve this Doc View Source

PrefixValue

Gets the prefix value of this unit.

Declaration
public double PrefixValue { get; }
Property Value
Type Description
Double

The prefix value of this unit.

| Improve this Doc View Source

UnitName

Gets the name of this unit.

Declaration
public string UnitName { get; }
Property Value
Type Description
String

The name of this unit.

| Improve this Doc View Source

UnitSymbol

Gets the symbol of this unit.

Declaration
public string UnitSymbol { get; }
Property Value
Type Description
String

The symbol of this unit.

| Improve this Doc View Source

UnitValue

Gets the value of this unit expressed as bytes.

Declaration
public double UnitValue { get; }
Property Value
Type Description
Double

The value of this unit.

Methods

| Improve this Doc View Source

Equals(IUnit)

Indicates whether the current object is equal to another object of the same type.

Declaration
public virtual bool Equals(IUnit other)
Parameters
Type Name Description
IUnit other

An object to compare with this object.

Returns
Type Description
Boolean

true if the current object is equal to the other parameter; otherwise, false.

| Improve this Doc View Source

ToString()

Returns a String that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
String

A String that represents this instance.

Overrides
Object.ToString()
| Improve this Doc View Source

ToString(Action<UnitFormatOptions>)

Returns a String that represents this instance.

Declaration
public string ToString(Action<UnitFormatOptions> setup)
Parameters
Type Name Description
Action<UnitFormatOptions> setup

The UnitFormatOptions which may be configured.

Returns
Type Description
String

A String that represents this instance.

Implements

IPrefixUnit
IUnit
System.IEquatable<T>

See Also

IPrefixUnit
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright 2008-2022 Geekle. All rights reserved. Code with passion and love; deploy with confidence. 👨‍💻️🔥❤️🚀😎
Generated by DocFX