private ConversionInfo GetConversionWithoutCache(Type sourceType, Type targetType) { ConversionInfo best = ConversionInfo.Null; foreach (IConversionRule rule in rules) { ConversionCost cost = rule.GetConversionCost(sourceType, targetType, this); if (cost.CompareTo(best.Cost) < 0 && !cost.IsInvalid) { best = new ConversionInfo(cost, rule); } } return(best); }
public ConversionInfo(ConversionCost cost, IConversionRule rule) { Cost = cost; Rule = rule; }