From a15bf1762569323ebf47dd094b0f79b33829e76f Mon Sep 17 00:00:00 2001 From: qin <a@163.com> Date: 星期二, 21 五月 2024 12:53:09 +0800 Subject: [PATCH] 优化template对象,public方法 --- Hydraulic/Hydro.MapView/Template/Template.cs | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Hydraulic/Hydro.MapView/Template/Template.cs b/Hydraulic/Hydro.MapView/Template/Template.cs index 11d0233..f26f001 100644 --- a/Hydraulic/Hydro.MapView/Template/Template.cs +++ b/Hydraulic/Hydro.MapView/Template/Template.cs @@ -60,14 +60,22 @@ [Browsable(false)] public PointF3D OffSet { get; set; } = new PointF3D(0, 0, 0); - + private string _BackGroundImg_FullPath; [Browsable(false)] public string BackGroundImg_FullPath { get { - FileInfo fi = new FileInfo(FullPath); - return fi.FullName.Substring(0, fi.FullName.Length - fi.Extension.Length) + ".png"; + if (string.IsNullOrEmpty(_BackGroundImg_FullPath)) + { + FileInfo fi = new FileInfo(FullPath); + return fi.FullName.Substring(0, fi.FullName.Length - fi.Extension.Length) + ".png"; + } + else return _BackGroundImg_FullPath; + } + set + { + _BackGroundImg_FullPath = value; } } -- Gitblit v1.9.3