コード例 #1
0
        private bool RemoveDeletedConfigurationProperties()
        {
            List <string> removeList = new List <string>();

            CreateRemoveList(removeList);
            foreach (string propertyName in removeList)
            {
                propertiesCollection.Remove(propertyName);
            }
            return(removeList.Count > 0);
        }
コード例 #2
0
        internal bool UpdatePropertyCollection()
        {
            bool      isModified       = false;
            ArrayList newPropertyNames = null;

            if (this._propertyNames != null)
            {
                foreach (ConfigurationProperty property in this._properties)
                {
                    if (IsImplementedProperty(property.Name) || _propertyNames.Get(property.Name) != null)
                    {
                        continue;
                    }

                    if (newPropertyNames == null)
                    {
                        newPropertyNames = new ArrayList();
                    }

                    newPropertyNames.Add(property.Name);

                    isModified = true;
                }

                if (newPropertyNames != null)
                {
                    foreach (string name in newPropertyNames)
                    {
                        _properties.Remove(name);
                    }
                }

                foreach (string name in _propertyNames)
                {
                    string oldVal = _propertyNames[name];
                    string newVal = GetProperty(name);

                    if (newVal == null || oldVal != newVal)
                    {
                        SetProperty(name, oldVal);

                        isModified = true;
                    }
                }
            }

            return(isModified);
        }
コード例 #3
0
 // Remove an element from the property collection.
 public void RemoveCollectionElement(string elName)
 {
     Properties.Remove(elName);
 }