From 9189e6c3fa549717e95a4d29de890941197eee03 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 20 四月 2021 11:38:47 +0800
Subject: [PATCH] 增加二次调试开关

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs |  136 +++++++++++++++++++++++++-------------------
 1 files changed, 77 insertions(+), 59 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
index d97b978..3a28dd7 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
@@ -52,12 +52,12 @@
         /// </summary>
         Button btnRoomManagementTitle;
 
-        #region F3闃舵
         /// <summary>
         /// 璋冭瘯鏉冮檺寮�鍏虫寜閽�
         /// </summary>
-        //Button btnCommissioningAuthoritySwitchIcon;
+        Button btnCommissioningAuthoritySwitchIcon;
 
+        #region F3闃舵
         #region 绠$悊鍛樻潈闄愯縼绉�
         //FrameLayout administratorPermissionMigrationRow;
         //Button btnAdministratorPermissionMigrationTitle;
@@ -98,11 +98,17 @@
 
         public void LoadPage()
         {
-
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-
             new TopViewDiv(bodyView, Language.StringByID(StringId.ResidenceManage)).LoadTopView();
-            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.ResidenceManage));
+
+            VerticalScrolViewLayout contentView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(64),
+                Height = Application.GetRealHeight(667 - 64),
+                ScrollEnabled = false,
+            };
+            bodyView.AddChidren(contentView);
+
 
             #region 浣忓畢鍚嶇О
             FrameLayout residenceNameRow;
@@ -112,7 +118,7 @@
                 Height = Application.GetRealHeight(50),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(residenceNameRow);
