/// <summary> /// Initializes a new instance of <see cref="SettingsFiller"/> class with converter chooser, some settings providers by their names and optionally a default <see cref="IRawSettingsProvider"/>. /// </summary> public SettingsFiller(ISettingsConverterChooser settingsConverterChooser, IDictionary <string, IRawSettingsProvider> rawSettingsProvidersByNames, IRawSettingsProvider defaultRawSettingsProvider = null) { this.SettingsConverterChooser = settingsConverterChooser ?? throw new RapidSettingsException($"{nameof(settingsConverterChooser)} cannot be null!"); if (rawSettingsProvidersByNames == null || rawSettingsProvidersByNames.Count == 0) { throw new RapidSettingsException($"{nameof(rawSettingsProvidersByNames)} cannot be null or empty!"); } this.RawSettingsProvidersByNames = rawSettingsProvidersByNames; if (defaultRawSettingsProvider != null) { this.RawSettingsProvidersByNames[DefaultRawSettingsProviderKey] = defaultRawSettingsProvider; } }
/// <summary> /// Initializes a new instance of <see cref="SettingsFiller"/> class with converter chooser and default raw settings provider. Any parameter left with null will default to values from <see cref="SettingsFillerStaticDefaults"/>. /// </summary> public SettingsFiller(ISettingsConverterChooser settingsConverterChooser = null, IRawSettingsProvider defaultRawSettingsProvider = null) : this( settingsConverterChooser ?? SettingsFillerStaticDefaults.DefaultSettingsConverterChooser, defaultRawSettingsProvider == null ? new Dictionary <string, IRawSettingsProvider>(SettingsFillerStaticDefaults.DefaultRawSettingsProviders) : new Dictionary <string, IRawSettingsProvider> { { DefaultRawSettingsProviderKey, defaultRawSettingsProvider } }, defaultRawSettingsProvider ?? SettingsFillerStaticDefaults.DefaultDefaultRawSettingsProvider) { }