From 7d005a7618e3d7a80d8ede3baf6ecc4bf8019cd5 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 01 九月 2020 15:22:09 +0800
Subject: [PATCH] 2020-09-01

---
 HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
index 88429c1..6da5522 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
@@ -14,7 +14,7 @@
         /// 鏇存柊鍔熻兘鐘舵��
         /// </summary>
         /// <param name="updataFunction"></param>
-        public void UpdataStates(Function updataFunction, FrameLayout view, VerticalScrolViewLayout scrolView)
+        public void UpdataStates(Function updataFunction, FrameLayout view, VerticalScrolViewLayout scrolView,Room room=null)
         {
             try
             {
@@ -24,6 +24,14 @@
                     {
                         return;
                     }
+                    if (room != null)
+                    {
+                        if (!updataFunction.roomIdList.Contains(room.sid))
+                        {
+                            return;
+                        }
+                    }
+                    //if(updataFunction.roomIdList.Contains(Room))
                     for (int i = 0; i < scrolView.ChildrenCount; i++)
                     {
                         if (scrolView.GetChildren(i).Tag == null || scrolView.GetChildren(i).Tag.ToString() == "")
@@ -50,7 +58,7 @@
                                             {
                                                 try
                                                 {
-                                                    (fcView.GetChildren(j) as Button).IsSelected = updataFunction.on_off == "on";
+                                                    (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.value.ToString() == "on";
                                                 }
                                                 catch (Exception ex)
                                                 {
@@ -63,13 +71,14 @@
                                             {
                                                 try
                                                 {
-                                                    if (updataFunction.on_off == "on")
+                                                    if (updataFunction.trait_on_off.value.ToString() == "on")
                                                     {
                                                         (fcView.GetChildren(j) as DiyImageSeekBar).Progress = (updataFunction as Light).brightness;
                                                         (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
                                                     }
                                                     else
                                                     {
+                                                        (fcView.GetChildren(j) as DiyImageSeekBar).Progress = (updataFunction as Light).brightness;
                                                         (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.PromptingColor2;
                                                     }
                                                 }
@@ -84,7 +93,7 @@
                                             {
                                                 try
                                                 {
-                                                    (fcView.GetChildren(j) as Button).IsSelected = updataFunction.on_off == "on";
+                                                    (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.value.ToString() == "on";
                                                     (fcView.GetChildren(j) as Button).Text = updataFunction.lastState;
                                                 }
                                                 catch (Exception ex)
@@ -101,7 +110,7 @@
                                             {
                                                 try
                                                 {
-                                                    (fcView.GetChildren(j) as Button).IsSelected = uCurtain.on_off == "off";
+                                                    (fcView.GetChildren(j) as Button).IsSelected = uCurtain.trait_on_off.value.ToString() == "off";
                                                 }
                                                 catch (Exception ex)
                                                 {
@@ -112,7 +121,7 @@
                                             {
                                                 try
                                                 {
-                                                    (fcView.GetChildren(j) as Button).IsSelected = uCurtain.on_off == "on";
+                                                    (fcView.GetChildren(j) as Button).IsSelected = uCurtain.trait_on_off.value.ToString() == "on";
                                                 }
                                                 catch (Exception ex)
                                                 {
@@ -121,6 +130,22 @@
                                             }
                                             #endregion
                                             break;
+                                        case FunctionCategory.Music:
+                                            #region 闊充箰鏇存柊
+                                            var uMusic = updataFunction as Music.A31MusicModel;
+                                            if (cTag == updataFunction.functionType + "_State_" + updataFunction.sid)
+                                            {
+                                                try
+                                                {
+                                                    (fcView.GetChildren(j) as Button).IsSelected = uMusic.A31PlayStatus.status == "play" ;
+                                                }
+                                                catch (Exception ex)
+                                                {
+                                                    MainPage.Log($"{this.GetType()} error 3 : {ex.Message}");
+                                                }
+                                            }
+                                            #endregion
+                                            break;
                                     }
                                 }
                             }

--
Gitblit v1.8.0