old mode 100755
new mode 100644
| | |
| | | /// </summary> |
| | | private FrameLayout bodyFrameLayout; |
| | | |
| | | List<string> floorIds = new List<string> { }; |
| | | List<string> floorNames = new List<string> { }; |
| | | List<List<string>> roomNames = new List<List<string>> { }; |
| | | List<List<Common.Room>> rooms = new List<List<Common.Room>> { }; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | public static string ImagePath; |
| | | public static string SceneText; |
| | | |
| | | public static Shared.Common.Room CurrentRoom; |
| | | public Common.Room curRoom; |
| | | |
| | | public static List<SceneTargetDeviceUI> sceneTargetDevicesList = new List<SceneTargetDeviceUI> { }; |
| | | /// <summary> |
| | |
| | | } |
| | | //1-60秒 |
| | | //PickerView.Show(tList, (obj) => |
| | | // { |
| | | // targetDevice.DelayTime = int.Parse(obj.Split(' ')[0]); |
| | | // }, Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | //{ |
| | | //targetDevice.DelayTime = int.Parse(obj.Split(' ')[0]); |
| | | //}, Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | }; |
| | | //删除设备 |
| | | devRight.MouseUpEventHandler += (sender, e) => |
| | |
| | | /// <summary> |
| | | /// Show this instance. |
| | | /// </summary> |
| | | public void Show() |
| | | public void Show(Common.Room room=null) |
| | | { |
| | | Init(); |
| | | |
| | | curRoom = room; |
| | | |
| | | AddTop(); |
| | | |
| | | AddBodyView(); |
| | |
| | | |
| | | #region Add____________________________________ |
| | | |
| | | private void Init() |
| | | { |
| | | |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | floorIds.Add(floor.Key); |
| | | floorNames.Add(floor.Value); |
| | | roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key)); |
| | | rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key)); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// AddTop |
| | | /// </summary> |
| | | public void AddTop() |
| | | private void AddTop() |
| | | { |
| | | var top = new TopFrameLayout(); |
| | | AddChidren(top); |
| | |
| | | /// <summary> |
| | | /// AddBodyView |
| | | /// </summary> |
| | | public void AddBodyView() |
| | | private void AddBodyView() |
| | | { |
| | | bodyFrameLayout = new FrameLayout() |
| | | { |
| | |
| | | Height = Application.GetRealHeight(464), |
| | | Gravity = Gravity.Center, |
| | | Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius), |
| | | UnSelectedImagePath = ImagePath |
| | | //UnSelectedImagePath = ImagePath |
| | | UnSelectedImagePath = "SceneIcon/3.png" |
| | | }; |
| | | imgFL.AddChidren(backGround); |
| | | |
| | |
| | | var zoneRow = new DeviceInfoRow(257); |
| | | zoneRow.Init(); |
| | | zoneRow.SetTipTitle(R.MyInternationalizationString.BelongZone); |
| | | zoneRow.SetTitle(CurrentRoom.Name); |
| | | //zoneRow.SetTitle(curRoom.Name); |
| | | infoFL.AddChidren(zoneRow); |
| | | |
| | | |
| | | var targetFL = new FrameLayout() |
| | | { |
| | |
| | | { |
| | | nameRow.NameText.Text = SceneText; |
| | | } |
| | | if (CurrentRoom != null) |
| | | if (curRoom != null) |
| | | { |
| | | |
| | | } |
| | | if (Modify) |
| | | { |
| | | //title.TextID = R.MyInternationalizationString.ModifyScene; |
| | | oldRoom = CurrentRoom; |
| | | oldRoom = curRoom; |
| | | if (ModifySceneUI != null && ModifySceneUI.IsSharedScene) |
| | | { |
| | | nameRow.NameText.Enable = false; |
| | |
| | | //选择背景图 |
| | | EventHandler<MouseEventArgs> backGroundIMGHander = (sender, e) => |
| | | { |
| | | if (CurrentRoom.IsSharedRoom) |
| | | if (curRoom.IsSharedRoom) |
| | | { |
| | | RoomCommon.ShowTipRoomIsShared(); |
| | | return; |
| | |
| | | //区域 |
| | | EventHandler<MouseEventArgs> zoneHander = (sender, e) => |
| | | { |
| | | if (CurrentRoom.IsSharedRoom) |
| | | if (curRoom.IsSharedRoom) |
| | | { |
| | | RoomCommon.ShowTipRoomIsShared(); |
| | | return; |
| | | } |
| | | var selectRoom = new CategorySceneSelectRoomList(); |
| | | UserView.HomePage.Instance.AddChidren(selectRoom); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | selectRoom.SelectedRoomAction = (room) => |
| | | |
| | | PickerView.ShowSecondary(floorNames, roomNames, (index1,index2) => |
| | | { |
| | | CurrentRoom = room; |
| | | zoneRow.NameText.Text = CurrentRoom.Name; |
| | | }; |
| | | selectRoom.Show(); |
| | | curRoom = rooms[index1][index2]; |
| | | zoneRow.NameText.Text = $"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}"; |
| | | }, 0,0, Language.StringByID(R.MyInternationalizationString.BelongFloor), Language.StringByID(R.MyInternationalizationString.Confrim), Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | }; |
| | | zoneRow.NextBtn.MouseUpEventHandler += zoneHander; |
| | | zoneRow.TipBtn.MouseUpEventHandler += zoneHander; |
| | | zoneRow.NameText.MouseUpEventHandler += zoneHander; |
| | | zoneRow.MouseUpEventHandler += zoneHander; |
| | | |
| | | //执行目标-添加执行设备 |
| | | EventHandler<MouseEventArgs> targetAddHander = (sender, e) => |
| | | { |
| | | if (CurrentRoom.IsSharedRoom) |
| | | if (curRoom.IsSharedRoom) |
| | | { |
| | | RoomCommon.ShowTipRoomIsShared(); |
| | | return; |
| | |
| | | //确定添加目标 |
| | | confirmBtn.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | if (CurrentRoom.IsSharedRoom) |
| | | if (curRoom.IsSharedRoom) |
| | | { |
| | | RemoveFromParent(); |
| | | return; |
| | |
| | | } |
| | | sceneRemoveMemberData.DeviceList = removeSceneDeviceListInfoList; |
| | | sceneRemoveMemberData.ScenesId = ModifySceneUI.Id; |
| | | var result = await CurrentRoom.ModifyScene(ModifySceneUI, sceneRemoveMemberData, memberDataList); |
| | | var result = await curRoom.ModifyScene(ModifySceneUI, sceneRemoveMemberData, memberDataList); |
| | | if (result == 1) |
| | | { |
| | | if (oldRoom != CurrentRoom) |
| | | if (oldRoom != curRoom) |
| | | { |
| | | oldRoom.SceneUIList.Remove(ModifySceneUI); |
| | | oldRoom.SceneUIFilePathList.Remove(ModifySceneUI.FileName); |
| | | CurrentRoom.SceneUIList.Add(ModifySceneUI); |
| | | CurrentRoom.SceneUIFilePathList.Add(ModifySceneUI.FileName); |
| | | curRoom.SceneUIList.Add(ModifySceneUI); |
| | | curRoom.SceneUIFilePathList.Add(ModifySceneUI.FileName); |
| | | oldRoom.Save(); |
| | | CurrentRoom.Save(); |
| | | curRoom.Save(); |
| | | } |
| | | |
| | | RemoveFromParent(); |
| | |
| | | } |
| | | } |
| | | |
| | | var result = await CurrentRoom.AddScene(nameRow.NameText.Text, backGround.UnSelectedImagePath, memberDataList); |
| | | var result = await curRoom.AddScene(nameRow.NameText.Text, backGround.UnSelectedImagePath, memberDataList); |
| | | if (result == 1) |
| | | { |
| | | RemoveFromParent(); |