From a5b3c4bae726ef6770d4bfcbf2f4b50a37ed4a15 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 06 三月 2020 15:31:36 +0800
Subject: [PATCH] 删除了郭雪城的 DeviceUi 这个类

---
 ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs |   60 ++++++++++++++++++++++++++++++++----------------------------
 1 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs
index 2ea8539..14b9580 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs
@@ -46,6 +46,7 @@
                 Height = Application.GetRealHeight(69),
                 Y = Application.GetRealHeight(92),
                 TextID = MyInternationalizationString.devicestate,
+                IsBold = true,
             };
             topRowLayout.AddChidren(titleName);
 
@@ -106,7 +107,8 @@
 
 
             ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
-            if (Common.Room.Lists.Count == 0)
+            var listAllRoom = UserCenter.HdlRoomLogic.Current.GetAllListRooms();
+            if (listAllRoom.Count == 0)
             {
                 return;
             }
@@ -133,7 +135,7 @@
 
             };
             this.AddChidren(devicetypehorizontalScrol);
-            devicetypehorizontalScrol.SetCornerWithSameRadius(20, HDLUtils.RectCornerBottomLeft);
+            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
 
             middle = new VerticalScrolViewLayout();
             middle.Y = devicetypehorizontalScrol.Bottom + Application.GetRealHeight(40);
@@ -142,7 +144,7 @@
             middle.X = Application.GetRealWidth(58);
             //middle.Radius = (uint)Application.GetRealHeight(50);
             this.AddChidren(middle);
-            middle.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft);
+            middle.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
 
             ///鐩墠鏀寔鐨勮澶�
             List<DeviceType> deviceTypeList = new List<DeviceType> {
@@ -264,7 +266,7 @@
                 dropdown.Visible = false;
                 if (Config.Instance.Home.FloorDics.Count == 0)
                 {
-                    roomlists.AddRange(Common.Room.Lists);
+                    roomlists.AddRange(listAllRoom);
                 }
                 else
                 {
@@ -324,15 +326,16 @@
 
                     roomTextButton.IsSelected = false;
                     roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
+                    roomnameBtn.IsSelected = true;
+                    var list = new List<CommonDevice>();
+                    foreach (var deviceKeys in room.ListDevice)
                     {
-                        if (device.CommonDevice == null)
+                        var device = LocalDevice.Current.GetDevice(deviceKeys);
+                        if (device == null)
                         {
                             continue;
                         }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
+                        if (!deviceTypeList.Contains(device.Type))
                         {
                             continue;
                         }
@@ -363,15 +366,16 @@
 
                     roomTextButton.IsSelected = false;
                     roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
+                    roomnameBtn.IsSelected = true;
+                    var list = new List<CommonDevice>();
+                    foreach (var deviceKeys in room.ListDevice)
                     {
-                        if (device.CommonDevice == null)
+                        var device = LocalDevice.Current.GetDevice(deviceKeys);
+                        if (device == null)
                         {
                             continue;
                         }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
+                        if (!deviceTypeList.Contains(device.Type))
                         {
                             continue;
                         }
@@ -402,29 +406,29 @@
         /// <summary>
         ///鍔犺浇璇ュ尯鍩熸墍鏈夎澶囩殑瑙嗗浘鏂规硶
         /// </summary>
-        void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol)
+        void AllDeviceTypeView(List<CommonDevice> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol)
         {
 
             List<string> devicetypelist = new List<string>();
             devicetypelist.Clear();
 
             #region  ------鎺掑垪璁惧绫诲瀷------
-            var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput);
+            var lightjosn = devicelist.Find((device) => device.Type == DeviceType.DimmableLight || device.Type == DeviceType.OnOffOutput);
             if (lightjosn != null)
             {
                 devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
             }
-            var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice);
+            var curtainjosn = devicelist.Find((device) => device.Type == DeviceType.WindowCoveringDevice);
             if (curtainjosn != null)
             {
                 devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
             }
-            var ac = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.Thermostat);
+            var ac = devicelist.Find((device) => device.Type == DeviceType.Thermostat);
             if (ac != null)
             {
                 devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC));
             }
-            var airSwitch = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.AirSwitch);
+            var airSwitch = devicelist.Find((device) => device.Type == DeviceType.AirSwitch);
             if (airSwitch != null)
             {
                 devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch));
@@ -547,13 +551,13 @@
         /// 鍔犺浇璇ョ被鍨嬭澶囪鍥炬柟娉�
         /// </summary>
         /// <param name="devicelist">璁惧鍒楄〃</param>
-        void ActionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist)
+        void ActionDeviceView(List<DeviceType> deviceTypelist, List<CommonDevice> devicelist)
         {
             middle.RemoveAll();
             foreach (var common in devicelist)
             {
 
-                if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type))
+                if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.Type))
                 {
                     continue;
                 }
@@ -597,14 +601,14 @@
 
                 var devicename = new Button
                 {
-                    Text = common.CommonDevice.DeviceEpointName,
+                    Text = common.DeviceEpointName,
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                     SelectedTextColor = ZigbeeColor.Current.LogicAddColor,
                     TextSize = 14,
                 };
                 deviceRow.AddChidren(devicename);
-                switch (common.CommonDevice.Type)
+                switch (common.Type)
                 {
 
                     case DeviceType.OnOffOutput:
@@ -654,7 +658,7 @@
 
                     var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
                     this.AddChidren(flMain);
-                    CurrentDeviceStateView(flMain, common.CommonDevice, false);
+                    CurrentDeviceStateView(flMain, common, false);
                 };
                 deviceFramelayout.MouseUpEventHandler += devicclick;
                 bjFramelayout.MouseUpEventHandler += devicclick;
@@ -691,7 +695,7 @@
                // Radius = (uint)Application.GetRealHeight(60),
             };
             flMain.AddChidren(devicefra);
-            devicefra.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
+            devicefra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
 
             #region  -------鍙栨秷   瀹屾垚
             var timetype = new RowLayout
@@ -2069,9 +2073,9 @@
                 {
                     if (!edit)
                     {
-                        var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
-                                               Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
-                                               Language.StringByID(MyInternationalizationString.complete));
+                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+                        Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
+                        Language.StringByID(MyInternationalizationString.confrim));
                         alert.Show();
                         return;
                     }

--
Gitblit v1.8.0