| | |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using Shared.Common; |
| | | using ZigBee.Device; |
| | | |
| | | namespace Shared.Phone.UserCenter.DoorLock |
| | | { |
| | | public class UnLockMethod : DoorLockCommonLayout |
| | | public class UnLockMethod : DoorLockCommonLayout, ZigBee.Common.IStatus |
| | | { |
| | | /// <summary> |
| | | /// 处理变化事件 |
| | | /// </summary> |
| | | /// <param name="common"></param> |
| | | /// <param name="typeTag"></param> |
| | | public void DeviceInfoChange(CommonDevice tempDevice, string typeTag) |
| | | { |
| | | if (typeTag == "DoorLockProgrammingEventNotificationCommand" && tempDevice != null) |
| | | { |
| | | if (tempDevice != null) |
| | | { |
| | | if (tempDevice.DeviceEpoint == doorLock.DeviceEpoint |
| | | && tempDevice.DeviceAddr == doorLock.DeviceAddr) |
| | | { |
| | | var doorLock = tempDevice as ZigBee.Device.DoorLock; |
| | | if (doorLock.doorLockProgrammingEventNotificationCommand != null) |
| | | { |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="doorLock"></param> |
| | |
| | | this.btnTitleLine.Visible = false; |
| | | EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | this.btnBack.MouseUpEventHandler += eHandlerBack; |
| | | this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; |
| | |
| | | |
| | | var btnAddFrameLayout = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(953), |
| | | X = Application.GetRealWidth(953 - 116), |
| | | Height = Application.GetRealHeight(72), |
| | | Width = Application.GetRealWidth(72), |
| | | }; |
| | |
| | | UnSelectedImagePath = "DoorLock/AddIcon.png", |
| | | }; |
| | | btnAddFrameLayout.AddChidren(btnAdd); |
| | | btnAdd.MouseDownEventHandler += (sender, e) => |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | if (doorLock.IsFreezeAccount[curAccountObj.SubAccountDistributedMark] == true) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | } |
| | | else |
| | | { |
| | | var addUnLockMethod = new Shared.Phone.UserCenter.DoorLock.AddUnLockMethod(doorLock, curAccountObj); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethod); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethod.Show(); |
| | | } |
| | | }; |
| | | btnAdd.Width = 0; |
| | | } |
| | | btnAdd.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | if (doorLock.IsFreezeAccount[curAccountObj.SubAccountDistributedMark] == true) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | } |
| | | else |
| | | { |
| | | var addUnLockMethod = new Shared.Phone.UserCenter.DoorLock.AddUnLockMethod(doorLock, curAccountObj); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethod); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethod.Show(); |
| | | } |
| | | }; |
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 3) |
| | | { |
| | | btnAddFrameLayout.Width = 0; |
| | | } |
| | | else |
| | | { |
| | | btnAddFrameLayout.Width = Application.GetRealWidth(72); |
| | | } |
| | | MidFrameLayoutContent(); |
| | | } |
| | | //中部布局 |
| | |
| | | |
| | | bodyView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Y = midTopFrameLayout.Bottom, |
| | | Height = Application.GetRealHeight(1921 - 184 - 115 - 1), |
| | | }; |
| | | this.midFrameLayout.AddChidren(bodyView); |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | //开关图标 |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写移除方法 |
| | | /// </summary> |
| | | public override void RemoveFromParent() |
| | | { |
| | | ZbGateway.StatusList.Remove(this); |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | | |
| | | |
| | | public void Changed(CommonDevice common) |
| | | { |
| | | } |
| | | public void ChangedILogicStatus(ZigBee.Device.Logic logic) |
| | | { |
| | | } |
| | | |
| | | public void ChangedISceneStatus(Scene scene) |
| | | { |
| | | } |
| | | } |
| | | } |