private static NotificationsSettingsSection getNotificationSettings() { Configuration appConfig = _getAppConfig(); NotificationsSettingsSection notificationSettings = null; notificationSettings = (NotificationsSettingsSection)appConfig.Sections.Get("NotificationSettings"); if (notificationSettings == null) { notificationSettings = new NotificationsSettingsSection(); NotificationSoundsSettings settings = new NotificationSoundsSettings(); notificationSettings.Sounds = settings; } return notificationSettings; }
public static void updateNotificationPath(string newpath) { NotificationsSettingsSection newSection = new NotificationsSettingsSection(); newSection.Sounds.WavFile = newpath; Configuration appConfig = _getAppConfig(); appConfig.Sections.Remove("NotificationSettings"); appConfig.Sections.Add("NotificationSettings", newSection); appConfig.Save(); }