wxr
2023-06-05 753e67c3705dddb8e913bd853db151f94f81d600
HDL_ON/UI/UI2/2-Classification/RoomPage.cs
@@ -1,4 +1,5 @@
using System;

using System;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -53,6 +54,7 @@
            deleteAction = delAction;
            this.modifyImageAction = modifyImageAction;
        }
        /// <summary>
        /// 重载界面
        /// </summary>
@@ -64,6 +66,7 @@
                LoadPage();
            }
        }
        public void LoadPage()
        {
@@ -78,18 +81,23 @@
            };
            bodyView.AddChidren(functionListView);
            foreach (var function in room.GetRoomFunctions(false))
            var list = room.GetRoomFunctions(false);
            foreach (var function in list)
            {
                if (MainPage.RoomNotSupportFunctionList.Contains( function.spk))
                {
                    continue;
                }
#if DEBUG
                //throw new ArgumentNullException();
#endif
                functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
                if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming)
                {
                    var functionDiv = new FunctionControlZone(function)
                    var functionDiv = new FunctionControlZone(function, null)
                    {
                        Gravity = Gravity.CenterHorizontal,
                        Width = Application.GetRealWidth(343),
@@ -105,7 +113,10 @@
                }
                else
                {
                    var functionDiv = new FunctionControlZone(function)
                    var functionDiv = new FunctionControlZone(function, () =>
                    {
                        this.ReLoadPage();
                    })
                    {
                        Gravity = Gravity.CenterHorizontal,
                        Width = Application.GetRealWidth(343),
@@ -120,8 +131,14 @@
                    functionListView.AddChidren(functionDiv);
                }
            }
            try
            {
            foreach (var scene in room.GetRoomScenes(false))
            {
                    if (scene == null)
                    {
                        continue;
                    }
                functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
                var sceneRow = new FrameLayout()
                {
@@ -136,6 +153,10 @@
                };
                functionListView.AddChidren(sceneRow);
                LoadSceneRow(sceneRow, scene);
                }
            }catch (Exception ex)
            {
                MainPage.Log($"RoomPage LoadPage Error:{ex.Message}");
            }
        }
@@ -235,7 +256,8 @@
        /// </summary>
        void LoadEvent_ControlScene(Button btnName,Button btnFromFloor,FrameLayout bodyDiv, Scene scene)
        {
            EventHandler<MouseEventArgs> upEvent = (sender, e) => {
            EventHandler<MouseEventArgs> upEvent = (sender, e) =>
            {
                DriverLayer.Control.Ins.ControlScene(scene);
                string msg = scene.name + Language.StringByID(StringId.AlreadyOpened);
                new PublicAssmebly().TipMsgAutoClose(msg, false);
@@ -245,5 +267,6 @@
            bodyDiv.MouseUpEventHandler = upEvent;
        }
    }
}