黄学彪
2020-01-10 985abd7ee6049147119518aa41fb2d08c0cfc40d
合并代码
13个文件已修改
10917 ■■■■ 已修改文件
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs 10050 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/Device.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlACZbGatewayUpdateLogic.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs 667 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs
Diff too large
ZigbeeApp/Shared/Common/Device.cs
@@ -867,10 +867,15 @@
                    //不是同一个网关
                    continue;
                }
                //没有其他回路
                if (dicDeviceEpoint.ContainsKey(ota.DeviceAddr) == false
                    || dicDeviceEpoint[ota.DeviceAddr].Count == 0)
                {
                    list.Add(ota);
                    //目前只针对中央空调
                    if (ota.ModelIdentifier == "MAC/GW-ZB.10")
                    {
                        list.Add(ota);
                    }
                }
            }
            return list;
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
@@ -74,6 +74,11 @@
        public void InitControl()
        {
            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(this.deviceMac);
            if (listDevice.Count == 0)
            {
                //针对单纯只有一个200端点的设备
                listDevice.Add(Common.LocalDevice.Current.GetOTADevice(this.deviceMac));
            }
            //图标
            btnIcon = frameTable.AddLeftIcon(81);
            Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
@@ -127,6 +132,11 @@
            hadRefresh = true;
            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(this.deviceMac);
            if (listDevice.Count == 0)
            {
                //针对单纯只有一个200端点的设备
                listDevice.Add(Common.LocalDevice.Current.GetOTADevice(this.deviceMac));
            }
            //图标
            Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
            //设备
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlACZbGatewayUpdateLogic.cs
@@ -41,7 +41,7 @@
        /// <summary>
        /// 设备对象
        /// </summary>
        private AC deviceAc = null;
        private CommonDevice deviceAc = null;
        /// <summary>
        /// 前一次的最终状态
        /// </summary>
@@ -63,7 +63,7 @@
        /// </summary>
        /// <param name="i_deviceAc">设备</param>
        /// <param name="i_deviceFirmware">设备的固件信息</param>
        public HdlACZbGatewayUpdateLogic(AC i_deviceAc, FirmwareVersionInfo i_deviceFirmware)
        public HdlACZbGatewayUpdateLogic(CommonDevice i_deviceAc, FirmwareVersionInfo i_deviceFirmware)
        {
            this.ClassDiv = 2;
            this.deviceAc = i_deviceAc;
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs
@@ -19,7 +19,7 @@
        /// <summary>
        /// 设备
        /// </summary>
        private AC deviceAc = null;
        private CommonDevice deviceAc = null;
        /// <summary>
        /// 前回选择的控件
        /// </summary>
@@ -33,7 +33,7 @@
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_deviceAc">设备</param>
        public void ShowForm(AC i_deviceAc)
        public void ShowForm(CommonDevice i_deviceAc)
        {
            this.deviceAc = i_deviceAc;
            this.otaDevice = Common.LocalDevice.Current.GetOTADevice(i_deviceAc.DeviceAddr);
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs
@@ -15,7 +15,7 @@
        /// <summary>
        /// 设备
        /// </summary>
        private AC deviceAc = null;
        private CommonDevice deviceAc = null;
        #endregion
@@ -26,7 +26,7 @@
        /// </summary>
        /// <param name="i_deviceAc">设备</param>
        /// <param name="hadNewVersion">拥有新版本</param>
        public void ShowForm(AC i_deviceAc, bool hadNewVersion)
        public void ShowForm(CommonDevice i_deviceAc, bool hadNewVersion)
        {
            this.deviceAc = i_deviceAc;
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -205,7 +205,6 @@
            Shared.Common.Room curRoom = roomList[0];
            int index = 0;
            RefreshRoomList(curRoom, ref index);
            //RefreshSceneList(roomList[index]);
            if (curRoom.SceneUIList.Count == 0)
            {
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
@@ -38,6 +38,12 @@
            this.ClearBodyFrame();
            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac);
            var oTADevice = Common.LocalDevice.Current.GetOTADevice(i_deviceMac);
            if (listDevice.Count == 0)
            {
                //针对单纯只有一个200端点的设备
                listDevice.Add(oTADevice);
            }
            var listView = new VerticalListControl(12);
            listView.BackgroundColor = UserCenterColor.Current.White;
@@ -76,9 +82,8 @@
                rowImage.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uImageId), 400);
                rowImage.AddMostRightView(otaDevice.ImgTypeId.ToString(), 400);
                rowImage.AddBottomLine();
            }
            }
            var oTADevice = Common.LocalDevice.Current.GetOTADevice(listDevice[0].DeviceAddr);
            if (oTADevice != null)
            {
                //固件版本
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -154,6 +154,8 @@
            //获取设备列表
            string gwID = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway);
            var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(gwID);
            var listSpecialOta = Common.LocalDevice.Current.GetSpecialOtaDevice(gwID);
            listDevice.AddRange(listSpecialOta);
            this.dicRowInfo.Clear();
