From 841e7972869b6e967d06da0d91186cd69f1d4eb5 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 26 九月 2023 14:59:12 +0800
Subject: [PATCH] 2023年09月26日14:59:01

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs |   81 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs
index 0edb7a4..97fb64a 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs
@@ -1,11 +1,92 @@
 锘縰sing System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection;
 using Shared;
 namespace HDL_ON.UI.UI2.Intelligence.Automation
 {
     public class PublicInterface
     {
+
+        /// <summary>
+        /// 鍗曢�夋嫨
+        /// </summary>
+        /// <param name="frame">鏄剧ず鍦ㄥ摢涓晫闈㈢殑鐖舵帶浠�</param>
+        /// <param name="list">鏄剧ず鏁版嵁婧�</param>
+        /// <param name="titleText"></param>
+        /// <param name="stateText">涔嬪墠鐘舵�佹枃鏈�</param>
+        /// <param name="action">杩斿洖鍊�</param>
+        /// <param name="textSize">鏄剧ず鏂囨湰瀛椾綋澶у皬</param>
+        public void SingleSelectionShow(FrameLayout frame, List<FuntionControlView.Aks.Entity.RemoteControlEntity> list, string titleText, string stateText, Action<int> action, int textSize = LogicView.TextSize.text14)
+        {
+            if (list == null)
+            {
+                return;
+            }
+            FrameLayout frameLayout = new FrameLayout
+            {
+                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+            };
+            frame.AddChidren(frameLayout);
+
+            LogicView.DateView view = new LogicView.DateView();
+            view.btnTitle.Text = titleText;
+            view.FLayoutView(frameLayout, list.Count);
+            view.btnCancel.MouseUpEventHandler += (sender, e) =>
+            {
+                //绉婚櫎fLayout鐣岄潰
+                frameLayout.RemoveFromParent();
+            };
+            ///瀹氫箟涓�涓狟tn璁板綍閫変腑鐘舵��
+            Button checkBtn = new Button
+            {
+                Tag = "unknown",
+            };
+            for (int i = 0; i < list.Count; i++)
+            {
+                FuntionControlView.Aks.Entity.RemoteControlEntity remoteControl = list[i];
+                LogicView.CheckView checkView = new LogicView.CheckView();
+                checkView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i);
+                checkView.btnText.TextSize = textSize;
+                view.frameLayout.AddChidren(checkView.FLayoutView());
+                checkView.btnText.Text = remoteControl.name;
+                checkView.btnClick.Tag = i;//鏍囪
+
+                if (stateText == remoteControl.name)
+                {
+                    //鏄剧ず涔嬪墠鐨勯�変腑鐘舵��
+                    checkBtn.IsSelected = false;
+                    checkView.btnCheckIcon.IsSelected = true;
+                    checkBtn = checkView.btnCheckIcon;
+                    checkBtn.Tag = checkView.btnClick.Tag.ToString();
+                }
+                //鐐瑰嚮浜嬩欢
+                checkView.btnClick.MouseUpEventHandler += (sender1, e1) =>
+                {
+                    checkBtn.IsSelected = false;
+                    checkView.btnCheckIcon.IsSelected = true;
+                    checkBtn = checkView.btnCheckIcon;
+                    checkBtn.Tag = checkView.btnClick.Tag.ToString();
+                };
+
+            }
+            view.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
+            {
+                if (checkBtn.Tag.ToString() == "unknown")
+                {
+                    return;
+                }
+                var index = int.Parse(checkBtn.Tag.ToString());
+                if (index > list.Count)
+                {
+                    index = 0;
+                }
+                action(index);
+                //绉婚櫎fLayout鐣岄潰
+                frameLayout.RemoveFromParent();
+            };
+
+        }
         /// <summary>
         /// 鍗曢�夋嫨
         /// </summary>

--
Gitblit v1.8.0