using GeoSigmaDrawLib;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KevServer
{
public class GeoLayerTree
{
public GeoSigmaXY Geo
{
get; set;
} = null;
public string CurrentLayer
{
get
{
return Geo?.GetCurrentLayer();
}
set
{
Geo.SetCurrentLayer(value);
}
}
public string Layers
{
get
{
return Geo?.GetLayers(true);
}
}
public GeoLayerTree(GeoSigmaXY geo)
{
this.Geo = geo;
}
///
/// 设置树结点的状态
///
/// 结点状态数据
///
public bool SetLayersStatus(string layersStatus)
{
StringReader reader = new StringReader(layersStatus);
string strLine = string.Empty;
while((strLine = reader.ReadLine())!=null)
{
string[] saLine = strLine.Split('|');
if (saLine.Length < 2)
{
continue;
}
this.Geo.SetLayerState(saLine[1], (LayerStatus)Convert.ToInt32(saLine[0]));
}
return true;
}
}
}