From fe3b2466c68b5db70d38e78039703add3b8b1dfe Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 31 十二月 2020 19:29:43 +0800 Subject: [PATCH] 合并了代码 --- ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs | 141 ++++++++++++++++------------------------------ 1 files changed, 50 insertions(+), 91 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs index 7531f97..91c65a7 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs @@ -30,7 +30,7 @@ Common.Logic.CurrentLogic.LogicName = logicName; if (Common.Logic.CurrentLogic.Conditions.Count == 1) { - ConditionView(false, frameLayout); + ConditionView(false, frameLayout,null); } else { @@ -145,7 +145,7 @@ case 1: { var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]); - name = HdlDeviceCommonLogic.Current.GetDeviceEpointName(deviceinof); + name = LocalDevice.Current.GetDeviceEpointName(deviceinof); selecteddevice.regionNameBtn.Visible = true; Method.RoomNmae(selecteddevice.regionNameBtn, deviceinof); @@ -515,16 +515,14 @@ break; case 6: { - var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; - frameLayout.AddChidren(flMain); - AddLogicPage.SecurityView(flMain, true); + + AddLogicPage.SecurityView(frameLayout, true); } break; case 7: { - var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; - frameLayout.AddChidren(flMain); - AddLogicPage.LocationView(flMain, true); + + AddLogicPage.LocationView(frameLayout, true); } break; } @@ -533,7 +531,7 @@ selecteddevice.del.MouseUpEventHandler += (sender, e) => { - var alert = new ShowMsgControl(ShowMsgType.Confirm, + var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(MyInternationalizationString.doyouwanttodelete), Language.StringByID(MyInternationalizationString.confrim)); alert.Show(); @@ -593,7 +591,7 @@ { var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); - name = HdlDeviceCommonLogic.Current.GetDeviceEpointName(deviceinof); + name = LocalDevice.Current.GetDeviceEpointName(deviceinof); actiondevice.regionNameBtn.Visible = true; Method.RoomNmae(actiondevice.regionNameBtn, deviceinof); switch (deviceinof.Type) @@ -937,7 +935,7 @@ case 2: { //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙; - var sceneinof = HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString())); + var sceneinof = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString())); //鏈湴娌℃湁瀛樺湪; if (sceneinof == null) { @@ -966,7 +964,7 @@ actiondevice.regionNameBtn.Visible = true; /////閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О Common.Room room = new Common.Room(); - actiondevice.regionNameBtn.Text = HdlRoomLogic.Current.GetRoomNameBySceneId(sceneinof.Id); + actiondevice.regionNameBtn.Text = UserCenter.HdlRoomLogic.Current.GetRoomNameBySceneId(sceneinof.Id); } break; @@ -1094,7 +1092,7 @@ actiondevice.del.MouseUpEventHandler += (sender, e) => { - var alert = new ShowMsgControl(ShowMsgType.Confirm, + var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(MyInternationalizationString.doyouwanttodelete), Language.StringByID(MyInternationalizationString.confrim)); alert.Show(); @@ -1120,90 +1118,50 @@ /// <summary> /// 涓庢垨鏉′欢甯冨眬鐣岄潰鐨勬柟娉� /// </summary> - /// <param name="edit"></param> - /// <param name="frameLayout"></param> - public void ConditionView(bool edit, FrameLayout frameLayout) + /// <param name="edit">琛ㄧず鏄惁缂栬緫</param> + /// <param name="frameLayout">鏄剧ず鍦ㄥ摢涓晫闈�</param> + /// <param name="button">鏄剧ず閫変腑鏂囨湰</param> + public void ConditionView(bool edit, FrameLayout frameLayout,Button button) { - #region ------缁勫悎鏉′欢鐣岄潰甯冨眬閮ㄥ垎 - var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; - frameLayout.AddChidren(flMain); - CompleteView completeView = new CompleteView(); - flMain.AddChidren(completeView.Show(2)); - completeView.Btntitle.TextID = MyInternationalizationString.condition; - EventHandler<MouseEventArgs> clickcancel = (sender, e) => - { - UserView.HomePage.Instance.ScrollEnabled = true; - flMain.RemoveFromParent(); - }; - flMain.MouseUpEventHandler += clickcancel; - completeView.Btncancel.MouseUpEventHandler += clickcancel; - - //婊¤冻鎵�鏈夋潯浠� - mFunView allFunView = new mFunView(); - allFunView.frameLayout.Y = Application.GetRealHeight(140 + 20); - completeView.Show(2).AddChidren(allFunView.Show()); - allFunView.titleBtn.TextID = MyInternationalizationString.Allconditions; - //婊¤冻鍏朵腑涓�涓潯浠� - mFunView ormFunview = new mFunView(); - ormFunview.frameLayout.Y = allFunView.frameLayout.Bottom; - completeView.Show(2).AddChidren(ormFunview.Show()); - ormFunview.titleBtn.TextID = MyInternationalizationString.anycondition; - ormFunview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; - #endregion - - ///婊¤冻鎵�鏈夋潯浠剁偣鍑讳簨浠� - allFunView.clickviewBtn.MouseUpEventHandler += (sedner, e) => - { - allFunView.selectedIconBtn.Visible = true; - ormFunview.selectedIconBtn.Visible = false; - allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; - ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; - }; - ///婊¤冻鍏朵腑涓�涓潯浠剁偣鍑讳簨浠� - ormFunview.clickviewBtn.MouseUpEventHandler += (sedner, e) => - { - allFunView.selectedIconBtn.Visible = false; - ormFunview.selectedIconBtn.Visible = true; - allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; - ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; - }; - + + string stateText = ""; if (edit) { - if (Common.Logic.CurrentLogic.Relationship == 0) - { - allFunView.selectedIconBtn.Visible = true; - ormFunview.selectedIconBtn.Visible = false; - allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; - ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; - } - else - { - allFunView.selectedIconBtn.Visible = false; - ormFunview.selectedIconBtn.Visible = true; - allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; - ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; - } - } - completeView.Btncomplete.MouseUpEventHandler += (sender, e) => - { - if (!allFunView.selectedIconBtn.Visible && !ormFunview.selectedIconBtn.Visible) - { - ///鍙互鎻愮ず鏈�変腑鐘舵�侊紱 - return; - } - flMain.RemoveFromParent(); - if (allFunView.selectedIconBtn.Visible) + switch (Common.Logic.CurrentLogic.Relationship) + { + case 0: + { + stateText = Language.StringByID(MyInternationalizationString.Allconditions); + } + break; + case 1: + { + stateText = Language.StringByID(MyInternationalizationString.anycondition); + } + break; + } + + } + + PublicInterface publicInterface = new PublicInterface(); + var list = publicInterface.GetViewList("缁勫悎鏉′欢"); + publicInterface.SingleSelectionShow(frameLayout, list, MyInternationalizationString.condition, stateText, (str) => + { + //鏄剧ず閫変腑鏂囨湰 + if (button!=null) { + button.Text = Language.StringByID(MyInternationalizationString.followingconditions)+ str; + } + if (str == Language.StringByID(MyInternationalizationString.Allconditions)) { Common.Logic.CurrentLogic.Relationship = 0; } - if (ormFunview.selectedIconBtn.Visible) + else if (str == Language.StringByID(MyInternationalizationString.anycondition)) { - Common.Logic.CurrentLogic.Relationship = 1; + Common.Logic.CurrentLogic.Relationship = 1; } if (edit) { @@ -1211,10 +1169,6 @@ { Send.LogicControlSwitch(Common.Logic.CurrentLogic); } - var logicCommunalPage = new LogicCommunalPage(); - UserView.HomePage.Instance.AddChidren(logicCommunalPage); - UserView.HomePage.Instance.PageIndex += 1; - logicCommunalPage.Show(() => { }); } else { @@ -1223,7 +1177,12 @@ UserView.HomePage.Instance.PageIndex += 1; addLogicPage.Show(); } - }; + + }); + + + + } } -- Gitblit v1.8.0