| | |
| | |
|
| | | //设备的背景容器
|
| | | 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;
|
| | |
| | | {
|
| | | //头部的白色背景
|
| | | 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);
|
| | |
| | | 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);
|
| | |
| | |
|
| | | //左右滑动的控件
|
| | | 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);
|
| | |
| | | //初始化设备列表控件
|
| | | 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);
|
| | |
| | | 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));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | //全部的设备
|
| | | 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);
|
| | | //按所属ID分组
|
| | | if (dic.ContainsKey(typeInfo.BeloneText) == false)
|
| | | {
|
| | |
| | | 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;
|
| | | }
|