Example #1
0
        private static MethodInfo GetConversionMethod(this IValue source, IUnit unit)
        {
            var methods = source.GetConversionMethods();

            return(methods.SingleOrDefault(mi => mi.GetParameters().First().ParameterType == unit.GetType()));
        }
Example #2
0
        private static IEnumerable <Type> GetConversions(this IValue source)
        {
            var methods = source.GetConversionMethods();

            return(methods.Select(mi => mi.GetParameters().First().ParameterType));
        }