| | |
| | | #endregion |
| | | |
| | | #region 场景延时row |
| | | if (DB_ResidenceData.residenceData.GatewayType == 1) |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | FrameLayout sceneDelayRow = new FrameLayout() |
| | | { |
| | |
| | | row.AddRightView(btnDelSceneFunction); |
| | | btnDelSceneFunction.MouseUpEventHandler = (sender, e) => { |
| | | scene.functions.Remove(scenefunction); |
| | | scene.SaveSceneData(); |
| | | scene.SaveSceneData(true); |
| | | row.RemoveFromParent(); |
| | | functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count); |
| | | //LoadFunctionRow(functionListView); |
| | |
| | | addSceneImageView.ImagePath = scene.ImagePath; |
| | | if (pageTitleId == StringId.EditScene) |
| | | { |
| | | scene.SaveSceneData(); |
| | | scene.SaveSceneData(true); |
| | | } |
| | | }; |
| | | |
| | |
| | | scene.ImagePath = imageUrl; |
| | | if (pageTitleId == StringId.EditScene) |
| | | { |
| | | scene.SaveSceneData(); |
| | | scene.SaveSceneData(true); |
| | | } |
| | | }; |
| | | //上传图片到云端 |
| | |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | foreach (var tempRoom in DB_ResidenceData.functionList.scenes) |
| | | foreach (var tempRoom in FunctionList.List.scenes) |
| | | { |
| | | if (scene.name == tempRoom.name) |
| | | { |
| | |
| | | return; |
| | | } |
| | | } |
| | | scene.SaveSceneData(); |
| | | DB_ResidenceData.functionList.scenes.Add(scene); |
| | | scene.SaveSceneData(true); |
| | | FunctionList.List.scenes.Add(scene); |
| | | backAction(); |
| | | this.RemoveFromParent(); |
| | | } |
| | |
| | | { |
| | | Action action = () => |
| | | { |
| | | DB_ResidenceData.functionList.DeleteScene(scene); |
| | | FunctionList.List.DeleteScene(scene,true); |
| | | backAction(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | new PublicAssmebly().TipMsg(StringId.Tip, StringId.DeleteSceneTip, action); |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteSceneTip, action); |
| | | }; |
| | | }; |
| | | } |
| | |
| | | scene.name = str; |
| | | if (pageTitleId == StringId.EditScene) |
| | | { |
| | | scene.SaveSceneData(); |
| | | scene.SaveSceneData(true); |
| | | } |
| | | }; |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | List<string> sceneNameList = new List<string>(); |
| | | foreach (var tempScene in DB_ResidenceData.functionList.scenes) |
| | | foreach (var tempScene in FunctionList.List.scenes) |
| | | { |
| | | sceneNameList.Add(tempScene.name); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + selectImagePath); |
| | | //MainPage.Log("SelectPicture 裁剪图片返回路径: " + selectImagePath); |
| | | //1.读取裁剪后的图片,然后删除 |
| | | var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath); |
| | | System.IO.File.Delete(selectImagePath); |
| | |
| | | var newImageName = mScene.name.Trim() + ".png"; |
| | | var uploadImageObj = new UploadImageObj() |
| | | { |
| | | prefix = "ONS", |
| | | prefix = "Scene" + Utlis.GetTimestamp(), |
| | | fileName = newImageName, |
| | | uid = mScene.sid, |
| | | content = imageBytes, |
| | |
| | | //上传成功 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Utlis.WriteLine("上传成功:" + imageUrl); |
| | | //Utlis.WriteLine("上传成功:" + imageUrl); |
| | | //1.2如果是自定义图片删除之前的 |
| | | if (!imageView.ImagePath.Contains("Classification/Room/Roombg")) |
| | | if (!string.IsNullOrEmpty(imageView.ImagePath) && !imageView.ImagePath.Contains("Classification/Room/Roombg")) |
| | | { |
| | | Utlis.WriteLine("删除: " + imageView.ImagePath); |
| | | //Utlis.WriteLine("删除: " + imageView.ImagePath); |
| | | System.IO.File.Delete(imageView.ImagePath); |
| | | } |
| | | //重命名保存 |
| | | FileUtils.WriteFileByBytes(imageUrl, imageBytes); |
| | | ImageUtlis.Current.WriteFileByBytes(imageUrl, imageBytes); |
| | | imageView.ImagePath = null; |
| | | imageView.ImageBytes = imageBytes; |
| | | //上传成功 |