From 652243206427f35a256400a149a1734085824cb9 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 02 九月 2020 17:35:03 +0800
Subject: [PATCH] 2020-09-02-4

---
 ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs |  331 +++++++++++++++----------------------------------------
 1 files changed, 91 insertions(+), 240 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
old mode 100644
new mode 100755
index 809e2ed..ff9e8ec
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
@@ -30,268 +30,120 @@
 
             var middle = new FrameLayout();
             middle.Y = view.topRowLayout.Bottom;
-            middle.Height = Application.GetRealHeight(1920 - 184);
+            middle.Height = Application.GetRealHeight(Method.H - 184);
             middle.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
             this.AddChidren(middle);
 
-            var btnsave = new Button
-            {
-                Y= middle.Height-Application.GetRealHeight(260),
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize=16,
+            LogicView.SaveView saveView = new LogicView.SaveView();
+            saveView.frameLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+            saveView.frameLayout.Y = middle.Height - Application.GetRealHeight(260);
+            middle.AddChidren(saveView.Show());
 
-            };
-            middle.AddChidren(btnsave);
+
 
             #region ----(鍦ㄥ/绂诲)甯冮槻 鎾ら槻 鑳佽揩鎾ら槻----
             #region  鍦ㄥ甯冮槻
 
-            var athomeFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(athomeFrameLayout);
+            FunView athomeView = new FunView();
+            athomeView.iconBtn.UnSelectedImagePath = "ZigeeLogic/athome.png";
+            athomeView.funnameBtn.TextID = MyInternationalizationString.logicathomegarrison;
+            athomeView.funnextBtn.Width = Application.GetMinRealAverage(60);
+            athomeView.funnextBtn.Height = Application.GetMinRealAverage(60);
+            athomeView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+            athomeView.funnextBtn.Visible = false;
+            middle.AddChidren(athomeView.FunFrameView());
 
-            var athomeiconBtn = new Button
-            {
-                Width = Application.GetMinRealAverage(81),
-                Height = Application.GetMinRealAverage(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/athome.png",
 
-            };
-            athomeFrameLayout.AddChidren(athomeiconBtn);
 
-            var athomedefenceRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            athomeFrameLayout.AddChidren(athomedefenceRowLayout);
-
-            var btnathomedefence = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.logicathomegarrison),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-
-            };
-            athomedefenceRowLayout.AddChidren(btnathomedefence);
-            var athomedefenceSelected = new SelectedButton(789);
-            athomedefenceRowLayout.AddChidren(athomedefenceSelected);
             #endregion
 
             #region  绂诲甯冮槻
 
-            var leavehomeFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = athomeFrameLayout.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(leavehomeFrameLayout);
 
+            FunView leaveView= new FunView();
+            leaveView.funFrameLayout.Y = athomeView.funFrameLayout.Bottom;
+            leaveView.iconBtn.UnSelectedImagePath = "ZigeeLogic/leavehome.png";
+            leaveView.funnameBtn.TextID = MyInternationalizationString.logicremovehomegarrison;
+            leaveView.funnextBtn.Width = Application.GetMinRealAverage(60);
+            leaveView.funnextBtn.Height = Application.GetMinRealAverage(60);
+            leaveView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+            leaveView.funnextBtn.Visible = false;
+            middle.AddChidren(leaveView.FunFrameView());
 
-            var leavehomeiconBtn = new Button
-            {
-                Width = Application.GetMinRealAverage(81),
-                Height = Application.GetMinRealAverage(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/leavehome.png",
-
-            };
-            leavehomeFrameLayout.AddChidren(leavehomeiconBtn);
-
-
-            var leavehomedefenceRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            leavehomeFrameLayout.AddChidren(leavehomedefenceRowLayout);
-
-            var leavehomebtndefence = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-
-            };
-            leavehomedefenceRowLayout.AddChidren(leavehomebtndefence);
-            var leavehomedefenceSelected = new SelectedButton(789);
-            leavehomedefenceRowLayout.AddChidren(leavehomedefenceSelected);
 
             #endregion
 
             #region  鎾ら槻
 
