public IConnectionTypeConverter UseConverter(Type converterType) { if (Converters == null) { Converters = new List <IConnectionTypeConverter>(); } IConnectionTypeConverter converter = null; foreach (var existingConverter in Converters) { if (existingConverter.GetType() == converterType) { converter = existingConverter; break; } } if (converter == null) { converter = (IConnectionTypeConverter)Activator.CreateInstance(converterType); Converters.Add(converter); } return(converter); }
public void RegisterConverter(IConnectionTypeConverter converter) { if (Converters == null) { Converters = new List <IConnectionTypeConverter> (); } Converters.Add(converter); }
public void RegisterConverter(IConnectionTypeConverter converter) => Source.RegisterConverter(converter);