/// <summary> /// Creates a <see cref="ExtensionConfigurationSection"/> according to the provided settings dictionary. /// </summary> /// <param name="settings">The settings.</param> /// <returns>A newly created <see cref="ExtensionConfigurationSection"/>.</returns> public static ExtensionConfigurationSection CreateSection(params KeyValuePair<string, string>[] settings) { var section = new ExtensionConfigurationSection(); var elementCollection = new ExtensionSettingsElementCollection(); foreach (ExtensionSettingsElement element in settings.Select(settingPair => new ExtensionSettingsElement { Key = settingPair.Key, Value = settingPair.Value })) { elementCollection["Configuration"] = element; } section.Configuration = elementCollection; return section; }
/// <summary> /// Creates a <see cref="ExtensionConfigurationSection"/> according to the provided settings dictionary. /// </summary> /// <param name="settings">The settings.</param> /// <returns>A newly created <see cref="ExtensionConfigurationSection"/>.</returns> public static ExtensionConfigurationSection CreateSection(params KeyValuePair <string, string>[] settings) { var section = new ExtensionConfigurationSection(); var elementCollection = new ExtensionSettingsElementCollection(); foreach (ExtensionSettingsElement element in settings.Select(settingPair => new ExtensionSettingsElement { Key = settingPair.Key, Value = settingPair.Value })) { elementCollection["Configuration"] = element; } section.Configuration = elementCollection; return(section); }