public void AddConditional(Type type, Type converterType, Func <TypeInfo, PropertyInfo, bool> condition, Func <TypeInfo, PropertyInfo, ValueConverter> factory = null) { if (!_types.TryGetValue(type, out var converters)) { _types.Add(type, converters = new ConverterTypeCollection()); } converters.ConditionalConverters.Add(new ConditionalDefinition(new Definition(converterType, factory), condition)); }
public void SetDefault(Type type, Type converterType, Func <TypeInfo, PropertyInfo, ValueConverter> factory = null) { if (!_types.TryGetValue(type, out var converters)) { _types.Add(type, converters = new ConverterTypeCollection()); } converters.DefaultConverter = new Definition(converterType, factory); }