public bool Matches(Type type, ConverterLibrary converter) { if (type.IsArray && converter.CanBeParsed(type.GetElementType())) { return(true); } return(type.IsGenericEnumerable() && converter.CanBeParsed(type.GetGenericArguments()[0])); }
public bool Matches(Type type, ConverterLibrary converter) { try { return(TypeDescriptor.GetConverter(type).CanConvertFrom(typeof(string))); } catch (Exception) { return(false); } }
public bool Matches(Type type, ConverterLibrary converter) { if (type.IsArray) { return(false); } var constructorInfo = type.GetConstructor(new[] { typeof(string) }); return(constructorInfo != null); }
public abstract bool Matches(Type type, ConverterLibrary converter);
public bool Matches(Type type, ConverterLibrary converter) { return(type.IsEnum); }
private ObjectConverter(Func <Type, object> finder, ConverterLibrary library) { _library = library; _finder = finder; }
public ObjectConverter(IServiceLocator services, ConverterLibrary library) : this(type => services.GetInstance(type), library) { }
public bool Matches(Type type, ConverterLibrary converter) { return(type.IsNullable()); }