From 37c315988c2dc11e4f477233f7a9f87d57bb61aa Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 08 三月 2021 09:17:15 +0800
Subject: [PATCH] 数据结构优化修改

---
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs |   71 +++++++++++++++++++----------------
 1 files changed, 39 insertions(+), 32 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 13fb0f2..4e4505a 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -442,41 +442,41 @@
                 {
                     case ShowFunction.Light:
                         #region Light
-                        functionCount = FunctionList.List.lights.Count;
-                        functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetLightList().Count;
+                        functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.AC:
                         #region AC
-                        functionCount = FunctionList.List.aCs.Count;
-                        functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetAcList().Count;
+                        functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.Curtain:
                         #region Curtain
-                        functionCount = FunctionList.List.curtains.Count;
-                        functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetCurtainList().Count;
+                        functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.FloorHeating:
                         #region 鍦扮儹
-                        functionCount = FunctionList.List.floorHeatings.Count;
-                        functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetFloorHeatingList().Count;
+                        functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.DoorLock:
                         break;
                     case ShowFunction.Electric:
                         #region 鐢靛櫒
-                        functionCount = FunctionList.List.electricals.Count;
-                        functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetElectricals().Count;
+                        functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.EnergyMonitoring:
                         break;
                     case ShowFunction.Environmental:
                         #region 鐜鏁版嵁
-                        functionCount = FunctionList.List.sensorsEnvironmentalScience.Count;
+                        functionCount = FunctionList.List.GetEnvirSensorsList().Count;
                         #endregion
                         break;
                     case ShowFunction.FreshAir:
@@ -488,10 +488,10 @@
                     case ShowFunction.Panel:
                         break;
                     case ShowFunction.SecurityMonitoring:
+                        functionCount = 1;
                         break;
                     case ShowFunction.Sensor:
-                        functionCount = FunctionList.List.sensorsArm.Count;
-                        //functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetArmSensorList().Count;
                         break;
                     case ShowFunction.VideoIntercom:
                         break;
@@ -550,7 +550,9 @@
                 };
                 functionView.AddChidren(btnName);
 
-                if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && functionCount != 0)
+                if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom
+                    && item != ShowFunction.SecurityMonitoring
+                    && functionCount != 0)
                 {
                     Button btnFunctionCount = new Button()
                     {
@@ -595,8 +597,6 @@
                     case ShowFunction.Light:
                         #region Light
                         btnName.TextID = StringId.Lights;
-                        functionCount = FunctionList.List.lights.Count;
-                        functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         Button btnLightPower = new Button()
                         {
                             X = Application.GetRealWidth(120),
@@ -615,14 +615,12 @@
                             LoadEvent_SwitchFunction(btnLightPower, item, functionView);
                         };
                         functionPageTitleId = StringId.Lights;
-                      
+
                         #endregion
                         break;
                     case ShowFunction.AC:
                         #region AC
                         btnName.TextID = StringId.AC;
-                        functionCount = FunctionList.List.aCs.Count;
-                        functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         Button btnAcPower = new Button()
                         {
                             X = Application.GetRealWidth(120),
@@ -645,8 +643,6 @@
                     case ShowFunction.Curtain:
                         #region Curtain
                         btnName.TextID = StringId.Curtain;
-                        functionCount = FunctionList.List.curtains.Count;
-                        functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         Button btnClose;
                         btnClose = new Button()
                         {
@@ -680,8 +676,6 @@
                     case ShowFunction.FloorHeating:
                         #region 鍦扮儹
                         btnName.TextID = StringId.FloorHeating;
-                        functionCount = FunctionList.List.floorHeatings.Count;
-                        functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         Button btnFhPower = new Button()
                         {
                             X = Application.GetRealWidth(120),
@@ -707,8 +701,6 @@
                     case ShowFunction.Electric:
                         #region 鐢靛櫒
                         btnName.TextID = StringId.Electric;
-                        functionCount = FunctionList.List.electricals.Count;
-                        functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         Button btnElectricPower = new Button()
                         {
                             X = Application.GetRealWidth(120),
@@ -748,8 +740,6 @@
                         break;
                     case ShowFunction.Music:
                         btnName.TextID = StringId.Music;
-                        functionCount = Music.A31MusicModel.A31MusicModelList.Count;
-                        functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                         {
                             var musicMain = new Music.MusicMain();
@@ -763,10 +753,27 @@
                         break;
                     case ShowFunction.SecurityMonitoring:
                         btnName.TextID = StringId.SecurityMonitoring;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+#if __IOS__
+                            EZSDK.IOS.EZSDK.Go2EZvizMonitor();
+#else  //瀹夊崜鎽勫儚澶�
+                            ((BaseActivity)Shared.Application.Activity).SetCamera(b =>
+                            {
+                                if (b)
+                                {
+                                    Android.Content.Intent intent = new Android.Content.Intent();
+                                    intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity"));
+                                    Shared.Application.Activity.StartActivity(intent);
+                                }
+                            });
+
+#endif
+                        };
                         break;
                     case ShowFunction.Sensor:
                         btnName.TextID = StringId.Sensor;
-
+                        functionPageTitleId = StringId.Sensor;
                         break;
                     case ShowFunction.VideoIntercom:
                         btnName.TextID = StringId.VideoIntercom;
@@ -774,7 +781,7 @@
 
                 }
                 //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈�
-                if (item != ShowFunction.Music && item != ShowFunction.Environmental)
+                if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring)
                 {
                     btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                     {
@@ -793,10 +800,10 @@
                 s1View.Height = s2View.Height = functionContentView.Height = functionContentViewHeight+ Application.GetRealWidth(40);
             }
 
-            #endregion
+#endregion
         }
 
-        #region 鍒囨崲妤煎眰
+#region 鍒囨崲妤煎眰
         /// <summary>
         /// 妤煎眰鏄剧ず鍒囨崲
         /// </summary>
@@ -953,6 +960,6 @@
         {
 
         }
-        #endregion
+#endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0