Beispiel #1
0
 static ReadingValuesConverterCache()
 {
     TemperatureCache = new ValueConverterCache <TemperatureUnit>(k => new TemperatureConverter(k.From, k.To));
     SpeedCache       = new ValueConverterCache <SpeedUnit>(k => new SpeedConverter(k.From, k.To));
     PressCache       = new ValueConverterCache <PressureUnit>(k => new PressureConverter(k.From, k.To));
     Default          = new ReadingValuesConverterCache <TValue>(
         k => new ReadingValuesConverter <TValue>(
             TemperatureCache.Get(k.Temp) as TemperatureConverter,
             SpeedCache.Get(k.Speed) as SpeedConverter,
             PressCache.Get(k.Press) as PressureConverter
             )
         );
 }
Beispiel #2
0
 public Key(ValueConverterCache <TemperatureUnit> .Key temp, ValueConverterCache <SpeedUnit> .Key speed, ValueConverterCache <PressureUnit> .Key press)
 {
     Temp  = temp;
     Speed = speed;
     Press = press;
 }
Beispiel #3
0
 public ReadingValuesConverter <TValue> Get(ValueConverterCache <TemperatureUnit> .Key temp, ValueConverterCache <SpeedUnit> .Key speed, ValueConverterCache <PressureUnit> .Key press)
 {
     return(Get(new Key(temp, speed, press)));
 }