| | |
| | | public void ShowForm(string deviceMac)
|
| | | {
|
| | | this.listNewDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
|
| | | //排序
|
| | | this.listNewDevice.Sort((obj1, obj2) =>
|
| | | {
|
| | | if (obj1.DeviceEpoint > obj2.DeviceEpoint)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | return -1;
|
| | | });
|
| | |
|
| | | this.listDeviceType.Clear();
|
| | | foreach (var device in listNewDevice)
|
| | |
| | | btnNote.txtInput.FinishInputEvent += () =>
|
| | | {
|
| | | string oldName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
|
| | | if (btnNote.Text.Trim() == string.Empty)
|
| | | if (btnNote.Text == string.Empty)
|
| | | {
|
| | | btnNote.Text = oldName;
|
| | | }
|
| | | if (oldName != btnNote.Text.Trim())
|
| | | if (oldName != btnNote.Text)
|
| | | {
|
| | | //修改名字
|
| | | this.DeviceReName(btnNote.Text.Trim(), false);
|
| | | this.DeviceReName(btnNote.Text, false);
|
| | | }
|
| | | };
|
| | |
|
| | |
| | | {
|
| | | foreach (var device in this.listNewDevice)
|
| | | {
|
| | | //保存这个设备属于哪个区域
|
| | | device.DeviceRoomId = roomKeys;
|
| | | device.ReSave();
|
| | | var room = Room.CurrentRoom.GetRoomByDevice(device);
|
| | | string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | if (room == null)
|
| | |
| | | Room.CurrentRoom.ChangedRoom(device, roomKeys);
|
| | | }
|
| | | }
|
| | | //保存设备房间索引
|
| | | Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys);
|
| | | };
|
| | |
|
| | | //添加全部菜单
|