From 16277f0b999eb1b2c6bbcf710be04cadaf2a07fa Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 12 三月 2021 15:20:21 +0800
Subject: [PATCH] 2021-03-12-2

---
 .vs/HDL_APP_Project/xs/UserPrefs.xml                  |   33 +++-------
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs |  113 ++++++++++++++++++++-----------------
 2 files changed, 71 insertions(+), 75 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 96415d5..1fc21ed 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,42 +1,31 @@
 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
   <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-001674E61438002E" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs">
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs">
     <Files>
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="372" Column="62" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="290" Column="15" />
       <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="250" Column="36" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="284" Column="22" />
-      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="302" Column="63" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs" Line="155" Column="67" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="165" Column="64" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="378" Column="17" />
+      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="293" Column="55" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs" Line="154" Column="72" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="138" Column="45" />
       <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="267" Column="70" />
       <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs" Line="14" Column="91" />
       <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs" Line="59" Column="65" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" Line="357" Column="48" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs" Line="200" Column="66" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" Line="215" Column="81" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs" Line="214" Column="1" />
       <File FileName="HDL_ON/Entity/Function/Function.cs" Line="637" Column="18" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" Line="13" Column="27" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" Line="220" Column="55" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
           <Node name="HDL_APP_Project" expanded="True">
             <Node name="HDL_ON" expanded="True">
-              <Node name="DAL" expanded="True">
-                <Node name="Mqtt" expanded="True" />
-              </Node>
-              <Node name="Entity" expanded="True">
-                <Node name="Function" expanded="True" />
-              </Node>
               <Node name="UI" expanded="True">
                 <Node name="UI2" expanded="True">
-                  <Node name="3-Intelligence" expanded="True">
-                    <Node name="Automation" expanded="True">
-                      <Node name="LogicView" expanded="True" />
-                    </Node>
-                  </Node>
                   <Node name="4-PersonalCenter" expanded="True">
                     <Node name="PirDevice" expanded="True">
-                      <Node name="BrandList.cs" selected="True" />
+                      <Node name="PirMain.cs" selected="True" />
                     </Node>
                   </Node>
                 </Node>
@@ -55,7 +44,7 @@
     <String>Shared.IOS/Shared.IOS.csproj</String>
   </DisabledProjects>
   <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.4b65c4650918" />
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     <BreakpointStore />
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
index 7f35847..33aee38 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
@@ -19,7 +19,8 @@
             topView.topNameBtn.TextID = StringId.shebeigaunli;
             topView.topIconBtn.Visible = true;
             this.AddChidren(topView.FLayoutView());
-            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => {
+            topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
+            {
                 action();
                 this.RemoveFromParent();
             };
@@ -32,14 +33,14 @@
                 //鍏抽棴鍒锋柊View锛�
                 vv.EndHeaderRefreshing();
                 //鑾峰彇鍒楄〃
-                Method.GetPirDeviceList(this,() =>
-                {
-                    Application.RunOnMainThread(() =>
-                    {
+                Method.GetPirDeviceList(this, () =>
+                 {
+                     Application.RunOnMainThread(() =>
+                     {
                         //鍒锋柊鐣岄潰
                         UIView(vv);
-                    });
-                });
+                     });
+                 });
 
             };
             #endregion
@@ -164,14 +165,17 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextSize = TextSize.text12,
                     TextColor = 0xFF67D569,// CSS.CSS_Color.textColor,
-                    SelectedTextColor =CSS.CSS_Color.textRedColor,
+                    SelectedTextColor = CSS.CSS_Color.textRedColor,
                     IsBold = true,
                 };
                 devfLayout.AddChidren(stateTextBtn);
