|
|
|
|
|
using GeoSigmaDrawLib;
|
|
|
|
|
|
using SigmaDrawerElement;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
using System.Xml.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace SmartWells
|
|
|
|
|
|
{
|
|
|
|
|
|
internal static class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 应用程序的主入口点。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[STAThread]
|
|
|
|
|
|
static void Main()
|
|
|
|
|
|
{
|
|
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaDrawLib.NativeLibraryPathRegistrar.Register();
|
|
|
|
|
|
|
|
|
|
|
|
//DrawerElementHelp elementHelp = new DrawerElementHelp();
|
|
|
|
|
|
GeoSigma.SigmaDrawerElement.DrawerData propertys = new GeoSigma.SigmaDrawerElement.DrawerData(); //elementHelp.DeserializeList(curveData);
|
|
|
|
|
|
DrawerPline drawerPline = new DrawerPline()
|
|
|
|
|
|
{
|
|
|
|
|
|
Layer = "TestLayer",
|
|
|
|
|
|
Name = "TestLine",
|
|
|
|
|
|
Coordinate = "1,1"
|
|
|
|
|
|
};
|
|
|
|
|
|
DrawerElementProperty property = new DrawerElementProperty()
|
|
|
|
|
|
{
|
|
|
|
|
|
ElementType = DrawElementType.ELEMENT_CURVE,
|
|
|
|
|
|
Element = drawerPline,
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
propertys.Add(property);
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder strb = new StringBuilder();
|
|
|
|
|
|
StringWriter swString = new StringWriter(strb);
|
|
|
|
|
|
System.Xml.Serialization.XmlSerializer xmlSerializer = new System.Xml.Serialization.XmlSerializer(typeof(GeoSigma.SigmaDrawerElement.DrawerData));
|
|
|
|
|
|
xmlSerializer.Serialize(swString, propertys);
|
|
|
|
|
|
string strOut = strb.ToString();
|
|
|
|
|
|
DrawerElementHelp elementHelp = new DrawerElementHelp();
|
|
|
|
|
|
strOut = strOut.Replace("DrawerElementProperty", "Element");
|
|
|
|
|
|
strOut = @"<Data>
|
|
|
|
|
|
<Element Color=""#FF00FF"" Layer=""边界"" Visibility=""1"" Type=""Pline"">
|
|
|
|
|
|
<Pline>
|
|
|
|
|
|
<Coordinate>
|
|
|
|
|
|
18601560.22234595,3303258.95828066
|
|
|
|
|
|
18620621.30258478,3302001.36662453
|
|
|
|
|
|
18613056.20459116,3269747.83944374
|
|
|
|
|
|
18576194.89377911,3269599.8874842
|
|
|
|
|
|
18579013.26361987,3282323.75600506
|
|
|
|
|
|
18591547.59264851,3283803.27560051
|
|
|
|
|
|
18601486.05471857,3303037.03034134
|
|
|
|
|
|
18601560.22234595,3303258.95828066
|
|
|
|
|
|
</Coordinate>
|
|
|
|
|
|
</Pline>
|
|
|
|
|
|
</Element>
|
|
|
|
|
|
|
|
|
|
|
|
</Data>";
|
|
|
|
|
|
List<DrawerElementProperty> propertysOut = elementHelp.DeserializeList(strOut);
|
|
|
|
|
|
Application.Run(new Form1());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|