HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-11-18 4ce5177289b1d34e467de9d8790836559cc5a09e
ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
@@ -33,7 +33,17 @@
        /// <summary>
        /// IconPathType
        /// </summary>
        public int IconPathType = 0;
        public int IconPathType;
        /// <summary>
        /// OldBackgroundImagePath
        /// </summary>
        private string OldBackgroundImagePath;
        /// <summary>
        /// OldIconPathType
        /// </summary>
        public int OldIconPathType;
        #endregion
@@ -49,6 +59,11 @@
        {
            room = r;
            IconPathType = r.BackgroundImageType;
            OldIconPathType= r.BackgroundImageType;
            if (IconPathType != 1)
            {
                OldBackgroundImagePath = r.BackgroundImage;
            }
            AddTop();
            AddBodyView();
@@ -383,6 +398,10 @@
                var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
                var fileName = $"Room_{tradeTime}";
                room.Name = nameRow.NameText.Text.Trim();
                if (OldIconPathType != 1)
                {
                    Shared.IO.FileUtils.DeleteFile(OldBackgroundImagePath);
                }
                if (IconPathType == 0)
                {
                    room.BackgroundImage = backGround.UnSelectedImagePath;
@@ -394,6 +413,7 @@
                }
                room.BackgroundImageType = IconPathType;
                room.Save();
                action?.Invoke();
                RemoveFromParent();
            };