Пример #1
0
 public IConversion GetConverter(Unit from, Unit to)
 {
     var seq = new ConversionTracker(this);
     var conversionSequence = seq.FindConversionSequence(from, to);
     if (conversionSequence == null)
         throw new InvalidOperationException("No conversion could be found between the provided units.");
     return conversionSequence;
 }
Пример #2
0
        public IConversion GetConverter(Unit from, Unit to)
        {
            var seq = new ConversionTracker(this);
            var conversionSequence = seq.FindConversionSequence(from, to);

            if (conversionSequence == null)
            {
                throw new InvalidOperationException("No conversion could be found between the provided units.");
            }
            return(conversionSequence);
        }