private void menuClick_RevertSNPDatabase(object sender, RoutedEventArgs args) { // Revert the SNP database to the builtin database. SNPDatabaseManager.RevertDatabase(); // Reanalyse after updating the SNP database. InitAnalysis(); }
private void menuClick_SaveSNPDatabase(object sender, RoutedEventArgs args) { var dialog = new WinForms.SaveFileDialog(); dialog.Filter = "SNPDatabase files|*.SNPDatabase|All files (*.*)|*.*"; if (dialog.ShowDialog() == WinForms.DialogResult.OK) { // Open the file chosen by the user, and write the genome to it in CSV format. using (var fileStream = dialog.OpenFile()) { SNPDatabaseManager.ExportDatabase(fileStream); } } }
private void menuClick_LoadSNPDatabase(object sender, RoutedEventArgs args) { var dialog = new WinForms.OpenFileDialog(); dialog.Filter = "SNPDatabase files|*.SNPDatabase|All files (*.*)|*.*"; if (dialog.ShowDialog() == WinForms.DialogResult.OK) { // Open the file chosen by the user, and write the genome to it in CSV format. using (var fileStream = dialog.OpenFile()) { if (!SNPDatabaseManager.ImportDatabase(fileStream)) { WinForms.MessageBox.Show("The file doesn't appear to be a valid SNPDatabase file.", "Unrecognized file"); } else { // Reanalyse after updating the SNP database. InitAnalysis(); } } } }