public ICustomTypeConverter GetConverter(Type type, Type inputType)
        {
            ICustomTypeConverter output = items.FirstOrDefault(x => x.TargetType == type && x.InputTypes.Contains(inputType));

            //if (items.ContainsKey(type)) return items[type];
            return(output);
        }
 public void AddConverter(ICustomTypeConverter converter)
 {
     items.Add(converter);
 }
예제 #3
0
 public void AddCustomTypeConverter(ICustomTypeConverter customTypeConverter, string propertyName)
 {
     if (!customTypeConverters.ContainsKey(propertyName.ToUpperInvariant()))
         customTypeConverters.Add(propertyName.ToUpperInvariant(), customTypeConverter);
 }