configuration group, one section per each client as such. contains the value items collection.
Inheritance: System.Configuration.ConfigurationElement
Exemplo n.º 1
0
        private void SetIndexesForConfigGroupElementRecursively(ConfigurationGroupElement configGroup)
        {
            for (int j = 0; j < configGroup.ValueItemCollection.Count; j++)
            {
                configGroup.ValueItemCollection[j].Index = j;
            }

            if (configGroup.InnerCollections != null && configGroup.InnerCollections.Count > 0)
            {
                for (int i = 0; i < configGroup.InnerCollections.Count; i++)
                {
                    var innerConfigGroup = configGroup.InnerCollections[i];
                    innerConfigGroup.Index = i;

                    SetIndexesForConfigGroupElementRecursively(innerConfigGroup);
                }
            }
        }
        internal ConfigSection(ConfigurationGroupElement configElement, ConfigSection parent, bool allowValueInheritance)
        {
            AllowValueInheritance = allowValueInheritance;
            ConfigElement         = configElement;
            foreach (ValueItemElement element in configElement.ValueItemCollection)
            {
                //mirroring the behavour of the configurationGroupElement stuff that will just return the last item even if dups keys used.
                if (!valuesAsDictionary.ContainsKey(element.Key))
                {
                    valuesAsDictionary.Add(element.Key, element.Value);
                }
            }

            ParentElement = parent;

            //add values from parent
            if (allowValueInheritance && parent != null)
            {
                foreach (ConfigValueItem parentValue in parent.valuesAsDictionary)
                {
                    ValuesAsDictionary.Add(parentValue.Key, parentValue.Value, false, true);
                }
            }
        }
Exemplo n.º 3
0
        private void SetIndexesForConfigGroupElementRecursively(ConfigurationGroupElement configGroup)
        {
            for (int j = 0; j < configGroup.ValueItemCollection.Count; j++)
            {
                configGroup.ValueItemCollection[j].Index = j;
            }

            if (configGroup.InnerCollections != null && configGroup.InnerCollections.Count > 0)
            {
                for (int i = 0; i < configGroup.InnerCollections.Count; i++)
                {
                    var innerConfigGroup = configGroup.InnerCollections[i];
                    innerConfigGroup.Index = i;

                    SetIndexesForConfigGroupElementRecursively(innerConfigGroup);
                }
            }
        }
 public void Remove(ConfigurationGroupElement g)
 {
     BaseRemove(g.Name);
 }
 public void Add(ConfigurationGroupElement item)
 {
     BaseAdd(item);
 }
 public void Remove(ConfigurationGroupElement g)
 {
     BaseRemove(g.Name);
 }
 public void Add(ConfigurationGroupElement item)
 {
     BaseAdd(item);
 }
 internal ConfigSection(ConfigurationGroupElement configElement, bool allowValueInheritance) : this(configElement, null, allowValueInheritance)
 {
 }