From cbc156bc38d8b8eae7aef60cb186ab2b52fa701f Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 16 七月 2024 13:59:56 +0800
Subject: [PATCH] 增加全部挂断

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 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
index 0b9a0d1..138c39d 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
@@ -97,7 +97,7 @@
         /// View鐨勬柟娉�
         /// </summary>
         ///  <param name="frame">鐖舵帶浠�</param>
-        /// <param name="i">鏄剧ず閫夋嫨View鏁伴噺</param>
+        /// <param name="i">琛ㄧずView鏁伴噺</param>
         ///<param name="stateVuale">涔嬪墠鐨勭姸鎬佸��</param>
         /// <param name="action">杩斿洖鍥炶皟</param>
         /// <returns></returns>
@@ -166,23 +166,30 @@
         /// View鐨勬柟娉�
         /// </summary>
         ///  <param name="frame">鐖舵帶浠�</param>
-        /// <param name="text1">鐖舵帶浠�</param>
-        /// <param name="text2">鏄剧ず閫夋嫨View鏁伴噺</param>
+        /// <param name="text1">绗竴涓娉�</param>
+        /// <param name="text2">绗簩涓娉�</param>
         ///<param name="stateVuale">涔嬪墠鐨勭姸鎬佸��</param>
+        /// <param name="i">琛ㄧずView鏁伴噺</param>
         /// <param name="action">杩斿洖鍥炶皟</param>
         /// <returns></returns>
-        public void FLayoutView(FrameLayout frame, int text1, int text2, string stateVuale, Action<int> action,bool tag=true)
+        public void FLayoutView(FrameLayout frame, int text1, int text2, string stateVuale, int i, Action<int> action,bool tag=true)
         {
-            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);
+            if (i == 1)
+            {
+                frameLayout.AddChidren(btnOn);
+            }
+            else if (i == 2)
+            {
+                frameLayout.AddChidren(btnOn);
+                frameLayout.AddChidren(btnLine);
+                frameLayout.AddChidren(btnOff);
+            }
             //鍙栨秷鐐瑰嚮浜嬩欢
             btnCancel.MouseUpEventHandler += (sender1, e1) =>
             {
@@ -190,7 +197,7 @@
             };
 
             ///鏄剧ず涔嬪墠鐘舵��
-            if (stateVuale != "")
+            if (!string.IsNullOrEmpty(stateVuale))
             {
                 if (stateVuale == btnOn.Text)
                 {

--
Gitblit v1.8.0