How this works

Each of the principal types of measurement—area, length, speed, etc.—is
a distinct .NET structure. This means that the compiler, not the developer, controls
what kind of measurements are possible for a particular phenomenon.

However, all of the built-in measurement structures implement
IMeasurable, which defines a number of properties and methods
useful for a generic converter like this one.

The framework also defines an abstract
Unit
class, and a collection of concrete measurement units that derive from it. Each
contains its own list of conversion factors, meaning that measurements can convert
directly to other measurements without going through an intermediary; and the conversion
framework is completely extensible, since new Unit classes can simply define
their own conversion list.

(This, incidentally, is why Speed and Pressure have so few conversions available
in this demo. We are working on making the demo aware of compound units.)

But even in a generic case, like this conversion utility, the appropriate use of
interfaces and abstractions makes it not much more complicated than the more common,
concrete case. This is the salient code behind this Web form: