Exemplo n.º 1
0
        internal void InternalUnMerge(ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode)
        {
            this.Unmerge(sourceElement, parentElement, saveMode);
            base.BaseClear();
            ProfileGroupSettingsCollection settingss  = sourceElement as ProfileGroupSettingsCollection;
            ProfileGroupSettingsCollection settingss2 = parentElement as ProfileGroupSettingsCollection;

            foreach (ProfileGroupSettings settings in settingss)
            {
                ProfileGroupSettings settings2 = settingss2.Get(settings.Name);
                ProfileGroupSettings element   = new ProfileGroupSettings();
                element.InternalUnmerge(settings, settings2, saveMode);
                this.BaseAdd(element);
            }
        }
        internal void InternalUnMerge(ConfigurationElement sourceElement, ConfigurationElement parentElement,
                                      ConfigurationSaveMode saveMode)
        {
            // This requires a special unmerge because it should not act like an element in a collection
            // which is the default behavior
            Unmerge(sourceElement, parentElement, saveMode); // Base merge to get locks merged
            BaseClear();                                     // don't use the merged data however

            ProfileGroupSettingsCollection source = sourceElement as ProfileGroupSettingsCollection;
            ProfileGroupSettingsCollection parent = parentElement as ProfileGroupSettingsCollection;

            // foreach group in the source we should unmerge the individual settings.
            foreach (ProfileGroupSettings settings in source)
            {
                ProfileGroupSettings settingsFromParent = parent.Get(settings.Name);
                ProfileGroupSettings deltaSettings      = new ProfileGroupSettings();

                deltaSettings.InternalUnmerge(settings, settingsFromParent, saveMode);
                BaseAdd(deltaSettings);
            }
        }