Example #1
0
        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);
        }
Example #2
0
        public void RegisterConverter(IConnectionTypeConverter converter)
        {
            if (Converters == null)
            {
                Converters = new List <IConnectionTypeConverter> ();
            }

            Converters.Add(converter);
        }
Example #3
0
 public void RegisterConverter(IConnectionTypeConverter converter) => Source.RegisterConverter(converter);