private static bool TryGetConverter(ConverterSearchContext context, out IConverter converter)
        {
            if (context.SourceType == typeof(string) && context.TargetType == typeof(TimeSpan))
            {
                converter = new TimeSpanConveter();
                return(true);
            }

            converter = null;
            return(false);
        }
        private static bool TryConvertStringToEnum(ConverterSearchContext context, out IConverter converter)
        {
            if (context.TargetType.GetTypeInfo().IsEnum)
            {
                converter = new StringToEnumConverter(false);
                return(true);
            }
            else if (context.TargetType.GetTypeInfo().IsGenericType&& context.TargetType.GetGenericTypeDefinition() == typeof(Nullable <>) && context.TargetType.GetGenericArguments()[0].GetTypeInfo().IsEnum)
            {
                converter = new StringToNullableConverter(new StringToEnumConverter(false), true);
                return(true);
            }

            converter = null;
            return(false);
        }
 private static bool TryConvertToString(ConverterSearchContext context, out IConverter converter)
 {
     converter = new ToStringConverter();
     return(true);
 }