| | |
| | | |
| | | #region ◆ 变量申明__________________________ |
| | | ZigBee.Device.DoorLock doorLock; |
| | | /// <summary> |
| | | /// 设备需要保存的设备名字 |
| | | /// </summary> |
| | | private Dictionary<int, string> dicDeviceSaveName = new Dictionary<int, string>(); |
| | | /// <summary> |
| | | /// 当前选择的设备 |
| | | /// </summary> |
| | | private CommonDevice nowSelectDevice = null; |
| | | /// <summary> |
| | | /// 设备备注的控件 |
| | | /// </summary> |
| | | private FrameCaptionInputControl btnDeviceName = null; |
| | | /// <summary> |
| | | /// 设备的某一回路 |
| | | /// </summary> |
| | | private CommonDevice deviceObj = null; |
| | | #endregion |
| | | |
| | | /// <summary>
|
| | |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | | this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.FunctionSetting)); |
| | | this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.DoorLockFunctionSetting)); |
| | | |
| | | EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => |
| | | { |
| | |
| | | |
| | | var bottomFrameLayout2 = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(1319), |
| | | Height = Application.GetRealHeight(1054), |
| | | Y = Application.GetRealHeight(418), |
| | | }; |
| | | this.midFrameLayout.AddChidren(bottomFrameLayout2); |
| | |
| | | Text = Language.StringByID(R.MyInternationalizationString.InformationEdit), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 12, |
| | | TextSize = 15, |
| | | }; |
| | | bottomFrameLayout2.AddChidren(informationEdit); |
| | | |
| | | for (int i = 0; i < 7; i++) |
| | | for (int i = 0; i < 6; i++) |
| | | { |
| | | var bottomRowLayout = new FrameLayout() |
| | | { |
| | |
| | | Width = Application.GetRealWidth(233), |
| | | Height = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(58), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 12, |
| | | TextSize = 14, |
| | | }; |
| | | bottomRowLayout.AddChidren(btnName); |
| | | |
| | |
| | | var btnLine = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(965), |
| | | Height = Application.GetRealHeight(2), |
| | | Height = 1, |
| | | X = Application.GetRealWidth(58), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | Visible = false, |
| | |
| | | btnNext.SelectedImagePath = "DoorLock/SwitchOn.png"; |
| | | btnLine.Visible = true; |
| | | btnLine.Y = Application.GetRealHeight(853); |
| | | if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "") |
| | | if (doorLock.RemoteUnlockPassword == "") |
| | | { |
| | | btnNext.IsSelected = false; |
| | | } |
| | |
| | | btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockTime); |
| | | btnNextFrameLayout.Y = btnName.Y; |
| | | btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; |
| | | btnLine.Visible = true; |
| | | btnLine.Visible = false; |
| | | btnLine.Y = Application.GetRealHeight(992); |
| | | } |
| | | else if (i == 6) |
| | | { |
| | | bottomRowLayout.Y = Application.GetRealHeight(999 + 35); |
| | | btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockShare); |
| | | btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; |
| | | btnLine.Visible = true; |
| | | btnLine.Y = Application.GetRealHeight(1131); |
| | | } |
| | | //else if (i == 6) |
| | | //{ |
| | | // bottomRowLayout.Y = Application.GetRealHeight(999 + 35); |
| | | // btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockShare); |
| | | // btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; |
| | | // btnLine.Visible = true; |
| | | // btnLine.Y = Application.GetRealHeight(1131); |
| | | //} |
| | | int currentIndex = i; |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | if (currentIndex == 1) |
| | | { |
| | | //获取设备所属房间 |
| | | var aa = Common.Room.CurrentRoom.GetRoomByDevice(doorLock); |
| | | //获取设备所在楼层 |
| | | var bb = aa.FloorId; |
| | | //获取设备所在楼层 |
| | | var cc = aa.FloorId; |
| | | //获取楼层的名字 |
| | | var dd = Common.Config.Instance.Home.GetFloorNameById(cc); |
| | | //if (Common.Config.Instance.Home.FloorDics.Count == 0)//这个是无楼层模式 |
| | | EventHandler<MouseEventArgs> eHandler = async (sender, e) => |
| | | { |
| | | if (currentIndex == 1) |
| | | { |
| | | //获取设备所属房间 |
| | | var aa = Common.Room.CurrentRoom.GetRoomByDevice(doorLock); |
| | | //获取设备所在楼层 |
| | | var bb = aa.FloorId; |
| | | //获取设备所在楼层 |
| | | var cc = aa.FloorId; |
| | | //获取楼层的名字 |
| | | var dd = Common.Config.Instance.Home.GetFloorNameById(cc); |
| | | //if (Common.Config.Instance.Home.FloorDics.Count == 0)//这个是无楼层模式 |
| | | |
| | | var listCheck = new List<string>(); |
| | | } |
| | | else if (currentIndex == 3) |
| | | { |
| | | var temporaryPassword = new Shared.Phone.UserCenter.DoorLock.TemporaryPassword(doorLock); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(temporaryPassword); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | temporaryPassword.Show(); |
| | | } |
| | | else if (currentIndex == 4) |
| | | { |
| | | btnNext.IsSelected = !btnNext.IsSelected; |
| | | if (btnNext.IsSelected) |
| | | { |
| | | if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "") |
| | | { |
| | | RemotePasswordDialog(doorLock, btnNext); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ZigBee.Device.DoorLock.RemoteUnlockPassword = ""; |
| | | } |
| | | } |
| | | else if (currentIndex == 5) |
| | | { |
| | | var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "DoorLockTime"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | tempPage.Show(); |
| | | } |
| | | else if (currentIndex == 6) |
| | | { |
| | | } |
| | | }; |
| | | var listCheck = new List<string>(); |
| | | } |
| | | else if (currentIndex == 3) |
| | | { |
| | | var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid); |
| | | if (result == false) |
| | | { |
| | | var temporaryPassword = new Shared.Phone.UserCenter.DoorLock.TemporaryPassword(doorLock); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(temporaryPassword); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | temporaryPassword.Show(); |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | } |
| | | |
| | | } |
| | | else if (currentIndex == 4) |
| | | { |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid); |
| | | if (result == false) |
| | | { |
| | | var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid); |
| | | if (result1 == true) |
| | | { |
| | | btnNext.IsSelected = !btnNext.IsSelected; |
| | | if (btnNext.IsSelected) |
| | | { |
| | | if (doorLock.RemoteUnlockPassword == "") |
| | | { |
| | | RemotePasswordDialog(doorLock, btnNext); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | doorLock.RemoteUnlockPassword = ""; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.NoAccess), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | btnNext.IsSelected = !btnNext.IsSelected; |
| | | if (btnNext.IsSelected) |
| | | { |
| | | if (doorLock.RemoteUnlockPassword == "") |
| | | { |
| | | RemotePasswordDialog(doorLock, btnNext); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | doorLock.RemoteUnlockPassword = ""; |
| | | } |
| | | } |
| | | } |
| | | else if (currentIndex == 5) |
| | | { |
| | | var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid); |
| | | if (result == false) |
| | | { |
| | | var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "DoorLockTime"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | tempPage.Show(); |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip); |
| | | } |
| | | } |
| | | }; |
| | | bottomRowLayout.MouseDownEventHandler += eHandler; |
| | | btnNext.MouseDownEventHandler += eHandler; |
| | | btnName.MouseDownEventHandler += eHandler; |
| | | btnNextFrameLayout.MouseDownEventHandler += eHandler; |
| | | #endregion |
| | | } |
| | | |
| | | //保存 |
| | | //var btnFinifh = new Button() |
| | | //{ |
| | | // Width = Application.GetRealWidth(907), |
| | | // Height = Application.GetRealHeight(127), |
| | | // Y = Application.GetRealHeight(1472), |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Radius = (uint)Application.GetRealHeight(127) / 2, |
| | | // TextID = R.MyInternationalizationString.Save, |
| | | // BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | // TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | // TextSize = 16, |
| | | //}; |
| | | //this.midFrameLayout.AddChidren(btnFinifh); |
| | | //btnFinish.MouseUpEventHandler += async (sender, e) => |
| | | //{ |
| | | // //记录起当前正在操作的回路名字 |
| | | // dicDeviceSaveName[nowSelectDevice.DeviceEpoint] = btnDeviceName.Text.Trim(); |
| | | // //开启进度条 |
| | | // this.ShowProgressBar(); |
| | | // foreach (var epoint in dicDeviceSaveName.Keys) |
| | | // { |
| | | // var device = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, epoint); |
| | | // if (device == null || dicDeviceSaveName[epoint] == string.Empty) |
| | | // { |
| | | // //不能允许空白名字 |
| | | // continue; |
| | | // } |
| | | // string newName = dicDeviceSaveName[epoint]; |
| | | // string oldName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | // if (oldName != newName) |
| | | // { |
| | | // //设备名称修改 |
| | | // var result = await Common.LocalDevice.Current.ReName(device, newName); |
| | | // if (result == false) |
| | | // { |
| | | // //关闭 |
| | | // this.CloseProgressBar(); |
| | | // return; |
| | | // } |
| | | // } |
| | | // } |
| | | // this.CloseProgressBar(); |
| | | // //关闭自身 |
| | | // this.CloseForm(); |
| | | //}; |
| | | } |
| | | |
| | | #region ◆ 接口实现__________________________ |