From 6fa9d69da922c8049f5acfcbb9ce9fd26811024c Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期四, 16 四月 2020 17:10:57 +0800 Subject: [PATCH] 请合并代码 --- ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs | 286 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 286 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs new file mode 100755 index 0000000..ff9e8ec --- /dev/null +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs @@ -0,0 +1,286 @@ +锘縰sing System; +using Shared; +using Shared.R; +using Shared.Common; +using System.Collections.Generic; + +namespace Shared.Phone.Device.Logic +{ + public class SecurityMode : FrameLayout + { + public SecurityMode() + { + Tag = "Logic"; + } + /// <summary> + /// 鏍囪鏄惁缂栬緫 + /// </summary> + public bool IsDeviceEditor; + Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); + + public void Show() + { + + #region 鏈�涓婇潰鐨勫竷灞�浠g爜 + TopView view = new TopView(); + this.AddChidren(view.TopRowView()); + view.toptitleNameBtn.TextID = MyInternationalizationString.securitymode; + view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); }; + #endregion + + var middle = new FrameLayout(); + middle.Y = view.topRowLayout.Bottom; + middle.Height = Application.GetRealHeight(Method.H - 184); + middle.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; + this.AddChidren(middle); + + LogicView.SaveView saveView = new LogicView.SaveView(); + saveView.frameLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; + saveView.frameLayout.Y = middle.Height - Application.GetRealHeight(260); + middle.AddChidren(saveView.Show()); + + + + #region ----(鍦ㄥ/绂诲)甯冮槻 鎾ら槻 鑳佽揩鎾ら槻---- + #region 鍦ㄥ甯冮槻 + + 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()); + + + + #endregion + + #region 绂诲甯冮槻 + + + 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()); + + + #endregion + + #region 鎾ら槻 + + 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 鑳佽揩鎾ら槻 + + 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 + + ///鍦ㄥ甯冮槻鐐瑰嚮浜嬩欢 + athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) => + { + athomeView.funnextBtn.Visible = true; + leaveView.funnextBtn.Visible = false; + withdrawalView.funnextBtn.Visible = false; + urgentwithdView.funnextBtn.Visible = false; + }; + + + ///绂诲甯冮槻鐐瑰嚮浜嬩欢 + leaveView.clickviewBtn.MouseUpEventHandler += (sender, e) => + { + athomeView.funnextBtn.Visible = false; + leaveView.funnextBtn.Visible = true; + withdrawalView.funnextBtn.Visible = false; + urgentwithdView.funnextBtn.Visible = false; + }; + + + ///鎾ら槻鐐瑰嚮浜嬩欢 + withdrawalView.clickviewBtn.MouseUpEventHandler+= (seder, e) => + { + athomeView.funnextBtn.Visible = false; + leaveView.funnextBtn.Visible = false; + withdrawalView.funnextBtn.Visible = true; + urgentwithdView.funnextBtn.Visible = false; + + }; + + + ///鑳佽揩鎾ら槻鐐瑰嚮浜嬩欢 + urgentwithdView.clickviewBtn.MouseUpEventHandler += (seder, e) => + { + athomeView.funnextBtn.Visible = false; + leaveView.funnextBtn.Visible = false; + withdrawalView.funnextBtn.Visible = false; + urgentwithdView.funnextBtn.Visible = true; + }; + + + if (IsDeviceEditor) + { + foreach (var actions in Common.Logic.CurrentLogic.Actions) + { + if (actions["LinkType"].ToString() == "6") + { + + if (actions["SecuritySetting"].ToString() == "0") + { + if (actions["Password"].ToString() == "888888") + { + athomeView.funnextBtn.Visible = false; + leaveView.funnextBtn.Visible = false; + withdrawalView.funnextBtn.Visible = false; + urgentwithdView.funnextBtn.Visible = true; + } + else + { + athomeView.funnextBtn.Visible = false; + leaveView.funnextBtn.Visible = false; + withdrawalView.funnextBtn.Visible = true; + urgentwithdView.funnextBtn.Visible = false; + } + + } + else if (actions["SecuritySetting"].ToString() == "1") + { + if (actions["SecurityModeId"].ToString() == "1") + { + + athomeView.funnextBtn.Visible = true; + leaveView.funnextBtn.Visible = false; + withdrawalView.funnextBtn.Visible = false; + urgentwithdView.funnextBtn.Visible = false; + } + else + { + athomeView.funnextBtn.Visible = false; + leaveView.funnextBtn.Visible = true; + withdrawalView.funnextBtn.Visible = false; + urgentwithdView.funnextBtn.Visible = false; + + } + } + break; + + } + + } + + } + + saveView.clickviewBtn.MouseUpEventHandler += (sender, e) => + { + 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)); + alert.Show(); + return; + } + + if (actionsInfo.ContainsKey("LinkType")) + { + actionsInfo.Remove("LinkType"); + } + if (actionsInfo.ContainsKey("CheckIASStatus")) + { + actionsInfo.Remove("CheckIASStatus"); + } + if (actionsInfo.ContainsKey("IsDelayStart")) + { + actionsInfo.Remove("IsDelayStart"); + } + + actionsInfo.Add("LinkType", 6); + actionsInfo.Add("CheckIASStatus", 0); + actionsInfo.Add("IsDelayStart", 0); + + if (actionsInfo.ContainsKey("Password")) + { + actionsInfo.Remove("Password"); + } + if (actionsInfo.ContainsKey("SecuritySetting")) + { + actionsInfo.Remove("SecuritySetting"); + } + if (actionsInfo.ContainsKey("SecurityModeId")) + { + actionsInfo.Remove("SecurityModeId"); + } + ///鍦ㄥ甯冮槻 + if (athomeView.funnextBtn.Visible) + { + actionsInfo.Add("SecuritySetting", "1"); + actionsInfo.Add("SecurityModeId", "1"); + actionsInfo.Add("Password", "666666"); + + } + ///绂诲甯冮槻 + if (leaveView.funnextBtn.Visible) + { + actionsInfo.Add("SecuritySetting", "1"); + actionsInfo.Add("SecurityModeId", "2"); + actionsInfo.Add("Password", "666666"); + + } + ///鎾ら槻 + if (withdrawalView.funnextBtn.Visible) + { + actionsInfo.Add("SecuritySetting", "0"); + actionsInfo.Add("SecurityModeId", "0"); + actionsInfo.Add("Password", "999999"); + + } + ///绱ц揩鎾ら槻 + if (urgentwithdView.funnextBtn.Visible) + { + actionsInfo.Add("SecuritySetting", "0"); + actionsInfo.Add("SecurityModeId", "0"); + actionsInfo.Add("Password", "888888"); + + } + LogicIfon.AddSecurityactions(actionsInfo); + this.RemoveFromParent(); + var logicCommunalPage = new LogicCommunalPage(); + UserView.HomePage.Instance.AddChidren(logicCommunalPage); + UserView.HomePage.Instance.PageIndex += 1; + logicCommunalPage.Show(() => { }); + + + }; + } + + + } +} -- Gitblit v1.8.0