From b94f318b1cb5c3618dd53b5240c1d999c8427b71 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 29 十一月 2019 13:09:25 +0800 Subject: [PATCH] 2019.11.29 --- ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs index 875a6c7..551355a 100644 --- a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs +++ b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs @@ -60,7 +60,7 @@ room = r; IconPathType = r.BackgroundImageType; OldIconPathType= r.BackgroundImageType; - if (IconPathType != 1) + if (IconPathType != 0) { OldBackgroundImagePath = r.BackgroundImage; } @@ -118,6 +118,10 @@ Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius), UnSelectedImagePath = room.BackgroundImage }; + if (room.BackgroundImageType != 0) + { + backGround.UnSelectedImagePath = System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage); + } bodyFrameLayout.AddChidren(backGround); backGround.SetViewShadow(true); backGround.MouseUpEventHandler += backGroundIMGHander; @@ -391,9 +395,9 @@ var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); var fileName = $"Room_{tradeTime}"; room.Name = nameRow.NameText.Text.Trim(); - if (OldIconPathType != 1) + if (OldIconPathType != 0) { - Shared.IO.FileUtils.DeleteFile(OldBackgroundImagePath); + Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath,OldBackgroundImagePath)); } if (IconPathType == 0) { @@ -402,7 +406,7 @@ else { Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); - room.BackgroundImage = System.IO.Path.Combine(Config.Instance.FullPath, fileName); + room.BackgroundImage = fileName; } room.BackgroundImageType = IconPathType; room.Save(); -- Gitblit v1.8.0