gxc
2020-01-02 34e965100d635346e2d4cd6e6013bdaed66b3004
ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
old mode 100755 new mode 100644
@@ -4,6 +4,7 @@
using Shared.Common;
using Shared.Phone.Device.CommonForm;
using Shared.Phone.Device.Room;
using Shared.Phone.UserCenter;
using static ZigBee.Device.Scene;
namespace Shared.Phone.Device.Category
@@ -90,9 +91,11 @@
        /// <summary>
        /// selectedTimeAction
        /// </summary>
        public Action<SceneTargetDeviceUI> selectedAction;
        private Action<SceneTargetDeviceUI> selectedAction;
        /// <summary>
        /// 修改场景action
        /// </summary>
        public Action<SceneUI, Common.Room> EditorAction;
        #endregion
@@ -108,7 +111,6 @@
        /// </summary>
        public override void RemoveFromParent()
        {
            Category.instance?.RefreshBodyView();
            base.RemoveFromParent();
        }
        /// <summary>
@@ -254,7 +256,7 @@
                        }
                    }
                }
                if (sceneTargetDevicesList.Count > 1)
                {
                    var targetRowLayout = new RowLayout()
@@ -577,7 +579,7 @@
                {
                    selectFL.RemoveFromParent();
                    var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
                    var fileName = $"SceneIcon_{tradeTime}";
                    var fileName = $"SceneIcon_{tradeTime}.png";
                    //通过相机拍照裁剪
                    CropImage.TakePicture((imagePath) =>
                    {
@@ -586,6 +588,7 @@
                            if (IconPathType != 0)
                            {
                                Global.DeleteFilebyHomeId(backGround.ImagePath);
                                HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
                            }
                        }
@@ -601,7 +604,7 @@
                {
                    selectFL.RemoveFromParent();
                    var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
                    var fileName = $"SceneIcon_{tradeTime}";
                    var fileName = $"SceneIcon_{tradeTime}.png";
                    //从相册选择图片裁剪
                    CropImage.SelectPicture((imagePath) =>
                    {
@@ -610,6 +613,7 @@
                            if (IconPathType != 0)
                            {
                                Global.DeleteFilebyHomeId(backGround.ImagePath);
                                HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
                            }
                        }
@@ -871,7 +875,7 @@
                        try
                        {
                            var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
                            var fileName = $"SceneIcon_{tradeTime}";
                            var fileName = $"SceneIcon_{tradeTime}.png";
                            if (modifySceneUI.Name != nameRow.NameText.Text.Trim())
                            {
                                if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null)
@@ -898,10 +902,13 @@
                            if (OldIconPathType != 0)
                            {
                                Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
                                HdlAutoBackupLogic.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
                            }
                            if (IconPathType == 1 || IconPathType == 2)
                            {
                                Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes);
                                HdlAutoBackupLogic.AddOrEditorFile(System.IO.Path.Combine(Config.Instance.FullPath, fileName));
                                modifySceneUI.IconPath = fileName;
                            }
                            else
@@ -1139,7 +1146,6 @@
                        {
                            CommonPage.Loading.Hide();
                        }
                    }
                }