| | |
| | | /// bodyFrameLayout |
| | | /// </summary> |
| | | private FrameLayout bodyFrameLayout; |
| | | /// <summary> |
| | | /// floorIds |
| | | /// </summary> |
| | | List<string> floorIds = new List<string> { }; |
| | | /// <summary> |
| | | /// floorNames |
| | | /// </summary> |
| | | List<string> floorNames = new List<string> { }; |
| | | /// <summary> |
| | | /// roomNames |
| | | /// </summary> |
| | | List<List<string>> roomNames = new List<List<string>> { }; |
| | | /// <summary> |
| | | /// roomNames |
| | | /// </summary> |
| | | List<List<Common.Room>> rooms = new List<List<Common.Room>> { }; |
| | | ///// <summary> |
| | | ///// floorIds |
| | | ///// </summary> |
| | | //List<string> floorIds = new List<string> { }; |
| | | ///// <summary> |
| | | ///// floorNames |
| | | ///// </summary> |
| | | //List<string> floorNames = new List<string> { }; |
| | | ///// <summary> |
| | | ///// roomNames |
| | | ///// </summary> |
| | | //List<List<string>> roomNames = new List<List<string>> { }; |
| | | ///// <summary> |
| | | ///// roomNames |
| | | ///// </summary> |
| | | //List<List<Common.Room>> rooms = new List<List<Common.Room>> { }; |
| | | /// <summary> |
| | | /// ImagePath |
| | | /// </summary> |
| | | private string ImagePath="SceneIcon/1.png"; |
| | | /// <summary> |
| | | /// 图片来源 0--本地图库 1--拍照 2--系统图库 |
| | | /// </summary> |
| | | public int IconPathType = 0; |
| | | /// <summary> |
| | | /// curRoom |
| | | /// </summary> |
| | |
| | | /// sceneTargetDevicesList |
| | | /// </summary> |
| | | private List<SceneTargetDeviceUI> sceneTargetDevicesList = new List<SceneTargetDeviceUI> { }; |
| | | |
| | | /// <summary> |
| | | /// 添加目标后的展示列表 |
| | | /// </summary> |
| | | public VerticalScrolViewLayout TargetListScrolView; |
| | | /// <summary> |
| | | /// 添加的执行目标的行高 |
| | | /// </summary> |
| | | private readonly int TargetListScrolView_RowHeight = 170; |
| | | /// <summary> |
| | | /// The confirm button. |
| | | /// </summary> |
| | | private CommonForm.CompleteButton confirmBtn; |
| | | |
| | | /// <summary> |
| | | /// 确定按钮最开始的坐标 |
| | | /// backGround |
| | | /// </summary> |
| | | private readonly int ConfirmButton_Y = CommonPage.AppRealHeight - 300; |
| | | private Button backGround; |
| | | |
| | | /// <summary> |
| | | /// 是否修改 |
| | | /// </summary> |
| | | public bool isModify; |
| | | /// <summary> |
| | | /// 修改的场景 |
| | | /// </summary> |
| | | public SceneUI modifySceneUI; |
| | | /// <summary> |
| | | /// 记录编辑前的设备列表 |
| | | /// </summary> |
| | | public List<SceneTargetDeviceUI> modifySceneTargetDevicesList; |
| | | /// <summary> |
| | | /// modifyRoom |
| | | /// </summary> |
| | | public Common.Room modifyRoom; |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | public CategoryAddScene() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | Tag = "categoryAddScene"; |
| | | } |
| | | /// <summary> |
| | | /// RemoveFromParent |
| | |
| | | { |
| | | foreach (var targetDevice in sceneTargetDevicesList) |
| | | { |
| | | var targetRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | TargetListScrolView.AddChidren(targetRowLayout); |
| | | string devImgPath = string.Empty; |
| | | string devNameText = string.Empty; |
| | | if (targetDevice.Type == 0) |
| | |
| | | if (targetDevice.DeviceUI == null || targetDevice.DeviceUI.CommonDevice == null) continue; |
| | | devImgPath = targetDevice.DeviceUI.IconPath; |
| | | devNameText = targetDevice.DeviceUI.CommonDevice.DeviceEpointName; |
| | | } |
| | | else if (targetDevice.Type == 1) |
| | | { |
| | | devImgPath = "Item/Timer.png"; |
| | | devNameText = $"{targetDevice.DelayTime} {Language.StringByID(R.MyInternationalizationString.Second)}"; |
| | | |
| | | var targetRow = new SceneTargetFunctionRow(23); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | targetRow.Init(); |
| | | targetRow.SetIcon(devImgPath); |
| | | targetRow.SetNameText(devNameText); |
| | | targetRow.SetZoneText(targetDevice.DeviceUI.GetZone()); |
| | | targetRow.SetStatuText(targetDevice.GetDeviceStatu()); |
| | | } |
| | | else if (targetDevice.Type == 2) |
| | | { |
| | | devImgPath = "Item/Scene.png"; |
| | | devNameText = targetDevice.SceneName; |
| | | devNameText = CommonFormResouce.GetTimeString(targetDevice.DelayTime); |
| | | devNameText += Language.StringByID(R.MyInternationalizationString.Later); |
| | | var targetRow = new SceneTargetTimeRow(23); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | targetRow.Init(); |
| | | targetRow.SetTitle(devNameText); |
| | | } |
| | | var targetRowLayout = new RowLayout() |
| | | else if (targetDevice.Type == 1) |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | LineColor = ZigbeeColor.Current.GXCLineColor, |
| | | BackgroundColor=ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | TargetListScrolView.AddChidren(targetRowLayout); |
| | | devImgPath = "Scene/SceneIcon.png"; |
| | | devNameText = targetDevice.SceneName; |
| | | |
| | | var targetFL = new FrameLayout() |
| | | var targetRow = new SceneTargetFunctionRow(23); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | targetRow.Init(); |
| | | targetRow.SetIcon(devImgPath); |
| | | targetRow.SetNameText(devNameText); |
| | | targetRow.SetZoneText(targetDevice.SceneUI.GetZone()); |
| | | } |
| | | |
| | | var editBtn = new Button() |
| | | { |
| | | |
| | | BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor, |
| | | TextID = R.MyInternationalizationString.Edit, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | targetRowLayout.AddChidren(targetFL); |
| | | |
| | | var devIMG = new Button() |
| | | { |
| | | X = Application.GetRealWidth(CommonPage.XLeft), |
| | | Width = Application.GetMinRealAverage(110), |
| | | Height = Application.GetMinRealAverage(110), |
| | | UnSelectedImagePath = devImgPath, |
| | | Gravity = Gravity.CenterVertical |
| | | }; |
| | | targetRowLayout.AddChidren(devIMG); |
| | | var devName = new Button() |
| | | { |
| | | X = devIMG.Right, |
| | | Width = Application.GetRealWidth(500), |
| | | Height = Application.GetRealHeight(100), |
| | | Gravity = Gravity.CenterVertical, |
| | | Text = devNameText, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | targetRowLayout.AddChidren(devName); |
| | | var devTimer = new Button() |
| | | { |
| | | X = targetRowLayout.Width - Application.GetRealWidth(150), |
| | | Width = Application.GetMinRealAverage(110), |
| | | Height = Application.GetMinRealAverage(110), |
| | | UnSelectedImagePath = "Item/Timer.png", |
| | | Gravity = Gravity.CenterVertical |
| | | }; |
| | | /////******暂时先不加延时,安卓控件有问题*******//// |
| | | //targetRowLayout.AddChidren(devTimer); |
| | | var devRight = new Button() |
| | | targetRowLayout.AddRightView(editBtn); |
| | | //编辑设备 |
| | | editBtn.MouseUpEventHandler += detailMouseUpEventHandler; |
| | | var delBtn = new Button() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCRedColor, |
| | | TextID = R.MyInternationalizationString.Delete, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | targetRowLayout.AddRightView(devRight); |
| | | targetRowLayout.AddRightView(delBtn); |
| | | //删除设备 |
| | | devRight.MouseUpEventHandler += (sender, e) => |
| | | delBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | sceneTargetDevicesList.Remove(targetDevice); |
| | | RefreshTargetListView(); |
| | |
| | | { |
| | | return; |
| | | } |
| | | if (targetDevice.DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput) |
| | | { |
| | | //开关灯 |
| | | var taskList = targetDevice.TaskList; |
| | | if (taskList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | var detail = new CategorySceneSelectLightSetting(); |
| | | UserView.HomePage.Instance.AddChidren(detail); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].Data1); |
| | | } |
| | | else if (targetDevice.DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch) |
| | | { |
| | | //空气开关 |
| | | var taskList = targetDevice.TaskList; |
| | | if (taskList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | var detail = new CategorySceneSelectAirSwitchSetting(); |
| | | UserView.HomePage.Instance.AddChidren(detail); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].Data1); |
| | | } |
| | | else if (targetDevice.DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice) |
| | | { |
| | | //卷帘 |
| | | var taskList = targetDevice.TaskList; |
| | | if (taskList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | var detail = new CategorySceneSelectCurtainSetting(); |
| | | UserView.HomePage.Instance.AddChidren(detail); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].Data1, taskList[0].Data2); |
| | | } |
| | | else if (targetDevice.DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight) |
| | | { |
| | | //调光灯 |
| | | var taskList = targetDevice.TaskList; |
| | | if (taskList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | var detail = new CategorySceneSelectedDimmableLightSetting(); |
| | | UserView.HomePage.Instance.AddChidren(detail); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | if (taskList[0].TaskType == 1) |
| | | { |
| | | detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].Data1, taskList[0].Data2); |
| | | } |
| | | else if (taskList[0].TaskType == 3) |
| | | { |
| | | detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].TaskType, taskList[0].Data1); |
| | | |
| | | var deviceView = new SelectDevice(); |
| | | UserView.HomePage.Instance.AddChidren(deviceView); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | deviceView.sceneTargetDevice = targetDevice; |
| | | deviceView.deviceUI = targetDevice.DeviceUI; |
| | | deviceView.Show(); |
| | | deviceView.selectedAction = (selectedDevice) => |
| | | { |
| | | var targetDeviceUI = sceneTargetDevicesList.Find((obj) => obj.SceneTargetDeviceUIID == selectedDevice.SceneTargetDeviceUIID); |
| | | if (targetDeviceUI != null) |
| | | { |
| | | targetDeviceUI.DeviceUI = selectedDevice.DeviceUI; |
| | | targetDeviceUI.TaskList = selectedDevice.TaskList; |
| | | } |
| | | |
| | | |
| | | } |
| | | RefreshTargetListView(); |
| | | }; |
| | | |
| | | } |
| | | //时间间隔 |
| | | else if (targetDevice.Type == 1) |
| | | else if (targetDevice.Type == 2) |
| | | { |
| | | var delayTimeView = new SelectDelayTime(); |
| | | UserView.HomePage.Instance.AddChidren(delayTimeView); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | delayTimeView.sceneTargetDevice = targetDevice; |
| | | delayTimeView.totalSecond = targetDevice.DelayTime; |
| | | delayTimeView.Show(); |
| | | delayTimeView.selectedTimeAction = (second) => |
| | | { |
| | |
| | | }; |
| | | } |
| | | //场景 |
| | | else if (targetDevice.Type == 2) |
| | | else if (targetDevice.Type == 1) |
| | | { |
| | | var sceneView = new CategorySceneSelectedScene(); |
| | | var sceneView = new SelectScene(); |
| | | UserView.HomePage.Instance.AddChidren(sceneView); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | sceneView.Show(sceneTargetDevicesList, 1, targetDevice.SceneTargetDeviceUIID); |
| | | sceneView.sceneTargetDevice = targetDevice; |
| | | sceneView.sceneUI = targetDevice.SceneUI; |
| | | sceneView.Show(); |
| | | sceneView.selectedAction = (selectedScene) => |
| | | { |
| | | var targetDeviceUI = sceneTargetDevicesList.Find((obj) => obj.SceneTargetDeviceUIID == selectedScene.SceneTargetDeviceUIID); |
| | | if (targetDeviceUI != null) |
| | | { |
| | | targetDeviceUI.SceneName = selectedScene.SceneName; |
| | | targetDevice.SceneUI = selectedScene.SceneUI; |
| | | targetDevice.ElseScenesId = selectedScene.ElseScenesId; |
| | | } |
| | | RefreshTargetListView(); |
| | | }; |
| | | } |
| | | } |
| | | devIMG.MouseUpEventHandler += detailMouseUpEventHandler; |
| | | devName.MouseUpEventHandler += detailMouseUpEventHandler; |
| | | targetRowLayout.MouseUpEventHandler += detailMouseUpEventHandler; |
| | | targetFL.MouseUpEventHandler += detailMouseUpEventHandler; |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | private void Init() |
| | | { |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | floorIds.Add(floor.Key); |
| | | floorNames.Add(floor.Value); |
| | | if(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key).Count>0) |
| | | { |
| | | roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key)); |
| | | rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key)); |
| | | } |
| | | } |
| | | //foreach (var floor in Config.Instance.Home.FloorDics) |
| | | //{ |
| | | // floorIds.Add(floor.Key); |
| | | // floorNames.Add(floor.Value); |
| | | // if(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key).Count>0) |
| | | // { |
| | | // roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key)); |
| | | // rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key)); |
| | | // } |
| | | //} |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var top = new TopFrameLayout(); |
| | | AddChidren(top); |
| | | top.InitTopview(); |
| | | top.SetTopTitle(R.MyInternationalizationString.AddScence); |
| | | if(isModify) |
| | | { |
| | | top.SetTopTitle(R.MyInternationalizationString.EditorScene); |
| | | } |
| | | else |
| | | { |
| | | top.SetTopTitle(R.MyInternationalizationString.AddScence); |
| | | } |
| | | top.backButton.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | |
| | | }; |
| | | bodyFrameLayout.AddChidren(imgFL); |
| | | |
| | | var backGround = new Button() |
| | | backGround = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(930), |
| | | Height = Application.GetRealHeight(464), |
| | | Width = Application.GetMinRealAverage(930), |
| | | Height = Application.GetMinRealAverage(464), |
| | | Gravity = Gravity.Center, |
| | | Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius), |
| | | Radius = (uint)Application.GetMinRealAverage(CommonFormResouce.BigFormRadius), |
| | | //UnSelectedImagePath = ImagePath |
| | | UnSelectedImagePath = "SceneIcon/3.png" |
| | | UnSelectedImagePath = "SceneIcon/3.jpg" |
| | | }; |
| | | imgFL.AddChidren(backGround); |
| | | backGround.SetViewShadow(true); |
| | | |
| | | var infoFL = new FrameLayout |
| | | { |
| | |
| | | zoneRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongZone)}:"); |
| | | //zoneRow.SetTitle(curRoom.Name); |
| | | infoFL.AddChidren(zoneRow); |
| | | zoneRow.HideLine(false); |
| | | zoneRow.HideLine(true); |
| | | |
| | | var targetFL = new FrameLayout() |
| | | { |
| | |
| | | //添加目标后的展示列表 |
| | | TargetListScrolView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = targetLine.Bottom, |
| | | Height = Application.GetRealHeight(730-127), |
| | | Y = Application.GetRealHeight(49+127), |
| | | Height = Application.GetRealHeight(730-127-49), |
| | | //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | targetFL.AddChidren(TargetListScrolView); |
| | | |
| | | confirmBtn = new CommonForm.CompleteButton(1656, 907, 127); |
| | | AddChidren(confirmBtn); |
| | | |
| | | if(isModify) |
| | | { |
| | | backGround.UnSelectedImagePath = modifySceneUI.IconPath; |
| | | nameRow.SetTitle(modifySceneUI.Name); |
| | | zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(modifyRoom.FloorId)},{modifyRoom.Name}"); |
| | | IconPathType = modifySceneUI.IconPathType; |
| | | curRoom = modifyRoom; |
| | | sceneTargetDevicesList.AddRange(modifySceneTargetDevicesList); |
| | | } |
| | | |
| | | RefreshTargetListView(); |
| | | |
| | |
| | | //选择背景图 |
| | | EventHandler<MouseEventArgs> backGroundIMGHander = (sender, e) => |
| | | { |
| | | if (curRoom == null) |
| | | { |
| | | RoomCommon.ShowTipNoRoom(); |
| | | return; |
| | | } |
| | | if (curRoom.IsSharedRoom) |
| | | if (curRoom != null && curRoom.IsSharedRoom) |
| | | { |
| | | RoomCommon.ShowTipRoomIsShared(); |
| | | return; |
| | | } |
| | | |
| | | var localPic = new CategorySceneSelectImgByLocal(); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | localPic.Show(); |
| | | localPic.action = () => |
| | | int selectRow_Height = 150; |
| | | int selectRow_Width = 1034; |
| | | var selectFL = new FrameLayout() |
| | | { |
| | | backGround.UnSelectedImagePath = ImagePath; |
| | | BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor |
| | | }; |
| | | AddChidren(selectFL); |
| | | |
| | | var itemFL = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(1276), |
| | | Height = Application.GetRealHeight(450), |
| | | Width = Application.GetRealWidth(selectRow_Width), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | selectFL.AddChidren(itemFL); |
| | | itemFL.Animate = Animate.DownToUp; |
| | | |
| | | var selectLocalPicture = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.LocalPicture, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | }; |
| | | itemFL.AddChidren(selectLocalPicture); |
| | | var selectLocalLine = new Button() |
| | | { |
| | | Y = selectLocalPicture.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCLineColor |
| | | }; |
| | | itemFL.AddChidren(selectLocalLine); |
| | | |
| | | var selectPhotographBtn = new Button() |
| | | { |
| | | Y = selectLocalLine.Bottom, |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.Photograph, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | }; |
| | | itemFL.AddChidren(selectPhotographBtn); |
| | | var selectPhotographLine = new Button() |
| | | { |
| | | Y = selectPhotographBtn.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCLineColor, |
| | | }; |
| | | itemFL.AddChidren(selectPhotographLine); |
| | | |
| | | var selectAblumsBtn = new Button() |
| | | { |
| | | Y = selectPhotographLine.Bottom, |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.MyAblums, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | }; |
| | | itemFL.AddChidren(selectAblumsBtn); |
| | | |
| | | var cancelBtn = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(1742), |
| | | Height = Application.GetRealHeight(selectRow_Height), |
| | | Width = Application.GetRealWidth(selectRow_Width), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextID = R.MyInternationalizationString.Cancel, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | }; |
| | | selectFL.AddChidren(cancelBtn); |
| | | |
| | | selectLocalPicture.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | var localPic = new CategorySceneSelectImgByLocal(); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | localPic.Show(); |
| | | localPic.action = (imgPath) => |
| | | { |
| | | IconPathType = 0; |
| | | backGround.ImageBytes = null; |
| | | backGround.UnSelectedImagePath = imgPath; |
| | | }; |
| | | }; |
| | | selectPhotographBtn.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
| | | var fileName = $"Scene_{tradeTime}"; |
| | | //通过相机拍照裁剪 |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | if (isModify) |
| | | { |
| | | if (IconPathType != 0) |
| | | { |
| | | Global.DeleteFilebyHomeId(backGround.UnSelectedImagePath); |
| | | } |
| | | } |
| | | |
| | | IconPathType = 1; |
| | | backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath); |
| | | backGround.UnSelectedImagePath = imagePath; |
| | | System.IO.File.Delete(imagePath); |
| | | |
| | | }, fileName, 2, 1); |
| | | }; |
| | | |
| | | selectAblumsBtn.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
| | | var fileName = $"Scene_{tradeTime}"; |
| | | //从相册选择图片裁剪 |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | if (isModify) |
| | | { |
| | | if (IconPathType != 0) |
| | | { |
| | | Global.DeleteFilebyHomeId(backGround.UnSelectedImagePath); |
| | | } |
| | | } |
| | | |
| | | IconPathType = 2; |
| | | backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath); |
| | | backGround.UnSelectedImagePath = imagePath; |
| | | System.IO.File.Delete(imagePath); |
| | | |
| | | }, fileName, 2,1); |
| | | }; |
| | | |
| | | cancelBtn.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | }; |
| | | selectFL.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | }; |
| | | }; |
| | | backGround.MouseUpEventHandler += backGroundIMGHander; |
| | | |
| | | |
| | | //区域 |
| | | EventHandler<MouseEventArgs> zoneHander = (sender, e) => |
| | | { |
| | | PickerView.ShowSecondary(floorNames, roomNames, (index1, index2) => |
| | | 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>> { }; |
| | | List<Common.Room> rs = new List<Common.Room> { }; |
| | | List<string> rNames = new List<string> { }; |
| | | if (Config.Instance.Home.FloorDics.Count > 0) |
| | | { |
| | | 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)); |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | floorIds.Add(floor.Key); |
| | | floorNames.Add(floor.Value); |
| | | if (Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key).Count > 0) |
| | | { |
| | | roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key)); |
| | | rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key)); |
| | | } |
| | | } |
| | | PickerView.ShowSecondary(floorNames, roomNames, (index1, index2) => |
| | | { |
| | | curRoom = rooms[index1][index2]; |
| | | zoneRow.SetTitle($"{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)); |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < Common.Room.Lists.Count; i++) |
| | | { |
| | | var r = Common.Room.Lists[i]; |
| | | if (r.IsLove) |
| | | { |
| | | continue; |
| | | } |
| | | rs.Add(r); |
| | | rNames.Add(r.Name); |
| | | } |
| | | PickerView.Show(rNames, (index1) => |
| | | { |
| | | curRoom = rs[index1]; |
| | | zoneRow.SetTitle(rs[index1].Name); |
| | | }, 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; |
| | | zoneRow.ClickBtn.MouseUpEventHandler += zoneHander; |
| | | |
| | | //执行目标-添加执行设备 |
| | | EventHandler<MouseEventArgs> targetAddHander = (sender, e) => |
| | |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | selectFL.AddChidren(itemFL); |
| | | itemFL.Animate = Animate.DownToUp; |
| | | |
| | | var selectedFunctionBtn = new Button() |
| | | { |
| | |
| | | selectedFunctionBtn.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | var deviceTypeList = new CategorySceneSelectDevice(); |
| | | UserView.HomePage.Instance.AddChidren(deviceTypeList); |
| | | var deviceView = new SelectDevice(); |
| | | UserView.HomePage.Instance.AddChidren(deviceView); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | deviceTypeList.Show(sceneTargetDevicesList); |
| | | deviceView.beforeSceneTargetDeviceUIs = sceneTargetDevicesList; |
| | | deviceView.Show(); |
| | | deviceView.selectedAction = (selectedDevice) => |
| | | { |
| | | sceneTargetDevicesList.Add(selectedDevice); |
| | | RefreshTargetListView(); |
| | | }; |
| | | }; |
| | | //添加场景 |
| | | selectedSceneBtn.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | var sceneView = new CategorySceneSelectedScene(); |
| | | var sceneView = new SelectScene(); |
| | | UserView.HomePage.Instance.AddChidren(sceneView); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //if (Modify) |
| | | //{ |
| | | // sceneView.Show(sceneTargetDevicesList, -1, "", false, ModifySceneUI.Id); |
| | | //} |
| | | //else |
| | | //{ |
| | | // sceneView.Show(sceneTargetDevicesList); |
| | | //} |
| | | sceneView.beforeSceneTargetDeviceUIs = sceneTargetDevicesList; |
| | | sceneView.Show(); |
| | | sceneView.selectedAction = (selectedScene) => |
| | | { |
| | | sceneTargetDevicesList.Add(selectedScene); |
| | | RefreshTargetListView(); |
| | | }; |
| | | |
| | | }; |
| | | //添加时间间隔 |
| | | selectedTimerBtn.MouseUpEventHandler += (send, ee) => |
| | |
| | | return; |
| | | } |
| | | |
| | | //新增 |
| | | if (string.IsNullOrEmpty(nameRow.NameText.Text)) |
| | | if(isModify) |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull), Language.StringByID(R.MyInternationalizationString.Close)); |
| | | alert.Show(); |
| | | alert.ResultEventHandler += (sendAlert, eAlert) => |
| | | if (string.IsNullOrEmpty(nameRow.NameText.Text)) |
| | | { |
| | | return; |
| | | }; |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull), Language.StringByID(R.MyInternationalizationString.Close)); |
| | | alert.Show(); |
| | | alert.ResultEventHandler += (sendAlert, eAlert) => |
| | | { |
| | | return; |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | try |
| | | { |
| | | var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
| | | var fileName = $"Scene_{tradeTime}"; |
| | | //改名 |
| | | if (modifySceneUI.Name != nameRow.NameText.Text.Trim()) |
| | | { |
| | | if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) |
| | | { |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | return; |
| | | } |
| | | //修改名字 |
| | | var r = await ZigBee.Device.Scene.RenameSceneAsync(modifySceneUI.Id, nameRow.NameText.Text.Trim()); |
| | | var reName = r.sceneRenameResponseData.Result; |
| | | if (reName == 0) |
| | | { |
| | | //失败 |
| | | return; |
| | | } |
| | | else if (reName == 1) |
| | | { |
| | | //成功 |
| | | modifySceneUI.Name = nameRow.NameText.Text.Trim(); |
| | | |
| | | } |
| | | else if (reName == 2) |
| | | { |
| | | //没有该场景 |
| | | return; |
| | | } |
| | | } |
| | | //图片 |
| | | if(IconPathType==1 || IconPathType ==2) |
| | | { |
| | | Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); |
| | | modifySceneUI.IconPath = System.IO.Path.Combine(Config.Instance.FullPath, fileName); |
| | | } |
| | | else |
| | | { |
| | | modifySceneUI.IconPath = backGround.UnSelectedImagePath; |
| | | } |
| | | modifySceneUI.IconPathType = IconPathType; |
| | | |
| | | CommonPage.Loading.Start(); |
| | | var memberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData>(); |
| | | for (int i = 0; i < sceneTargetDevicesList.Count; i++) |
| | | { |
| | | var sceneTarget = sceneTargetDevicesList[i]; |
| | | |
| | | if (sceneTarget.Type == 0) |
| | | { |
| | | if (sceneTarget.DeviceUI == null || sceneTarget.DeviceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | var memberData = new AddSceneMemberData |
| | | { |
| | | Type = 0, |
| | | ScenesId = 0, |
| | | DeviceAddr = sceneTarget.DeviceUI.CommonDevice.DeviceAddr, |
| | | Epoint = sceneTarget.DeviceUI.CommonDevice.DeviceEpoint, |
| | | TaskList = sceneTarget.TaskList, |
| | | DelayTime = 0, |
| | | MemberNumber = i+1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | | else if (sceneTarget.Type == 1) |
| | | { |
| | | var memberData = new AddSceneMemberData |
| | | { |
| | | Type = 1, |
| | | ScenesId = 0, |
| | | ElseScenesId = sceneTarget.ElseScenesId, |
| | | DelayTime = 0, |
| | | MemberNumber = i+1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | | else if (sceneTarget.Type == 2) |
| | | { |
| | | var memberData = new AddSceneMemberData |
| | | { |
| | | Type = 2, |
| | | ScenesId = 0, |
| | | DelayTime = sceneTarget.DelayTime, |
| | | MemberNumber = i+1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | | } |
| | | |
| | | var sceneRemoveMemberData = new SceneRemoveMemberData { }; |
| | | var removeSceneDeviceListInfoList = new List<RemoveSceneDeviceListInfo> { }; |
| | | for (int i = 0; i < modifySceneTargetDevicesList.Count; i++) |
| | | { |
| | | var sceneTarget = modifySceneTargetDevicesList[i]; |
| | | if (sceneTarget.Type == 0) |
| | | { |
| | | if (sceneTarget.DeviceUI == null || sceneTarget.DeviceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | var removeDevice = new RemoveSceneDeviceListInfo |
| | | { |
| | | Type = 0, |
| | | DeviceAddr = sceneTarget.DeviceUI.CommonDevice.DeviceAddr, |
| | | Epoint = sceneTarget.DeviceUI.CommonDevice.DeviceEpoint, |
| | | MemberNumber = sceneTarget.DelayTimeSerialNumber |
| | | }; |
| | | removeSceneDeviceListInfoList.Add(removeDevice); |
| | | } |
| | | else if (sceneTarget.Type == 1) |
| | | { |
| | | var removeDevice = new ZigBee.Device.Scene.RemoveSceneDeviceListInfo |
| | | { |
| | | Type = 1, |
| | | ElseScenesId = sceneTarget.ElseScenesId, |
| | | MemberNumber = sceneTarget.DelayTimeSerialNumber |
| | | }; |
| | | removeSceneDeviceListInfoList.Add(removeDevice); |
| | | } |
| | | else |
| | | { |
| | | var removeDevice = new ZigBee.Device.Scene.RemoveSceneDeviceListInfo |
| | | { |
| | | Type = 2, |
| | | DelayTime=sceneTarget.DelayTime, |
| | | MemberNumber=sceneTarget.DelayTimeSerialNumber |
| | | }; |
| | | removeSceneDeviceListInfoList.Add(removeDevice); |
| | | } |
| | | } |
| | | sceneRemoveMemberData.DeviceList = removeSceneDeviceListInfoList; |
| | | sceneRemoveMemberData.ScenesId = modifySceneUI.Id; |
| | | var result = await curRoom.ModifyScene(modifySceneUI, sceneRemoveMemberData, memberDataList); |
| | | if (result == 1) |
| | | { |
| | | if (modifyRoom != curRoom) |
| | | { |
| | | |
| | | modifyRoom.SceneUIList.Remove(modifySceneUI); |
| | | modifyRoom.SceneUIFilePathList.Remove(modifySceneUI.FileName); |
| | | curRoom.SceneUIList.Add(modifySceneUI); |
| | | curRoom.SceneUIFilePathList.Add(modifySceneUI.FileName); |
| | | modifyRoom.Save(); |
| | | curRoom.Save(); |
| | | } |
| | | RemoveFromParent(); |
| | | } |
| | | else if (result == 0) |
| | | { |
| | | //失败 |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain); |
| | | } |
| | | else if (result == -1) |
| | | { |
| | | //已存在 |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | System.Console.WriteLine($"分类添加场景出错{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | try |
| | | //新增 |
| | | if (string.IsNullOrEmpty(nameRow.NameText.Text)) |
| | | { |
| | | if (Shared.Common.Room.AllRoomSceneUIList.Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull), Language.StringByID(R.MyInternationalizationString.Close)); |
| | | alert.Show(); |
| | | alert.ResultEventHandler += (sendAlert, eAlert) => |
| | | { |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | return; |
| | | } |
| | | CommonPage.Loading.Start(); |
| | | var memberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData>(); |
| | | //累加延时 |
| | | int AddedDelayTime = 0; |
| | | for (int i = 0; i < sceneTargetDevicesList.Count; i++) |
| | | { |
| | | var sceneTarget = sceneTargetDevicesList[i]; |
| | | SceneTargetDeviceUI beforeSceneTarget = null; |
| | | if (i - 1 >= 0) |
| | | { |
| | | beforeSceneTarget = sceneTargetDevicesList[i - 1]; |
| | | } |
| | | if (sceneTarget.Type == 0) |
| | | { |
| | | if (sceneTarget.DeviceUI == null || sceneTarget.DeviceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (beforeSceneTarget != null && beforeSceneTarget.Type == 1) |
| | | { |
| | | if (i - 1 >= 0) |
| | | { |
| | | for (int k = i - 1; k >= 0; k--) |
| | | { |
| | | if (sceneTargetDevicesList[k] == null || sceneTargetDevicesList[k].Type != 1) |
| | | { |
| | | break; |
| | | } |
| | | AddedDelayTime += sceneTargetDevicesList[k].DelayTime; |
| | | } |
| | | } |
| | | } |
| | | |
| | | var memberData = new ZigBee.Device.Scene.AddSceneMemberData |
| | | { |
| | | DeviceAddr = sceneTarget.DeviceUI.CommonDevice.DeviceAddr, |
| | | Type = 0, |
| | | ScenesId = 0, |
| | | Epoint = sceneTarget.DeviceUI.CommonDevice.DeviceEpoint, |
| | | TaskList = sceneTarget.TaskList, |
| | | DelayTime = AddedDelayTime |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | | else if (sceneTarget.Type == 2) |
| | | { |
| | | if (beforeSceneTarget != null && beforeSceneTarget.Type == 1) |
| | | { |
| | | if (i - 1 >= 0) |
| | | { |
| | | for (int k = i - 1; k >= 0; k--) |
| | | { |
| | | if (sceneTargetDevicesList[k] == null || sceneTargetDevicesList[k].Type != 1) |
| | | { |
| | | break; |
| | | } |
| | | AddedDelayTime += sceneTargetDevicesList[k].DelayTime; |
| | | } |
| | | } |
| | | } |
| | | var memberData = new ZigBee.Device.Scene.AddSceneMemberData |
| | | { |
| | | Type = 1, |
| | | ScenesId = 0, |
| | | ElseScenesId = sceneTarget.ElseScenesId, |
| | | DelayTime = AddedDelayTime |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | | } |
| | | |
| | | var result = await curRoom.AddScene(nameRow.NameText.Text, backGround.UnSelectedImagePath, memberDataList); |
| | | if (result == 1) |
| | | { |
| | | RemoveFromParent(); |
| | | } |
| | | else if (result == 0) |
| | | { |
| | | //失败 |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.AddSceneFail); |
| | | } |
| | | else if (result == -1) |
| | | { |
| | | //已存在 |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | } |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | else |
| | | { |
| | | System.Console.WriteLine($"分类添加场景出错{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | try |
| | | { |
| | | var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
| | | var fileName = $"SceneIcon_{tradeTime}.png"; |
| | | string imgPath; |
| | | //图片 |
| | | if (IconPathType == 1 || IconPathType == 2) |
| | | { |
| | | Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); |
| | | imgPath = System.IO.Path.Combine(Config.Instance.FullPath, fileName); |
| | | } |
| | | else |
| | | { |
| | | imgPath = backGround.UnSelectedImagePath; |
| | | } |
| | | if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) |
| | | { |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | return; |
| | | } |
| | | CommonPage.Loading.Start(); |
| | | var memberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData>(); |
| | | for (int i = 0; i < sceneTargetDevicesList.Count; i++) |
| | | { |
| | | var sceneTarget = sceneTargetDevicesList[i]; |
| | | |
| | | if (sceneTarget.Type == 0) |
| | | { |
| | | if (sceneTarget.DeviceUI == null || sceneTarget.DeviceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | var memberData = new AddSceneMemberData |
| | | { |
| | | Type = 0, |
| | | ScenesId = 0, |
| | | DeviceAddr = sceneTarget.DeviceUI.CommonDevice.DeviceAddr, |
| | | Epoint = sceneTarget.DeviceUI.CommonDevice.DeviceEpoint, |
| | | TaskList = sceneTarget.TaskList, |
| | | DelayTime = 0, |
| | | MemberNumber = i+1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | | else if (sceneTarget.Type == 1) |
| | | { |
| | | var memberData = new AddSceneMemberData |
| | | { |
| | | Type = 1, |
| | | ScenesId = 0, |
| | | ElseScenesId = sceneTarget.ElseScenesId, |
| | | DelayTime = 0, |
| | | MemberNumber = i+1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | | else if (sceneTarget.Type == 2) |
| | | { |
| | | var memberData = new AddSceneMemberData |
| | | { |
| | | Type = 2, |
| | | ScenesId = 0, |
| | | DelayTime = sceneTarget.DelayTime, |
| | | MemberNumber = i+1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | | } |
| | | |
| | | var result = await curRoom.AddScene(nameRow.NameText.Text, imgPath, memberDataList); |
| | | if (result == 1) |
| | | { |
| | | RemoveFromParent(); |
| | | } |
| | | else if (result == 0) |
| | | { |
| | | //失败 |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.AddSceneFail); |
| | | } |
| | | else if (result == -1) |
| | | { |
| | | //已存在 |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | System.Console.WriteLine($"分类添加场景出错{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | }; |
| | | #endregion |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |