private void OnLoadProfile(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.DefaultExt = ".json"; dlg.Filter = "json files (*.json)|*.json|All files (*.*)|*.*"; bool?result = dlg.ShowDialog(); if (result != true) { return; } object rootObject = JsonConvert.DeserializeObject(File.ReadAllText(dlg.FileName)); if (!(rootObject is JObject)) { System.Windows.MessageBox.Show("Invalid json file content!"); } JObject jRoot = (JObject)rootObject; PopulateExternalStorageFromJson(jRoot); TheAppsConfigurator.FromJson(jRoot); DesiredDiagnosticLogs.FromJson(jRoot); }
private void OnSetDiagnosticLogsInfo(object sender, RoutedEventArgs e) { SetDesired(DesiredDiagnosticLogs.SectionName, DesiredDiagnosticLogs.ToJson()).FireAndForget(); }