Ejemplo n.º 1
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));
            }
        }
Ejemplo n.º 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));
                }
            }
        }