From 171bf03f3664226eeff2b20ee9bd2e914b63a17d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 13 三月 2020 09:18:50 +0800
Subject: [PATCH] 20200313

---
 HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
index d470b42..b4c5dd0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
@@ -8,6 +8,14 @@
         void LoadEventList()
         {
             LoadColorChangeEvent();
+            LoadCollectionEvent();
+            LoadSwitchEvent();
+
+            //鍥為��鍒锋柊淇℃伅浜嬩欢
+            actionRefresh = () => {
+                btnFunctionName.Text = btnFunctionName_Out.Text = light.name;
+                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = light.GetRoomListName();
+            };
         }
 
         /// <summary>
@@ -29,5 +37,38 @@
             };
 
         }
+
+
+        /// <summary>
+        /// 鏀惰棌鍔熻兘鎸夐挳浜嬩欢
+        /// </summary>
+        void LoadCollectionEvent()
+        {
+            btnCollection.MouseUpEventHandler += (sender, e) => {
+                btnCollection.IsSelected = light.collection = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
+                DB_ResidenceData.residenceData.SaveResidenceData();
+            };
+        }
+
+        /// <summary>
+        /// 鍔犺浇寮�鍏充簨浠�
+        /// </summary>
+        void LoadSwitchEvent()
+        {
+            btnSwitch.MouseUpEventHandler += (sender, e) =>
+            {
+                btnSwitch.IsSelected = !btnSwitch.IsSelected;
+
+                new System.Threading.Thread(() =>
+                {
+                    var light = this.light as Light;
+                    light.state = btnSwitch.IsSelected ? 1 : 0;
+                    Control.Send("write", this.light, 3);
+                })
+                { IsBackground = true }.Start();
+            };
+
+        }
+
     }
 }

--
Gitblit v1.8.0