You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.5 KiB
C#
62 lines
1.5 KiB
C#
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;
|
|
}
|
|
/// <summary>
|
|
/// 设置树结点的状态
|
|
/// </summary>
|
|
/// <param name="layersStatus">结点状态数据</param>
|
|
/// <returns></returns>
|
|
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;
|
|
}
|
|
}
|
|
}
|