-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImportExportEngine.cs
More file actions
38 lines (36 loc) · 1.41 KB
/
ImportExportEngine.cs
File metadata and controls
38 lines (36 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.IO;
using Windows.Storage;
namespace PassDefend
{
class ImportExportEngine
{
public static string exportPath { get; set; }
public static async void ExportDB(string key)
{
bool dialogNotCompleted = true;
ExportDialog exportDialog = new ExportDialog();
while (dialogNotCompleted == true)
{
await exportDialog.ShowAsync();
if (exportDialog.Result == ExportDialogResult.ExportReady)
{
dialogNotCompleted = false; //breaking loop because export ready
//prepare the file path
string dbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "core");
string fileExport = Path.Combine(exportPath, "PassProtectExport"); //+ DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + ".PassDefend");
//close the database for copying
DataAccess.CloseDB(MainPage.dbconnection);
//copy the database
//HERE
//reopen the database afterwards
MainPage.dbconnection = DataAccess.OpenDB(key);
}
else if (exportDialog.Result == ExportDialogResult.ExportCancel)
{
dialogNotCompleted = false;
}
}
}
}
}