mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-26 03:07:55 +08:00
mind
This commit is contained in:
@@ -518,6 +518,28 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return new Size(double.Parse(pieces[0]), double.Parse(pieces[1]));
|
||||
}
|
||||
|
||||
public static string SerializeCornerRadius(CornerRadius cornerRadius)
|
||||
{
|
||||
return string.Format("{0},{1},{2},{3}", cornerRadius.TopLeft, cornerRadius.TopRight, cornerRadius.BottomRight, cornerRadius.BottomLeft);
|
||||
}
|
||||
|
||||
public static CornerRadius DeserializeCornerRadius(string cornerRadius)
|
||||
{
|
||||
string[] pieces = cornerRadius.Split(new char[] { ',' });
|
||||
return new CornerRadius(double.Parse(pieces[0]), double.Parse(pieces[1]), double.Parse(pieces[2]), double.Parse(pieces[3]));
|
||||
}
|
||||
|
||||
public static string SerializeThickness(Thickness thickness)
|
||||
{
|
||||
return string.Format("{0},{1},{2},{3}", thickness.Left, thickness.Top, thickness.Right, thickness.Bottom);
|
||||
}
|
||||
|
||||
public static Thickness DeserializeThickness(string thickness)
|
||||
{
|
||||
string[] pieces = thickness.Split(new char[] { ',' });
|
||||
return new Thickness(double.Parse(pieces[0]), double.Parse(pieces[1]), double.Parse(pieces[2]), double.Parse(pieces[3]));
|
||||
}
|
||||
|
||||
public static string SerializeDoubleNull(double? point)
|
||||
{
|
||||
return point?.ToString();
|
||||
|
||||
@@ -147,6 +147,19 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public PointBase Ratio
|
||||
{
|
||||
get
|
||||
{
|
||||
return new PointBase(XRatio, YRatio);
|
||||
}
|
||||
set
|
||||
{
|
||||
XRatio = value.X;
|
||||
YRatio = value.Y;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInnerPoint
|
||||
{
|
||||
get; set;
|
||||
|
||||
Reference in New Issue
Block a user