@@ -229,7 +231,7 @@
            //检测设备是否拥有定位的功能
            var listdevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
            if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
            if (listdevice.Count > 0 && Common.LocalDevice.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
            {
                //定位
                var btnPosition = new NormalViewControl(Application.GetRealWidth(184), rowMenu.Height, false);
@@ -845,8 +847,14 @@
                var localDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceAddr);
                if (localDevice.Count == 0)
                {
                    //入网之后,又把它删了
                    return;
                    //针对单纯只有一个200端点的设备
                    var ota = Common.LocalDevice.Current.GetOTADevice(deviceAddr);
                    if (ota == null)
                    {
                        //入网之后,又把它删了
                        return;
                    }
                    localDevice.Add(ota);
                }
                var rowNewInfo = new DeviceObjRowInfo();
                rowNewInfo.DeviceMac = deviceAddr;
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -45,6 +45,11 @@
        public void ShowForm(string deviceMac)
        {
            this.listNewDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
            if (listNewDevice.Count == 0)
            {
                //针对单纯只有一个200端点的设备
                listNewDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
            }
            this.listDeviceType.Clear();
            foreach (var device in listNewDevice)
@@ -131,6 +136,11 @@
            {
                foreach (var device in this.listNewDevice)
                {
                    if (device is OTADevice)
                    {
                        //针对单纯只有一个200端点的设备
                        continue;
                    }
                    var room = Room.CurrentRoom.GetRoomByDevice(device);
                    string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device);
                    if (room == null)
@@ -724,10 +734,12 @@
        /// </summary>
        private void AddIndoorUnitSettionRow()
        {
            if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.AirConditioner_ZbGateway)
            if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.AirConditioner_ZbGateway
                || this.listNewDevice[0] is OTADevice)//追加:单纯只有200端点的话,不显示这个菜单
            {
                return;
            }
            //室内机设置
            string caption = Language.StringByID(R.MyInternationalizationString.uIndoorUnitSettion);
            var btnFunction = new FrameRowControl(listview.rowSpace / 2);
@@ -937,7 +949,7 @@
                {
                    //中央空调的升级的话,是特殊的
                    var form = new DeviceAirConditioner.ACZbGatewayUpdateMenuForm();
                    form.AddForm((AC)listNewDevice[0], btnNewVersion.Visible);
                    form.AddForm(listNewDevice[0], btnNewVersion.Visible);
                }
                btnNewVersion.Visible = false;
            };
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -363,43 +363,20 @@
                //使用确认型弹框时,的回调函数
                alertRemoteUnlockRequest.ConfirmClickEvent += () =>
                {
                    if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                    var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                    Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                    Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                    functionSetting.Show();
                    functionSetting.devicNameAction += (deviceRename) =>
                    {
                        var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                        Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                        functionSetting.Show();
                        functionSetting.devicNameAction += (deviceRename) =>
                        if (!string.IsNullOrEmpty(deviceRename))
                        {
                            if (!string.IsNullOrEmpty(deviceRename))
                            if (btnDoorLockTitle != null)
                            {
                                if (btnDoorLockTitle != null)
                                {
                                    btnDoorLockTitle.Text = deviceRename;
                                }
                                btnDoorLockTitle.Text = deviceRename;
                            }
                        };
                    }
                    else
                    {
                        var functionSettingSub = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
                        Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSettingSub);
                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                        functionSettingSub.Show();
                        functionSettingSub.devicNameAction += (deviceRename) =>
                        {
                            if (!string.IsNullOrEmpty(deviceRename))
                            {
                                if (!string.IsNullOrEmpty(deviceRename))
                                {
                                    if (btnDoorLockTitle != null)
                                    {
                                        btnDoorLockTitle.Text = deviceRename;
                                    }
                                }
                            }
                        };
                    }
                        }
                    };
                };
                return;
            }
