Skip to content

Direct quantity access

cureos edited this page Mar 25, 2011 · 1 revision

The Cureos.Measures library automatically identifies its own quantities and units through reflection. The collection of defined quantities and its associated units can be accessed via the static class QuantityCollection.

QuantityCollection holds one member, the property getter

IEnumerable<QuantityAdapter> Quantities { get; }

The QuantityAdapter is simply a wrapper of one quantity and the collection of physical units associated with the quantity:

class QuantityAdapter
{
  IQuantity Quantity { get; }
  IEnumerable<IUnit> Units { get; }
}

Clone this wiki locally