-
-            var withdrawalFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = leavehomeFrameLayout.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(withdrawalFrameLayout);
-
-
-            var withdrawaliconBtn = new Button
-            {
-                Width = Application.GetMinRealAverage(81),
-                Height = Application.GetMinRealAverage(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/withdrawal.png",
-
-            };
-            withdrawalFrameLayout.AddChidren(withdrawaliconBtn);
-
-
-
-            var withdrawalRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            withdrawalFrameLayout.AddChidren(withdrawalRowLayout);
-
-            var btnwithdrawal = new Button
-            {
-
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextID = MyInternationalizationString.withdrawal,
-                TextSize = 15,
-
-            };
-            withdrawalRowLayout.AddChidren(btnwithdrawal);
-            var withdrawalSelected = new SelectedButton(789);
-            withdrawalRowLayout.AddChidren(withdrawalSelected);
+            FunView withdrawalView= new FunView();
+            withdrawalView.funFrameLayout.Y = leaveView.funFrameLayout.Bottom;
+            withdrawalView.iconBtn.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
+            withdrawalView.funnameBtn.TextID = MyInternationalizationString.withdrawal;
+            withdrawalView.funnextBtn.Width = Application.GetMinRealAverage(60);
+            withdrawalView.funnextBtn.Height = Application.GetMinRealAverage(60);
+            withdrawalView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+            withdrawalView.funnextBtn.Visible = false;
+            middle.AddChidren(withdrawalView.FunFrameView());
 
             #endregion
 
             #region  鑳佽揩鎾ら槻
-            var urgentwithdFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = withdrawalFrameLayout.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(urgentwithdFrameLayout);
 
-
-            var urgentwithdiconBtn = new Button
-            {
-                Width = Application.GetMinRealAverage(81),
-                Height = Application.GetMinRealAverage(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/withdrawal.png",
-
-            };
-            urgentwithdFrameLayout.AddChidren(urgentwithdiconBtn);
-
-            var urgentwithdrawalRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            urgentwithdFrameLayout.AddChidren(urgentwithdrawalRowLayout);
-
-            var btnurgentwithdrawal = new Button
-            {
-                TextID = MyInternationalizationString.urgentwithdrawal,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            urgentwithdrawalRowLayout.AddChidren(btnurgentwithdrawal);
-
-            var urgentwithdrawalSelected = new SelectedButton(789);
-            urgentwithdrawalRowLayout.AddChidren(urgentwithdrawalSelected);
+            FunView urgentwithdView = new FunView();
+            urgentwithdView.funFrameLayout.Y = withdrawalView.funFrameLayout.Bottom;
+            urgentwithdView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+            urgentwithdView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
+            urgentwithdView.iconBtn.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
+            urgentwithdView.funnameBtn.TextID = MyInternationalizationString.urgentwithdrawal;
+            urgentwithdView.funnextBtn.Width = Application.GetMinRealAverage(60);
+            urgentwithdView.funnextBtn.Height = Application.GetMinRealAverage(60);
+            urgentwithdView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+            urgentwithdView.funnextBtn.Visible = false;
+            middle.AddChidren(urgentwithdView.FunFrameView());
             #endregion
 
             #endregion
 
             ///鍦ㄥ甯冮槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> athomeclick = (sedner14, e14) =>
+            athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                athomedefenceSelected.Visible = true;
-                leavehomedefenceSelected.Visible = false;
-                withdrawalSelected.Visible = false;
-                urgentwithdrawalSelected.Visible = false;
+                athomeView.funnextBtn.Visible = true;
+                leaveView.funnextBtn.Visible = false;
+                withdrawalView.funnextBtn.Visible = false;
+                urgentwithdView.funnextBtn.Visible = false;
             };
-            athomedefenceRowLayout.MouseUpEventHandler += athomeclick;
-            btnathomedefence.MouseUpEventHandler += athomeclick;
-            athomedefenceSelected.MouseUpEventHandler += athomeclick;
-            athomeFrameLayout.MouseUpEventHandler += athomeclick;
-            athomeiconBtn.MouseUpEventHandler += athomeclick;
+
 
             ///绂诲甯冮槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> leavehomeclick = (sedner14, e14) =>
+            leaveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                athomedefenceSelected.Visible = false;
-                leavehomedefenceSelected.Visible = true;
-                withdrawalSelected.Visible = false;
-                urgentwithdrawalSelected.Visible = false;
+                athomeView.funnextBtn.Visible = false;
+                leaveView.funnextBtn.Visible = true;
+                withdrawalView.funnextBtn.Visible = false;
+                urgentwithdView.funnextBtn.Visible = false;
             };
-            leavehomedefenceRowLayout.MouseUpEventHandler += leavehomeclick;
-            leavehomebtndefence.MouseUpEventHandler += leavehomeclick;
-            leavehomedefenceSelected.MouseUpEventHandler += leavehomeclick;
-            leavehomeFrameLayout.MouseUpEventHandler += leavehomeclick;
-            leavehomeiconBtn.MouseUpEventHandler += leavehomeclick;
+
 
             ///鎾ら槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> disableclick = (seder, e) =>
+            withdrawalView.clickviewBtn.MouseUpEventHandler+= (seder, e) =>
             {
-                athomedefenceSelected.Visible = false;
-                leavehomedefenceSelected.Visible = false;
-                withdrawalSelected.Visible = true;
-                urgentwithdrawalSelected.Visible = false;
+                athomeView.funnextBtn.Visible = false;
+                leaveView.funnextBtn.Visible = false;
+                withdrawalView.funnextBtn.Visible = true;
+                urgentwithdView.funnextBtn.Visible = false;
 
             };
-            withdrawalRowLayout.MouseUpEventHandler += disableclick;
-            btnwithdrawal.MouseUpEventHandler += disableclick;
-            withdrawalSelected.MouseUpEventHandler += disableclick;
-            withdrawalFrameLayout.MouseUpEventHandler += disableclick;
-            withdrawaliconBtn.MouseUpEventHandler += disableclick;
+
 
             ///鑳佽揩鎾ら槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> urgentwithdrawalclick = (seder, e) =>
+            urgentwithdView.clickviewBtn.MouseUpEventHandler += (seder, e) =>
             {
-                athomedefenceSelected.Visible = false;
-                leavehomedefenceSelected.Visible = false;
-                withdrawalSelected.Visible = false;
-                urgentwithdrawalSelected.Visible = true;
+                athomeView.funnextBtn.Visible = false;
+                leaveView.funnextBtn.Visible = false;
+                withdrawalView.funnextBtn.Visible = false;
+                urgentwithdView.funnextBtn.Visible = true;
             };
-            urgentwithdrawalRowLayout.MouseUpEventHandler += urgentwithdrawalclick;
-            btnurgentwithdrawal.MouseUpEventHandler += urgentwithdrawalclick;
-            urgentwithdrawalSelected.MouseUpEventHandler+= urgentwithdrawalclick;
-            urgentwithdFrameLayout.MouseUpEventHandler += urgentwithdrawalclick;
-            urgentwithdiconBtn.MouseUpEventHandler += urgentwithdrawalclick;
+          
 
             if (IsDeviceEditor)
             {
@@ -304,17 +156,17 @@
                         {
                             if (actions["Password"].ToString() == "888888")
                             {
-                                athomedefenceSelected.Visible = false;
-                                leavehomedefenceSelected.Visible = false;
-                                withdrawalSelected.Visible = false;
-                                urgentwithdrawalSelected.Visible = true;
+                                athomeView.funnextBtn.Visible = false;
+                                leaveView.funnextBtn.Visible = false;
+                                withdrawalView.funnextBtn.Visible = false;
+                                urgentwithdView.funnextBtn.Visible = true;
                             }
                             else
                             {
-                                athomedefenceSelected.Visible = false;
-                                leavehomedefenceSelected.Visible = false;
-                                withdrawalSelected.Visible = true;
-                                urgentwithdrawalSelected.Visible = false;
+                                athomeView.funnextBtn.Visible = false;
+                                leaveView.funnextBtn.Visible = false;
+                                withdrawalView.funnextBtn.Visible = true;
+                                urgentwithdView.funnextBtn.Visible = false;
                             }
 
                         }
@@ -323,17 +175,17 @@
                             if (actions["SecurityModeId"].ToString() == "1")
                             {
 
-                                athomedefenceSelected.Visible = true;
-                                leavehomedefenceSelected.Visible = false;
-                                withdrawalSelected.Visible = false;
-                                urgentwithdrawalSelected.Visible = false;
+                                athomeView.funnextBtn.Visible = true;
+                                leaveView.funnextBtn.Visible = false;
+                                withdrawalView.funnextBtn.Visible = false;
+                                urgentwithdView.funnextBtn.Visible = false;
                             }
                             else
                             {
-                                athomedefenceSelected.Visible = false;
-                                leavehomedefenceSelected.Visible = true;
-                                withdrawalSelected.Visible = false;
-                                urgentwithdrawalSelected.Visible = false;
+                                athomeView.funnextBtn.Visible = false;
+                                leaveView.funnextBtn.Visible = true;
+                                withdrawalView.funnextBtn.Visible = false;
+                                urgentwithdView.funnextBtn.Visible = false;
 
                             }
                         }
@@ -344,13 +196,12 @@
                 }
 
             }
