From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs |   84 +++++++++++++++++++++++++++++++++--------
 1 files changed, 67 insertions(+), 17 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs
index dd5e4ed..f26e854 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs
@@ -11,6 +11,11 @@
     {
         #region 鈻� 鍙橀噺澹版槑___________________________
 
+        /// <summary>
+        /// 瑙e瘑
+        /// </summary>
+        private bool decryptPassword = false;
+
         #endregion
 
         #region 鈻� 鍒濆鍖朹____________________________
@@ -20,11 +25,30 @@
         /// </summary>
         public void ShowForm(string i_file)
         {
+            this.ScrollEnabled = false;
             //璁剧疆澶撮儴淇℃伅
             base.SetTitleText("鏂囦欢鍐呭");
 
             //鍒濆鍖栦腑閮ㄤ俊鎭�
             this.InitMiddleFrame(i_file);
+
+            var btnButton = new NormalViewControl(200, 69, true);
+            btnButton.Gravity = Gravity.CenterVertical;
+            btnButton.X = bodyFrameLayout.Width - Application.GetRealWidth(200) - HdlControlResourse.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(i_file);
+                }
+            };
         }
 
         /// <summary>
@@ -32,6 +56,10 @@
         /// </summary>
         private void InitMiddleFrame(string i_file)
         {
+            if (i_file == string.Empty) { return; }
+
+            this.ClearBodyFrame();
+
             if (i_file.EndsWith(".png") == true || i_file.EndsWith(".jpg") == true || i_file.EndsWith(".JPG") == true)
             {
                 var btnPic = new ImageView();
@@ -46,26 +74,48 @@
             else
             {
                 string textValue = System.Text.Encoding.UTF8.GetString(Shared.IO.FileUtils.ReadFile(i_file)).Trim();
-                textValue = textValue.Replace(",", "\r\n");
-                if (textValue.StartsWith("{") == true)
-                {
-                    textValue = "{\r\n" + textValue.Substring(1);
-                }
-                if (textValue.EndsWith("}") == true)
-                {
-                    textValue = textValue.Substring(0, textValue.Length - 1) + "\r\n}";
-                }
-
-                var btnText = new EditTextView();
-                btnText.Width = bodyFrameLayout.Width;
-                btnText.Height = bodyFrameLayout.Height;
-                btnText.TextAlignment = TextAlignment.TopLeft;
-                btnText.TextColor = UserCenterColor.Current.TextColor1;
-                btnText.Text = textValue;
-                bodyFrameLayout.AddChidren(btnText);
+                this.SetTextContent(textValue);
             }
         }
 
+        /// <summary>
+        /// 鑷畾涔夎缃樉绀虹殑鏂囨湰
+        /// </summary>
+        /// <param name="i_text"></param>
+        public void SetTextContent(string textValue)
+        {
+            if (this.decryptPassword == true)
+            {
+                var strArry = textValue.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
+
+                textValue = string.Empty;
+                foreach (var strtext in strArry)
+                {
+                    string value = HdlCommonLogic.Current.DecryptPassword(HdlUserCenterResourse.FileEncryptKey, strtext);
+                    textValue += value + "\r\n";
+                }
+            }
+            if (textValue.StartsWith("{") == true)
+            {
+                textValue = "{\r\n" + textValue.Substring(1);
+            }
+            if (textValue.EndsWith("}") == true)
+            {
+                textValue = textValue.Substring(0, textValue.Length - 1) + "\r\n}";
+            }
+
+            var btnText = new EditTextView();
+            btnText.Width = bodyFrameLayout.Width;
+            btnText.Height = bodyFrameLayout.Height;
+            btnText.TextAlignment = TextAlignment.TopLeft;
+            btnText.TextColor = UserCenterColor.Current.TextColor1;
+            btnText.Text = textValue;
+#if Android
+            btnText.Foucs = false;
+#endif
+            bodyFrameLayout.AddChidren(btnText);
+        }
+
         #endregion
 
         #region 鈻� 涓�鑸柟娉昣__________________________

--
Gitblit v1.8.0