@@ -534,43 +511,20 @@
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.DoorlockPasswordDispear), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
                                        CommonPage.Loading.Hide();
                                        doorLock.RemoteUnlockPassword = "";
                                        if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                                        var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                                        Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                        functionSetting.Show();
                                        functionSetting.devicNameAction += (deviceRename) =>
                                        {
                                            var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                                            Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                                            Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                            functionSetting.Show();
                                            functionSetting.devicNameAction += (deviceRename) =>
                                            if (!string.IsNullOrEmpty(deviceRename))
                                            {
                                                if (!string.IsNullOrEmpty(deviceRename))
                                                if (btnDoorLockTitle != null)
                                                {
                                                    if (btnDoorLockTitle != null)
                                                    {
                                                        btnDoorLockTitle.Text = deviceRename;
                                                    }
                                                    btnDoorLockTitle.Text = deviceRename;
                                                }
                                            };
                                        }
                                        else
                                        {
                                            var functionSettingSub = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
                                            Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSettingSub);
                                            Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                            functionSettingSub.Show();
                                            functionSettingSub.devicNameAction += (deviceRename) =>
                                            {
                                                if (!string.IsNullOrEmpty(deviceRename))
                                                {
                                                    if (!string.IsNullOrEmpty(deviceRename))
                                                    {
                                                        if (btnDoorLockTitle != null)
                                                        {
                                                            btnDoorLockTitle.Text = deviceRename;
                                                        }
                                                    }
                                                }
                                            };
                                        }
                                            }
                                        };
                                    });
                                }
                            }
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -7,19 +7,23 @@
{
    public class FunctionSetting : DoorLockCommonLayout, ZigBee.Common.IStatus
    {
        #region ◆ 构造函数__________________________
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="doorLock"></param>
        public FunctionSetting(ZigBee.Device.DoorLock doorLock)
        {
            //闪退
            this.doorLock = doorLock;
            listNewDevice.Add(doorLock);
            BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
            ZigBee.Device.ZbGateway.StatusList.Add(this);
        }
        #endregion
        #region ◆ 变量申明__________________________
        ZigBee.Device.DoorLock doorLock;
        public ZigBee.Device.DoorLock doorLock = null;
        /// <summary>
        /// 设备需要保存的设备名字
        /// </summary>
@@ -36,13 +40,20 @@
        /// 设备的某一回路
        /// </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>
@@ -61,7 +72,9 @@
            MidFrameLayoutContent();
        }
        #endregion
        #region ◆ 中部显示 __________________________
        public void MidFrameLayoutContent()
        {
            var MidTopFrameLayout = new FrameLayout()
@@ -87,28 +100,13 @@
            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 bottomFrameLayout = new FrameLayout()
            bottomFrameLayout = new FrameLayout()
            {
                Height = Application.GetRealHeight(1319),
                Y = Application.GetRealHeight(418),
@@ -129,323 +127,350 @@
            };
            bottomFrameLayout.AddChidren(informationEdit);
            for (int i = 0; i < 6; i++)
            listview = new VerticalListControl()
            {
                var bottomRowLayout = new FrameLayout()
                Height = Application.GetRealHeight(1319 - 141),
                Y = Application.GetRealHeight(170),
            };
            bottomFrameLayout.AddChidren(listview);
            #endregion
            FunctionDetail(doorLock);
        }
        #endregion
        #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)
                {
                    Height = Application.GetRealHeight(58),
                };
                bottomFrameLayout.AddChidren(bottomRowLayout);
                var btnName = new Button()
                {
                    Width = Application.GetRealWidth(233),
                    Height = Application.GetRealHeight(58),
                    X = Application.GetRealWidth(58),
                    TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = 14,
                };
                bottomRowLayout.AddChidren(btnName);
                var btnNextFrameLayout = new FrameLayout()
                {
                    Width = Application.GetRealWidth(104),
                    Height = Application.GetRealHeight(58),
                    X = Application.GetRealWidth(861 + 58),
                };
                bottomRowLayout.AddChidren(btnNextFrameLayout);
                var btnNext = new Button()
                {
                    Width = Application.GetRealWidth(58),
                    Height = Application.GetRealHeight(58),
                    X = Application.GetRealWidth(46)
                };
                btnNextFrameLayout.AddChidren(btnNext);
                var btnLine = new FrameLayout()
                {
                    Width = Application.GetRealWidth(965),
                    Height = 1,
                    X = Application.GetRealWidth(58),
                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                    Visible = false,
                };
                bottomFrameLayout.AddChidren(btnLine);
                if (i == 0)
                {
                    bottomRowLayout.Y = Application.GetRealHeight(220);
                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm) + ":";
                    btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58 - 20);
                    btnNextFrameLayout.X = Application.GetRealWidth(233 + 20);
                    var btnDeviceNameEditText = new EditText()
                    {
                        X = Application.GetRealWidth(46),
                        Width = Application.GetRealWidth(731),
                        Height = Application.GetRealHeight(58),
                        TextColor = ZigbeeColor.Current.XMGray3,
                        TextSize = 14,
                        PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
                        TextAlignment = TextAlignment.CenterLeft,
                        Text = string.IsNullOrEmpty(doorLock.DeviceName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : doorLock.DeviceName,
                    };
                    btnNextFrameLayout.AddChidren(btnDeviceNameEditText);
                    btnDeviceNameEditText.TextChangeEventHandler += (sender, e) =>
                    {
                        modifyDeviceName = btnDeviceNameEditText.Text;
                    };
                    Action<Shared.View> actionEdit = async (obj) =>
                     {
                         try
                         {
                             Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
                             var doorLockDeviceList = new List<CommonDevice> { };
                             doorLockDeviceList.Add(doorLock);
                             var result = await Common.LocalDevice.Current.ReMacName(doorLockDeviceList, btnDeviceNameEditText.Text);
                             if (result)
                             {
                                 IsModifyName = false;
                             }
                             else
                             {
                                 IsModifyName = true;
                             }
                         }
                         catch { }
                         finally
                         {
                             Application.RunOnMainThread(() =>
                             {
                                 CommonPage.Loading.Hide();
                             });
                         }
                     };
                    btnDeviceNameEditText.EditorEnterAction += actionEdit;
                    btnLine.Visible = true;
                    btnLine.Y = Application.GetRealHeight(303);
                    btnNote.Text = oldName;
                }
                else if (i == 1)
                if (oldName != btnNote.Text)
                {
                    bottomRowLayout.Y = Application.GetRealHeight(312);
                    bottomRowLayout.Height = Application.GetRealHeight(127);
                    btnName.Width = Application.GetRealWidth(0);
                    btnNextFrameLayout.Width = Application.GetRealWidth(0);
                    //所属区域
                    var rowBeloneArea = new BelongAreaControl(0);
                    bottomRowLayout.AddChidren(rowBeloneArea);
                    //修改名字
                    this.DeviceReName(btnNote.Text, false);
                }
            };
                    rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), doorLock);
                    //底线
                    rowBeloneArea.AddBottomLine();
                    rowBeloneArea.SelectRoomEvent += (roomKeys) =>
            //所属区域
            var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
            listview.AddChidren(rowBeloneArea);
            rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), this.listNewDevice);
            //底线
            rowBeloneArea.AddBottomLine();
            var listCheck = new List<string>();
            rowBeloneArea.SelectRoomEvent += (roomKeys) =>
            {
                foreach (var device in this.listNewDevice)
                {
                    var room = Room.CurrentRoom.GetRoomByDevice(device);
                    string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device);
                    if (room == null)
                    {
                        //变更房间
                        Common.Room.CurrentRoom.ChangedRoom(doorLock, roomKeys);
                    };
                    btnLine.Visible = false;
                }
                else if (i == 2)
                {
                    bottomRowLayout.Y = Application.GetRealHeight(481);
                    btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongModel) + ":";
                    btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58 - 20);
                    btnNextFrameLayout.X = Application.GetRealWidth(253);
                    btnNext.TextAlignment = TextAlignment.CenterLeft;
                    btnNext.Height = Application.GetRealHeight(58);
                    btnNext.Text = doorLock.DeviceName;
                    btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
                    btnNext.TextSize = 14;
                    btnLine.Visible = true;
                    btnLine.Y = Application.GetRealHeight(575);
                }
                else if (i == 3)
                {
                    bottomRowLayout.Y = Application.GetRealHeight(585 + 35);
                    btnName.Text = Language.StringByID(R.MyInternationalizationString.TemporaryPassword);
                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
                    btnLine.Visible = true;
                    btnLine.Y = Application.GetRealHeight(714);
                }
                else if (i == 4)
                {
                    bottomRowLayout.Y = Application.GetRealHeight(723 + 35);
                    btnNext.X = Application.GetRealWidth(0);
                    btnName.Text = Language.StringByID(R.MyInternationalizationString.RemotelyUnlock);
                    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(853);
                    if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
                        //这里有点特殊,如果回路没有设置有区域的时候,才设置
                        listCheck.Add(mainKeys);
                        Room.CurrentRoom.ChangedRoom(device, roomKeys);
                    }
                    else if (listCheck.Contains(mainKeys) == true)
                    {
                        btnNext.IsSelected = false;
                        //如果这个回路之前都还没有区域,在本界面还没有关闭之前,可以无条件随便变更
                        Room.CurrentRoom.ChangedRoom(device, roomKeys);
                    }
                }
                //保存设备房间索引
                Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys);
            };
            //设备模块
            caption = Language.StringByID(R.MyInternationalizationString.BelongModel);
            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)
                {
                    btnNote.Text = oldName;
                }
                if (oldName != btnNote.Text.Trim())
                {
                    //修改名字
                    this.DeviceReName(btnNote.Text.Trim(), true);
                }
                else
                {
                    //关闭自身
                    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, action);
                };
                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;
                    }
                    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 result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid);
                        if (result1 == true)
                        {
                            if (btnswitch.IsSelected == true)
                            {
                                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
                        {
                            this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.NoAccess));
                        }
                    }
                    else
                    {
                        btnNext.IsSelected = true;
                        this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AccountIsFreezed));
                    }
                }
                else if (i == 5)
                {
                    bottomRowLayout.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(992);
                }
                int currentIndex = i;
                EventHandler<MouseEventArgs> eHandler = async (sender, e) =>
                 {
                     if (currentIndex == 3)
                     {
                         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, action);
                         };
                         HdlCheckLogic.Current.CheckSecondarySecurity(action, actionNone);
                     }
                     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 (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
                                         {
                                             RemotePasswordDialog(doorLock, btnNext);
                                         }
                                     }
                                     else
                                     {
                                         doorLock.RemoteUnlockPassword = "";
                                     }
                                 }
                                 else
                                 {
                                     new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.NoAccess), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                 }
                             }
                             else
                             {
                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                             }
                         }
                         else
                         {
                             btnNext.IsSelected = !btnNext.IsSelected;
                             if (btnNext.IsSelected)
                             {
                                 if (string.IsNullOrEmpty(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.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                         }
                     }
                 };
                btnNext.MouseDownEventHandler += eHandler;
                if (i != 4)
                {
                    bottomRowLayout.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,
                IsBold = true,
            };
            this.midFrameLayout.AddChidren(btnFinifh);
            btnFinifh.MouseUpEventHandler += (sender, e) =>
            {
                System.Threading.Tasks.Task.Run(async () =>
                {
                    Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
                    try
                    {
                        if (IsModifyName)
                        {
                            var doorLockDeviceList = new List<CommonDevice> { };
                            doorLockDeviceList.Add(doorLock);
                            var result = await Common.LocalDevice.Current.ReMacName(doorLockDeviceList, modifyDeviceName);
                            if (result)
                            {
                                if (devicNameAction != null)
                                {
                                    devicNameAction(modifyDeviceName);
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        var mess = ex.Message;
                    }
                    finally
                    {
                        Application.RunOnMainThread(() =>
                        {
                            CommonPage.Loading.Hide();
                        });
                    }
                });
            };
        }
        #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
                    {
                        this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AccountIsFreezed));
                    }
                }
            };
        }
        #endregion
        #region ◆ 设备重命名__________________________
        /// <summary>
        /// 设备重命名
        /// </summary>
        /// <param name="i_deviceName">deviceName.</param>
        private async void DeviceReName(string i_deviceName, bool closeForm)
        {
            //开启进度条
            this.ShowProgressBar();
            //修改MAC名
            string deviceName = i_deviceName.Trim();
            var result = await 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 ◆ 行数超过容器时,补一个空白FrameLayout__________________________
        /// <summary>
        /// 行数超过容器时,补一个空白FrameLayout,使之能滑动
        /// </summary>
        void FinishInitControl(FrameLayout bodyFrameLayout, VerticalListControl listview)
        {
            var btnFinish = new BottomClickButton();
            btnFinish.Y = Application.GetRealHeight(1054);
            if (listview.ChildrenCount > 0)
            {
                var realHeight = listview.GetChildren(0).Height * listview.ChildrenCount;
                if (bodyFrameLayout.Height - btnFinish.Y + realHeight > listview.Height)
                {
                    //促使被挡住的菜单能够向上滑动
                    var frameTemp = new FrameLayout();
                    frameTemp.Height = bodyFrameLayout.Height - btnFinish.Y + Application.GetRealHeight(115);
                    listview.AddChidren(frameTemp);
                }
            }
        }
        #endregion
        #region ◆ 接口实现__________________________
        /// <summary>
        /// 处理变化事件 --将弃用 改用DeviceInfoChange()
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -66,37 +66,20 @@
            btnFuncSetFrameLayout.AddChidren(btnFuncSet);
            btnFuncSet.MouseDownEventHandler += (sender, e) =>
            {
                if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                functionSetting.Show();
                functionSetting.devicNameAction += (deviceRename) =>
                {
                    var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                    Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                    Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                    functionSetting.Show();
                    functionSetting.devicNameAction += (deviceRename) =>
                    if (!string.IsNullOrEmpty(deviceRename))
                    {
                        if (!string.IsNullOrEmpty(deviceRename))
                        {
                            btnDoorLockTitle.Text = deviceRename;
                            //改房间
                            Shared.Common.Room.CurrentRoom.ChangedRoom(deviceUI.CommonDevice, currentRoom.Id);
                            deviceUI.CommonDevice.ReSave();
                        }
                    };
                }
                else
                {
                    var functionSettingSub = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
                    Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSettingSub);
                    Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                    functionSettingSub.Show();
                    functionSettingSub.devicNameAction += (deviceRename) =>
                    {
                        if (!string.IsNullOrEmpty(deviceRename))
                        {
                            btnDoorLockTitle.Text = deviceRename;
                        }
                    };
                }
                        btnDoorLockTitle.Text = deviceRename;
                        //改房间
                        Shared.Common.Room.CurrentRoom.ChangedRoom(deviceUI.CommonDevice, currentRoom.Id);
                        deviceUI.CommonDevice.ReSave();
                    }
                };
            };
            btnShare.MouseDownEventHandler += (sender, e) =>
@@ -127,10 +110,10 @@
                Height = Application.GetRealHeight(60),
                X = Application.GetRealWidth(372),
                Y = Application.GetRealHeight(46),
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack ,
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 15,
                TextAlignment = TextAlignment.Center,
                IsBold =true,
                IsBold = true,
            };
            midTopFrameLayout.AddChidren(btnDoorLockTitle);
            //获取Mac名字