public void SaveSettings(IProvider provider) { ProviderSettings providerSettings = this.settings.Providers[provider]; if (providerSettings == null) { providerSettings = new ProviderSettings(provider); this.settings.Providers[provider] = providerSettings; } if (provider is Provider) { providerSettings.Properties = new ProviderPropertyList(((Provider)provider).GetProperties()); } this.SaveSettings(); }
public void FromXml(XmlProviderManagerSettings xml) { this.Providers.Clear(); if (xml.Providers != null) { foreach (XmlProvider current in xml.Providers) { ProviderSettings providerSettings = new ProviderSettings(current.ProviderId, current.InstanceId); if (current.Properties != null) { foreach (XmlProviderProperty current2 in current.Properties) { providerSettings.Properties.SetValue(current2.Name, current2.Value); } } this.Providers[new ProviderSettingsKey(providerSettings.ProviderId, providerSettings.InstanceId)] = providerSettings; } } }