From df7dd3e3f8830eceb615c59099631fc2a744b0ee Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 27 一月 2021 17:20:42 +0800
Subject: [PATCH] Merge branch 'WJC' into NewFilePath

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

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
old mode 100755
new mode 100644
index 078ef48..46020f5
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
@@ -162,6 +162,62 @@
         }
 
 
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        ///  <param name="frame">鐖舵帶浠�</param>
+        /// <param name="text1">鐖舵帶浠�</param>
+        /// <param name="text2">鏄剧ず閫夋嫨View鏁伴噺</param>
+        ///<param name="stateVuale">涔嬪墠鐨勭姸鎬佸��</param>
+        /// <param name="action">杩斿洖鍥炶皟</param>
+        /// <returns></returns>
+        public void FLayoutView(FrameLayout frame, int text1, int text2, string stateVuale, Action<int> action)
+        {
+            int i = 2;
+            frameLayout.Y = Application.GetRealHeight(603 - (44 * i));
+            frameLayout.Height = Application.GetRealHeight(44 * i);
+            frame.AddChidren(frameLayout);
+            frame.AddChidren(btnCancel);
+            btnOn.TextID = text1;
+            btnOff.TextID = text2;
+            frameLayout.AddChidren(btnOn);
+            frameLayout.AddChidren(btnLine);
+            frameLayout.AddChidren(btnOff);
+            //鍙栨秷鐐瑰嚮浜嬩欢
+            btnCancel.MouseUpEventHandler += (sender1, e1) =>
+            {
+                frame.RemoveFromParent();
+            };
+
+            ///鏄剧ず涔嬪墠鐘舵��
+            if (stateVuale != "")
+            {
+                if (stateVuale == btnOn.Text)
+                {
+                    btnOn.TextColor = CSS.CSS_Color.textConfirmColor;
+                }
+                else if (stateVuale == btnOff.Text)
+                {
+                    btnOff.TextColor = CSS.CSS_Color.textConfirmColor;
+                }
+
+            }
+
+            //鐐瑰嚮浜嬩欢
+            btnOn.MouseUpEventHandler += (sender2, e2) =>
+            {
+                action(btnOn.TextID);
+                frame.RemoveFromParent();
+            };
+            //鐐瑰嚮浜嬩欢
+            btnOff.MouseUpEventHandler += (sender3, e3) =>
+            {
+                action(btnOff.TextID);
+                frame.RemoveFromParent();
+            };
+
+
+        }
 
 
         ///// <summary>

--
Gitblit v1.8.0