+            contentView.AddChidren(residenceNameRow);
             Button btnResidenceNameTitle = new Button()
             {
                 X = Application.GetRealWidth(16),
@@ -128,7 +134,7 @@
             {
                 X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right,
                 Width = Application.GetRealWidth(200),
-                Text = DB_ResidenceData.Instance.CurrentRegion.Name,
+                Text = DB_ResidenceData.Instance.CurrentRegion.homeName,
                 TextSize = CSS_FontSize.TextFontSize,
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.TextualColor,
@@ -162,7 +168,7 @@
                             Height = Application.GetRealHeight(50),
                             BackgroundColor = CSS_Color.MainBackgroundColor,
                         };
-                        bodyView.AddChidren(residenceAddressRow);
+                        contentView.AddChidren(residenceAddressRow);
 
                         var btnResidenceAddressTitle = new Button()
                         {
@@ -189,7 +195,7 @@
                         {
                             X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right,
                             Width = Application.GetRealWidth(200),
-                            Text = DB_ResidenceData.Instance.CurrentRegion.Address,
+                            Text = DB_ResidenceData.Instance.CurrentRegion.homeAddress,
                             TextSize = CSS_FontSize.TextFontSize,
                             TextAlignment = TextAlignment.CenterLeft,
                             TextColor = CSS_Color.TextualColor,
@@ -197,13 +203,14 @@
                         residenceAddressRow.AddChidren(btnResidenceAddress);
             #endregion
             #region 妤煎眰绠$悊
+            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
+
             floorManagementRow = new FrameLayout()
             {
-                Y = Application.GetRealHeight(8) + residenceNameRow.Bottom,// residenceAddressRow.Bottom,
                 Height = Application.GetRealHeight(50),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(floorManagementRow);
+            contentView.AddChidren(floorManagementRow);
 
             btnFloorManagementTitle = new Button()
             {
@@ -244,7 +251,7 @@
                 Height = Application.GetRealHeight(50),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(roomManagementRow);
+            contentView.AddChidren(roomManagementRow);
 
             btnRoomManagementTitle = new Button()
             {
@@ -271,13 +278,13 @@
 
             #region F3闃舵
             #region 绠$悊鍛樻潈闄愯縼绉�
+            //contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
             //administratorPermissionMigrationRow = new FrameLayout()
             //{
-            //    Y = Application.GetRealHeight(8) + roomManagementRow.Bottom,
             //    Height = Application.GetRealHeight(65),
             //    BackgroundColor = CSS_Color.MainBackgroundColor,
             //};
-            //bodyView.AddChidren(administratorPermissionMigrationRow);
+            //contentView.AddChidren(administratorPermissionMigrationRow);
 
             //btnAdministratorPermissionMigrationTitle = new Button()
             //{
@@ -336,7 +343,7 @@
             //    Height = Application.GetRealHeight(65),
             //    BackgroundColor = CSS_Color.MainBackgroundColor,
             //};
-            //bodyView.AddChidren(transferRow);
+            //contentView.AddChidren(transferRow);
 
             //btnTransferTitle = new Button()
             //{
@@ -376,55 +383,66 @@
             #endregion
             #endregion
 
-            #region F3闃舵
             #region 璋冭瘯鏉冮檺
-            //FrameLayout commissioningAuthorityRow;
-            //commissioningAuthorityRow = new FrameLayout()
-            //{
-            //    Y = Application.GetRealHeight(8) + transferRow.Bottom,
-            //    Height = Application.GetRealHeight(65),
-            //    BackgroundColor = CSS_Color.MainBackgroundColor,
-            //};
-            //bodyView.AddChidren(commissioningAuthorityRow);
+
+            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
+            FrameLayout commissioningAuthorityRow;
+            commissioningAuthorityRow = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(65),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            contentView.AddChidren(commissioningAuthorityRow);
 
 
-            //var btnCommissioningAuthorityTitle = new Button()
-            //{
-            //    X = Application.GetRealWidth(16),
-            //    Y = Application.GetRealHeight(10),
-            //    Width = Application.GetRealWidth(308),
-            //    Height = Application.GetRealHeight(24),
-            //    TextID = StringId.CommissioningAuthority,
-            //    TextAlignment = TextAlignment.CenterLeft,
-            //    TextSize = CSS_FontSize.SubheadingFontSize,
-            //    TextColor = CSS_Color.FirstLevelTitleColor,
-            //};
-            //commissioningAuthorityRow.AddChidren(btnCommissioningAuthorityTitle);
+            var btnCommissioningAuthorityTitle = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Y = Application.GetRealHeight(10),
+                Width = Application.GetRealWidth(308),
+                Height = Application.GetRealHeight(24),
+                TextID = StringId.CommissioningAuthority,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            commissioningAuthorityRow.AddChidren(btnCommissioningAuthorityTitle);
 
-            //var btnCommissioningAuthorityExplan = new Button()
-            //{
-            //    X = Application.GetRealWidth(16),
-            //    Y = btnCommissioningAuthorityTitle.Bottom,
-            //    Width = Application.GetRealWidth(308),
-            //    Height = Application.GetRealHeight(21),
-            //    TextID = StringId.CommissioningAuthorityExPlan,
-            //    TextAlignment = TextAlignment.CenterLeft,
-            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-            //    TextColor = CSS_Color.PromptingColor1,
-            //};
-            //commissioningAuthorityRow.AddChidren(btnCommissioningAuthorityExplan);
+            var btnCommissioningAuthorityExplan = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Y = btnCommissioningAuthorityTitle.Bottom,
+                Width = Application.GetRealWidth(308),
+                Height = Application.GetRealHeight(21),
+                TextID = StringId.CommissioningAuthorityExPlan,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                TextColor = CSS_Color.PromptingColor1,
+            };
+            commissioningAuthorityRow.AddChidren(btnCommissioningAuthorityExplan);
 
-            //btnCommissioningAuthoritySwitchIcon = new Button()
-            //{
-            //    X = Application.GetRealWidth(314),
-            //    Gravity = Gravity.CenterVertical,
-            //    Width = Application.GetMinRealAverage(48),
-            //    Height = Application.GetMinRealAverage(36),
-            //    UnSelectedImagePath = "Public/Switch.png",
-            //    SelectedImagePath = "Public/SwitchOn.png",
-            //};
-            //commissioningAuthorityRow.AddChidren(btnCommissioningAuthoritySwitchIcon);
-            #endregion
+            btnCommissioningAuthoritySwitchIcon = new Button()
+            {
+                X = Application.GetRealWidth(314),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(48),
+                Height = Application.GetMinRealAverage(36),
+                UnSelectedImagePath = "Public/Switch.png",
+                SelectedImagePath = "Public/SwitchOn.png",
+                IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm
+            };
+            commissioningAuthorityRow.AddChidren(btnCommissioningAuthoritySwitchIcon);
+
+            btnCommissioningAuthoritySwitchIcon.MouseUpEventHandler = (sender, e) => {
+                DB_ResidenceData.Instance.CurrentRegion.debugPerm = !DB_ResidenceData.Instance.CurrentRegion.debugPerm;
+                btnCommissioningAuthoritySwitchIcon.IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm;
+                new System.Threading.Thread(() =>
+                {
+                    new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm);
+                })
+                { IsBackground = true }.Start();
+            };
+
             #endregion
 
 

--
Gitblit v1.8.0