System.Configuration.ConfigurationElement.SetPropertyValue C# (CSharp) Метод

SetPropertyValue() защищенный Метод

protected SetPropertyValue ( ConfigurationProperty prop, object value, bool ignoreLocks ) : void
prop ConfigurationProperty
value object
ignoreLocks bool
Результат void
        protected void SetPropertyValue(ConfigurationProperty prop, object value, bool ignoreLocks) {
            if (IsReadOnly()) {
                throw new ConfigurationErrorsException(SR.GetString(SR.Config_base_read_only));
            }

            if ((ignoreLocks == false) && 
                ((_lockedAllExceptAttributesList != null && _lockedAllExceptAttributesList.HasParentElements && !_lockedAllExceptAttributesList.DefinedInParent(prop.Name)) ||
                    (_lockedAttributesList != null && (_lockedAttributesList.DefinedInParent(prop.Name) || _lockedAttributesList.DefinedInParent(LockAll))) ||
                    ((_fItemLocked & ConfigurationValueFlags.Locked) != 0) &&
                    (_fItemLocked & ConfigurationValueFlags.Inherited) != 0)) {
                throw new ConfigurationErrorsException(SR.GetString(SR.Config_base_attribute_locked, prop.Name));
            }

            _bModified = true;

            // Run the new value through the validator to make sure its ok to store it
            if (value != null) {
                prop.Validate(value);
            }

            _values[prop.Name] = (value != null) ? value : s_nullPropertyValue;
        }