FindConversionSequence() 공개 메소드

public FindConversionSequence ( Unit unit, Unit target ) : IConversion
unit Unit
target Unit
리턴 IConversion
예제 #1
0
파일: UnitGraph.cs 프로젝트: flq/NMeasure
 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);
        }