From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 10 七月 2020 10:52:13 +0800 Subject: [PATCH] 2020-07-10-01 --- ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs | 587 ++++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 385 insertions(+), 202 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs index c3cd244..8d69a71 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs @@ -1,32 +1,74 @@ 锘縰sing System; +using System.Collections.Generic; using Shared.Common; +using Shared.Phone.UserView; using ZigBee.Device; namespace Shared.Phone.UserCenter.DoorLock { - public class FunctionSetting : DoorLockCommonLayout, ZigBee.Common.IStatus + public class FunctionSetting : DoorLockCommonLayout { + #region 鏋勯�犲嚱鏁� /// <summary> /// 鏋勯�犲嚱鏁� /// </summary> /// <param name="doorLock"></param> - public FunctionSetting(ZigBee.Device.DoorLock doorLock) + public FunctionSetting(Room room, CommonDevice doorLock) { - this.doorLock = doorLock; + this.doorLock = doorLock as ZigBee.Device.DoorLock; + currentRoom = room; + deviceUI = doorLock; + listNewDevice.Add(doorLock); BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; - ZigBee.Device.ZbGateway.StatusList.Add(this); } - - #region 鈼� 鍙橀噺鐢虫槑__________________________ - ZigBee.Device.DoorLock doorLock; #endregion + #region 鍙橀噺鐢虫槑 + public ZigBee.Device.DoorLock doorLock = null; + /// <summary> + /// 褰撳墠鎴块棿 + /// </summary> + Room currentRoom; + /// <summary> + /// 璁惧UI瀵硅薄 + /// </summary> + CommonDevice deviceUI; + /// <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; + /// <summary> + /// 璁惧瀵硅薄 + /// </summary> + private List<CommonDevice> listNewDevice = new List<CommonDevice> { }; + Action action; + Action actionNone; + string modifyDeviceName = ""; + bool IsModifyName = true; + public Action<string> devicNameAction; + private VerticalListControl listview = null;//鍔熻兘鍒楄〃 + FrameLayout bottomFrameLayout; + #endregion + + #region UI鏄剧ず /// <summary> /// UI鏄剧ず /// </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) => { @@ -39,48 +81,45 @@ MidFrameLayoutContent(); } + #endregion + #region 涓儴鏄剧ず public void MidFrameLayoutContent() { + //鍥剧墖 + var btnPic = new DeviceInfoIconControl(); + btnPic.Y = Application.GetRealHeight(92); + btnPic.Gravity = Gravity.CenterHorizontal; + this.midFrameLayout.AddChidren(btnPic); + btnPic.InitControl(doorLock); - var MidTopFrameLayout = new FrameLayout() + var btnDeviceText = new Button() { - X = Application.GetRealWidth(449), - Y = Application.GetRealHeight(58), - Width = Application.GetRealWidth(184), - Height = Application.GetRealHeight(184), - BackgroundImagePath = "DoorLock/DoorlockPicture.png", + Y = Application.GetRealHeight(288), + Height = Application.GetRealHeight(60), + Gravity = Gravity.CenterHorizontal, + TextColor = ZigbeeColor.Current.XMBlack, + TextSize = 15, + Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock), }; - this.midFrameLayout.AddChidren(MidTopFrameLayout); + this.midFrameLayout.AddChidren(btnDeviceText); + BottomFrameLayout(); } + #endregion + #region 搴曢儴鏄剧ず public void BottomFrameLayout() { #region UI - var bottomFrameLayout = new FrameLayout() - { - Height = Application.GetRealHeight(100), - Y = Application.GetRealHeight(418), - Radius = 17, - BackgroundColor = ZigbeeColor.Current.XMWhite, - }; - this.midFrameLayout.AddChidren(bottomFrameLayout); - - var bottomFrameLayout1 = new FrameLayout() - { - Height = Application.GetRealHeight(1319 - 50), - Y = Application.GetRealHeight(418 + 48), - BackgroundColor = ZigbeeColor.Current.XMWhite, - }; - this.midFrameLayout.AddChidren(bottomFrameLayout1); - - var bottomFrameLayout2 = new FrameLayout() + bottomFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(1319), Y = Application.GetRealHeight(418), + BackgroundColor = ZigbeeColor.Current.XMWhite, }; - this.midFrameLayout.AddChidren(bottomFrameLayout2); + this.midFrameLayout.AddChidren(bottomFrameLayout); + bottomFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); var informationEdit = new Button() { @@ -90,223 +129,367 @@ Text = Language.StringByID(R.MyInternationalizationString.InformationEdit), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextAlignment = TextAlignment.CenterLeft, - TextSize = 12, + TextSize = 15, }; - bottomFrameLayout2.AddChidren(informationEdit); + bottomFrameLayout.AddChidren(informationEdit); - for (int i = 0; i < 7; i++) + listview = new VerticalListControl() { - var btnName = new Button() - { - Width = Application.GetRealWidth(233), - Height = Application.GetRealHeight(58), - X = Application.GetRealWidth(58), - TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, - TextAlignment = TextAlignment.CenterLeft, - TextSize = 12, - }; - bottomFrameLayout2.AddChidren(btnName); + Height = Application.GetRealHeight(1319 - 141), + Y = Application.GetRealHeight(170), + }; + bottomFrameLayout.AddChidren(listview); + #endregion - var btnNextFrameLayout = new FrameLayout() - { - Width = Application.GetRealWidth(104), - Height = Application.GetRealHeight(58), - X = Application.GetRealWidth(861 + 58), - }; - bottomFrameLayout2.AddChidren(btnNextFrameLayout); + FunctionDetail(doorLock); + } + #endregion - var btnNext = new Button() + #region 鍔熻兘鏄剧ず + void FunctionDetail(ZigBee.Device.DoorLock doorLock) + { + listview.RemoveAll(); + //璁惧澶囨敞 + string caption = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm); + string deviceName = Common.LocalDevice.Current.GetDeviceMacName(doorLock); + var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2); + listview.AddChidren(btnNote); + btnNote.InitControl(); + //鍒掔嚎 + btnNote.AddBottomLine(); + btnNote.txtInput.FinishInputEvent += () => + { + string oldName = Common.LocalDevice.Current.GetDeviceMacName(doorLock); + if (btnNote.Text == string.Empty) { - Width = Application.GetRealWidth(60), - Height = Application.GetRealHeight(60), - }; - btnNextFrameLayout.AddChidren(btnNext); - - var btnLine = new FrameLayout() - { - Width = Application.GetRealWidth(965), - Height = Application.GetRealHeight(5), - X = Application.GetRealWidth(58), - BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, - Visible = false, - }; - bottomFrameLayout2.AddChidren(btnLine); - - if (i == 0) - { - btnName.Y = Application.GetRealHeight(204); - btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceName) + ":"; - btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58); - btnNextFrameLayout.Y = btnName.Y; - btnNextFrameLayout.X = btnName.Right; - btnNext.TextAlignment = TextAlignment.CenterLeft; - btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; - btnNext.Text = "鏅鸿兘闂ㄩ攣"; - btnLine.Visible = true; - btnLine.Y = Application.GetRealHeight(308); + btnNote.Text = oldName; } - else if (i == 1) + if (oldName != btnNote.Text) { - btnName.Y = Application.GetRealHeight(343); - btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongZone) + ":"; - var btnArea = new Button() - { - Width = Application.GetRealWidth(789 - 109 - 58), - Height = Application.GetRealHeight(58), - X = btnName.Right, - Y = btnName.Y, - TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, - Text = "涓�妤硷紝瀹㈠巺", - TextAlignment = TextAlignment.CenterLeft, - }; - bottomFrameLayout2.AddChidren(btnArea); - btnNextFrameLayout.Y = btnName.Y; - btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; - btnLine.Visible = true; - btnLine.Y = Application.GetRealHeight(446); + //淇敼鍚嶅瓧 + this.DeviceReName(btnNote.Text, false); } - else if (i == 2) - { - btnName.Y = Application.GetRealHeight(481); - btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongModel) + ":"; - btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58); - btnNextFrameLayout.Y = btnName.Y; - btnNextFrameLayout.X = btnName.Right; + }; - btnNext.TextAlignment = TextAlignment.CenterLeft; - btnNext.Height = Application.GetRealHeight(58); - btnNext.Text = "HDL-Doorlock"; - btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + //鎵�灞炲尯鍩� + var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2); + listview.AddChidren(rowBeloneArea); + rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), this.listNewDevice); + //搴曠嚎 + rowBeloneArea.AddBottomLine(); - btnLine.Visible = true; - btnLine.Y = Application.GetRealHeight(1025 - 449); - } - else if (i == 3) - { - btnName.Y = Application.GetRealHeight(585 + 35); - btnName.Text = Language.StringByID(R.MyInternationalizationString.TemporaryPassword); - - btnNextFrameLayout.Y = btnName.Y; - btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; - - btnLine.Visible = true; - btnLine.Y = Application.GetRealHeight(619 + 58 + 35); - } - else if (i == 4) - { - btnName.Y = Application.GetRealHeight(723 + 35); - btnName.Text = Language.StringByID(R.MyInternationalizationString.RemotelyUnlock); - btnNextFrameLayout.Y = btnName.Y; - btnNext.Width = Application.GetRealWidth(104); - btnNext.Height = Application.GetRealHeight(63); - btnNext.UnSelectedImagePath = "DoorLock/Switch.png"; - btnNext.SelectedImagePath = "DoorLock/SwitchOn.png"; - btnLine.Visible = true; - btnLine.Y = Application.GetRealHeight(723 + 127); - if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "") - { - btnNext.IsSelected = false; + var listCheck = new List<string>(); + rowBeloneArea.SelectRoomEvent += (roomKeys) => + { + //閫夋嫨鏈垎閰嶆椂,娓呯┖ + if (roomKeys == string.Empty) { listCheck = new List<string>(); } + foreach (var device in this.listNewDevice) + { + if (roomKeys == string.Empty) + { + //濡傛灉閫夋嫨鐨勬槸鏈垎閰嶏紝鍒欏畠鐨勫叏閮ㄥ洖璺棤鏉′欢鍏ㄩ儴娓呯┖鎴块棿 + HdlRoomLogic.Current.ChangedRoom(device, roomKeys); + continue; } - else + var room = HdlRoomLogic.Current.GetRoomByDevice(device); + string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device); + if (room == null) { - btnNext.IsSelected = true; + //杩欓噷鏈夌偣鐗规畩,濡傛灉鍥炶矾娌℃湁璁剧疆鏈夊尯鍩熺殑鏃跺��,鎵嶈缃� + listCheck.Add(mainKeys); + HdlRoomLogic.Current.ChangedRoom(device, roomKeys); + } + else if (listCheck.Contains(mainKeys) == true) + { + //濡傛灉杩欎釜鍥炶矾涔嬪墠閮借繕娌℃湁鍖哄煙,鍦ㄦ湰鐣岄潰杩樻病鏈夊叧闂箣鍓�,鍙互鏃犳潯浠堕殢渚垮彉鏇� + HdlRoomLogic.Current.ChangedRoom(device, roomKeys); } } - else if (i == 5) + //淇濆瓨璁惧鎴块棿绱㈠紩 + Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys); + }; + + //璁惧妯″潡 + caption = Language.StringByID(R.MyInternationalizationString.BelongDevice); + deviceName = Common.LocalDevice.Current.GetDeviceObjectText(listNewDevice); + var btnType = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2); + btnType.UseClickStatu = false; + listview.AddChidren(btnType); + btnType.InitControl(); + //鍒掔嚎 + btnType.AddBottomLine(); + + //娣诲姞鍏ㄩ儴鑿滃崟 + this.AddAllMenuRow(); + FinishInitControl(bottomFrameLayout, this.listview); + //淇濆瓨 + var btnFinish = new BottomClickButton(); + btnFinish.Y = Application.GetRealHeight(1054); + btnFinish.TextID = R.MyInternationalizationString.uSave; + bottomFrameLayout.AddChidren(btnFinish); + btnFinish.ButtonClickEvent += (sender, e) => + { + string oldName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]); + if (btnNote.Text.Trim() == string.Empty) { - btnName.Y = Application.GetRealHeight(861 + 35); - btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockTime); - btnNextFrameLayout.Y = btnName.Y; - btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; - btnLine.Visible = true; - btnLine.Y = Application.GetRealHeight(861 + 127); + btnNote.Text = oldName; } - else if (i == 6) + if (oldName != btnNote.Text.Trim()) { - btnName.Y = Application.GetRealHeight(999 + 35); - btnName.Text = Language.StringByID(R.MyInternationalizationString.Shared); - btnNextFrameLayout.Y = btnName.Y; - btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; - btnLine.Visible = true; - btnLine.Y = Application.GetRealHeight(999 + 127); + //淇敼鍚嶅瓧 + this.DeviceReName(btnNote.Text.Trim(), true); } - int currentIndex = i; - EventHandler<MouseEventArgs> eHandler = (sender, e) => + else { - if (currentIndex == 1) + //鍏抽棴鑷韩 + this.CloseForm(); + } + }; + } + #endregion + + #region 娣诲姞鍏ㄩ儴鑿滃崟 + /// <summary> + /// 娣诲姞鍏ㄩ儴鑿滃崟 + /// </summary> + private void AddAllMenuRow() + { + if (UserCenterResourse.UserInfo.AuthorityNo == 1) + { + //娣诲姞銆愪复鏃跺瘑鐮併�戣 + this.AddTempPasswordRow(); + //娣诲姞銆愯繙绋嬪紑閿併�戣 + this.AddRemoteUnLocksRow(); + //娣诲姞銆愰棬閿佹椂闂淬�戣 + this.AddDoorLocksTimeRow(); + } + else + { + //娣诲姞銆愯繙绋嬪紑閿併�戣 + this.AddRemoteUnLocksRow(); + } + } + #endregion + + #region 涓存椂瀵嗙爜 + /// <summary> + /// 涓存椂瀵嗙爜 + /// </summary> + private void AddTempPasswordRow() + { + //鐢ㄦ埛绠$悊 + string caption = Language.StringByID(R.MyInternationalizationString.TemporaryPassword); + var btnRow = new FrameRowControl(listview.rowSpace / 2); + listview.AddChidren(btnRow); + btnRow.AddLeftCaption(caption, 600); + //鍚戝彸鍥炬爣 + btnRow.AddRightArrow(); + //搴曠嚎 + btnRow.AddBottomLine(); + btnRow.ButtonClickEvent += async (sender, e) => + { + action = async () => + { + 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(); + }; + actionNone = async () => + { + Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock); + }; + HdlCheckLogic.Current.CheckSecondarySecurity(action, actionNone); + }; + } + + #endregion + + #region 杩滅▼寮�閿� + /// <summary> + /// 娣诲姞銆愯繙绋嬪紑閿併�戣锛堥棬閿佷笓鐢級 + /// </summary> + private void AddRemoteUnLocksRow() + { + //杩滅▼寮�閿� + string caption = Language.StringByID(R.MyInternationalizationString.uRemoteUnLocks); + var btnRow = new FrameRowControl(listview.rowSpace / 2); + btnRow.UseClickStatu = false; + listview.AddChidren(btnRow); + btnRow.AddLeftCaption(caption, 600); + //寮�鍏冲浘鏍� + var btnswitch = btnRow.AddMostRightSwitchIcon(); + //搴曠嚎 + btnRow.AddBottomLine(); + + var doorLock = (ZigBee.Device.DoorLock)listNewDevice[0]; + if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword) == false) + { + btnswitch.IsSelected = true; + } + + btnswitch.ButtonClickEvent += async (sender, e) => + { + if (UserCenterResourse.UserInfo.AuthorityNo == 1) + { + if (btnswitch.IsSelected == true) { + btnswitch.IsSelected = false; + doorLock.RemoteUnlockPassword = string.Empty; + return; } - else if (currentIndex == 3) + var frame = new DoorLock.DoorLockCommonLayout(); + frame.RemotePasswordDialog((ZigBee.Device.DoorLock)listNewDevice[0], btnswitch.btnIcon); + frame = null; + } + else + { + 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 if (currentIndex == 4) - { - btnNext.IsSelected = !btnNext.IsSelected; - if (btnNext.IsSelected) + var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid); + if (result1 == true) { - if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "") + if (btnswitch.IsSelected == true) { - RemotePasswordDialog(doorLock, btnNext); + btnswitch.IsSelected = false; + doorLock.RemoteUnlockPassword = string.Empty; + return; } + var frame = new DoorLock.DoorLockCommonLayout(); + frame.RemotePasswordDialog((ZigBee.Device.DoorLock)listNewDevice[0], btnswitch.btnIcon); + frame = null; } else { - ZigBee.Device.DoorLock.RemoteUnlockPassword = ""; + this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.NoAccess)); } } - else if (currentIndex == 5) + else + { + this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AccountIsFreezed)); + } + } + }; + } + + #endregion + + #region 闂ㄩ攣鏃堕棿 + + /// <summary> + /// 娣诲姞銆愰棬閿佹椂闂淬�戣锛堥棬閿佷笓鐢級 + /// </summary> + private void AddDoorLocksTimeRow() + { + //闂ㄩ攣鏃堕棿 + string caption = Language.StringByID(R.MyInternationalizationString.uDoorLocksTime); + var btnRow = new FrameRowControl(listview.rowSpace / 2); + listview.AddChidren(btnRow); + btnRow.AddLeftCaption(caption, 600); + //鍚戝彸鍥炬爣 + btnRow.AddRightArrow(); + //搴曠嚎 + btnRow.AddBottomLine(); + var doorLock = this.listNewDevice[0] as ZigBee.Device.DoorLock; + btnRow.ButtonClickEvent += async (sender, e) => + { + if (UserCenterResourse.UserInfo.AuthorityNo == 1) + { + 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 + { + 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 if (currentIndex == 6) + else { + this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AccountIsFreezed)); } - }; - btnNext.MouseDownEventHandler += eHandler; - btnName.MouseDownEventHandler += eHandler; - btnNextFrameLayout.MouseDownEventHandler += eHandler; - #endregion + } + }; + } + + #endregion + + #region 璁惧閲嶅懡鍚� + /// <summary> + /// 璁惧閲嶅懡鍚� + /// </summary> + /// <param name="i_deviceName">deviceName.</param> + private void DeviceReName(string i_deviceName, bool closeForm) + { + //寮�鍚繘搴︽潯 + this.ShowProgressBar(); + + //淇敼MAC鍚� + string deviceName = i_deviceName.Trim(); + var result = Common.LocalDevice.Current.ReMacName(listNewDevice, deviceName); + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + + if (result == false) + { + return; + } + else + { + if (devicNameAction != null) + { + devicNameAction(deviceName); + } + } + if (closeForm == true) + { + //鍏抽棴鐣岄潰 + this.CloseForm(); + } + else + { + //璁惧澶囨敞淇敼鎴愬姛! + string msg = Language.StringByID(R.MyInternationalizationString.uDeviceReNoteSuccess); + this.ShowMassage(ShowMsgType.Tip, msg); } } + #endregion - #region 鈼� 鎺ュ彛瀹炵幇__________________________ + #region 琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout /// <summary> - /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange() - /// </summary> - /// <returns>The changed.</returns> - /// <param name="common">Common.</param> - public void Changed(CommonDevice common) + /// 琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout锛屼娇涔嬭兘婊戝姩 + /// </summary> + void FinishInitControl(FrameLayout bodyFrameLayout, VerticalListControl listview) { + if (listview.ChildrenCount > 0) + { + var realHeight = listview.GetChildren(0).Height * listview.ChildrenCount; + if (bodyFrameLayout.Height - Application.GetRealHeight(1054) + realHeight > listview.Height) + { + //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩 + var frameTemp = new FrameLayout(); + frameTemp.Height = bodyFrameLayout.Height - Application.GetRealHeight(1054) + Application.GetRealHeight(115); + listview.AddChidren(frameTemp); + } + } } + #endregion + + #region 绉婚櫎鏂规硶 /// <summary> - /// 澶勭悊鍙樺寲浜嬩欢 + /// 閲嶅啓绉婚櫎鏂规硶 /// </summary> - /// <param name="common"></param> - /// <param name="typeTag"></param> - public void DeviceInfoChange(CommonDevice common, string typeTag) + public override void RemoveFromParent() { - } - /// <summary> - /// Changeds the IL ogic status. - /// </summary> - /// <param name="logic">Logic.</param> - public void ChangedILogicStatus(ZigBee.Device.Logic logic) - { - } - /// <summary> - /// Changeds the IS cene status. - /// </summary> - /// <param name="scene">Scene.</param> - public void ChangedISceneStatus(Scene scene) - { + base.RemoveFromParent(); } #endregion } -- Gitblit v1.8.0