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/CommonForm/DeviceDetailInfo.cs |   62 +++++++++++++++---------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs
index 9384b38..1b5cb52 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs
@@ -21,7 +21,7 @@
         /// <summary>
         /// action
         /// </summary>
-        public Action<DeviceUI,Common.Room> EditAction;
+        public Action<CommonDevice, Common.Room> EditAction;
         /// <summary>
         /// curRoom
         /// </summary>
@@ -70,7 +70,7 @@
         /// </summary>
         /// <param name="device"></param>
         /// <param name="room"></param>
-        public void Show(DeviceUI device, Common.Room room)
+        public void Show(CommonDevice device, Common.Room room)
         {
             Init(device);
 
@@ -102,7 +102,7 @@
         /// <summary>
         /// AddBodyView
         /// </summary>
-        public void AddBodyView(DeviceUI device, Common.Room room)
+        public void AddBodyView(CommonDevice device, Common.Room room)
         {
             bodyFrameLayout = new FrameLayout()
             {
@@ -144,7 +144,7 @@
             };
             bodyFrameLayout.AddChidren(deviceIMG);
 
-            var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice);
+            var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device);
 
             var deviceTypeName = new Button()
             {
@@ -199,7 +199,7 @@
             var nameRow = new DeviceInfoEditRow(12);
             nameRow.Init();
             nameRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.FunctionName)} : ");
-            nameRow.SetTitle(string.IsNullOrEmpty(Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice));
+            nameRow.SetTitle(string.IsNullOrEmpty(Common.LocalDevice.Current.GetDeviceEpointName(device)) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : Common.LocalDevice.Current.GetDeviceEpointName(device));
             nameFL.AddChidren(nameRow);
 
 
@@ -225,11 +225,11 @@
             var modelRow = new DeviceInfoRow(12);
             modelRow.Init();
             modelRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongModel)} : ");
-            modelRow.SetTitle(string.IsNullOrEmpty(device.CommonDevice.DeviceName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : device.CommonDevice.DeviceName);
+            modelRow.SetTitle(string.IsNullOrEmpty(device.DeviceName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : device.DeviceName);
             modelRow.HideNext(true);
             modelFL.AddChidren(modelRow);
 
-            if (device.CommonDevice.Type==DeviceType.OnOffOutput || device.CommonDevice.Type==DeviceType.AirSwitch)
+            if (device.Type == DeviceType.OnOffOutput || device.Type == DeviceType.AirSwitch)
             {
                 var typeFL = new FrameLayout
                 {
@@ -241,7 +241,7 @@
                 functionTypeRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.FunctionType)} : ");
                 //functionTypeRow.SetTitle(device.CommonDevice.DfunctionType);
                 typeFL.AddChidren(functionTypeRow);
-                var dfunctionType = device.CommonDevice.DfunctionType;
+                var dfunctionType = device.DfunctionType;
 
                 //鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛�
                 string strT = string.Empty;
@@ -261,7 +261,7 @@
 
                 functionTypeRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
                 {
-                    var DfunctionType = device.CommonDevice.DfunctionType;
+                    var DfunctionType = device.DfunctionType;
 
                     //鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛�
                     int nowSelectNo = 1;
@@ -298,15 +298,15 @@
                         //璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨�
                         if (selectNo == 0)
                         {
-                            device.CommonDevice.DfunctionType  = DeviceFunctionType.A寮�鍏�;
+                            device.DfunctionType  = DeviceFunctionType.A寮�鍏�;
                         }
                         else if (selectNo == 1)
                         {
-                            device.CommonDevice.DfunctionType = DeviceFunctionType.A鐏厜;
+                            device.DfunctionType = DeviceFunctionType.A鐏厜;
                         }
                         else
                         {
-                            device.CommonDevice.DfunctionType = DeviceFunctionType.A鎻掑骇;
+                            device.DfunctionType = DeviceFunctionType.A鎻掑骇;
                         }
                     };
                 };
@@ -325,7 +325,7 @@
                 zone.ZoneAction += (selectRoom) =>
                 {
                     curRoom = selectRoom;
-                    zoneRow.SetTitle(selectRoom.GetZoneName());
+                    zoneRow.SetTitle(HdlRoomLogic.Current.GetZoneName(selectRoom));
                 };
             };
             zoneRow.ClickBtn.MouseUpEventHandler += selectZoneEvent;
