コード例 #1
0
 private void MenuItem_ImportFromXml_Click(object sender, RoutedEventArgs e)
 {
     Window_Notification window_notification = new Window_Notification("Notice", "Importing from an .xml file will OVERWRITE all records currently in the database.\r\nThis action CANNOT be undone.\r\nContinue?");
     window_notification.ShowDialog();
     if(window_notification.Accepted)
     {
         string backupFile = null;
         window_notification = new Window_Notification("Notice", "Would you like to backup your database before the import?");
         window_notification.ShowDialog();
         if(window_notification.Accepted)
         {
             Window_SelectFile window_selectFile = new Window_SelectFile("Backup to ...", string.Empty);
             window_selectFile.ShowDialog();
             if (window_selectFile.Accepted)
                 backupFile = window_selectFile.FileName;
         }
         Window_OpenFile window_openFile = new Window_OpenFile("Import from ...", string.Empty);
         window_openFile.ShowDialog();
         if (window_openFile.Accepted)
             GinTubBuilderManager.ImportFromXml(window_openFile.FileName, backupFile);
     }
 }
コード例 #2
0
 private void MenuItem_ExportToXml_Click(object sender, RoutedEventArgs e)
 {
     Window_SelectFile window = new Window_SelectFile("Export to ...", string.Empty);
     window.ShowDialog();
     if (window.Accepted)
         GinTubBuilderManager.ExportToXml(window.FileName);
 }