public ConverterSettings(ConverterSection settings)
        {
            if (settings == null)
            {
                _type = typeof(Converter);
            }
            else
            {
                _name = settings.Name;
                _type = Type.GetType(settings.Type);

                if (_type == null)
                    throw new ConfigurationErrorsException(String.Format(Resources.CouldNotFindType, settings.Type));

                if (_type.GetInterface("IConverter") == null)
                    throw new ConfigurationErrorsException(String.Format(Resources.TypeDoesNotImplementInterface, settings.Type, typeof(IConverter).FullName));
            }
        }
Beispiel #2
0
        public ConverterSettings(ConverterSection settings)
        {
            if (settings == null)
            {
                _type = typeof(Converter);
            }
            else
            {
                _name = settings.Name;
                _type = Type.GetType(settings.Type);

                if (_type == null)
                {
                    throw new ConfigurationErrorsException(String.Format(Resources.CouldNotFindType, settings.Type));
                }

                if (_type.GetInterface("IConverter") == null)
                {
                    throw new ConfigurationErrorsException(String.Format(Resources.TypeDoesNotImplementInterface, settings.Type, typeof(IConverter).FullName));
                }
            }
        }