From 0d9f64668fd7350d6a21fd157e32009a96d98134 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 16 十二月 2020 13:09:08 +0800 Subject: [PATCH] 新云端代码Ver1.2 --- ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs | 178 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 89 insertions(+), 89 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs index 35854a4..b50d6ec 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs @@ -1,17 +1,17 @@ -锘縰sing System; -using System.Collections.Generic; -using Shared.Common; -using Shared.Phone.Device.CommonForm; +锘縰sing System; +using System.Collections.Generic; +using Shared.Common; +using Shared.Phone.Device.CommonForm; using Shared.Phone.UserCenter; -using Shared.Phone.UserView; -using ZigBee.Device; - -namespace Shared.Phone.MainPage -{ +using Shared.Phone.UserView; +using ZigBee.Device; + +namespace Shared.Phone.MainPage +{ /// <summary> /// 鏈垎閰嶇殑绠$悊鐣岄潰 - /// </summary> - public class UnallocatedRoomForm : EditorCommonForm + /// </summary> + public class UnallocatedRoomForm : EditorCommonForm { #region 鈻� 鍙橀噺澹版槑___________________________ @@ -72,46 +72,46 @@ #region 鈻� 鍒濆鍖朹____________________________ - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() { //鍒濆鍖栧ご閮ㄦ帶浠� - this.InitTopFrameLayout(); - //鍒濆鍖栦腑閮ㄦ帶浠� - this.InitBodyFrameLayout(); - - //璁剧疆澶撮儴淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.Unallocated)); - - //鍒濆鍖栧叏閫夋帶浠� - this.InitAllSelectControl(); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame() + this.InitTopFrameLayout(); + //鍒濆鍖栦腑閮ㄦ帶浠� + this.InitBodyFrameLayout(); + + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.Unallocated)); + + //鍒濆鍖栧叏閫夋帶浠� + this.InitAllSelectControl(); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() { var tabControl = new SceneFunctionSwitchControl(); tabControl.Y = Application.GetRealHeight(40); bodyFrameLayout.AddChidren(tabControl); //鍒濆鍖栧満鏅甯� - this.SceneBodyTableControl = new NormalFrameLayout(); - SceneBodyTableControl.Y = tabControl.Bottom; - SceneBodyTableControl.Height = bodyFrameLayout.Height - tabControl.Bottom; + this.SceneBodyTableControl = new NormalFrameLayout(); + SceneBodyTableControl.Y = tabControl.Bottom; + SceneBodyTableControl.Height = bodyFrameLayout.Height - tabControl.Bottom; bodyFrameLayout.AddChidren(SceneBodyTableControl); //鍒濆鍖栬澶囨甯� - this.DeviceBodyTableControl = new NormalFrameLayout(); - DeviceBodyTableControl.Y = tabControl.Bottom; - DeviceBodyTableControl.Height = bodyFrameLayout.Height - tabControl.Bottom; - bodyFrameLayout.AddChidren(DeviceBodyTableControl); - + this.DeviceBodyTableControl = new NormalFrameLayout(); + DeviceBodyTableControl.Y = tabControl.Bottom; + DeviceBodyTableControl.Height = bodyFrameLayout.Height - tabControl.Bottom; + bodyFrameLayout.AddChidren(DeviceBodyTableControl); + tabControl.SelectTabEvent += (index) => { //鍦烘櫙 @@ -130,17 +130,17 @@ //妫�娴嬪悇鎺т欢鐘舵�� this.CheckControlsStatu(this.nowSelectDeviceInfo); } - }; - + }; + //寮�濮嬪垵濮嬪寲鍦烘櫙鍔熻兘鍒囨崲鎺т欢 var listTitle = new List<string>(); listTitle.Add(Language.StringByID(R.MyInternationalizationString.uScence)); listTitle.Add(Language.StringByID(R.MyInternationalizationString.uFunction)); - //浠栦細鑷姩鍥炶皟浜嬩欢 - tabControl.InitControl(listTitle); + //浠栦細鑷姩鍥炶皟浜嬩欢 + tabControl.InitControl(listTitle); } - #endregion + #endregion #region 鈻� 鍦烘櫙鍒嗘敮___________________________ @@ -271,7 +271,7 @@ //璁惧鐨勮儗鏅鍣� var frameDeviceBack = new FrameLayout(); - frameDeviceBack.X = ControlCommonResourse.XXLeft; + frameDeviceBack.X = HdlControlResourse.XXLeft; frameDeviceBack.Y = Application.GetRealHeight(369); frameDeviceBack.BackgroundColor = UserCenterColor.Current.White; frameDeviceBack.Width = bodyFrameLayout.Width; @@ -300,7 +300,7 @@ { //澶撮儴鐨勭櫧鑹茶儗鏅� var functionBack1 = new FrameLayout(); - functionBack1.X = ControlCommonResourse.XXLeft; + functionBack1.X = HdlControlResourse.XXLeft; functionBack1.Y = Application.GetRealHeight(55); functionBack1.Height = Application.GetRealHeight(160); functionBack1.Width = Application.GetRealWidth(1028); @@ -308,7 +308,7 @@ DeviceBodyTableControl.AddChidren(functionBack1); functionBack1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft); var functionBack2 = new FrameLayout(); - functionBack2.X = ControlCommonResourse.XXLeft; + functionBack2.X = HdlControlResourse.XXLeft; functionBack2.Y = functionBack1.Bottom - Application.GetRealHeight(50); functionBack2.Height = Application.GetRealHeight(279 - 160 + 50); functionBack2.Width = Application.GetRealWidth(1028); @@ -318,7 +318,7 @@ //宸﹀彸婊戝姩鐨勬帶浠� var HorizontalView = new HorizontalScrolViewLayout(); - HorizontalView.X = Application.GetRealWidth(CommonFormResouce.X_Left); + HorizontalView.X = HdlControlResourse.XXLeft; HorizontalView.Y = Application.GetRealHeight(55); HorizontalView.Height = Application.GetRealHeight(279); HorizontalView.Width = Application.GetRealWidth(1028); @@ -391,7 +391,7 @@ //鍒濆鍖栬澶囧垪琛ㄦ帶浠� foreach (var deviceKey in rowInfo.listDeviceKeys) { - var device = LocalDevice.Current.GetDevice(deviceKey); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKey); var deviceRow = new Controls.DeviceSelectUnallocatedControl(listDeviceView.rowSpace / 2); listDeviceView.AddChidren(deviceRow); deviceRow.InitControl(device); @@ -489,12 +489,12 @@ if (this.canSelectAll == true) { //娣诲姞缂撳瓨 - dicSelectDevice[LocalDevice.Current.GetDeviceMainKeys(device)] = device; + dicSelectDevice[HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device)] = device; } else { //绉婚櫎缂撳瓨 - dicSelectDevice.Remove(LocalDevice.Current.GetDeviceMainKeys(device)); + dicSelectDevice.Remove(HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device)); } } } @@ -504,55 +504,55 @@ }; } - #endregion + #endregion - #region 鈻� [娣诲姞鍒癩鎺т欢_______________________ - + #region 鈻� [娣诲姞鍒癩鎺т欢_______________________ + /// <summary> /// 鍒濆鍖栨坊鍔犲埌鎺т欢 - /// </summary> + /// </summary> private void InitAddToControl() { - //娣诲姞鍒� 鐨勮儗鏅浘鎺т欢 - this.frameAddBackGroud = new FrameLayoutStatuControl(); - frameAddBackGroud.UseClickStatu = false; - frameAddBackGroud.Height = Application.GetRealHeight(202); - frameAddBackGroud.Gravity = Gravity.BottomCenter; - frameAddBackGroud.BackgroundImagePath = "Room/AddBackground.png"; - bodyFrameLayout.AddChidren(frameAddBackGroud); - frameAddBackGroud.Visible = false; - - //娣诲姞鍒� 鎸夐挳 - var btnAdd = new NormalViewControl(1034, 156, true); - btnAdd.Gravity = Gravity.Center; + //娣诲姞鍒� 鐨勮儗鏅浘鎺т欢 + this.frameAddBackGroud = new FrameLayoutStatuControl(); + frameAddBackGroud.UseClickStatu = false; + frameAddBackGroud.Height = Application.GetRealHeight(202); + frameAddBackGroud.Gravity = Gravity.BottomCenter; + frameAddBackGroud.BackgroundImagePath = "Room/AddBackground.png"; + bodyFrameLayout.AddChidren(frameAddBackGroud); + frameAddBackGroud.Visible = false; + + //娣诲姞鍒� 鎸夐挳 + var btnAdd = new NormalViewControl(1034, 156, true); + btnAdd.Gravity = Gravity.Center; btnAdd.BackgroundColor = UserCenterColor.Current.White; - btnAdd.TextColor = ZigbeeColor.Current.GXCTextSelectedColor4; - btnAdd.TextAlignment = TextAlignment.Center; - btnAdd.TextID = R.MyInternationalizationString.AddTo; - btnAdd.TextSize = 17; - btnAdd.Radius = (uint)Application.GetRealHeight(35); + btnAdd.TextColor = ZigbeeColor.Current.GXCTextSelectedColor4; + btnAdd.TextAlignment = TextAlignment.Center; + btnAdd.TextID = R.MyInternationalizationString.AddTo; + btnAdd.TextSize = 17; + btnAdd.Radius = (uint)Application.GetRealHeight(35); frameAddBackGroud.AddChidren(btnAdd, ChidrenBindMode.BindEvent); frameAddBackGroud.ButtonClickEvent += (sender, e) => { - HdlControlLogic.Current.ShowBottomListRoomView(string.Empty, Language.StringByID(R.MyInternationalizationString.AddTo), (selectId, selectName) => - { + HdlControlLogic.Current.ShowBottomListRoomView(string.Empty, Language.StringByID(R.MyInternationalizationString.AddTo), (selectId, selectName) => + { if (selectId == string.Empty) { //閫夋嫨鐨勬槸鏈垎閰� return; - } - //鍙樻洿浜嗗綋鍓嶆埧闂寸殑涓滆タ,涓婚〉闇�瑕佸埛鏂� + } + //鍙樻洿浜嗗綋鍓嶆埧闂寸殑涓滆タ,涓婚〉闇�瑕佸埛鏂� if (HdlRoomLogic.Current.NowMainPageRoom.Id == selectId) { this.dataHadChanged = true; - } - //淇濆瓨閫夋嫨鐨勮澶囧拰鍦烘櫙 - var room = HdlRoomLogic.Current.GetRoomById(selectId); + } + //淇濆瓨閫夋嫨鐨勮澶囧拰鍦烘櫙 + var room = HdlRoomLogic.Current.GetRoomById(selectId); this.SaveSelectDeviceAndScene(room); //鍒嗙被鐣岄潰闇�瑕佸埛鏂� UserPage.Instance.RefreshCategoryForm = true; //涓婁紶绌洪棿鍖哄煙淇℃伅 - HdlRoomLogic.Current.SetRoomInfoToGateway(); + HdlRoomLogic.Current.SetRoomInfoToGateway(); }); }; } @@ -634,11 +634,11 @@ //鍏ㄩ儴鐨勮澶� var listDevice = HdlRoomLogic.Current.GetUnalloctedDevice(); //鏍规嵁璁惧鎵�灞炵被鍨嬫帓搴� - listDevice = LocalDevice.Current.SortDeviceByBelongType(listDevice); + listDevice = HdlDeviceCommonLogic.Current.SortDeviceByBelongType(listDevice); var dic = new Dictionary<string, DeviceRowInfo>(); foreach (var device in listDevice) { - var typeInfo = LocalDevice.Current.GetDeviceBelongEnumInfo(device); + var typeInfo = HdlDeviceCommonLogic.Current.GetDeviceBelongEnumInfo(device); //鎸夋墍灞濱D鍒嗙粍 if (dic.ContainsKey(typeInfo.BeloneText) == false) { @@ -646,12 +646,12 @@ string path1 = string.Empty; string path2 = string.Empty; //鑾峰彇鍥剧墖 - Common.LocalDevice.Current.GetDeviceFunctionTypeMenuIcon(typeInfo, ref path1, ref path2); + HdlDeviceCommonLogic.Current.GetDeviceFunctionTypeMenuIcon(typeInfo, ref path1, ref path2); dic[typeInfo.BeloneText].IconPath = path1; dic[typeInfo.BeloneText].IconPathSelected = path2; dic[typeInfo.BeloneText].Text = typeInfo.BeloneText; } - dic[typeInfo.BeloneText].listDeviceKeys.Add(LocalDevice.Current.GetDeviceMainKeys(device)); + dic[typeInfo.BeloneText].listDeviceKeys.Add(HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device)); } return dic; } @@ -774,6 +774,6 @@ public List<string> listDeviceKeys = new List<string>(); } - #endregion - } -} + #endregion + } +} -- Gitblit v1.8.0