From 6fa9d69da922c8049f5acfcbb9ce9fd26811024c Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 16 四月 2020 17:10:57 +0800
Subject: [PATCH] 请合并代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs |   58 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
index fe01496..0dc5e74 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -22,6 +22,10 @@
         /// </summary>
         private VerticalListRefreshControl listView = null;
         /// <summary>
+        /// 鍓嶄竴娆℃樉绀哄嚭宸︽粦鑿滃崟鐨凴owLayout
+        /// </summary>
+        private RowLayoutControl oldShowRightMuneRow = null;
+        /// <summary>
         /// 琛屾帶浠剁殑淇℃伅(Keys锛歁ac鍦板潃)
         /// </summary>
         private Dictionary<string, DeviceObjRowInfo> dicRowInfo = new Dictionary<string, DeviceObjRowInfo>();
@@ -214,6 +218,7 @@
 
             //鎺т欢
             var rowMenu = new DeviceObjectControl(deviceMac, listView.rowSpace / 2);
+            rowMenu.MainKeys = deviceMac;
             frameTable.AddChidren(rowMenu);
             rowMenu.InitControl();
             rowInfo.MenuRow = rowMenu;
@@ -234,13 +239,8 @@
             if (listdevice.Count > 0 && Common.LocalDevice.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
             {
                 //瀹氫綅
-                var btnPosition = new NormalViewControl(Application.GetRealWidth(184), rowMenu.Height, false);
+                var btnPosition = rowMenu.AddEditorControl(false);
                 btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
-                btnPosition.TextAlignment = TextAlignment.Center;
-                btnPosition.TextSize = 12;
-                btnPosition.TextColor = UserCenterColor.Current.White;
-                btnPosition.BackgroundColor = 0xff4a4a4a;
-                rowMenu.AddRightView(btnPosition);
                 btnPosition.ButtonClickEvent += (sender, e) =>
                 {
                     //瀹氫綅
@@ -270,11 +270,30 @@
 
             rowMenu.frameTable.ButtonClickEvent += (sender, e) =>
             {
+                //闅愯棌鑿滃崟
+                rowMenu.HideMenu();
+                //寮哄埗璺宠浆鐪熷疄璁惧鐣岄潰
+                if (UserCenterResourse.HideOption.GotoRealDeviceForm == 1)
+                {
+                    var form2 = new DeviceAddSuccessForm();
+                    form2.AddForm(deviceMac);
+                    return;
+                }
                 btnNew.Visible = false;
                 var form = new DeviceMacInfoEditorForm();
                 form.AddForm(deviceMac);
                 //鐣岄潰璺宠浆,璁板綍褰撳墠鐨勬鍦ㄦ搷浣滅殑璁惧鐨凪ac鍦板潃
                 this.nowActionDeviceMac = deviceMac;
+            };
+            //宸︽粦鑿滃崟浜嬩欢
+            rowMenu.OpenMenuAction += () =>
+            {
+                if (this.oldShowRightMuneRow != null && this.oldShowRightMuneRow.MainKeys != rowMenu.MainKeys)
+                {
+                    //宸︽粦鑿滃崟鍙兘婊戜竴涓�
+                    this.oldShowRightMuneRow.HideMenu();
+                }
+                this.oldShowRightMuneRow = rowMenu;
             };
         }
 
@@ -331,6 +350,7 @@
 
             //琛屾帶浠�
             var rowDevice = new DeviceRoomControl(device, frame.rowSpace / 2);
+            rowDevice.MainKeys = LocalDevice.Current.GetDeviceMainKeys(device);
             frame.AddChidren(rowDevice);
             rowDevice.frameTable.LeftOffset = Application.GetRealWidth(173) - ControlCommonResourse.XXLeft;
             rowDevice.InitControl();
@@ -349,13 +369,8 @@
             if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(device) == true)
             {
                 //瀹氫綅
-                var btnPosition = new NormalViewControl(Application.GetRealWidth(184), rowDevice.Height, false);
+                var btnPosition = rowDevice.AddEditorControl(false);
                 btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
-                btnPosition.TextAlignment = TextAlignment.Center;
-                btnPosition.TextSize = 12;
-                btnPosition.TextColor = UserCenterColor.Current.White;
-                btnPosition.BackgroundColor = 0xff4a4a4a;
-                rowDevice.AddRightView(btnPosition);
                 btnPosition.ButtonClickEvent += (sender, e) =>
                 {
                     //瀹氫綅
@@ -365,10 +380,22 @@
 
             rowDevice.frameTable.ButtonClickEvent += (sender, e) =>
             {
+                //闅愯棌鑿滃崟
+                rowDevice.HideMenu();
                 //鐣岄潰璺宠浆,璁板綍褰撳墠鐨勬鍦ㄦ搷浣滅殑璁惧鐨凪ac鍦板潃
                 this.nowActionDeviceMac = device.DeviceAddr;
                 //鏄剧ず璁惧鍔熻兘閰嶇疆鐣岄潰
                 this.ShowDeviceFunctionSettionForm(device, deviceEnumInfo);
+            };
+            //宸︽粦鑿滃崟浜嬩欢
+            rowDevice.OpenMenuAction += () =>
+            {
+                if (this.oldShowRightMuneRow != null && this.oldShowRightMuneRow.MainKeys != rowDevice.MainKeys)
+                {
+                    //宸︽粦鑿滃崟鍙兘婊戜竴涓�
+                    this.oldShowRightMuneRow.HideMenu();
+                }
+                this.oldShowRightMuneRow = rowDevice;
             };
         }
 
@@ -418,10 +445,11 @@
                 form.AddForm(device, true);
             }
             //鏂伴闈㈡澘
-            else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueNewWind)
+            else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
             {
-                var form = new DeviceFunctionSettionForm();
-                form.AddForm(device, true);
+                //鏂规偊鏂伴闈㈡澘鐨勬寜閿厤缃�
+                var form = new DevicePanel.PanelFangyueFreshAirButtonSettionForm();
+                form.AddForm(device);
             }
             //鏂规偊闈㈡澘
             else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo

--
Gitblit v1.8.0