From 0e4ad9a4de5b95f58daf1a6c5072c6a57cf223f9 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期一, 30 十二月 2019 10:02:10 +0800
Subject: [PATCH] 2019.12.30

---
 ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs |   34 ++++++++++++++++++++++++----------
 1 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
index e620358..0d012e2 100644
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
@@ -16,10 +16,16 @@
         /// </summary>
         public Action action;
 
+        FrameLayout roomNameBackground;
+
+        FrameLayout roomTemperatureBackground;
+
+        Button roomListBtn;
+
         public override void RemoveFromParent()
         {
-            HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice");
-            HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice");
+            HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice" + room.Id);
+            HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice" + room.Id);
             base.RemoveFromParent();
         }
 
@@ -58,7 +64,7 @@
             };
             roomBackView.AddChidren(roomImg);
 
-            var roomNameBackground = new FrameLayout
+            roomNameBackground = new FrameLayout
             {
                 X = Application.GetRealWidth(29),
                 Y = Application.GetRealHeight(282),
@@ -79,7 +85,7 @@
             roomNameBackground.AddChidren(roomName);
 
 
-            var roomTemperatureBackground = new FrameLayout
+            roomTemperatureBackground = new FrameLayout
             {
                 X = Application.GetRealWidth(29),
                 Y = Application.GetRealHeight(374),
@@ -133,8 +139,8 @@
 
             if (string.IsNullOrEmpty(room.TemperatrueDevice) == false)
             {
-                HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice");
-                HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (Action<ZigBee.Device.CommonDevice>)((report) =>
+                HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice" + room.Id);
+                HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice" + room.Id, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
                 {
                     string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report);
                     if (room.TemperatrueDevice != mainKeys)
@@ -173,7 +179,7 @@
                             }
                         }
                     }
-                }));
+                });
                 //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护
                 var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
                 if (dev != null)
@@ -184,8 +190,8 @@
 
             if (string.IsNullOrEmpty(room.HumidityDevice) == false)
             {
-                HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice");
-                HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice",  ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
+                HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice"+room.Id);
+                HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice" + room.Id,  ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
                 {
                     string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report);
                     if (room.HumidityDevice != mainKeys)
@@ -224,7 +230,7 @@
             }
 
 
-            var roomListBtn = new Button()
+            roomListBtn = new Button()
             {
                 X = roomBackView.Width - Application.GetRealWidth(100 + 20),
                 Y = Application.GetRealHeight(20),
@@ -247,5 +253,13 @@
                 };
             };
         }
+
+        /// <summary>
+        /// HideName
+        /// </summary>
+        public void HideName(bool statu)
+        {
+            roomNameBackground.Visible = roomTemperatureBackground.Visible = roomListBtn.Visible = !statu;
+        }
     }
 }

--
Gitblit v1.8.0