@@ -340,7 +340,7 @@
                 {
                     deviceIMG.UnSelectedImagePath = unSelectedImagePath;
                     deviceIMG.SelectedImagePath = selectedImagePath;
-                    device.CommonDevice.IsCustomizeImage = true;
+                    device.IsCustomizeImage = true;
                 };
             };
             deviceIMG.MouseUpEventHandler += selectDeviceIconEvent;
@@ -350,51 +350,51 @@
                 try
                 {
                     CommonPage.Loading.Start();
-                    if (device.CommonDevice == null)
+                    if (device == null)
                     {
                         CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain));
                         return;
                     }
-                    if (device.CommonDevice.Type == DeviceType.OnOffOutput || device.CommonDevice.Type == DeviceType.AirSwitch)
+                    if (device.Type == DeviceType.OnOffOutput || device.Type == DeviceType.AirSwitch)
                     {
                         if (device.IsCustomizeImage == false)
                         {
-                            if (device.CommonDevice.DfunctionType == DeviceFunctionType.A寮�鍏�)
+                            if (device.DfunctionType == DeviceFunctionType.A寮�鍏�)
                             {
-                                device.CommonDevice.IconPath = "Device/Switch.png";
+                                device.IconPath = "Device/Switch.png";
                             }
-                            else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A鎻掑骇)
+                            else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇)
                             {
-                                device.CommonDevice.IconPath = "Device/Socket1.png";
+                                device.IconPath = "Device/Socket1.png";
                             }
-                            else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A鐏厜)
+                            else if (device.DfunctionType == DeviceFunctionType.A鐏厜)
                             {
-                                device.CommonDevice.IconPath = "Device/Light.png";
+                                device.IconPath = "Device/Light.png";
                             }
                         }
                         else
                         {
                             //鏀瑰浘鐗�
-                            device.CommonDevice.IconPath = deviceIMG.UnSelectedImagePath;
+                            device.IconPath = deviceIMG.UnSelectedImagePath;
                         }
                     }
                     else
                     {
                         //鏀瑰浘鐗�
-                        device.CommonDevice.IconPath = deviceIMG.UnSelectedImagePath;
+                        device.IconPath = deviceIMG.UnSelectedImagePath;
                     }
                     bool result;
                     new System.Threading.Thread(async () =>
                     {
-                        result = await LocalDevice.Current.ReName(device.CommonDevice, nameRow.NameText.Text.Trim());
+                        result = await LocalDevice.Current.ReName(device, nameRow.NameText.Text.Trim());
                         Application.RunOnMainThread(() =>
                         {
                             CommonPage.Loading.Hide();
                             if (result)
                             {
                                 //鏀规埧闂�
-                                Shared.Common.Room.CurrentRoom.ChangedRoom(device.CommonDevice, curRoom.Id);
-                                device.CommonDevice.ReSave();
+                                HdlRoomLogic.Current.ChangedRoom(device, curRoom.Id);
+                                device.ReSave();
                                 EditAction?.Invoke(device, curRoom);
                                 RemoveFromParent();
                             }
@@ -419,11 +419,11 @@
         /// Init
         /// </summary>
         /// <param name="device"></param>
-        public void Init(DeviceUI device)
+        public void Init(CommonDevice device)
         {
-            roomName = device.GetZone();
-            befRoom = Common.Room.CurrentRoom.GetRoomByDevice(device.CommonDevice);
-            curRoom = Common.Room.CurrentRoom.GetRoomByDevice(device.CommonDevice);
+            roomName = HdlRoomLogic.Current.GetRoomNameByDevice(device, "锛�");
+            befRoom = HdlRoomLogic.Current.GetRoomByDevice(device);
+            curRoom = HdlRoomLogic.Current.GetRoomByDevice(device);
         }
         #endregion
     }

--
Gitblit v1.8.0