From 23bbed132eea46eef51c6d01c21b346238e29ee2 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 30 六月 2022 13:39:12 +0800
Subject: [PATCH] Merge branch 'wxr0114' into V1.5.9

---
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs |  200 +++++++++++++++++++++++++-------------------------
 1 files changed, 100 insertions(+), 100 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 8177983..342d1d5 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -14,46 +14,46 @@
         /// </summary>
         public static void LoadEvent_RefreshDevcieOnline(Function function)
         {
-            //Application.RunOnMainThread(() =>
-            //{
-            //    if (bodyView != null)
-            //    {
-            //        foreach (var view in bodyView.functionViews)
-            //        {
-            //            if (view.Tag.ToString() == function.sid)
-            //            {
-            //                for (int i = 0; i < view.ChildrenCount; i++)
-            //                {
-            //                    if (view.GetChildren(i).GetType() == typeof(Button))
-            //                    {
-            //                        var btn = view.GetChildren(i) as Button;
-            //                        if(btn.Tag == null)
-            //                        {
-            //                            continue;
-            //                        }
-            //                        if (btn.Tag.ToString() == function.sid)
-            //                        {
-            //                            if (function.online)
-            //                            {
-            //                                btn.UnSelectedImagePath = "Collection/Functionbg.png";
-            //                                btn.IsSelected = false;
-            //                            }
-            //                            else
-            //                            {
-            //                                btn.UnSelectedImagePath = "Collection/FunctionOfflineBg.png";
-            //                                btn.IsSelected = false;
-            //                            }
-            //                        }
-            //                        else if (btn.Tag.ToString() == "OnlineTag")
-            //                        {
-            //                            btn.Visible = !function.online;
-            //                        }
-            //                    }
-            //                }
-            //            }
-            //        }
-            //    }
-            //});
+            Application.RunOnMainThread(() =>
+            {
+                if (bodyView != null)
+                {
+                    foreach (var view in bodyView.functionViews)
+                    {
+                        if (view.Tag.ToString() == function.sid)
+                        {
+                            for (int i = 0; i < view.ChildrenCount; i++)
+                            {
+                                if (view.GetChildren(i).GetType() == typeof(Button))
+                                {
+                                    var btn = view.GetChildren(i) as Button;
+                                    if(btn.Tag == null)
+                                    {
+                                        continue;
+                                    }
+                                    if (btn.Tag.ToString() == function.sid)
+                                    {
+                                        if (function.online)
+                                        {
+                                            btn.UnSelectedImagePath = "Collection/Functionbg.png";
+                                            btn.IsSelected = false;
+                                        }
+                                        else
+                                        {
+                                            btn.UnSelectedImagePath = "Collection/FunctionOfflineBg.png";
+                                            btn.IsSelected = false;
+                                        }
+                                    }
+                                    else if (btn.Tag.ToString() == "OnlineTag")
+                                    {
+                                        btn.Visible = !function.online;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            });
         }
         /// <summary>
         /// 鏇存柊涓婚〉澶╂皵
@@ -514,16 +514,16 @@
         {
             btnSwitch.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //    return;
-                //}
+                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 btnSwitch.IsSelected = !btnSwitch.IsSelected;
                 new System.Threading.Thread(() =>
                 {
@@ -577,16 +577,16 @@
         {
             btnSwitch.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //    return;
-                //}
+                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 if (DB_ResidenceData.Instance.GatewayType == 1)
                 {
                     btnSwitch.IsSelected = !btnSwitch.IsSelected;
@@ -621,16 +621,16 @@
         {
             btnClose.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!curtain.online)//绂荤嚎涓嶅厑璁告搷浣�
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //    return;
-                //}
+                if (!curtain.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 btnClose.IsSelected = true;
                 curtain.trait_on_off.curValue = "off";
                 curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
@@ -641,16 +641,16 @@
 
             btnOpen.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!curtain.online)//绂荤嚎涓嶅厑璁告搷浣�
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //    return;
-                //}
+                if (!curtain.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 btnOpen.IsSelected = true;
                 curtain.trait_on_off.curValue = "on";
                 curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
@@ -671,16 +671,16 @@
             };
             btnUp.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //    return;
-                //}
+                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 new System.Threading.Thread(() =>
                 {
                     System.Threading.Thread.Sleep(2000);
@@ -702,16 +702,16 @@
             };
             btnDown.MouseUpEventHandler = (sender, e) =>
             {
-                //if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
-                //{
-                //    new Tip()
-                //    {
-                //        CloseTime = 1,
-                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                //        Direction = AMPopTipDirection.None,
-                //    }.Show(MainPage.BaseView);
-                //    return;
-                //}
+                if (!function.online)//绂荤嚎涓嶅厑璁告搷浣�
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
                 new System.Threading.Thread(() =>
                 {
                     System.Threading.Thread.Sleep(2000);

--
Gitblit v1.8.0