lss
2020-06-12 9c16d3614d9b88c637f967518a329f239fcd3aaf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
using Shared.Common;
using Shared.Phone.UserCenter.SmartSound;
using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
 
namespace Shared.Phone.UserCenter.Device
{
    /// <summary>
    /// 设备列表的主界面
    /// </summary>
    public class DeviceListMainForm : EditorCommonForm
    {
        #region ■ 变量声明___________________________
        /// <summary>
        /// 智能音箱
        /// </summary>
        private MySmartSoundControl smmartSoundView = null;
        /// <summary>
        /// 网关控件
        /// </summary>
        private MyGatewayControl gatewayViewRow = null;
        /// <summary>
        /// 列表控件
        /// </summary>
        private VerticalListRefreshControl listView = null;
        /// <summary>
        /// 前一次显示出左滑菜单的RowLayout
        /// </summary>
        private RowLayoutControl oldShowRightMuneRow = null;
        /// <summary>
        /// 行控件的信息(Keys:Mac地址)
        /// </summary>
        private Dictionary<string, DeviceObjRowInfo> dicRowInfo = new Dictionary<string, DeviceObjRowInfo>();
        /// <summary>
        /// 当前正在操作的设备对象Mac地址(设备信息编辑界面用)
        /// </summary>
        private string nowActionDeviceMac = null;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        public void ShowForm()
        {
            this.ScrollEnabled = false;
 
            //设置标题信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.DeviceManagement));
 
            //右上添加按钮
            var btnAddDeviceIcon = new MostRightIconControl(69, 69);
            btnAddDeviceIcon.UnSelectedImagePath = "Item/Add.png";
            topFrameLayout.AddChidren(btnAddDeviceIcon);
            btnAddDeviceIcon.InitControl();
            btnAddDeviceIcon.ButtonClickEvent += (sender, e) =>
            {
                var form = new DeviceDirection.AddDeviceTypeListForm();
                form.AddForm();
            };
 
            //初始化中部控件
            this.InitMiddleFrame();
 
            //开启传感器报警监视
            this.StartCheckDeviceAlarm();
            //添加接收设备在线上报的监听
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceListFormReceivePushOnline", ReceiveComandDiv.A设备在线上报, (report) =>
            {
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //接受设备状态
                    this.ReceiveDeviceStatu(report);
 
                }, ShowErrorMode.NO);
            });
            //开启检测网关在线状态的线程
            HdlGatewayLogic.Current.StartCheckGatewayOnlineThread(this);
        }
 
        /// <summary>
        /// 初始化中部控件(外部可以调用)
        /// </summary>
        public void InitMiddleFrame()
        {
            //清空bodyFrame
            this.ClearBodyFrame();
 
            smmartSoundView = new MySmartSoundControl();
            bodyFrameLayout.AddChidren(smmartSoundView);
            smmartSoundView.InitControl();
            //当前不是虚拟住宅的话
            if (Config.Instance.Home.IsVirtually == false)
            {
                smmartSoundView.ButtonClickEvent += (sernder, e) =>
                {
                    var form = new SmartSoundListForm();
                    form.AddForm();
                };
            }
            //初始化网关行控件
            GatewayResourse.NowSelectGatewayId = GatewayResourse.AppOldSelectGatewayId;
            var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId);
            this.gatewayViewRow = new MyGatewayControl(nowGateway);
            bodyFrameLayout.AddChidren(gatewayViewRow);
            gatewayViewRow.InitControl();
 
            //初始化搜索控件
            this.InitSearchControl();
 
            HdlThreadLogic.Current.RunThread(() =>
            {
                //初始化设备列表控件
                this.InitDeviceListControl();
            });
        }
 
        #endregion
 
        #region ■ 初始化搜索控件_____________________
 
        /// <summary>
        /// 初始化搜索控件
        /// </summary>
        private void InitSearchControl()
        {
            //白色背景
            var frame = new FrameLayout();
            frame.BackgroundColor = UserCenterColor.Current.White;
            frame.Y = this.gatewayViewRow.Bottom + Application.GetRealHeight(23);
            frame.Height = bodyFrameLayout.Height - this.gatewayViewRow.Bottom - Application.GetRealHeight(23);
            bodyFrameLayout.AddChidren(frame);
 
            //搜索设备关键词
            string textTip = Language.StringByID(R.MyInternationalizationString.uSearchDeviceKeyWorld);
            var txtSearchControl = new SearchTextControl(textTip);
            frame.AddChidren(txtSearchControl);
            txtSearchControl.Y = Application.GetRealHeight(46);
            //绑定回调函数
            txtSearchControl.BindEvent(this.SetRowDataBySearchKeys);
 
            //列表控件
            listView = new VerticalListRefreshControl(29);
            listView.Y = txtSearchControl.Bottom + Application.GetRealHeight(29);
            listView.Height = frame.Height - txtSearchControl.Bottom - Application.GetRealHeight(29);
            frame.AddChidren(listView);
            listView.BeginHeaderRefreshingAction += () =>
            {
                //刷新设备的话,主页需要重新刷新
                UserView.UserPage.Instance.RefreshForm = true;
 
                HdlThreadLogic.Current.RunThread(() =>
                {
                    //下拉刷新
                    this.ListViewBeginHeaderRefreshing();
                });
            };
        }
 
        #endregion
 
        #region ■ 初始化设备列表控件_________________
 
        /// <summary>
        /// 初始化设备列表控件
        /// </summary>
        private void InitDeviceListControl()
        {
            //获取设备列表
            var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(GatewayResourse.NowSelectGatewayId);
            var listSpecialOta = Common.LocalDevice.Current.GetSpecialOtaDevice(GatewayResourse.NowSelectGatewayId);
            listDevice.AddRange(listSpecialOta);
 
            this.dicRowInfo.Clear();
 
            //没有设备
            if (listDevice.Count == 0)
            {
                return;
            }
 
            //根据MAC合并设备列表
            this.MargeAllDeviceByMac(listDevice);
 
            if (this.Parent == null)
            {
                return;
            }
            HdlThreadLogic.Current.RunMain(() =>
            {
                var listOta = new List<OTADevice>();
                foreach (var macAddress in this.dicRowInfo.Keys)
                {
                    //获取ota设备
                    var ota = Common.LocalDevice.Current.GetOTADevice(macAddress);
                    if (ota != null)
                    {
                        listOta.Add(ota);
                    }
                    //添加设备的菜单行
                    this.AddDeviceMenuRow(macAddress);
                }
                //如果当前不是虚拟住宅
                if (Common.Config.Instance.Home.IsVirtually == false)
                {
                    //开启网关在线监测的线程
                    this.StartGatewayOnlieCheckThread();
                    //检测设备新版本
                    this.CheckDeviceNewVersion(listOta);
                }
            });
        }
 
        #endregion
 
        #region ■ 添加设备菜单行_____________________
 
        /// <summary>
        /// 添加设备的菜单行
        /// </summary>
        /// <param name="deviceMac">设备Mac地址</param>
        private void AddDeviceMenuRow(string deviceMac)
        {
            var rowInfo = this.dicRowInfo[deviceMac];
 
            //创建一个可以展开和收缩的FrameLayout,相当于菜单栏
            var frameTable = new FrameListControl(29);
            frameTable.Height = ControlCommonResourse.ListViewRowHeight + frameTable.rowSpace;
            listView.AddChidren(frameTable);
            rowInfo.frameTable = frameTable;
 
            //控件
            var rowMenu = new DeviceObjectControl(deviceMac, listView.rowSpace / 2);
            rowMenu.MainKeys = deviceMac;
            frameTable.AddChidren(rowMenu);
            rowMenu.InitControl();
            rowInfo.MenuRow = rowMenu;
            //向右图标
            var btnRight = rowMenu.frameTable.AddMostRightEmptyIcon(58, 58);
            btnRight.UnSelectedImagePath = "Item/RightNext.png";
            btnRight.SelectedImagePath = "Item/Down.png";
            rowMenu.frameTable.ChangedChidrenBindMode(btnRight, ChidrenBindMode.NotBind);
 
            //提示新版本
            var btnNew = new InformationTipView(rowMenu.btnIcon);
            btnNew.Visible = false;
            rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEvent);
            rowMenu.AddTag("btnNew", btnNew);
 
            //检测设备是否拥有定位的功能
            var listdevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
            if (listdevice.Count > 0 && Common.LocalDevice.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
            {
                //定位
                var btnPosition = rowMenu.AddEditorControl(false);
                btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
                btnPosition.ButtonClickEvent += (sender, e) =>
                {
                    //定位
                    Common.LocalDevice.Current.SetFixedPositionCommand(listdevice[0]);
                };
            }
 
            //展开,折叠
            btnRight.ButtonClickEvent += (sender, e) =>
            {
                //回路数大于1才展开
                if (Common.LocalDevice.Current.GetDevicesCountByMac(deviceMac) > 1)
                {
                    btnRight.IsSelected = !btnRight.IsSelected;
                    //展开或者折叠明细列表
                    this.ShowDetailList(deviceMac, btnRight.IsSelected);
                }
                else
                {
                    btnNew.Visible = false;
                    var form = new DeviceMacInfoEditorForm();
                    form.AddForm(deviceMac);
                    //界面跳转,记录当前的正在操作的设备的Mac地址
                    this.nowActionDeviceMac = deviceMac;
                }
            };
 
            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);
                //界面跳转,记录当前的正在操作的设备的Mac地址
                this.nowActionDeviceMac = deviceMac;
            };
            //左滑菜单事件
            rowMenu.OpenMenuAction += () =>
            {
                if (this.oldShowRightMuneRow != null && this.oldShowRightMuneRow.MainKeys != rowMenu.MainKeys)
                {
                    //左滑菜单只能滑一个
                    this.oldShowRightMuneRow.HideMenu();
                }
                this.oldShowRightMuneRow = rowMenu;
            };
        }
 
        #endregion
 
        #region ■ 展开折叠___________________________
 
        /// <summary>
        /// 展开或者隐藏列表
        /// </summary>
        /// <param name="deviceMac">设备Mac地址</param>
        /// <param name="isShow">是否展开</param>
        private void ShowDetailList(string deviceMac, bool isShow)
        {
            var rowInfo = this.dicRowInfo[deviceMac];
            //它原来的高度
            int oldHeight = rowInfo.frameTable.Height;
            //变更的高度,默认为列表隐藏
            int heightValue = ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace;
            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
            if (isShow == true)
            {
                //获取这一堆设备时属于什么类型的
                var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
                if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
                {
                    var listTemp = Common.LocalDevice.Current.GetMutilfunctionPanelByMac(listDevice);
                    //展开模式时,扩大依据为:它有几个子控件
                    heightValue = (listTemp.Count + 1) * (ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
                    //标题自己就是一个子控件
                    if (rowInfo.frameTable.ChildrenCount == 1)
                    {
                        foreach (CommonDevice info in listTemp)
                        {
                            //加载它的列表
                            this.AddDeviceDetailRow(rowInfo.frameTable, info, deviceEnumInfo);
                        }
                    }
                }
                else
                {
                    //展开模式时,扩大依据为:它有几个子控件
                    heightValue = (listDevice.Count + 1) * (ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
                    //标题自己就是一个子控件
                    if (rowInfo.frameTable.ChildrenCount == 1)
                    {
                        foreach (CommonDevice info in listDevice)
                        {
                            //加载它的列表
                            this.AddDeviceDetailRow(rowInfo.frameTable, info, deviceEnumInfo);
                        }
                    }
                }
            }
            //自身高度变更
            rowInfo.frameTable.Height = heightValue;
        }
 
        /// <summary>
        /// 添加设备的明细行
        /// </summary>
        /// <param name="frame">容器</param>
        /// <param name="device"></param>
        /// <param name="deviceEnumInfo"></param>
        private void AddDeviceDetailRow(FrameListControl frame, CommonDevice device, DeviceEnumInfo deviceEnumInfo)
        {
            var rowInfo = this.dicRowInfo[device.DeviceAddr];
            if (rowInfo.dicDetailRow == null)
            {
                rowInfo.dicDetailRow = new Dictionary<string, DeviceRoomControl>();
            }
 
            //行控件
            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();
            //底线
            rowDevice.frameTable.AddBottomLine();
            //右箭头
            rowDevice.frameTable.AddRightArrow();
            //在线状态
            rowDevice.IsOnline = rowInfo.MenuRow.IsOnline;
            //保存控件
            string maikey = Common.LocalDevice.Current.GetDeviceMainKeys(device);
            rowInfo.dicDetailRow[maikey] = rowDevice;
 
            //检测设备是否拥有定位的功能
            if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(device) == true)
            {
                //定位
                var btnPosition = rowDevice.AddEditorControl(false);
                btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
                btnPosition.ButtonClickEvent += (sender, e) =>
                {
                    //定位
                    Common.LocalDevice.Current.SetFixedPositionCommand(device);
                };
            }
 
            rowDevice.frameTable.ButtonClickEvent += (sender, e) =>
            {
                //隐藏菜单
                rowDevice.HideMenu();
                //界面跳转,记录当前的正在操作的设备的Mac地址
                this.nowActionDeviceMac = device.DeviceAddr;
                //如果当前住宅不是虚拟住宅
                if (Common.Config.Instance.Home.IsVirtually == false)
                {
                    //显示设备功能配置界面
                    this.ShowDeviceFunctionSettionForm(device, deviceEnumInfo);
                }
            };
            //左滑菜单事件
            rowDevice.OpenMenuAction += () =>
            {
                if (this.oldShowRightMuneRow != null && this.oldShowRightMuneRow.MainKeys != rowDevice.MainKeys)
                {
                    //左滑菜单只能滑一个
                    this.oldShowRightMuneRow.HideMenu();
                }
                this.oldShowRightMuneRow = rowDevice;
            };
        }
 
        /// <summary>
        /// 显示设备功能配置界面
        /// </summary>
        /// <param name="device"></param>
        /// <param name="deviceEnumInfo"></param>
        private void ShowDeviceFunctionSettionForm(CommonDevice device, DeviceEnumInfo deviceEnumInfo)
        {
            //智能门锁
            if (deviceEnumInfo.BeloneType == DeviceBeloneType.A智能门锁)
            {
                var form = new DeviceMacInfoEditorForm();
                form.AddForm(device.DeviceAddr);
            }
            else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A窗帘)
            {
                var form = new DeviceMacInfoEditorForm();
                form.AddForm(device.DeviceAddr);
            }
            //pir传感器
            else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.Sensor_Pir)
            {
                if (device is IASZone)
                {
                    var form = new DevicePirSensor.PirSensorBindTargetSettionForm();
                    form.AddForm((IASZone)device);
                }
                else
                {
                    //pir传感器,他们又搞了个继电器在里面
                    var form = new DeviceFunctionSettionForm();
                    form.AddForm(device, true);
                }
            }
            //中央空调
            else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.AirConditioner_ZbGateway)
            {
                var form = new DeviceAirConditioner.IndoorUnitSettionForm();
                form.AddForm((AC)device);
            }
            //环境面板
            else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment)
            {
                var form = new DeviceFunctionSettionForm();
                form.AddForm(device, true);
            }
            //新风面板
            else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
            {
                //方悦新风面板的按键配置
                //干接点
                if (device.Type == DeviceType.FreshAir)
                {
                    var form = new DevicePanel.PanelFangyueFreshAirButtonSettionForm();
                    form.AddForm(device);
                }
                else
                {
                    var form = new DeviceFunctionSettionForm();
                    form.AddForm(device, true);
                }
            }
            //方悦面板
            else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo
                || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour
                || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEight)
            {
                //干接点
                if (device.Type == DeviceType.OnOffSwitch)
                {
                    //方悦面板的按键配置
                    var form = new DevicePanel.PanelFangyueButtonSettionForm();
                    form.AddForm(device);
                }
                //继电器
                else if (device.Type == DeviceType.OnOffOutput)
                {
                    //方悦面板的功能配置
                    var form = new DevicePanel.PanelFangyueFunctionSettionForm();
                    form.AddForm(device, deviceEnumInfo);
                }
                else
                {
                    var form = new DeviceFunctionSettionForm();
                    form.AddForm(device, true);
                }
            }
            //面板设备
            else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A按键面板)
            {
                //干接点
                if (device.Type == DeviceType.OnOffSwitch)
                {
                    //河东设备
                    if (deviceEnumInfo.IsHdlDevice == true)
                    {
                        var form = new DevicePanel.PanelButtonSettionForm();
                        form.AddForm(device);
                    }
                    else
                    {
                        var form = new DeviceDryContactSettionForm();
                        form.AddForm(device);
                    }
                }
                //继电器
                else if (device.Type == DeviceType.OnOffOutput)
                {
                    //河东设备
                    if (deviceEnumInfo.IsHdlDevice == true)
                    {
                        var form = new DevicePanel.PanelFunctionSettionForm();
                        form.AddForm(device);
                    }
                    else
                    {
                        var form = new DeviceFunctionSettionForm();
                        form.AddForm(device, true);
                    }
                }
                else
                {
                    var form = new DeviceFunctionSettionForm();
                    form.AddForm(device, true);
                }
            }
            //如果是干接点
            else if (device.Type == DeviceType.OnOffSwitch)
            {
                var form = new DeviceDryContactSettionForm();
                form.AddForm(device);
            }
            else
            {
                var form = new DeviceFunctionSettionForm();
                form.AddForm(device, true);
            }
        }
 
        #endregion
 
        #region ■ 键值搜索___________________________
 
        /// <summary>
        /// 根据搜索键值,设定列表数据
        /// </summary>
        /// <param name="searchKey">Search key.</param>
        private void SetRowDataBySearchKeys(string searchKey)
        {
            lock (dicRowInfo)
            {
                Application.RunOnMainThread(() =>
                {
                    if (this.listView == null)
                    {
                        return;
                    }
                    //首先先移除列表所有控件
                    this.listView.RemoveAll();
                    //如果搜索键值为空,则还原为原始状态:显示设备类型总览
                    if (searchKey == string.Empty)
                    {
                        foreach (var deviceMac in dicRowInfo.Keys)
                        {
                            //添加设备的行
                            this.AddDeviceMenuRow(deviceMac);
                        }
                        //添加底部间隙
                        var frameTemp = new FrameLayout();
                        frameTemp.Height = Application.GetRealHeight(23);
                        listView.AddChidren(frameTemp);
                    }
                    else
                    {
                        //搜索名字里面包含键值的设备
                        foreach (var rowInfo in this.dicRowInfo.Values)
                        {
                            if ((rowInfo.MacName != null && rowInfo.MacName.Contains(searchKey) == true)
                                || rowInfo.DeviveTypeName.Contains(searchKey) == true)
                            {
                                //添加设备的行
                                this.AddDeviceMenuRow(rowInfo.DeviceMac);
                            }
                        }
                        //添加底部间隙
                        var frameTemp = new FrameLayout();
                        frameTemp.Height = Application.GetRealHeight(23);
                        listView.AddChidren(frameTemp);
                    }
                });
            }
        }
 
        #endregion
 
        #region ■ 下拉刷新___________________________
 
        /// <summary>
        /// 滑动控件下拉刷新
        /// </summary>
        private async void ListViewBeginHeaderRefreshing()
        {
            //如果当前住宅是虚拟的
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                //就显示一个特效而已
                System.Threading.Thread.Sleep(2000);
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //隐藏下拉刷新特效
                    listView.EndHeaderRefreshing();
                });
                return;
            }
            //如果是在线的
            var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.NowSelectGatewayId);
            if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(nowGateway) == true)
            {
                //检测广播到的这个网关是否拥有住宅ID
                ZbGateway realWay = null;
                if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, nowGateway) == true)
                {
                    //重新设置住宅ID(这个应该是不经过APP,直接把网关恢复了出厂设置)
                    if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.HomeId) == true)
                    {
                        //显示进度条
                        ProgressBar.Show();
                        int result2 = await HdlGatewayLogic.Current.ReBindNewGateway(realWay);
                        //关闭进度条
                        ProgressBar.Close();
                        if (result2 == -1)
                        {
                            return;
                        }
                    }
                }
            }
            if (this.Parent == null)
            {
                return;
            }
 
            //获取全部设备
            int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway);
            if (this.Parent == null)
            {
                return;
            }
            HdlThreadLogic.Current.RunMain(() =>
            {
                //隐藏下拉刷新特效
                listView.EndHeaderRefreshing();
                if (result != -1)
                {
                    //重新刷新界面
                    this.InitMiddleFrame();
                }
            });
        }
 
        #endregion
 
        #region ■ 网关在线检测_______________________
 
        /// <summary>
        /// 开启网关在线监测的线程
        /// </summary>
        private void StartGatewayOnlieCheckThread()
        {
            string selectGwId = GatewayResourse.NowSelectGatewayId;
            HdlThreadLogic.Current.RunThread(() =>
            {
                ZbGateway zbGateway = HdlGatewayLogic.Current.GetLocalGateway(selectGwId);
                if (zbGateway == null)
                {
                    return;
                }
                //刷新网关在线状态
                HdlGatewayLogic.Current.RefreshGatewayOnlineStatu(new List<ZbGateway>() { zbGateway });
 
                Application.RunOnMainThread(() =>
                {
                    if (this.gatewayViewRow != null && this.gatewayViewRow.zbGatewayId == selectGwId)
                    {
                        bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbGateway);
                        //刷新控件在线状态
                        this.gatewayViewRow?.RefreshOnlineStatu();
                        //根据网关在线状态刷新设备在线状态
                        this.RefreshDeviceOnlineStatuByGatewayOnline(online);
                    }
                });
            });
        }
 
        /// <summary>
        /// 网关在线状态变更
        /// </summary>
        /// <param name="gateWay">网关对象</param>
        /// <param name="online">在线状态变更后的状态</param>
        /// <param name="hadGwOnline">2020.05.25追加:此住宅是否拥有网关在线</param>
        public override void GatewayOnlinePush(ZbGateway gateWay, bool online, bool hadGwOnline)
        {
            if (this.gatewayViewRow == null)
            {
                return;
            }
            if (gateWay.GwId == this.gatewayViewRow.zbGatewayId)
            {
                Application.RunOnMainThread(() =>
                {
                    //相同的状态,不需要再次刷新
                    if (this.gatewayViewRow.isOnline != online)
                    {
                        //根据网关在线状态刷新设备在线状态
                        this.RefreshDeviceOnlineStatuByGatewayOnline(online);
                    }
                    //刷新控件在线状态
                    this.gatewayViewRow?.RefreshOnlineStatu();
                });
            }
        }
 
        #endregion
 
        #region ■ 设备在线检测_______________________
 
        /// <summary>
        /// 根据网关在线状态刷新设备在线状态
        /// </summary>
        /// <param name="gatewayOnline">网关的在线状态</param>
        private void RefreshDeviceOnlineStatuByGatewayOnline(bool gatewayOnline)
        {
            if (gatewayOnline == false)
            {
                //设置全部设备离线
                this.SetAllDeviceOffLine();
            }
            else
            {
                //刷新设备在线状态
                this.RefreshDeviceOnlineStatu();
            }
        }
 
        /// <summary>
        /// 刷新设备在线状态
        /// </summary>
        private void RefreshDeviceOnlineStatu()
        {
            string gwId = GatewayResourse.NowSelectGatewayId;
            HdlThreadLogic.Current.RunThread(() =>
            {
                System.Threading.Thread.Sleep(2000);
                //这里主要只是获取在线状态
                var list = LocalDevice.Current.GetDeviceOnlineList(gwId);
                HdlThreadLogic.Current.RunMain(() =>
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        //设置设备在线状态
                        this.ReceiveDeviceStatu(list[i]);
                    }
 
                }, ShowErrorMode.NO);
            });
        }
 
        /// <summary>
        /// 接受设备状态
        /// </summary>
        /// <param name="device"></param>
        private void ReceiveDeviceStatu(CommonDevice device)
        {
            DeviceObjRowInfo rowInfo = null;
            if (this.dicRowInfo.ContainsKey(device.DeviceAddr) == true)
            {
                rowInfo = this.dicRowInfo[device.DeviceAddr];
            }
            if (rowInfo == null || rowInfo.MenuRow == null)
            {
                return;
            }
            //刷新设备的在线状态
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
            var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
            if (localDevice != null)
            {
                //在线状态一样的话,不需要刷新
                if (localDevice.IsOnline != device.IsOnline)
                {
                    //保存状态
                    localDevice.IsOnline = device.IsOnline;
                    localDevice.ReSave();
                }
            }
 
            rowInfo.MenuRow.IsOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device);
            if (rowInfo.dicDetailRow != null)
            {
                foreach (var detailRow in rowInfo.dicDetailRow.Values)
                {
                    detailRow.IsOnline = rowInfo.MenuRow.IsOnline;
                }
            }
        }
 
        /// <summary>
        /// 设置全部设备离线
        /// </summary>
        private void SetAllDeviceOffLine()
        {
            foreach (var rowInfo in this.dicRowInfo.Values)
            {
                //菜单
                if (rowInfo.MenuRow != null)
                {
                    rowInfo.MenuRow.IsOnline = false;
                }
                //明细
                if (rowInfo.dicDetailRow != null)
                {
                    foreach (var detailRow in rowInfo.dicDetailRow.Values)
                    {
                        detailRow.IsOnline = false;
                    }
                }
            }
        }
 
        #endregion
 
        #region ■ 传感器报警_________________________
 
        /// <summary>
        /// 开启传感器报警监视
        /// </summary>
        private void StartCheckDeviceAlarm()
        {
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceListFormSensor", ReceiveComandDiv.A传感器上报, (device) =>
             {
                 HdlThreadLogic.Current.RunMain(() =>
                 {
                     if (this.dicRowInfo.ContainsKey(device.DeviceAddr) == false)
                     {
                         return;
                     }
                     //显示传感器上报的特效
                     this.dicRowInfo[device.DeviceAddr].MenuRow?.StartSensorPushAppeal();
                 });
             });
        }
 
        #endregion
 
        #region ■ 设备新版本_________________________
 
        /// <summary>
        /// 检测设备新版本
        /// </summary>
        /// <param name="list">ota设备</param>
        private void CheckDeviceNewVersion(List<OTADevice> list)
        {
            HdlThreadLogic.Current.RunThread(async () =>
            {
                await System.Threading.Tasks.Task.Delay(2000);
                foreach (var ota in list)
                {
                    if (this.Parent == null)
                    {
                        return;
                    }
                    //添加升级固件信息(成不成功都无所谓)
                    var result = await HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.ZigbeeDevice, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
 
                    //获取设备最新版本
                    var deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.ZigbeeDevice,
                        ota.HwVersion.ToString(),
                        ota.ImgTypeId.ToString(),
                        ota.ImgVersion);
 
                    if (deviceFirmware == null)
                    {
                        continue;
                    }
 
                    //拥有新版本
                    Application.RunOnMainThread(() =>
                    {
                        if (this.dicRowInfo.ContainsKey(ota.DeviceAddr) == true)
                        {
                            var row = this.dicRowInfo[ota.DeviceAddr].MenuRow;
                            if (row != null)
                            {
                                var btnNew = (InformationTipView)row.GetTagByKey("btnNew");
                                if (btnNew != null)
                                {
                                    btnNew.Visible = true;
                                }
                            }
                        }
                    });
                }
            });
        }
 
        #endregion
 
        #region ■ 实现外部调用_______________________
 
        /// <summary>
        /// 添加新的设备到界面桌布中(外部调用)
        /// </summary>
        /// <param name="deviceAddr">设备Mac地址</param>
        public void AddDeviceToFormTable(string deviceAddr)
        {
            //新建一个对象
            if (this.dicRowInfo.ContainsKey(deviceAddr) == false)
            {
                var localDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceAddr);
                if (localDevice.Count == 0)
                {
                    //针对单纯只有一个200端点的设备
                    var ota = Common.LocalDevice.Current.GetOTADevice(deviceAddr);
                    if (ota == null)
                    {
                        //入网之后,又把它删了
                        return;
                    }
                    localDevice.Add(ota);
                }
                var rowNewInfo = new DeviceObjRowInfo();
                rowNewInfo.DeviceMac = deviceAddr;
                rowNewInfo.MacName = Common.LocalDevice.Current.GetDeviceMacName(localDevice[0]);
                rowNewInfo.DeviveTypeName = Common.LocalDevice.Current.GetDeviceObjectText(localDevice);
                this.dicRowInfo[deviceAddr] = rowNewInfo;
 
                //创建新的行
                this.AddDeviceMenuRow(deviceAddr);
 
                //记录当前的正在操作的设备的Mac地址
                this.nowActionDeviceMac = deviceAddr;
            }
        }
 
        /// <summary>
        /// 刷新指定设备行的信息(外部调用)
        /// </summary>
        /// <param name="deviceAddr">设备Mac地址</param>
        public void RefreshDeviceRow(string deviceAddr)
        {
            if (this.dicRowInfo.ContainsKey(deviceAddr) == true)
            {
                var row = this.dicRowInfo[deviceAddr];
                row.MenuRow?.RefreshControlInfo(true);
                //明细
                if (row.dicDetailRow != null)
                {
                    foreach (var detailRow in row.dicDetailRow.Values)
                    {
                        detailRow.RefreshControlInfo();
                    }
                }
            }
        }
 
        #endregion
 
        #region ■ 合并数据___________________________
 
        /// <summary>
        /// 根据MAC合并设备列表
        /// </summary>
        /// <param name="listDevice"></param>
        private void MargeAllDeviceByMac(List<CommonDevice> listDevice)
        {
            //根据Mac全部分组
            var dic = new Dictionary<string, List<CommonDevice>>();
            foreach (CommonDevice device in listDevice)
            {
                if (device == null || device.DeviceAddr == null)
                {
                    continue;
                }
                if (dic.ContainsKey(device.DeviceAddr) == false)
                {
                    dic[device.DeviceAddr] = new List<CommonDevice>();
                }
                dic[device.DeviceAddr].Add(device);
            }
            //获取信息
            foreach (var mac in dic.Keys)
            {
                var info = new DeviceObjRowInfo();
                info.DeviceMac = mac;
                info.MacName = Common.LocalDevice.Current.GetDeviceMacName(dic[mac][0]);
                info.DeviveTypeName = Common.LocalDevice.Current.GetDeviceObjectText(dic[mac]);
                this.dicRowInfo[mac] = info;
            }
        }
 
        #endregion
 
        #region ■ 界面重新激活事件___________________
 
        /// <summary>
        /// 自身的上层界面关闭后,它自身处于最上层时,触发的事件
        /// </summary>
        public override int FormActionAgainEvent()
        {
            if (this.nowActionDeviceMac != null)
            {
                var rowInfo = this.dicRowInfo[nowActionDeviceMac];
                //检测这个设备是否被删除 2020.01.13变更:追加Ota设备的判断
                if (Common.LocalDevice.Current.GetDevicesByMac(nowActionDeviceMac).Count == 0
                    && Common.LocalDevice.Current.GetOTADevice(nowActionDeviceMac) == null)
                {
                    //移除控件
                    rowInfo.dicDetailRow = null;
                    rowInfo.frameTable.RemoveFromParent();
 
                    this.dicRowInfo.Remove(nowActionDeviceMac);
                    rowInfo = null;
                }
                else
                {
                    //刷新设备信息
                    rowInfo.MenuRow?.RefreshControlInfo(true);
                    if (rowInfo.dicDetailRow != null)
                    {
                        foreach (var contr in rowInfo.dicDetailRow.Values)
                        {
                            contr?.RefreshControlInfo();
                        }
                    }
                }
            }
            //清空记录
            this.nowActionDeviceMac = null;
            //网关控件刷新
            this.gatewayViewRow.RefreshControl();
 
            return 1;
        }
 
        #endregion
 
        #region ■ 关闭界面___________________________
 
        /// <summary>
        /// 画面关闭
        /// </summary>
        public override void CloseFormBefore()
        {
            HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceListFormSensor");
            HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceListFormReceivePushOnline");
 
            base.CloseFormBefore();
        }
 
        #endregion
 
        #region ■ 结构体类___________________________
 
        /// <summary>
        /// 设备行信息
        /// </summary>
        private class DeviceObjRowInfo
        {
            /// <summary>
            /// 设备Mac地址
            /// </summary>
            public string DeviceMac = string.Empty;
            /// <summary>
            /// 设备的MAC名字
            /// </summary>
            public string MacName = string.Empty;
            /// <summary>
            /// 设备类型的文本信息
            /// </summary>
            public string DeviveTypeName = string.Empty;
            /// <summary>
            /// 菜单行
            /// </summary>
            public DeviceObjectControl MenuRow = null;
            /// <summary>
            /// 桌布FrameLayout
            /// </summary>
            public FrameListControl frameTable = null;
            /// <summary>
            /// 明细行
            /// </summary>
            public Dictionary<string, DeviceRoomControl> dicDetailRow = null;
        }
 
        #endregion
 
        #region ■ 自定义网关控件_____________________
 
        /// <summary>
        /// 自定义网关控件
        /// </summary>
        private class MyGatewayControl : FrameRowControl
        {
            /// <summary>
            /// 网关ID
            /// </summary>
            public string zbGatewayId = string.Empty;
            /// <summary>
            /// 网关名字控件
            /// </summary>
            private NormalViewControl btnName = null;
            /// <summary>
            /// 在线状态
            /// </summary>
            public bool isOnline = false;
 
            /// <summary>
            /// 自定义网关控件
            /// </summary>
            /// <param name="i_zbGateway">网关对象</param>
            public MyGatewayControl(ZbGateway i_zbGateway)
            {
                this.UseClickStatu = false;
                if (i_zbGateway != null)
                {
                    this.zbGatewayId = i_zbGateway.GwId;
                }
                this.BackgroundColor = UserCenterColor.Current.White;
                this.Y = Application.GetRealHeight(174);
                this.Height = Application.GetRealHeight(173);
            }
 
            /// <summary>
            /// 初始化控件
            /// </summary>
            public void InitControl()
            {
                //获取本地网关对象
                ZbGateway zbway = HdlGatewayLogic.Current.GetLocalGateway(zbGatewayId);
                //图标
                var btnIcon = this.AddLeftIcon(81);
                if (zbway != null)
                {
                    HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, zbway);
                }
                else
                {
                    btnIcon.UnSelectedImagePath = "Gateway/GatewayIcon1.png";
                }
 
                //显示文本
                btnName = this.AddLeftCaption(string.Empty, 700);
                btnName.Height = Application.GetRealHeight(60);
                btnName.TextSize = 15;
                btnName.Y = Application.GetRealHeight(35);
                if (zbway != null)
                {
                    btnName.Text = HdlGatewayLogic.Current.GetGatewayName(zbway);
                    //在线状态
                    this.isOnline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
                    if (this.isOnline == false)
                    {
                        btnName.TextColor = UserCenterColor.Current.TextGrayColor1;
                    }
                }
                else
                {
                    //虚拟网关
                    btnName.Text = Language.StringByID(R.MyInternationalizationString.uVirtualGateway);
                }
 
                //当前网关
                var btnNowGw = this.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowGateway), 700);
                btnNowGw.Height = Application.GetRealHeight(49);
                btnNowGw.TextSize = 12;
                btnNowGw.Y = Application.GetRealHeight(95);
                btnNowGw.TextColor = UserCenterColor.Current.TextGrayColor1;
 
                //向右图标
                var btnRight = this.AddRightArrow();
                btnRight.Name = "btnRight";
                //网关管理
                var btnMament = this.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uGatewayManagement), 300);
                btnMament.Name = "btnMament";
 
                //当前不是虚拟住宅的话
                if (Common.Config.Instance.Home.IsVirtually == false)
                {
                    this.ButtonClickEvent += (sernder, e) =>
                    {
                        if (string.IsNullOrEmpty(((View)sernder).Name) == false)
                        {
                            //打开网关列表界面
                            var form = new GatewayManage.GatewayListForm();
                            form.AddForm();
                        }
                    };
                }
            }
 
            /// <summary>
            /// 刷新控件信息
            /// </summary>
            public void RefreshControl()
            {
                //获取本地网关对象
                ZbGateway zbway = HdlGatewayLogic.Current.GetLocalGateway(zbGatewayId);
                if (zbway == null)
                {
                    return;
                }
                btnName.Text = HdlGatewayLogic.Current.GetGatewayName(zbway);
                //刷新控件在线状态
                this.RefreshOnlineStatu();
            }
 
            /// <summary>
            /// 刷新控件在线状态
            /// </summary>
            public void RefreshOnlineStatu()
            {
                //获取本地网关对象
                ZbGateway zbway = HdlGatewayLogic.Current.GetLocalGateway(zbGatewayId);
                if (zbway == null)
                {
                    return;
                }
                //在线状态
                bool statu = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
                if (this.isOnline != statu)
                {
                    this.isOnline = statu;
                    if (this.isOnline == false)
                    {
                        btnName.TextColor = UserCenterColor.Current.TextGrayColor1;
                    }
                    else
                    {
                        btnName.TextColor = UserCenterColor.Current.TextColor1;
                    }
                }
            }
        }
        #endregion
 
        #region ■ 自定义智能音箱控件_____________________
 
        /// <summary>
        /// 自定义音箱控件
        /// </summary>
        private class MySmartSoundControl : FrameRowControl
        {
 
            /// <summary>
            /// 音箱名字控件
            /// </summary>
            private NormalViewControl btnName = null;
 
            /// <summary>
            /// 自定音箱关控件
            /// </summary>
            public MySmartSoundControl()
            {
                this.UseClickStatu = false;
                this.BackgroundColor = UserCenterColor.Current.White;
                this.Height = Application.GetRealHeight(173);
 
                //this.InitControl();
            }
 
 
            /// <summary>
            /// 初始化控件
            /// </summary>
            public void InitControl()
            {
                //图标
                var btnIcon = this.AddLeftIcon(81);
                btnIcon.UnSelectedImagePath = "SmartSound/SoundIcon.png";
 
                //显示文本
                btnName = this.AddLeftCaption(string.Empty, 700);
                btnName.Height = Application.GetRealHeight(60);
                btnName.TextSize = 15;
                btnName.Y = Application.GetRealHeight(57);
                btnName.Text = "小度小度";
 
                this.AddRightArrow();
                this.AddMostRightView("", 300, false).Name = "smartSoundLayout";
                this.AddBottomLine();
 
            }
        }
        #endregion
    }
}