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/ChooseRoomPage.cs |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs
index b723f7a..ab86b2c 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs
@@ -5,7 +5,7 @@
 
 namespace HDL_ON.UI
 {
-    public class ChooseRoomPage : FrameLayout
+    public partial class ChooseRoomPage : FrameLayout
     {
         #region 鎺т欢鍒楄〃
         FrameLayout bodyView;
@@ -13,21 +13,34 @@
         /// 鍐呭鍔犺浇鍖哄煙
         /// </summary>
         VerticalScrolViewLayout contentView;
+
+        Button btnChooseAll;
+
         #endregion
 
         #region 灞�閮ㄥ彉閲�
+
+        Function function;
+        /// <summary>
+        /// 鍥炶皟浜嬩欢
+        /// </summary>
+        Action backAction;
         #endregion
 
-        public ChooseRoomPage()
+        public ChooseRoomPage(Function func,Action action)
         {
             bodyView = this;
+            function = func;
+            backAction = action;
         }
 
-
+        /// <summary>
+        /// 鍔犺浇椤甸潰
+        /// </summary>
         public void LoadPage()
         {
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-            new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.LocationManagement));
+            new TopViewDiv(bodyView, Language.StringByID(StringId.LocationManagement)).LoadTopView(backAction);
 
             contentView = new VerticalScrolViewLayout()
             {
@@ -54,7 +67,7 @@
             };
             allRoomView.AddChidren(btnAllRoomText);
 
-            Button btnChooseAll = new Button()
+            btnChooseAll = new Button()
             {
                 X = Application.GetRealWidth(331),
                 Gravity = Gravity.CenterVertical,
@@ -62,6 +75,7 @@
                 Height = Application.GetMinRealAverage(28),
                 UnSelectedImagePath = "Public/ChooseIcon.png",
                 SelectedImagePath = "Public/ChooseOnIcon.png",
+                IsSelected = true
             };
             allRoomView.AddChidren(btnChooseAll);
 
@@ -71,6 +85,7 @@
                 {
                     Height = Application.GetRealHeight(50),
                     BackgroundColor = CSS_Color.MainBackgroundColor,
+                    Tag = "row"
                 };
                 contentView.AddChidren(roomView);
 
@@ -102,10 +117,23 @@
                     Height = Application.GetMinRealAverage(28),
                     UnSelectedImagePath = "Public/ChooseIcon.png",
                     SelectedImagePath = "Public/ChooseOnIcon.png",
+                    IsSelected = function.roomIdList.Contains(room.sid),
+                    Tag = "ChooseIcon"
                 };
                 roomView.AddChidren(btnChoose);
+                btnChoose.MouseUpEventHandler = (sender, e) => {
+                    btnChoose.IsSelected = !btnChoose.IsSelected;
+                    LoadEvent_RoomSelected(room, btnChoose.IsSelected);
+                };
+
+                if (!function.roomIdList.Contains(room.sid) && btnChooseAll.IsSelected)
+                {
+                    btnChooseAll.IsSelected = false;
+                }
 
             }
+
+            LoadEventLoad();
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0