From f71e74b5f0d2716fbf05da016cdaa18d64e09f80 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 31 十二月 2020 17:01:18 +0800
Subject: [PATCH] 又换完成最新门锁。空气质量传感器完成数据和基本配置功能。开发图表和自动化的同事可下载此代码

---
 ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs | 1176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 1,176 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
new file mode 100755
index 0000000..a994e30
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
@@ -0,0 +1,1176 @@
+锘縰sing Shared.Common;
+using Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category
+{
+    /// <summary>
+    /// 娣诲姞鎴栬�呯紪杈戝満鏅殑鐣岄潰
+    /// </summary>
+    public class AddOrEditorSceneForm : EditorCommonForm
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        /// <summary>
+        /// 鍦烘櫙鍙樻洿浜嬩欢(鍦烘櫙,鎴块棿ID)
+        /// </summary>
+        public Action<SceneUI, string> SceneChangedEvent = null;
+        /// <summary>
+        /// 淇敼鐨勫満鏅�
+        /// </summary>
+        private SceneUI editorScene = null;
+        /// <summary>
+        /// 鍏嬮殕鐨勫満鏅�(涓存椂缂栬緫鐢�)
+        /// </summary>
+        private SceneUI cloneScene = null;
+        /// <summary>
+        /// 鍦烘櫙褰撳墠鐨勬埧闂碔D
+        /// </summary>
+        private string nowRoomId = string.Empty;
+        /// <summary>
+        /// 褰撳墠鐣岄潰涓婃樉绀虹殑鎵ц鐩爣
+        /// </summary>
+        private List<Scene.DeviceListData> listAdjustTarget = null;
+        /// <summary>
+        /// 鏁翠釜鐣岄潰鐨勪笂涓嬫粦鍔ㄦ帶浠�
+        /// </summary>
+        private VerticalFrameControl listBodyControl = null;
+        /// <summary>
+        /// 娣诲姞鐩爣鐨勭殑瀹瑰櫒鎺т欢
+        /// </summary>
+        private FrameListControl frameTargetTableControl = null;
+        /// <summary>
+        /// 杩欎釜鏄姞鍒般�愭暣涓晫闈㈢殑涓婁笅婊戝姩鎺т欢銆戜腑,淇冧娇鐣岄潰鑳藉婊戝姩鍒氬ソ瓒呰繃銆愬畬鎴愭寜閽��
+        /// </summary>
+        private FrameLayout frameBottomTemp = null;
+        /// <summary>
+        /// 鍦烘櫙鍥剧墖鏄剧ず鎺т欢(鐢熸垚鍥剧墖鏂囦欢浣跨敤)
+        /// </summary>
+        private ImageView btnScenePic = null;
+        /// <summary>
+        /// 鍦烘櫙鍥剧墖鏄惁鍙樻洿(閽堝缂栬緫妯″紡)
+        /// </summary>
+        private bool isScenePictrueChanged = false;
+        /// <summary>
+        /// 鎵ц鐩爣鏄惁鏀瑰彉(閽堝缂栬緫妯″紡)
+        /// </summary>
+        private bool isAdjustTargetChanged = false;
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        /// <param name="i_editorScene">缂栬緫鐨勫満鏅璞�</param>
+        public void ShowForm(SceneUI i_editorScene)
+        {
+            this.ScrollEnabled = false;
+            this.editorScene = i_editorScene;
+
+            //鍏嬮殕涓�涓复鏃剁紪杈戠殑鍙橀噺
+            this.cloneScene = new SceneUI();
+            if (i_editorScene != null)
+            {
+                cloneScene.Id = i_editorScene.Id;
+                cloneScene.Name = i_editorScene.Name;
+                cloneScene.IconPath = i_editorScene.IconPath;
+                cloneScene.IconPathType = i_editorScene.IconPathType;
+                var room = HdlRoomLogic.Current.GetRoomBySceneId(i_editorScene.Id);
+                if (room != null)
+                {
+                    //褰撳墠鐨勬埧闂�
+                    this.nowRoomId = room.Id;
+                }
+                //璁剧疆澶撮儴淇℃伅
+                base.SetTitleText(Language.StringByID(R.MyInternationalizationString.EditorScene));
+            }
+            else
+            {
+                cloneScene.IconPath = "SceneIcon/0.png";
+                listAdjustTarget = new List<Scene.DeviceListData>();
+                //璁剧疆澶撮儴淇℃伅
+                base.SetTitleText(Language.StringByID(R.MyInternationalizationString.AddScence));
+            }
+
+            //鍒濆鍖栦腑閮ㄤ俊鎭�
+            this.InitMiddleFrame();
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+        /// </summary>
+        private void InitMiddleFrame()
+        {
+            //鏁翠釜鐣岄潰鐨勪笂涓嬫粦鍔ㄦ帶浠�
+            this.listBodyControl = new VerticalFrameControl();
+            listBodyControl.Height = bodyFrameLayout.Height;
+            bodyFrameLayout.AddChidren(listBodyControl);
+
+            //鍒濆鍖栧満鏅浘鐗�
+            this.InitScenePictureControl();
+
+            //鍒濆鍖栦俊鎭紪杈戞帶浠�
+            this.InitInfoEditorControl();
+
+            //鍒濆鍖栨坊鍔犵洰鏍�
+            this.InitAddTargetControl();
+
+            //瀹屾垚
+            var btnSave = new BottomClickButton();
+            btnSave.TextID = R.MyInternationalizationString.uFinish;
+            bodyFrameLayout.AddChidren(btnSave);
+            btnSave.ButtonClickEvent += (sender, e) =>
+            {
+                //淇濆瓨鍦烘櫙鏁版嵁
+                this.SaveSceneData();
+            };
+
+            //鍒嗕韩鐨勫満鏅笉鑳戒繚瀛�
+            if (this.editorScene != null && this.editorScene.IsSharedScene == true)
+            {
+                btnSave.CanClick = false;
+            }
+            else if (Config.Instance.Home.IsShowTemplate == true)
+            {
+                //妯℃澘鍦烘櫙涓嶈兘淇濆瓨
+                btnSave.CanClick = false;
+            }
+            //濡傛灉鏄湁妯℃澘,鏈夎澶囩殑鏃跺��,鍦ㄦ病鏈夊彂閫佹垚鍔熶箣鍓�
+            else if (Common.Config.Instance.Home.TemplateMode == 2
+               && Common.Config.Instance.Home.SendTemplateSuccess == false)
+            {
+                btnSave.CanClick = false;
+            }
+        }
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖栧満鏅浘鐗嘷____________________
+
+        /// <summary>
+        /// 鍒濆鍖栧満鏅浘鐗�
+        /// </summary>
+        private void InitScenePictureControl()
+        {
+            //鍦烘櫙鍥剧墖杩欓儴鍒嗙殑鐧借壊鑳屾櫙
+            var framePicBack = new FrameLayout();
+            framePicBack.Height = Application.GetRealHeight(559);
+            framePicBack.BackgroundColor = UserCenterColor.Current.White;
+            listBodyControl.frameTable.AddChidren(framePicBack);
+
+            //鍦烘櫙鍥剧墖搴曢儴闃村奖
+            var btnShadow = new PicViewControl(916, 487);
+            btnShadow.Y = Application.GetRealHeight(46);
+            btnShadow.Gravity = Gravity.CenterHorizontal;
+            btnShadow.UnSelectedImagePath = "Room/Room_Rectangle.png";
+            framePicBack.AddChidren(btnShadow);
+            //鍦烘櫙鍥剧墖
+            this.btnScenePic = new ImageView();
+            btnScenePic.Y = Application.GetRealHeight(46);
+            btnScenePic.Width = this.GetPictrueRealSize(887);
+            btnScenePic.Height = this.GetPictrueRealSize(444);
+            btnScenePic.Radius = (uint)Application.GetRealHeight(17);
+            btnScenePic.Gravity = Gravity.CenterHorizontal;
+            if (this.editorScene == null)
+            {
+                btnScenePic.ImagePath = "SceneIcon/0.png";
+            }
+            else if (this.editorScene.IconPathType == 0)
+            {
+                btnScenePic.ImagePath = this.editorScene.IconPath;
+            }
+            else
+            {
+                btnScenePic.ImageBytes = Global.ReadFileByHomeId(this.editorScene.IconPath);
+            }
+            framePicBack.AddChidren(btnScenePic);
+            //鍥剧墖閬僵
+            var btnZhezhao = new FrameLayout();
+            btnZhezhao.Width = btnScenePic.Width;
+            btnZhezhao.Height = btnScenePic.Height;
+            btnZhezhao.Y = btnScenePic.Y;
+            btnZhezhao.Gravity = Gravity.CenterHorizontal;
+            btnZhezhao.Radius = (uint)Application.GetRealHeight(17);
+            btnZhezhao.BackgroundColor = UserCenterColor.Current.PictrueZhezhaoColor;
+            framePicBack.AddChidren(btnZhezhao);
+
+            //鍒嗕韩鐨勫満鏅笉鑳界紪杈�
+            if (this.editorScene == null || this.editorScene.IsSharedScene == false)
+            {
+                if (Config.Instance.Home.IsShowTemplate == true)
+                {
+                    //妯℃澘鍦烘櫙涓嶅厑璁哥紪杈�
+                    return;
+                }
+                btnZhezhao.MouseUpEventHandler += (sender, e) =>
+                {
+                    //鎴块棿鍥剧墖閫夋嫨
+                    this.ScenePictrueSelect(btnScenePic);
+                };
+            }
+        }
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖栦俊鎭紪杈慱____________________
+
+        /// <summary>
+        /// 鍒濆鍖栦俊鎭紪杈戞帶浠�
+        /// </summary>
+        private void InitInfoEditorControl()
+        {
+            //鐧借壊鑳屾櫙妗�
+            var frameBack = new FrameLayout();
+            frameBack.Y = Application.GetRealHeight(582);
+            frameBack.Height = Application.GetRealHeight(429);
+            frameBack.BackgroundColor = UserCenterColor.Current.White;
+            this.listBodyControl.frameTable.AddChidren(frameBack);
+
+            //淇℃伅缂栬緫
+            var btnTitle = new NormalViewControl(300, 60, true);
+            btnTitle.X = ControlCommonResourse.XXLeft;
+            btnTitle.Y = Application.GetRealHeight(46);
+            btnTitle.TextSize = 15;
+            btnTitle.TextID = R.MyInternationalizationString.uInfoEditor;
+            btnTitle.TextColor = UserCenterColor.Current.TextColor2;
+            frameBack.AddChidren(btnTitle);
+
+            //鍦烘櫙鍚嶇О
+            var rowScene = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.SceneName), this.cloneScene.Name);
+            rowScene.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputSceneName);
+            rowScene.txtInput.MaxByte = 32;//闄愬埗鍙兘杈撳叆32涓瓧鑺�
+            rowScene.Y = btnTitle.Bottom + Application.GetRealHeight(23);
+            frameBack.AddChidren(rowScene);
+            rowScene.InitControl();
+            //搴曠嚎
+            rowScene.AddBottomLine();
+            rowScene.txtInput.TextChangeEventHandler += (sender, value) =>
+            {
+                this.cloneScene.Name = value;
+            };
+
+            //鎵�灞炲尯鍩�
+            var rowBelong = new BelongAreaControl();
+            rowBelong.Y = rowScene.Bottom + Application.GetRealHeight(14);
+            frameBack.AddChidren(rowBelong);
+            rowBelong.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), this.nowRoomId);
+            //鍒嗕韩鐨勫満鏅笉鑳界紪杈�
+            if (this.editorScene == null || this.editorScene.IsSharedScene == false)
+            {
+                rowBelong.SelectRoomEvent += (selectId) =>
+                {
+                    this.nowRoomId = selectId;
+                };
+            }
+            if (Config.Instance.Home.IsShowTemplate == true)
+            {
+                //妯℃澘鍦烘櫙涓嶅厑璁哥紪杈�
+                rowBelong.CanClick = false;
+            }
+        }
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖栨坊鍔犵洰鏍嘷____________________
+
+        /// <summary>
+        /// 鍒濆鍖栨坊鍔犵洰鏍�
+        /// </summary>
+        private void InitAddTargetControl()
+        {
+            if (this.frameTargetTableControl == null || this.frameTargetTableControl.Parent == null)
+            {
+                //娣诲姞鐩爣鐨勭殑瀹瑰櫒鎺т欢
+                this.frameTargetTableControl = new FrameListControl();
+                frameTargetTableControl.Y = Application.GetRealHeight(1034);
+                frameTargetTableControl.BackgroundColor = UserCenterColor.Current.White;
+                frameTargetTableControl.Height = Application.GetRealHeight(346);
+                this.listBodyControl.frameTable.AddChidren(frameTargetTableControl);
+            }
+            else
+            {
+                this.frameTargetTableControl?.RemoveAll();
+                frameTargetTableControl.Height = Application.GetRealHeight(346);
+            }
+
+            //娣诲姞鐩爣
+            var rowAddTarget = new FrameRowControl(frameTargetTableControl.rowSpace / 2);
+            rowAddTarget.UseClickStatu = false;
+            rowAddTarget.Y = Application.GetRealHeight(46 - 12);
+            frameTargetTableControl.AddChidren(rowAddTarget);
+            rowAddTarget.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.AddScentTargetAction), 600);
+            //+鍙�
+            var btnAddIcon = rowAddTarget.AddMostRightEmptyIcon(61, 58);
+            btnAddIcon.UnSelectedImagePath = "Item/Add.png";
+            //搴曠嚎
+            rowAddTarget.AddBottomLine();
+            rowAddTarget.ButtonClickEvent += (sender, e) =>
+            {
+                //鏄剧ず娣诲姞鐩爣鑿滃崟
+                this.ShowAddTargetMenu();
+            };
+            if (Config.Instance.Home.IsShowTemplate == true)
+            {
+                //妯℃澘鍦烘櫙涓嶅厑璁哥紪杈�
+                rowAddTarget.CanClick = false;
+            }
+            //濡傛灉鏄湁妯℃澘,鏈夎澶囩殑鏃跺��,鍦ㄦ病鏈夊彂閫佹垚鍔熶箣鍓�
+            if (Common.Config.Instance.Home.TemplateMode == 2
+               && Common.Config.Instance.Home.SendTemplateSuccess == false)
+            {
+                rowAddTarget.CanClick = false;
+            }
+
+            HdlThreadLogic.Current.RunThread(() =>
+            {
+                //浠庣綉鍏宠幏鍙栧満鏅殑鎵ц鐩爣
+                var result = this.GetSceneTargetList();
+                if (result == true)
+                {
+                    //娣诲姞銆愭墽琛岀洰鏍囪銆�
+                    this.AddTargetRow();
+                }
+            });
+        }
+
+        #endregion
+
+        #region 鈻� 鑾峰彇鍙婃坊鍔犮�愮洰鏍囪銆慱______________
+
+        /// <summary>
+        /// 娣诲姞銆愭墽琛岀洰鏍囪銆�
+        /// </summary>
+        private void AddTargetRow()
+        {
+            //妫�娴嬬綉鍏充笂鐨勬暟鎹槸鍚﹀拰鏈湴涓�鑷�
+            for (int i = 0; i < this.listAdjustTarget.Count; i++)
+            {
+                if (listAdjustTarget[i].Type == 0)
+                {
+                    //璁惧
+                    var device = Common.LocalDevice.Current.GetDevice(listAdjustTarget[i].DeviceAddr, listAdjustTarget[i].Epoint);
+                    if (device == null)
+                    {
+                        //涓嶆樉绀鸿繖涓笉瀛樺湪鏈湴鐨勮澶�
+                        listAdjustTarget.RemoveAt(i);
+                        i--;
+                    }
+                    continue;
+                }
+                else if (listAdjustTarget[i].Type == 1)
+                {
+                    //鍦烘櫙
+                    var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(listAdjustTarget[i].ElseScenesId);
+                    if (scene == null)
+                    {
+                        //涓嶆樉绀鸿繖涓笉瀛樺湪鏈湴鐨勮澶�
+                        listAdjustTarget.RemoveAt(i);
+                        i--;
+                    }
+                    continue;
+                }
+            }
+
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                for (int i = 0; i < listAdjustTarget.Count; i++)
+                {
+                    if (listAdjustTarget[i].Type == 0)
+                    {
+                        //璁惧
+                        this.AddDeviceTargetRow(listAdjustTarget[i], i, i != listAdjustTarget.Count - 1);
+                    }
+                    else if (listAdjustTarget[i].Type == 1)
+                    {
+                        //鍦烘櫙
+                        this.AddSceneTargetRow(listAdjustTarget[i], i, i != listAdjustTarget.Count - 1);
+                    }
+                    else if (listAdjustTarget[i].Type == 2)
+                    {
+                        //寤舵椂
+                        this.AddDelayTimeTargetRow(listAdjustTarget[i], i, i != listAdjustTarget.Count - 1);
+                    }
+                }
+                //鍒濆鍖栦績浣跨晫闈㈣兘澶熷垰濂芥粦鍔ㄨ秴杩囦繚瀛樻寜閽殑鎺т欢
+                this.InitFrameBottomTempControl();
+
+                //璋冩暣鎵ц鐩爣鐨勬甯冮珮搴�
+                this.AdjustTargetTableHeight();
+            });
+        }
+
+        #endregion
+
+        #region 鈻� 娣诲姞璁惧鎵ц鐩爣琛宊________________
+
+        /// <summary>
+        /// 娣诲姞璁惧鎵ц鐩爣琛�
+        /// </summary>
+        private void AddDeviceTargetRow(Scene.DeviceListData data, int index, bool addLine)
+        {
+            //璁惧
+            var device = Common.LocalDevice.Current.GetDevice(data.DeviceAddr, data.Epoint);
+            var rowDevice = new DeviceRoomControl(device, frameTargetTableControl.rowSpace / 2);
+            rowDevice.MainKeys = index.ToString();
+            this.frameTargetTableControl.AddChidren(rowDevice);
+            //鎺т欢鍚戝彸鍋忕Щ
+            rowDevice.frameTable.LeftOffset = Application.GetRealWidth(104) - ControlCommonResourse.XXLeft;
+            rowDevice.InitControl();
+            rowDevice.frameTable.UseClickStatu = false;
+
+            //鐘舵�佹枃鏈�
+            string statuText2 = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(data.TaskList);
+            var btnStatu = rowDevice.frameTable.AddMostRightView(statuText2, 400);
+            if (addLine == true)
+            {
+                //搴曠嚎
+                rowDevice.frameTable.AddBottomLine();
+            }
+            //鍒嗕韩鐨勫満鏅笉鑳界紪杈�
+            if (this.editorScene == null || this.editorScene.IsSharedScene == false)
+            {
+                if (Config.Instance.Home.IsShowTemplate == true)
+                {
+                    //妯℃澘鍦烘櫙涓嶅厑璁哥紪杈�
+                    return;
+                }
+                //缂栬緫
+                var btnEditor = rowDevice.AddEditorControl();
+                btnEditor.ButtonClickEvent += (sender, e) =>
+                {
+                    if (device.Type == DeviceType.DimmableLight//璋冨厜鍣�
+                      || device.Type == DeviceType.ColorDimmableLight)//褰╃伅
+                    {
+                        var form = new UserCenter.Safety.AlarmTargetStatuSelectLightForm();
+                        form.AddForm(device, data.TaskList);
+                        form.FinishSelectEvent += (statuText, listInfo) =>
+                        {
+                            //鎵ц鐩爣宸茬粡鏀瑰彉
+                            this.isAdjustTargetChanged = true;
+
+                            if (listInfo.Count == 0) { statuText = string.Empty; }
+                            btnStatu.Text = statuText;
+                            //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨
+                            data.TaskList.Clear();
+                            data.TaskList.AddRange(listInfo);
+                        };
+                    }
+                    else if (device.Type == DeviceType.Thermostat)//绌鸿皟
+                    {
+                        var form = new UserCenter.Safety.AlarmTargetStatuSelectAcForm();
+                        form.AddForm(device, data.TaskList);
+                        form.FinishSelectEvent += (statuText, listInfo) =>
+                        {
+                            //鎵ц鐩爣宸茬粡鏀瑰彉
+                            this.isAdjustTargetChanged = true;
+
+                            if (listInfo.Count == 0) { statuText = string.Empty; }
+                            btnStatu.Text = statuText;
+                            //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨
+                            data.TaskList.Clear();
+                            data.TaskList.AddRange(listInfo);
+                        };
+                    }
+                    else if (device.Type == DeviceType.WindowCoveringDevice)//绐楀笜
+                    {
+                        var form = new UserCenter.Safety.AlarmTargetStatuSelectCurtainForm();
+                        form.AddForm(device, data.TaskList);
+                        form.FinishSelectEvent += (statuText, listInfo) =>
+                        {
+                            //鎵ц鐩爣宸茬粡鏀瑰彉
+                            this.isAdjustTargetChanged = true;
+
+                            if (listInfo.Count == 0) { statuText = string.Empty; }
+                            btnStatu.Text = statuText;
+                            //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨
+                            data.TaskList.Clear();
+                            data.TaskList.AddRange(listInfo);
+                        };
+                    }
+                    else
+                    {
+                        //鍏朵粬鐩存帴褰掍负寮�鍏崇被
+                        var form = new UserCenter.Safety.AlarmTargetStatuSelectSwitchForm();
+                        form.AddForm(device, data.TaskList);
+                        form.FinishSelectEvent += (statuText, listInfo) =>
+                        {
+                            //鎵ц鐩爣宸茬粡鏀瑰彉
+                            this.isAdjustTargetChanged = true;
+
+                            if (listInfo.Count == 0) { statuText = string.Empty; }
+                            btnStatu.Text = statuText;
+                            //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨
+                            data.TaskList.Clear();
+                            data.TaskList.AddRange(listInfo);
+                        };
+                    }
+                };
+
+                //鍒犻櫎
+                var btnDelete = rowDevice.AddDeleteControl();
+                btnDelete.ButtonClickEvent += (sender, e) =>
+                {
+                    //闅愯棌鍙虫粦鑿滃崟
+                    rowDevice.HideMenu();
+                    //纭鏄惁瑕佸垹闄わ紵
+                    string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg);
+                    this.ShowMassage(ShowMsgType.Confirm, msg, () =>
+                    {
+                        //鎵ц鐩爣宸茬粡鏀瑰彉
+                        this.isAdjustTargetChanged = true;
+                        //璋冩暣鎵ц鐩爣閲岄潰鐨勫叏閮ㄥ潗鏍�(鍒犻櫎鐨勬椂鍊欎娇鐢�)
+                        this.AdjustTargetLocation(rowDevice.MainKeys);
+                        //绉婚櫎
+                        rowDevice.RemoveFromParent();
+                        this.listAdjustTarget.Remove(data);
+                        //璋冩暣鎵ц鐩爣鐨勬甯冮珮搴�
+                        this.AdjustTargetTableHeight();
+                    });
+                };
+            }
+        }
+
+        #endregion
+
+        #region 鈻� 娣诲姞鍦烘櫙鎵ц鐩爣琛宊________________
+
+        /// <summary>
+        /// 娣诲姞鍦烘櫙鎵ц鐩爣琛�
+        /// </summary>
+        private void AddSceneTargetRow(Scene.DeviceListData data, int index, bool addLine)
+        {
+            //鍦烘櫙
+            var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(data.ElseScenesId);
+            var rowScene = new SceneRoomControl(scene.Id, scene.Name, frameTargetTableControl.rowSpace / 2);
+            rowScene.MainKeys = index.ToString();
+            frameTargetTableControl.AddChidren(rowScene);
+            //鎺т欢鍚戝彸鍋忕Щ
+            rowScene.frameTable.LeftOffset = Application.GetRealWidth(104) - ControlCommonResourse.XXLeft;
+            rowScene.InitControl();
+            if (addLine == true)
+            {
+                //搴曠嚎
+                rowScene.frameTable.AddBottomLine();
+            }
+            rowScene.frameTable.UseClickStatu = false;
+
+            //鍒嗕韩鐨勫満鏅笉鑳界紪杈�
+            if (this.editorScene == null || this.editorScene.IsSharedScene == false)
+            {
+                if (Config.Instance.Home.IsShowTemplate == true)
+                {
+                    //妯℃澘鍦烘櫙涓嶅厑璁哥紪杈�
+                    return;
+                }
+                //鍒犻櫎
+                var btnDelete = rowScene.AddDeleteControl();
+                btnDelete.ButtonClickEvent += (sender, e) =>
+                {
+                    //闅愯棌鍙虫粦鑿滃崟
+                    rowScene.HideMenu();
+
+                    //纭鏄惁瑕佸垹闄わ紵
+                    string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg);
+                    this.ShowMassage(ShowMsgType.Confirm, msg, () =>
+                    {
+                        //鎵ц鐩爣宸茬粡鏀瑰彉
+                        this.isAdjustTargetChanged = true;
+                        //璋冩暣鎵ц鐩爣閲岄潰鐨勫叏閮ㄥ潗鏍�(鍒犻櫎鐨勬椂鍊欎娇鐢�)
+                        this.AdjustTargetLocation(rowScene.MainKeys);
+                        //绉婚櫎
+                        rowScene.RemoveFromParent();
+                        this.listAdjustTarget.Remove(data);
+                        //璋冩暣鎵ц鐩爣鐨勬甯冮珮搴�
+                        this.AdjustTargetTableHeight();
+                    });
+                };
+            }
+        }
+
+        #endregion
+
+        #region 鈻� 娣诲姞寤舵椂琛宊________________________
+
+        /// <summary>
+        /// 娣诲姞寤舵椂琛�
+        /// </summary>
+        private void AddDelayTimeTargetRow(Scene.DeviceListData data, int index, bool addLine)
+        {
+            string hourText = Language.StringByID(R.MyInternationalizationString.Hour);
+            string minuText = Language.StringByID(R.MyInternationalizationString.Minute);
+            string secondText = Language.StringByID(R.MyInternationalizationString.Second);
+
+            //琛屾帶浠�
+            var rowDelay = new RowLayoutControl(frameTargetTableControl.rowSpace / 2);
+            rowDelay.MainKeys = index.ToString();
+            frameTargetTableControl.AddChidren(rowDelay);
+            //鎺т欢鍚戝彸鍋忕Щ
+            rowDelay.frameTable.LeftOffset = Application.GetRealWidth(104) - ControlCommonResourse.XXLeft;
+            rowDelay.frameTable.UseClickStatu = false;
+            //鍥炬爣
+            var btnIcon = rowDelay.frameTable.AddLeftIcon();
+            btnIcon.UnSelectedImagePath = "Item/Timer.png";
+            //寤舵椂
+            var btnDelay = rowDelay.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.Delay), 400);
+            btnDelay.TextColor = UserCenterColor.Current.TextGrayColor3;
+
+            //x灏忔椂x鍒嗛挓x绉掑悗
+            string timeStr = this.GetTimeString(data.DelayTime, hourText, minuText, secondText);
+            timeStr += Language.StringByID(R.MyInternationalizationString.Later);
+            var btnStatu = rowDelay.frameTable.AddMostRightView(timeStr, 300);
+
+            if (addLine == true)
+            {
+                //搴曠嚎
+                rowDelay.frameTable.AddBottomLine();
+            }
+
+            //鍒嗕韩鐨勫満鏅笉鑳界紪杈�
+            if (this.editorScene == null || this.editorScene.IsSharedScene == false)
+            {
+                if (Common.Config.Instance.Home.IsShowTemplate == true)
+                {
+                    //妯℃澘鍦烘櫙涓嶅厑璁哥紪杈�
+                    return;
+                }
+                //缂栬緫
+                var btnEditor = rowDelay.AddEditorControl();
+                btnEditor.ButtonClickEvent += (sender, e) =>
+                {
+                    //寤舵椂鏃堕棿閫夋嫨
+                    var form = new AdjustTargetAddDelayTimeForm();
+                    form.AddForm(data.DelayTime);
+                    form.FinishSelectEvent += (delayTime) =>
+                    {
+                        //鎵ц鐩爣宸茬粡鏀瑰彉
+                        this.isAdjustTargetChanged = true;
+                        data.DelayTime = delayTime;
+                        //x灏忔椂x鍒嗛挓x绉掑悗
+                        timeStr = this.GetTimeString(data.DelayTime, hourText, minuText, secondText);
+                        btnStatu.Text = timeStr;
+                    };
+                };
+                //鍒犻櫎
+                var btnDelete = rowDelay.AddDeleteControl();
+                btnDelete.ButtonClickEvent += (sender, e) =>
+                {
+                    //闅愯棌鍙虫粦鑿滃崟
+                    rowDelay.HideMenu();
+                    //纭鏄惁瑕佸垹闄わ紵
+                    string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg);
+                    this.ShowMassage(ShowMsgType.Confirm, msg, () =>
+                    {
+                        //鎵ц鐩爣宸茬粡鏀瑰彉
+                        this.isAdjustTargetChanged = true;
+                        //璋冩暣鎵ц鐩爣閲岄潰鐨勫叏閮ㄥ潗鏍�(鍒犻櫎鐨勬椂鍊欎娇鐢�)
+                        this.AdjustTargetLocation(rowDelay.MainKeys);
+                        //绉婚櫎
+                        rowDelay.RemoveFromParent();
+                        this.listAdjustTarget.Remove(data);
+                        //璋冩暣鎵ц鐩爣鐨勬甯冮珮搴�
+                        this.AdjustTargetTableHeight();
+                    });
+                };
+            }
+        }
+
+        #endregion
+
+        #region 鈻� 鑾峰彇鎵ц鐩爣_______________________
+
+        /// <summary>
+        /// 浠庣綉鍏宠幏鍙栧満鏅殑鎵ц鐩爣
+        /// </summary>
+        /// <returns></returns>
+        private bool GetSceneTargetList()
+        {
+            if (this.editorScene == null || this.listAdjustTarget != null)
+            {
+                return true;
+            }
+
+            //鎵撳紑杩涘害鏉�
+            this.ShowProgressBar();
+            //鑾峰彇鎵ц鐩爣鍒楄〃
+            var listData = HdlSceneLogic.Current.GetAdjustTargetList(this.editorScene);
+            if (listData == null)
+            {
+                this.CloseProgressBar(ShowReLoadMode.YES);
+                return false;
+            }
+            this.listAdjustTarget = new List<Scene.DeviceListData>();
+            listAdjustTarget.AddRange(listData);
+
+            this.CloseProgressBar();
+            return true;
+        }
+
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖栦績浣跨晫闈㈡粦鍔ㄦ帶浠禵____________
+
+        /// <summary>
+        /// 鍒濆鍖栦績浣跨晫闈㈣兘澶熷垰濂芥粦鍔ㄨ秴杩囦繚瀛樻寜閽殑鎺т欢
+        /// </summary>
+        private void InitFrameBottomTempControl()
+        {
+            if (this.frameBottomTemp != null)
+            {
+                return;
+            }
+            //鍊熺敤涓�涓嬫帶浠剁殑Y杞�
+            var btnTemp = new BottomClickButton();
+
+            //閭d釜鐗规畩鐨勬帶浠�
+            this.frameBottomTemp = new FrameLayout();
+            frameBottomTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(23);
+            this.listBodyControl.AddChidren(frameBottomTemp);
+        }
+
+        #endregion
+
+        #region 鈻� 鏄剧ず娣诲姞鐩爣鑿滃崟___________________
+
+        /// <summary>
+        /// 鏄剧ず娣诲姞鐩爣鑿滃崟
+        /// </summary>
+        private void ShowAddTargetMenu()
+        {
+            var menuContr = new BottomMenuSelectForm();
+            menuContr.AddForm(3);
+            //鍔熻兘
+            menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uFunction), () =>
+            {
+                var form = new AdjustTargetAddDeviceForm();
+                form.AddForm(listAdjustTarget);
+                form.FinishSelectEvent += (dicData) =>
+                {
+                    //鎵ц鐩爣宸茬粡鏀瑰彉
+                    this.isAdjustTargetChanged = true;
+                    foreach (var mainKey in dicData.Keys)
+                    {
+                        var device = LocalDevice.Current.GetDevice(mainKey);
+                        var data = new Scene.DeviceListData();
+                        data.Type = 0;
+                        data.DeviceAddr = device.DeviceAddr;
+                        data.Epoint = device.DeviceEpoint;
+                        data.TaskList = dicData[mainKey];
+                        this.listAdjustTarget.Add(data);
+                    }
+                    //鍒锋柊鍒楄〃鎺т欢
+                    this.InitAddTargetControl();
+                };
+            });
+            //鍦烘櫙
+            menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uScence), () =>
+            {
+                var form = new AdjustTargetAddSceneForm();
+                form.AddForm(listAdjustTarget);
+                form.FinishSelectEvent += (listSceneId) =>
+                {
+                    //鎵ц鐩爣宸茬粡鏀瑰彉
+                    this.isAdjustTargetChanged = true;
+                    foreach (int sceneId in listSceneId)
+                    {
+                        var data = new Scene.DeviceListData();
+                        data.Type = 1;
+                        data.ElseScenesId = sceneId;
+                        this.listAdjustTarget.Add(data);
+                    }
+                    //鍒锋柊鍒楄〃鎺т欢
+                    this.InitAddTargetControl();
+                };
+            });
+            //寤舵椂
+            menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.Delay), () =>
+            {
+                //寤舵椂鏃堕棿閫夋嫨
+                var form = new AdjustTargetAddDelayTimeForm();
+                form.AddForm(0);
+                form.FinishSelectEvent += (delayTime) =>
+                {
+                    //鎵ц鐩爣宸茬粡鏀瑰彉
+                    this.isAdjustTargetChanged = true;
+                    var data = new Scene.DeviceListData();
+                    data.Type = 2;
+                    data.DelayTime = delayTime;
+                    this.listAdjustTarget.Add(data);
+                    //鍒锋柊鍒楄〃鎺т欢
+                    this.InitAddTargetControl();
+                };
+            });
+        }
+
+        #endregion
+
+        #region 鈻� 淇濆瓨鍦烘櫙鏁版嵁_______________________
+
+        /// <summary>
+        /// 淇濆瓨鍦烘櫙鏁版嵁
+        /// </summary>
+        private void SaveSceneData()
+        {
+            //妫�娴嬭兘鍚︿繚瀛樺満鏅�
+            if (this.CheckCanSaveScene() == false)
+            {
+                return;
+            }
+            HdlThreadLogic.Current.RunThread(() =>
+            {
+                //鎵撳紑杩涘害鏉�
+                this.ShowProgressBar();
+                //鏂板缓鍦烘櫙
+                if (this.editorScene == null)
+                {
+                    //淇濆瓨鏂板缓鐨勫満鏅�
+                    this.SaveSceneDataByNewMode();
+                }
+                //缂栬緫鍦烘櫙
+                else
+                {
+                    //淇濆瓨缂栬緫鐨勫満鏅�
+                    this.SaveSceneDataByEditorMode();
+                }
+            });
+        }
+
+        /// <summary>
+        /// 淇濆瓨鏂板缓鐨勫満鏅�
+        /// </summary>
+        private void SaveSceneDataByNewMode()
+        {
+            //娣诲姞鍦烘櫙
+            this.editorScene = HdlSceneLogic.Current.AddNewSceneToGateway(this.cloneScene.Name, this.listAdjustTarget);
+            //鍏抽棴杩涘害鏉�
+            this.CloseProgressBar();
+
+            if (editorScene == null)
+            {
+                return;
+            }
+            if (this.nowRoomId != string.Empty)
+            {
+                //娣诲姞鎴块棿
+                var newRoom = HdlRoomLogic.Current.GetRoomById(this.nowRoomId);
+                HdlSceneLogic.Current.AddSceneToRoom(newRoom, this.editorScene);
+            }
+            if (this.cloneScene.IconPathType != 0)
+            {
+                //鑷畾涔夊浘鐗�
+                var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss");
+                var fileName = $"SceneIcon_{tradeTime}.png";
+                //鐢熸垚鏂囦欢鍥剧墖
+                IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), this.btnScenePic.ImageBytes);
+                HdlAutoBackupLogic.AddOrEditorFile(fileName);
+                this.cloneScene.IconPath = fileName;
+            }
+            //杞Щ灞炴��
+            this.editorScene.Name = this.cloneScene.Name;
+            this.editorScene.IconPathType = this.cloneScene.IconPathType;
+            this.editorScene.IconPath = this.cloneScene.IconPath;
+            this.editorScene.Save();
+
+            //鏂板缓鍦烘櫙,涓婚〉闇�瑕侀噸鏂板埛鏂�
+            UserView.UserPage.Instance.RefreshAllForm = true;
+
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                //璋冪敤鍥炶皟鍑芥暟
+                this.SceneChangedEvent?.Invoke(this.editorScene, this.nowRoomId);
+                this.CloseForm();
+            });
+        }
+
+        /// <summary>
+        /// 淇濆瓨缂栬緫鐨勫満鏅�
+        /// </summary>
+        private async void SaveSceneDataByEditorMode()
+        {
+            if (this.editorScene.Name != this.cloneScene.Name)
+            {
+                //淇敼鍚嶇О
+                var result = await HdlSceneLogic.Current.EditorSceneNameFromGateway(this.editorScene, this.cloneScene.Name);
+                if (result == false)
+                {
+                    //鍏抽棴杩涘害鏉�
+                    this.CloseProgressBar();
+                    return;
+                }
+            }
+            if (isAdjustTargetChanged == true)
+            {
+                //淇敼鍦烘櫙
+                var result = await HdlSceneLogic.Current.EditorSceneFromGateway(this.editorScene, this.listAdjustTarget);
+                if (result == false)
+                {
+                    //鍏抽棴杩涘害鏉�
+                    this.CloseProgressBar();
+                    return;
+                }
+            }
+
+            if (this.nowRoomId != string.Empty)
+            {
+                //鍙樻洿鎴块棿
+                HdlSceneLogic.Current.ChangedSceneRoom(this.editorScene, this.nowRoomId);
+            }
+            else
+            {
+                //绉婚櫎鍑烘埧闂�
+                var room = HdlRoomLogic.Current.GetRoomBySceneId(this.editorScene.Id);
+                if (room != null)
+                {
+                    HdlSceneLogic.Current.DeleteSceneFromRoom(room, this.editorScene);
+                }
+            }
+
+            //鍥剧墖鏀瑰彉浜�
+            if (isScenePictrueChanged == true)
+            {
+                if (this.editorScene.IconPathType != 0)
+                {
+                    //鍒犻櫎鑷畾涔夊浘鐗�
+                    HdlFileLogic.Current.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, this.editorScene.IconPath));
+                    HdlAutoBackupLogic.DeleteFile(this.editorScene.IconPath);
+                }
+                if (this.cloneScene.IconPathType != 0)
+                {
+                    //鑷畾涔夊浘鐗�
+                    var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss");
+                    var fileName = $"SceneIcon_{tradeTime}.png";
+                    //鐢熸垚鏂囦欢鍥剧墖
+                    IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), this.btnScenePic.ImageBytes);
+                    HdlAutoBackupLogic.AddOrEditorFile(fileName);
+                    this.cloneScene.IconPath = fileName;
+                }
+            }
+
+            //杞Щ灞炴��
+            this.editorScene.Name = this.cloneScene.Name;
+            this.editorScene.IconPathType = this.cloneScene.IconPathType;
+            this.editorScene.IconPath = this.cloneScene.IconPath;
+            this.editorScene.Save();
+
+            //缂栬緫鍦烘櫙,涓婚〉闇�瑕侀噸鏂板埛鏂�
+            UserView.UserPage.Instance.RefreshAllForm = true;
+
+            //鍏抽棴杩涘害鏉�
+            this.CloseProgressBar();
+
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                //璋冪敤鍥炶皟鍑芥暟
+                this.SceneChangedEvent?.Invoke(this.editorScene, this.nowRoomId);
+                this.CloseForm();
+            });
+        }
+
+        /// <summary>
+        /// 妫�娴嬭兘鍚︿繚瀛樺満鏅�
+        /// </summary>
+        /// <returns></returns>
+        private bool CheckCanSaveScene()
+        {
+            if (this.cloneScene.Name == string.Empty)
+            {
+                //鍦烘櫙鍚嶄笉鑳戒负绌�
+                this.ShowMassage(ShowMsgType.Remind, Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull));
+                return false;
+            }
+            bool hadTarget = false;
+            foreach (var data in this.listAdjustTarget)
+            {
+                if (data.Type == 0 || data.Type == 1)
+                {
+                    //鎷ユ湁鎵ц鐩爣
+                    hadTarget = true;
+                    break;
+                }
+            }
+            if (hadTarget == false)
+            {
+                //璇锋坊鍔犳墽琛岀洰鏍�
+                this.ShowMassage(ShowMsgType.Remind, Language.StringByID(R.MyInternationalizationString.uPleaseAddAdjustTarget));
+                return false;
+            }
+            return true;
+        }
+
+        #endregion
+
+        #region 鈻� 鍦烘櫙鍥剧墖閫夋嫨_______________________
+
+        /// <summary>
+        /// 鍦烘櫙鍥剧墖閫夋嫨
+        /// </summary>
+        /// <param name="imageContr"></param>
+        private void ScenePictrueSelect(ImageView imageContr)
+        {
+            var menuContr = new BottomMenuSelectForm();
+            menuContr.AddForm(3);
+            //榛樿鍥惧簱
+            menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.LocalPicture), () =>
+            {
+                var form = new SelectLocalSceneImageForm();
+                form.AddForm();
+                form.FinishSelectEvent = (imgPath) =>
+                {
+                    if (string.IsNullOrEmpty(imgPath) == true)
+                    {
+                        return;
+                    }
+                    this.cloneScene.IconPathType = 0;
+                    this.cloneScene.IconPath = imgPath;
+                    imgPath = IO.FileUtils.GetImageFilePath(imgPath);
+                    imageContr.ImageBytes = IO.FileUtils.ReadFile(imgPath);
+                    //鍦烘櫙鍥剧墖宸茬粡鏀瑰彉
+                    this.isScenePictrueChanged = true;
+                };
+            });
+            //鎷嶇収
+            menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.Photograph), () =>
+            {
+                //閫氳繃鐩告満鎷嶇収瑁佸壀
+                CropImage.TakePicture((imagePath) =>
+                {
+                    if (string.IsNullOrEmpty(imagePath) == true)
+                    {
+                        return;
+                    }
+                    this.cloneScene.IconPathType = 1;
+                    imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
+                    System.IO.File.Delete(imagePath);
+                    //鍦烘櫙鍥剧墖宸茬粡鏀瑰彉
+                    this.isScenePictrueChanged = true;
+
+                }, "HdlPic", 2, 1);
+            });
+            //鎴戠殑鐩稿唽
+            menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.MyAblums), () =>
+            {
+                //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
+                CropImage.SelectPicture((imagePath) =>
+                {
+                    if (string.IsNullOrEmpty(imagePath) == true)
+                    {
+                        return;
+                    }
+                    this.cloneScene.IconPathType = 2;
+                    imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
+                    System.IO.File.Delete(imagePath);
+                    //鍦烘櫙鍥剧墖宸茬粡鏀瑰彉
+                    this.isScenePictrueChanged = true;
+
+                }, "HdlPic", 2, 1);
+            });
+        }
+
+        #endregion
+
+        #region 鈻� 鐣岄潰鍏抽棴___________________________
+
+        /// <summary>
+        /// 鐣岄潰鍏抽棴
+        /// </summary>
+        public override void CloseFormBefore()
+        {
+            this.SceneChangedEvent = null;
+
+            base.CloseFormBefore();
+        }
+
+        #endregion
+
+        #region 鈻� 涓�鑸柟娉昣__________________________
+
+        /// <summary>
+        /// 鑾峰彇鏃堕棿鐨勭炕璇戞枃鏈�
+        /// </summary>
+        /// <param name="second"></param>
+        /// <param name="hourText">灏忔椂鐨勬枃鏈�</param>
+        /// <param name="minuText">鍒嗙殑鏂囨湰</param>
+        /// <param name="secondText">绉掔殑鏂囨湰</param>
+        /// <returns></returns>
+        private string GetTimeString(int second, string hourText, string minuText, string secondText)
+        {
+            string timeStr = string.Empty;
+            int hour = second / 3600;
+            int minu = second % 3600 / 60;
+            int sec = second % 60;
+            if (hour > 0)
+            {
+                timeStr += hour + hourText;
+            }
+            if (minu > 0)
+            {
+                timeStr += minu + minuText;
+            }
+            if (sec > 0)
+            {
+                timeStr += sec + secondText;
+            }
+            return timeStr;
+        }
+
+        /// <summary>
+        /// 璋冩暣鎵ц鐩爣鐨勬甯冮珮搴�
+        /// </summary>
+        private void AdjustTargetTableHeight()
+        {
+            //璋冩暣妗屽竷楂樺害
+            int minHeight = Application.GetRealHeight(346);
+            int realHeight = frameTargetTableControl.GetChildren(frameTargetTableControl.ChildrenCount - 1).Bottom;
+            realHeight += Application.GetRealHeight(23);
+            if (realHeight > minHeight)
+            {
+                frameTargetTableControl.Height = realHeight;
+            }
+            else if (frameTargetTableControl.Height != minHeight)
+            {
+                frameTargetTableControl.Height = minHeight;
+            }
+            //杩欎釜鐗规畩鐨勪笢瑗垮繀椤绘斁鍦ㄦ墽琛岀洰鏍囧鍣ㄧ殑搴曢儴
+            this.frameBottomTemp.Y = frameTargetTableControl.Bottom;
+            //璋冩暣鍏ㄥ眬涓婁笅婊戝姩鎺т欢鐨勬甯冮珮搴�
+            this.listBodyControl.AdjustTableHeight();
+        }
+
+        /// <summary>
+        /// 璋冩暣鎵ц鐩爣閲岄潰鐨勫叏閮ㄥ潗鏍�(鍒犻櫎鐨勬椂鍊欎娇鐢�)
+        /// </summary>
+        /// <param name="mainKey">鍒犻櫎鐨勪富閿�</param>
+        private void AdjustTargetLocation(string mainKey)
+        {
+            bool canChanged = false;
+            int YY = 0;
+            for (int i = 0; i < frameTargetTableControl.ChildrenCount; i++)
+            {
+                var myRow = frameTargetTableControl.GetChildren(i);
+                if (canChanged == false && (myRow is RowLayoutControl))
+                {
+                    if (((RowLayoutControl)myRow).MainKeys == mainKey)
+                    {
+                        //宸茬粡鍒拌揪瑕佸垹闄ょ殑绱㈠紩
+                        canChanged = true;
+                        YY = frameTargetTableControl.GetChildren(i).Y;
+                    }
+                    continue;
+                }
+                if (canChanged == true)
+                {
+                    //瀹冧笅闈㈢殑琛屽叏閮ㄥ線涓婄Щ
+                    myRow.Y = YY;
+                    YY = myRow.Bottom;
+                }
+            }
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0