using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; namespace Kingo.PluginServiceInterface { //[XmlRoot("Maps")] //public class MapsCfg //{ // public string Name { get; set; } // public List Layers { get; set; } //} //[XmlRoot("LayerInfo")] //public class LayerCfg //{ // [System.Xml.Serialization.XmlIgnore] // public int ID { get; private set; } // [System.Xml.Serialization.XmlIgnore] // public int PID { get; private set; } // [XmlAttribute("LayerName")] // public string LayerName { get; set; } // [XmlAttribute("FcName")] // public string FcName { get; set; } // [XmlAttribute("Expanded")] // public bool Expanded { get; set; } // [XmlAttribute("Visible")] // public bool Visible { get; set; } // [XmlAttribute("Selectable")] // public bool Selectable { get; set; } // [XmlAttribute("AllowEdit")] // public bool AllowEdit { get; set; } // [XmlAttribute("Transparency")] // public int Transparency { get; set; } // [XmlAttribute("Required")] // public bool Required { get; set; } // public string FcPath { get; set; } // public string Symbol { get; set; } // [System.Xml.Serialization.XmlIgnore] // public Bitmap SymbolImg { get; set; } // [System.Xml.Serialization.XmlIgnore] // public object Data { get; set; } // /// // /// 绝对路径Data // /// // public string AbsolutePath { get; set; } // /// // /// 区分内外部数据 // /// // public string AbsolutePathType { get; set; } // public string FieldEditCfg { get; set; } // [System.Xml.Serialization.XmlIgnore] // public bool IsEdit { get; set; } // [System.Xml.Serialization.XmlIgnore] // public int ImgIndex { get; set; } // [XmlAttribute("LayerType")] // public EnumLayerType LayerType { get; set; } // public List Layers { get; set; } // public int MinScale { get; set; } // public int MaxScale { get; set; } // public LayerCfg() // { // PID = 0; // ID = 1; // Layers = new List(); // } // public LayerCfg(LayerCfg pParentLayer) // { // PID = pParentLayer.ID; // ID = pParentLayer.ID * 100 + pParentLayer.Layers.Count + 1; // Layers = new List(); // } // public void SetParentLayer(LayerCfg pParent) // { // PID = pParent.ID; // ID = pParent.ID * 100 + pParent.Layers.IndexOf(this) + 1; // } // /// // /// 将父子级数据结构转换为普通list // /// // /// // /// // public List GetAllItem() // { // List Resultlist = new List(); // //foreach (var item in list) // //{ // OperationChildData(Resultlist, this); // Resultlist.Add(this); // //} // return Resultlist; // } // /// // /// 递归子级数据 // /// // /// 树形列表数据 // /// 父级model // private void OperationChildData(List AllList, LayerCfg item) // { // if (item.Layers != null) // { // if (item.Layers.Count > 0) // { // //foreach (var subItem in item.Layers) // //{ // // subItem.SetParentLayer(item); // // AllList.Add(subItem); // //} // //AllList.AddRange(item.Layers); // foreach (var subItem in item.Layers) // { // subItem.SetParentLayer(item); // AllList.Add(subItem); // OperationChildData(AllList, subItem); // } // } // } // } //} public enum EnumLayerType { GroupLayer, FeatureLayer, RasterLayer, KOTilesLayer, WMTSLayer, Map, Null } }