mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-20 00:16:36 +08:00
xx
This commit is contained in:
@@ -438,7 +438,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public static string SerializeColorList(IEnumerable<Color> colors)
|
||||
{
|
||||
return string.Join("-", colors.Select(color => string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", color.A, color.R, color.G, color.B)));
|
||||
return string.Join("-", colors.Select(color => SerializeColor(color)));
|
||||
}
|
||||
|
||||
public static List<Color> DeserializeColorList(string colorstring)
|
||||
@@ -473,6 +473,22 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return new Point(double.Parse(pieces[0]), double.Parse(pieces[1]));
|
||||
}
|
||||
|
||||
public static string SerializePointList(List<Point> points)
|
||||
{
|
||||
return string.Join("-", points.Select(point => SerializePoint(point)));
|
||||
}
|
||||
|
||||
public static List<Point> DeserializePointList(string pointstring)
|
||||
{
|
||||
List<Point> pointlist = new List<Point>();
|
||||
var points = pointstring.Split('-');
|
||||
foreach (var point in points)
|
||||
{
|
||||
pointlist.Add(DeserializePoint(point));
|
||||
}
|
||||
return pointlist;
|
||||
}
|
||||
|
||||
public static string SerializeSize(Size size)
|
||||
{
|
||||
return string.Format("{0},{1}", size.Width, size.Height);
|
||||
|
||||
Reference in New Issue
Block a user