You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
using KGIS.Framework.Utils; |
|
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Text; |
|
using System.Threading.Tasks; |
|
using System.Xml.Linq; |
|
|
|
namespace Kingo.Plugin.EngineEditor.helper |
|
{ |
|
public class AreaConfigHelper |
|
{ |
|
/// <summary> |
|
/// 获取对应图层需要修改的面积字段名称 |
|
/// </summary> |
|
/// <param name="layername"></param> |
|
/// <returns></returns> |
|
public static string GetAreaPropertyByLayerName(string layername) |
|
{ |
|
var areapath = SysAppPath.GetAreaUpdateConfigPath(); |
|
//解析xml |
|
XElement rootelement = XElement.Load(areapath); |
|
var layerelment = rootelement.Element("Layers"); |
|
foreach (var sub in rootelement.Descendants()) |
|
{ |
|
Console.WriteLine(sub.Name); |
|
if (sub.Attribute("Name").Value == layername) |
|
{ |
|
var areaProperty = ""; |
|
areaProperty = sub.Attribute("AreaProperty").Value; |
|
return areaProperty; |
|
} |
|
} |
|
return ""; |
|
} |
|
|
|
} |
|
}
|
|
|