/// <summary> /// Returns the <see cref="T:ImageProcessor.Web.Config.ImageProcessingSection.SettingElementCollection"/> for the given plugin. /// </summary> /// <param name="name"> /// The name of the plugin to get the settings for. Override settings by adding appsettings in web.config using the format /// ImageProcessor.<.plugin-name.>.<settingKey> e.g. 'ImageProcessor.GaussianBlur.MaxSize'. /// The key must exist in the config section for the appsetting to apply" /// </param> /// <returns> /// The <see cref="T:ImageProcessor.Web.Config.ImageProcessingSection.SettingElementCollection"/> for the given plugin. /// </returns> private Dictionary <string, string> GetPluginSettings(string name) { ImageProcessingSection.PluginElement pluginElement = GetImageProcessingSection() .Plugins .Cast <ImageProcessingSection.PluginElement>() .FirstOrDefault(x => x.Name == name); Dictionary <string, string> settings; if (pluginElement != null) { settings = pluginElement.Settings .Cast <SettingElement>() .ToDictionary(setting => setting.Key, setting => setting.Value); // Override the settings found in config section with values in the app.config / deployment slot settings this.OverrideDefaultSettingsWithAppSettingsValue(settings, name); } else { settings = new Dictionary <string, string>(); } return(settings); }
/// <summary> /// Returns the <see cref="T:ImageProcessor.Web.Config.ImageProcessingSection.SettingElementCollection"/> for the given plugin. /// </summary> /// <param name="name"> /// The name of the plugin to get the settings for. /// </param> /// <returns> /// The <see cref="T:ImageProcessor.Web.Config.ImageProcessingSection.SettingElementCollection"/> for the given plugin. /// </returns> private Dictionary <string, string> GetPluginSettings(string name) { ImageProcessingSection.PluginElement pluginElement = GetImageProcessingSection() .Plugins .Cast <ImageProcessingSection.PluginElement>() .FirstOrDefault(x => x.Name == name); Dictionary <string, string> settings; if (pluginElement != null) { settings = pluginElement.Settings .Cast <SettingElement>() .ToDictionary(setting => setting.Key, setting => setting.Value); } else { settings = new Dictionary <string, string>(); } return(settings); }