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.
		
		
		
		
		
			
		
			
				
					
					
						
							34 lines
						
					
					
						
							1.0 KiB
						
					
					
				
			
		
		
	
	
							34 lines
						
					
					
						
							1.0 KiB
						
					
					
				using System; | 
						|
using System.Xml.Linq; | 
						|
using KGIS.Framework.Utils; | 
						|
 | 
						|
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 ""; | 
						|
        } | 
						|
 | 
						|
    } | 
						|
}
 | 
						|
 |