From 9463fa981945f278a639a1303192272732415f22 Mon Sep 17 00:00:00 2001
From: tzy <hxb@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:20:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/temp-wxr' into dev-tzy

---
 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs |   48 +++++++++++++++++++-----------------------------
 1 files changed, 19 insertions(+), 29 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs
index 981bf1c..341c300 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs
@@ -9,8 +9,11 @@
 {
     public class AcControlPage_AddIrButton : FrameLayout
     {
-        public AcControlPage_AddIrButton()
+        Action action;
+
+        public AcControlPage_AddIrButton(Action act)
         {
+            action = act;
         }
         public void Show(Function control)
         {
@@ -133,35 +136,22 @@
                 buttonObj.key = "key" + control.attributes.Count.ToString();
                 buttonObj.value = texts;
 
-                PirSend.CodeStudy(new Control() { deviceId = control.deviceId,sid = control.sid }, buttonObj, (mqttData) =>
-                {
-                    if (mqttData != null)// && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
-                    {
-                        Method method = new Method();
-                        Method.buttondata = "";
-                        var mqttdate = method.MqttDate("鎸夐敭", control.sid, 25);
-                        if (mqttdate != null)
-                        {
-                            this.RemoveFromParent();
-                            control.attributes.Add(new FunctionAttributes() { key = buttonObj.key, value = new System.Collections.Generic.List<string>() { buttonObj.value } });
-                        }
-                        else
-                        {
-                            replication.RemView();
-                            new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
-                        }
-                    }
-                    else
-                    {
-                        Method method = new Method();
-                        new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
-                    }
-
-                });
-
-
+                PirSend.CodeStudy(new Control() { deviceId = control.deviceId, sid = control.sid }, buttonObj, (mqttData) =>
+                 {
+                     if (mqttData != null)
+                     {
+                         control.attributes.Add(new FunctionAttributes() { key = buttonObj.key, value = new System.Collections.Generic.List<string>() { buttonObj.value } });
+                         this.RemoveFromParent();
+                         action?.Invoke();
+                         //new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiachenggong));
+                     }
+                     else
+                     {
+                         this.RemoveFromParent();
+                         new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
+                     }
+                 });
             };
-
         }
     }
 }

--
Gitblit v1.8.0