| | |
| | | room = r; |
| | | IconPathType = r.BackgroundImageType; |
| | | OldIconPathType= r.BackgroundImageType; |
| | | if (IconPathType != 1) |
| | | if (IconPathType != 0) |
| | | { |
| | | OldBackgroundImagePath = r.BackgroundImage; |
| | | } |
| | |
| | | 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; |
| | |
| | | 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) |
| | | { |
| | |
| | | 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(); |