-                        
 
-            btnsave.MouseUpEventHandler += (sender, e) =>
+            saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                if (!athomedefenceSelected.Visible && !leavehomedefenceSelected.Visible && !withdrawalSelected.Visible && !urgentwithdrawalSelected.Visible)
+                if (!athomeView.funnextBtn.Visible && !leaveView.funnextBtn.Visible && !withdrawalView.funnextBtn.Visible && !urgentwithdView.funnextBtn.Visible)
                 {
-                   
+
                     var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
                               Language.StringByID(MyInternationalizationString.securitytip),
                              Language.StringByID(MyInternationalizationString.confrim));
@@ -374,7 +225,7 @@
                 actionsInfo.Add("LinkType", 6);
                 actionsInfo.Add("CheckIASStatus", 0);
                 actionsInfo.Add("IsDelayStart", 0);
-                
+
                 if (actionsInfo.ContainsKey("Password"))
                 {
                     actionsInfo.Remove("Password");
@@ -388,7 +239,7 @@
                     actionsInfo.Remove("SecurityModeId");
                 }
                 ///鍦ㄥ甯冮槻
-                if (athomedefenceSelected.Visible)
+                if (athomeView.funnextBtn.Visible)
                 {
                     actionsInfo.Add("SecuritySetting", "1");
                     actionsInfo.Add("SecurityModeId", "1");
@@ -396,7 +247,7 @@
 
                 }
                 ///绂诲甯冮槻
-                if (leavehomedefenceSelected.Visible)
+                if (leaveView.funnextBtn.Visible)
                 {
                     actionsInfo.Add("SecuritySetting", "1");
                     actionsInfo.Add("SecurityModeId", "2");
@@ -404,7 +255,7 @@
 
                 }
                 ///鎾ら槻
-                if (withdrawalSelected.Visible)
+                if (withdrawalView.funnextBtn.Visible)
                 {
                     actionsInfo.Add("SecuritySetting", "0");
                     actionsInfo.Add("SecurityModeId", "0");
@@ -412,7 +263,7 @@
 
                 }
                 ///绱ц揩鎾ら槻
-                if (urgentwithdrawalSelected.Visible)
+                if (urgentwithdView.funnextBtn.Visible)
                 {
                     actionsInfo.Add("SecuritySetting", "0");
                     actionsInfo.Add("SecurityModeId", "0");

--
Gitblit v1.8.0