陈嘉乐
2020-04-28 3272ca5b51e19f7f8a827b0f68400570a547fe60
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
old mode 100644 new mode 100755
@@ -10,7 +10,7 @@
        public LockLogicList()
        {
            Tag = "Logic";
            Tag = "LockListView";
        }
        VerticalRefreshLayout middle;
        public void Show()
@@ -36,10 +36,9 @@
                //new一个新逻辑对象;
                Common.Logic.CurrentLogic = new Common.Logic();
                Common.Logic.CurrentLogic.IsEnable = 1;//默认为开
                Common.Logic.CurrentLogic.LogicType = 1;
                Common.Logic.CurrentLogic.LogicType = 1;//标记自动化类型
                Common.Logic.CurrentLogic.Relationship = 1;
                Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
                //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
                Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.linkageevent);
                var lockLogicCommunalPage = new LockLogicCommunalPage();
                UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
                UserView.HomePage.Instance.PageIndex += 1;
@@ -49,7 +48,7 @@
            middle = new VerticalRefreshLayout
            {
                Y = view.topRowLayout.Bottom,
                Height = Application.GetRealHeight(1920 - 184),
                Height = Application.GetRealHeight(Method.H - 184),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
            };
            this.AddChidren(middle);
@@ -80,13 +79,20 @@
                    for (int j = 0; j < listlogic.Count; j++)
                    {
                        var logic = listlogic[j];
                        if (logic.LogicType == 0)
                        if (logic.LogicType != 1)
                        {
                            continue;
                        }
                        bool yes = false;
                        for (int a = 0; a < logic.Accounts.Count; a++)
                        {
                        {
                            if (logic.Accounts[a]["MacAddr"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Epoint"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString())
                            {
                                //查找是否是那个门锁;
                                //如果不是该门锁联动事件不显示出来;
                                yes = false;
                                break;
                            }
                            if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid)
                            {
                                //查找自己账号下的创建联动事件;
@@ -228,7 +234,6 @@
                };
                ///删除
                var del = new Button
                {
@@ -239,18 +244,16 @@
                logicRowlayout.AddRightView(del);
                del.MouseUpEventHandler += (sender, e) =>
                {
                    var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                                             Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
                    alert.ResultEventHandler += (sender1, e1) =>
                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
                    Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                    Language.StringByID(MyInternationalizationString.confrim));
                    alert.Show();
                    alert.ConfirmClickEvent += () =>
                    {
                        if (e1)
                        {
                            Common.Logic.LockLogicList.Remove(logic);
                            Automationview();
                            Send.DelLogic(logic.LogicId);
                        }
                        Common.Logic.LockLogicList.Remove(logic);
                        Automationview();
                        Send.DelLogic(logic.LogicId);
                    };
                    alert.Show();
                };
            }