From 16604a593202f2f87adf71abd57d036fe7da3b52 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 18 十一月 2019 10:39:42 +0800 Subject: [PATCH] 同步了全部的代码 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs index af1fb24..30d17aa 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs @@ -58,15 +58,15 @@ return 0; } - //寮�鍚繘搴︽潯 - ProgressBar.SetMaxValue(listEditor.Count + listDelete.Count); - ProgressBar.Show(); + //寮�鍚繘搴︽潯 姝e湪涓婁紶澶囦唤鏂囦欢 + 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; } @@ -74,11 +74,11 @@ result = await DoDeleteFileFromDB(listDelete); if (result == false) { - ProgressBar.Close(); + ProgressFormBar.Current.Close(); return -1; } - ProgressBar.Close(); + ProgressFormBar.Current.Close(); return 1; } @@ -90,9 +90,11 @@ /// <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); @@ -110,7 +112,7 @@ return false; } //璁剧疆杩涘害鍊� - ProgressBar.SetValue(list.Count); + ProgressFormBar.Current.SetValue(i + 1, listFileCount); } return true; } @@ -371,8 +373,9 @@ //鑷姩澶囦唤鍙湁涓�涓� 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); -- Gitblit v1.8.0