Files

89 lines
2.0 KiB
C#
Raw Permalink Normal View History

2023-05-14 00:31:25 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
2023-05-14 15:06:30 +08:00
using System.Windows.Media;
2023-05-14 00:31:25 +08:00
using System.Xml.Serialization;
using Newtonsoft.Json;
namespace AIStudio.Wpf.DiagramDesigner
{
public class DrawingDesignerItemBase : DesignerItemBase
{
public DrawingDesignerItemBase()
{
}
public DrawingDesignerItemBase(DrawingDesignerItemViewModelBase item) : base(item)
{
this.Erasable = item.Erasable;
this.Geometry = item.Geometry.ToString();
if (item.Geometry.Transform != null)
{
this.Matrix = item.Geometry.Transform.Value.ToString();
}
2023-05-14 00:31:25 +08:00
this.Points = item.Points;
this.DrawMode = item.DrawMode;
}
[XmlAttribute]
public bool Erasable
{
get; set;
}
[XmlAttribute]
public string Geometry
{
get; set;
}
[XmlAttribute]
public string Matrix
{
get; set;
}
2023-05-14 15:06:30 +08:00
//[JsonIgnore]
//[XmlElement("Matrix")]
//public string XmlMatrix
//{
// get
// {
// return SerializeHelper.SerializeMatrix(Matrix);
// }
// set
// {
// Matrix = SerializeHelper.DeserializeMatrix(value);
// }
//}
2023-05-14 00:31:25 +08:00
[XmlIgnore]
public List<Point> Points
{
get; set;
}
[JsonIgnore]
[XmlElement("Points")]
public string XmlPoints
{
get
{
return SerializeHelper.SerializePointList(Points);
}
set
{
Points = SerializeHelper.DeserializePointList(value);
}
}
[XmlAttribute]
public DrawMode DrawMode
{
get; set;
}
}
}