| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | //开启进度条
|
| | | ProgressBar.SetMaxValue(listEditor.Count + listDelete.Count);
|
| | | ProgressBar.Show();
|
| | | //开启进度条 正在上传备份文件
|
| | | ProgressFormBar.Current.Start();
|
| | | ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileUploading));
|
| | |
|
| | | //上传文件到云端
|
| | | bool result = await UpLoadBackupFileToDB(listEditor);
|
| | | if (result == false)
|
| | | {
|
| | | ProgressBar.Close();
|
| | | ProgressFormBar.Current.Close();
|
| | | return -1;
|
| | | }
|
| | |
|
| | |
| | | result = await DoDeleteFileFromDB(listDelete);
|
| | | if (result == false)
|
| | | {
|
| | | ProgressBar.Close();
|
| | | ProgressFormBar.Current.Close();
|
| | | return -1;
|
| | | }
|
| | |
|
| | | ProgressBar.Close();
|
| | | ProgressFormBar.Current.Close();
|
| | |
|
| | | return 1;
|
| | | }
|
| | |
| | | /// <returns></returns>
|
| | | private async static Task<bool> UpLoadBackupFileToDB(List<string> listFile)
|
| | | {
|
| | | int listFileCount = listFile.Count;
|
| | | string backUpDir = System.IO.Path.Combine(DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
|
| | | foreach (string file in listFile)
|
| | | for (int i = 0; i < listFile.Count; i++)
|
| | | {
|
| | | string file = listFile[i];
|
| | | var datainfo = new FileInfoData();
|
| | | datainfo.BackupFileName = file;
|
| | | datainfo.BackupFileContent = ReadDirctoryFileByName(backUpDir, file);
|
| | |
| | | return false;
|
| | | }
|
| | | //设置进度值
|
| | | ProgressBar.SetValue(list.Count);
|
| | | ProgressFormBar.Current.SetValue(i + 1, listFileCount);
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
| | | //自动备份只有一个
|
| | | string backId = data[0].Id;
|
| | |
|
| | | //强制指定文本附加信息:账号数据同步中
|
| | | ProgressBar.SetAppendText(Language.StringByID(R.MyInternationalizationString.uAccountDataIsSynchronizing));
|
| | | //账号数据同步中
|
| | | ProgressFormBar.Current.Start();
|
| | | ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uAccountDataIsSynchronizing));
|
| | |
|
| | | //从云端获取备份的文件,然后存入本地指定的临时文件夹
|
| | | string tempDir = await HdlBackupLogic.Current.GetBackFileFromDBAndSetToLocation(backId);
|