System.Configuration.ConfigurationProperty.ConstructorInit C# (CSharp) Метод

ConstructorInit() приватный Метод

private ConstructorInit ( string name, Type type, ConfigurationPropertyOptions options, ConfigurationValidatorBase validator, TypeConverter converter ) : void
name string
type System.Type
options ConfigurationPropertyOptions
validator ConfigurationValidatorBase
converter System.ComponentModel.TypeConverter
Результат void
        private void ConstructorInit(string name,
                                        Type type,
                                        ConfigurationPropertyOptions options,
                                        ConfigurationValidatorBase validator,
                                        TypeConverter converter) {
            if (typeof(ConfigurationSection).IsAssignableFrom(type)) {
                throw new ConfigurationErrorsException(SR.GetString(SR.Config_properties_may_not_be_derived_from_configuration_section, name));
            }

            _providedName = name; // save the provided name so we can check for default collection names
            if ((options & ConfigurationPropertyOptions.IsDefaultCollection) != 0 &&
                String.IsNullOrEmpty(name)) {
                name = DefaultCollectionPropertyName;
            }
            else {
                ValidatePropertyName(name);
            }

            _name = name;
            _type = type;
            _options = options;
            _validator = validator;
            _converter = converter;

            // Use the default validator if none was supplied
            if (_validator == null) {
                _validator = DefaultValidatorInstance;
            }
            else {
                // Make sure the supplied validator supports the type of this property
                if (!_validator.CanValidate(_type)) {
                    throw new ConfigurationErrorsException(SR.GetString(SR.Validator_does_not_support_prop_type, _name));
                }
            }
        }