-                if (pirDevice.online) {
+                if (pirDevice.online)
+                {
                     stateIconBtn.IsSelected = true;
                     stateTextBtn.IsSelected = true;
-                } else {
+                }
+                else
+                {
                     stateIconBtn.IsSelected = false;
                     stateTextBtn.IsSelected = false;
                 }
@@ -291,54 +295,58 @@
                     }
                     delBtn.MouseUpEventHandler += (sender, e) =>
                     {
-
                         var Function = delBtn.Tag as Entity.Function;
-                        //鍔犺浇log
-                        Loading loading = new Loading();
-                        this.AddChidren(loading);
-                        HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
-                        loading.Start();
-                        new System.Threading.Thread(() =>
+                        string text = Language.StringByID(StringId.shanchushebei) + Function.name + "?";
+                        TipPopView tipPopView = new TipPopView();
+                        tipPopView.TipBox(StringId.tip, text, (dialog) =>
                         {
-                            try
+                            //鍔犺浇log
+                            Loading loading = new Loading();
+                            dialog.AddChidren(loading);
+                            HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
+                            loading.Start();
+                            new System.Threading.Thread(() =>
                             {
-                                responsePackNew = PirSend.DeleteDevice(Function.deviceId);
-                            }
-                            catch { }
-                            finally
-                            {
-                                Application.RunOnMainThread(() =>
+                                try
                                 {
-                                    loading.Hide();
-                                    try
+                                    responsePackNew = PirSend.DeleteDevice(Function.deviceId);
+                                }
+                                catch { }
+                                finally
+                                {
+                                    Application.RunOnMainThread(() =>
                                     {
-                                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
+                                        loading.Hide();
+                                        try
                                         {
-                                            var function = pirDevice.FunctioList.Find((c)=>c.sid== Function.sid);
-                                            if (function != null)
+                                            if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                                             {
-                                                pirDevice.FunctioList.Remove(Function);
-                                                if (Pir.currPir != null && pirDevice.sid == Pir.currPir.sid)
+                                                dialog.Close();
+                                                var function = pirDevice.FunctioList.Find((c) => c.sid == Function.sid);
+                                                if (function != null)
                                                 {
-                                                    Pir.currPir.FunctioList = pirDevice.FunctioList;
+                                                    pirDevice.FunctioList.Remove(Function);
+                                                    if (Pir.currPir != null && pirDevice.sid == Pir.currPir.sid)
+                                                    {
+                                                        Pir.currPir.FunctioList = pirDevice.FunctioList;
+                                                    }
                                                 }
+                                                UIView(vv);
                                             }
-                                            UIView(vv);
+                                            else
+                                            {
+                                                Method method = new Method();
+                                                method.ErrorShow(responsePackNew);
+                                            }
                                         }
+                                        catch { }
 
-                                        else
-                                        {
-                                            Method method = new Method();
-                                            method.ErrorShow(responsePackNew);
-                                        }
-                                    }
-                                    catch { }
+                                    });
+                                }
 
-                                });
-                            }
-
-                        })
-                        { IsBackground = true }.Start();
+                            })
+                            { IsBackground = true }.Start();
+                        }, () => { }, false);
                     };
                     EventHandler<MouseEventArgs> editClick = (sender, e) =>
                     {
@@ -358,8 +366,6 @@
                     areaBtn.MouseUpEventHandler += editClick;
                     nextIconBtn.MouseUpEventHandler += editClick;
                 }
-
-
 
             }
         }
@@ -383,14 +389,14 @@
                     {
                         list.Add(Pir.pirDeviceList[b].name);
                     }
-                    Method methodView = new Method(); 
+                    Method methodView = new Method();
                     methodView.EditControlName(StringId.xiugaimingzi, list, pirclick.name, (name, view) =>
                     {
                         pirclick.name = name;
+                        HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
                         //鍔犺浇log
                         Loading loading = new Loading();
                         view.AddChidren(loading);
-                        HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
                         loading.Start();
                         new System.Threading.Thread(() =>
                         {
@@ -420,9 +426,10 @@
 
                         })
                         { IsBackground = true }.Start();
-                    },()=> {
+                    }, () =>
+                    {
                         NewSwitchView(pirclick, vv);
-                    },false);
+                    }, false);
 
                 }
                 else
@@ -431,10 +438,10 @@
                     TipPopView tipPopView = new TipPopView();
                     tipPopView.TipBox(StringId.tip, text, (dialog) =>
                     {
+                        HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
                         //鍔犺浇log
                         Loading loading = new Loading();
                         dialog.AddChidren(loading);
-                        HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
                         loading.Start();
                         new System.Threading.Thread(() =>
                         {
@@ -474,6 +481,6 @@
             });
         }
 
-      
+
     }
 }

--
Gitblit v1.8.0