private void OnSettingsUpdate(object sender, ConfigSectionChangedEventArgs args) { if (args.IsSectionType(typeof(WdcClientConfiguration))) { UpdateSettings(); } }
private void OnSettingsChanged(object sender, ConfigSectionChangedEventArgs args) { if (args.SectionName == typeof(StorySyncWorkerSettings).Name) { // The sync worker settings have changed. // Update the settings // TODO: should I cancel the worker, and have it start again? _log.Debug("Reacting to a change in settings"); SetSettings(_configProvider.GetSection <StorySyncWorkerSettings>()); } }
public void OnSectionChangedEvent() { ConfigSectionChangedEventArgs testEventArgs = null; var config = new ConfigProvider(); config.OnSectionChanged += new EventHandler <ConfigSectionChangedEventArgs>((sender, args) => testEventArgs = args); var newSection = new TestAppConfig(); config.SetSection(newSection); Assert.IsNotNull(testEventArgs); }