From c1de48884fa145a16a0f8bcee93274dcfaa0ff82 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 07 五月 2020 10:40:28 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into dev-2020xm
---
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 153 insertions(+), 0 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs
new file mode 100755
index 0000000..0f19b03
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs
@@ -0,0 +1,153 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter.HideOption
+{
+ /// <summary>
+ /// 鏈湴缂撳瓨鏂囦欢鍒楄〃鐨勭晫闈�
+ /// </summary>
+ public class HideOptionFileListForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 瑙e瘑
+ /// </summary>
+ private bool decryptPassword = false;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm(string directory)
+ {
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText("鏂囦欢鍒楄〃");
+
+ var btnButton = new NormalViewControl(200, 69, true);
+ btnButton.Gravity = Gravity.CenterVertical;
+ btnButton.X = bodyFrameLayout.Width - Application.GetRealWidth(200) - ControlCommonResourse.XXLeft;
+ btnButton.TextColor = UserCenterColor.Current.TopLayoutTitleText;
+ btnButton.TextAlignment = TextAlignment.BottomRight;
+ btnButton.TextSize = 17;
+ btnButton.Text = "缈昏瘧";
+ topFrameLayout.AddChidren(btnButton);
+ btnButton.ButtonClickEvent += (sender, e) =>
+ {
+ if (this.decryptPassword == false)
+ {
+ this.decryptPassword = true;
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame(directory);
+ }
+ };
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame(directory);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame(string directory)
+ {
+ this.ClearBodyFrame();
+
+ var listAllFile = HdlAutoBackupLogic.GetFileFromDirectory(directory);
+ listAllFile.Sort();
+
+ var listView = new VerticalListControl(23);
+ listView.BackgroundColor = UserCenterColor.Current.White;
+ listView.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listView);
+
+ for (int i = 0; i < listAllFile.Count; i++)
+ {
+ this.AddRowControl(listView, listAllFile[i], directory, i != listAllFile.Count - 1);
+ }
+ listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(50));
+
+ var btnButon = new BottomClickButton();
+ btnButon.Text = "鍒犻櫎鏂囦欢澶�";
+ bodyFrameLayout.AddChidren(btnButon);
+ btnButon.ButtonClickEvent += (sender, e) =>
+ {
+ this.ShowMassage(ShowMsgType.Confirm, "鏄惁娓呴櫎璇ユ枃浠跺す", () =>
+ {
+ try
+ {
+ System.IO.Directory.Delete(directory, true);
+ this.CloseForm();
+ }
+ catch (Exception ex)
+ {
+ this.ShowMassage(ShowMsgType.Error, "娓呴櫎缂撳瓨鏂囦欢澶瑰紓甯�");
+ HdlLogLogic.Current.WriteLog(ex, "娓呴櫎缂撳瓨鏂囦欢澶瑰紓甯�");
+ }
+ });
+ };
+ if (directory == UserCenterLogic.CombinePath())
+ {
+ btnButon.CanClick = false;
+ }
+ }
+
+ private void AddRowControl(VerticalListControl listView, string fileName, string directory, bool addLine)
+ {
+ string fileNewName = fileName;
+ if (decryptPassword == true && fileName.StartsWith("Device_") == false)
+ {
+ try
+ {
+ fileNewName = UserCenterLogic.DecryptPassword(UserCenterResourse.FileEncryptKey, fileName);
+ }
+ catch { fileNewName = fileName; }
+ }
+
+ var row1 = new RowLayoutControl(listView.rowSpace / 2);
+ listView.AddChidren(row1);
+ var btnName = row1.frameTable.AddLeftCaption(fileNewName, 800);
+ btnName.IsMoreLines = true;
+ if (addLine == true)
+ {
+ row1.frameTable.AddBottomLine();
+ }
+ row1.frameTable.AddRightArrow();
+
+ var btnDelete = row1.AddDeleteControl();
+ btnDelete.ButtonClickEvent += (sender, e) =>
+ {
+ this.ShowMassage(ShowMsgType.Confirm, "鏄惁娓呴櫎璇ョ紦瀛樻枃浠�", () =>
+ {
+ var myFile = UserCenterLogic.CombinePath(directory, fileName);
+ try
+ {
+ System.IO.File.Delete(myFile);
+ row1.RemoveFromParent();
+ }
+ catch (Exception ex)
+ {
+ this.ShowMassage(ShowMsgType.Error, "娓呴櫎缂撳瓨鏂囦欢寮傚父");
+ HdlLogLogic.Current.WriteLog(ex, "娓呴櫎缂撳瓨鏂囦欢寮傚父");
+ }
+ });
+ };
+
+ row1.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new HideOptionFileContentForm();
+ form.AddForm(UserCenterLogic.CombinePath(directory, fileName));
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0