From aed247d7fa4499665041864479fae82089eafe5f Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 07 一月 2020 09:15:57 +0800
Subject: [PATCH] 2019.1.7

---
 ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
index 64f1430..598f6d8 100644
--- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
@@ -13,7 +13,7 @@
         /// <summary>
         /// The action.
         /// </summary>
-        public Action action;
+        public Action<DeviceUI, Common.Room> action;
 
         /// <summary>
         /// 鏀惰棌鎸夐挳
@@ -362,8 +362,8 @@
         public override void RemoveFromParent()
         {
             ZigBee.Device.ZbGateway.StatusList.Remove(this);
-            //action();
-            //action = null;
+            action(device, room);
+            action = null;
             RemoveUpdateControlDeviceStatuAction();
             HomePage.Instance.ScrollEnabled = true;
             if (IsDrawerLockMode)
@@ -881,6 +881,12 @@
         /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
         private void ShowChangeMode_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
         {
+            if (HadSupportModel() == false)
+            {
+                CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.AC_Model_None));
+                return;
+            }
+
             int modeItem_X = 80;
             int modeItem_Height = 150;
             int modeItem_Width = 449;
@@ -1058,6 +1064,24 @@
             ac.currentSystemMode = (int)acMode;
             mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
             ac.SetSystemModeAsync(acMode);
+        }
+
+        /// <summary>
+        /// 鏄惁閰嶇疆浜嗘ā寮�
+        /// </summary>
+        /// <returns></returns>
+        private bool HadSupportModel()
+        {
+            bool hadMode = false;
+            foreach (var m in ac.listSupportMode)
+            {
+                if (m == 1)
+                {
+                    hadMode = true;
+                    break;
+                }
+            }
+            return hadMode;
         }
 
         #endregion
@@ -1393,9 +1417,9 @@
             UserView.HomePage.Instance.AddChidren(detailInfo);
             UserView.HomePage.Instance.PageIndex += 1;
             detailInfo.Show(device, room);
-            detailInfo.EditAction = (d,r) =>
+            detailInfo.EditAction += (curDev, curRoom) =>
             {
-                Show(device, room);
+                Show(curDev, curRoom);
             };
         }
 

--
Gitblit v1.8.0