internal void HandleLockedAttributes(ConfigurationElement source)
 {
     if ((source != null) && ((source._lockedAttributesList != null) || (source._lockedAllExceptAttributesList != null)))
     {
         foreach (PropertyInformation information in source.ElementInformation.Properties)
         {
             if ((((source._lockedAttributesList != null) && (source._lockedAttributesList.Contains(information.Name) || source._lockedAttributesList.Contains("*"))) || ((source._lockedAllExceptAttributesList != null) && !source._lockedAllExceptAttributesList.Contains(information.Name))) && ((information.Name != "lockAttributes") && (information.Name != "lockAllAttributesExcept")))
             {
                 if (this.ElementInformation.Properties[information.Name] == null)
                 {
                     ConfigurationPropertyCollection properties = this.Properties;
                     ConfigurationProperty property = source.Properties[information.Name];
                     properties.Add(property);
                     this._evaluationElement = null;
                     ConfigurationValueFlags valueFlags = ConfigurationValueFlags.Locked | ConfigurationValueFlags.Inherited;
                     this._values.SetValue(information.Name, information.Value, valueFlags, source.PropertyInfoInternal(information.Name));
                 }
                 else
                 {
                     if (this.ElementInformation.Properties[information.Name].ValueOrigin == PropertyValueOrigin.SetHere)
                     {
                         throw new ConfigurationErrorsException(System.Configuration.SR.GetString("Config_base_attribute_locked", new object[] { information.Name }));
                     }
                     this.ElementInformation.Properties[information.Name].Value = information.Value;
                 }
             }
         }
     }
 }
Пример #2
0
 public void LogWarning(string message, System.Configuration.ElementInformation info)
 {
     Console.WriteLine("WARNING: " + message);
 }