陈嘉乐
2020-09-02 e79b65b97a8ae1eae5ee172dea1b52d041006599
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
@@ -7,6 +7,9 @@
using static ZigBee.Device.Panel;
namespace Shared.Phone.UserCenter.DeviceBind
{
    /// <summary>
    /// 普通面板的绑定设备界面【可绑定多个设备】
    /// </summary>
    public class AddDevicePage : BindCommonLayout
    {
        /// 构造函数
@@ -234,8 +237,8 @@
                }
            }
            else
            {
                // 获取楼层对应对房间
            {
                // 获取楼层对应对房间
                var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
                foreach (var room in listAllRoom)
                {
@@ -354,10 +357,12 @@
                    continue;
                }
                roomTempList.Add(room);
                if (roomTempList.Count != 0)
                {
                    curRoom = roomTempList[0];
                }
            }
            for (int i = 0; i < roomTempList.Count; i++)
            {
                var room = roomTempList[i];
                curRoom = roomTempList[0];
                var btnRoomFrameLayout = new FrameLayout
                {
@@ -373,7 +378,7 @@
                var btnRoom = new Button
                {
                    Height = Application.GetRealHeight(58),
                    Width = Application.GetRealWidth(127),
                    Width = Application.GetRealWidth(255),
                    Y = Application.GetRealHeight(58),
                    X = Application.GetRealWidth(14),
                    Text = room.Name,
@@ -390,6 +395,18 @@
                    btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite;
                    curentOldRoom = btnRoom;
                    curentOldRoomFrameLayout = btnRoomFrameLayout;
                }
                if (index == roomTempList.Count - 1 && index > 2)
                {
                    var btnRoomFrameLayoutEmpty = new FrameLayout
                    {
                        Height = Application.GetMinReal(159),
                        Width = Application.GetMinReal(50),
                        Y = Application.GetRealHeight(23),
                        X = Application.GetRealWidth(5),
                        BorderWidth = 1,
                    };
                    btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayoutEmpty);
                }
                EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                {
@@ -416,7 +433,6 @@
                        curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png";
                    }
                    curRoom = room;
                    currentKey.RoomId = room.Id;
                    RefreshDeviceList(curRoom);
                    if (curTypeDeviceList.Count == 0)
                    {
@@ -453,7 +469,7 @@
        /// <returns></returns>
        List<CommonDevice> GetALlDispalyRoomDeviceList()
        {
            currentKeyAllRoomDeviceList.Clear();
            currentKeyAllRoomDeviceList.Clear();
            var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
            switch (curDeviceBindType)
            {
@@ -492,7 +508,7 @@
                        if (r.IsLove == true)
                        {
                            continue;
                        }
                        }
                        foreach (var deviceKeys in r.ListDevice)
                        {
                            var device = LocalDevice.Current.GetDevice(deviceKeys);
@@ -548,9 +564,9 @@
            switch (curDeviceBindType)
            {
                case "AddSwitch":
                    foreach (var deviceKeys in curRoom.ListDevice)
                    {
                        var device = LocalDevice.Current.GetDevice(deviceKeys);
                    foreach (var deviceKeys in curRoom.ListDevice)
                    {
                        var device = LocalDevice.Current.GetDevice(deviceKeys);
                        if (device != null)
                        {
                            var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 6));
@@ -561,10 +577,10 @@
                        }
                    }
                    break;
                case "AddDimmer":
                    foreach (var deviceKeys in curRoom.ListDevice)
                    {
                        var device = LocalDevice.Current.GetDevice(deviceKeys);
                case "AddDimmer":
                    foreach (var deviceKeys in curRoom.ListDevice)
                    {
                        var device = LocalDevice.Current.GetDevice(deviceKeys);
                        if (device != null)
                        {
                            var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 8));
@@ -575,10 +591,10 @@
                        }
                    }
                    break;
                case "AddCurtain":
                    foreach (var deviceKeys in curRoom.ListDevice)
                    {
                        var device = LocalDevice.Current.GetDevice(deviceKeys);
                case "AddCurtain":
                    foreach (var deviceKeys in curRoom.ListDevice)
                    {
                        var device = LocalDevice.Current.GetDevice(deviceKeys);
                        if (device != null)
                        {
                            var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 258));
@@ -839,9 +855,9 @@
                        btnMethodText.IsSelected = true;
                        oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        oldbuttonText.IsBold = true;
                    }
                    //获取楼层对应的房间
                    }
                    //获取楼层对应的房间
                    var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
                    foreach (var room in listAllRoom)
                    {