public void Save() { ConfigItems.Where(ci => ci is IConfigItemBase).ToList().ForEach(ci => ((IConfigItemBase)ci).Save()); ConfigAdvancedItems.Where(ci => ci is IConfigItemBase).ToList().ForEach(ci => ((IConfigItemBase)ci).Save()); Logic.Instance.settings.Save(); TryClose(); }
public void Init(IDictionary <string, string> parameters) { foreach (IContentSourceConfigItem configItem in ConfigItems.Where(x => x.IsRequired)) { if (!parameters.ContainsKey(configItem.Name)) { throw new Exception($"The config item '{configItem.Name}' is not present in parameters"); } } foreach (KeyValuePair <string, string> parameter in parameters) { _parameterValues.Add(parameter.Key.ToLower(), parameter.Value); } OnInit(); }