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.

70 lines
2.3 KiB
C#

1 month ago
using GeoSigmaDrawLib;
using SigmaDrawerElement;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
1 month ago
using System.Windows.Forms;
1 month ago
using System.Xml.Linq;
1 month ago
namespace SmartWells
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
1 month ago
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);
1 month ago
Application.Run(new Form1());
}
}
}