This commit is contained in:
艾竹
2023-01-21 23:25:42 +08:00
parent 2e396d687b
commit ad227aee0c
5 changed files with 48 additions and 29 deletions

View File

@@ -1,9 +1,11 @@
using AIStudio.Wpf.DiagramDesigner;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Xml.Serialization;
@@ -37,31 +39,9 @@ namespace AIStudio.Wpf.DiagramDesigner
this.SinkInnerPoint = viewmodel.SinkConnectorInfoFully.IsInnerPoint;
this.RouterMode = viewmodel.RouterMode;
this.PathMode = viewmodel.PathMode;
this.Vertices = viewmodel.Vertices.Select(p => (Point)p.MiddlePosition).ToList();
}
//public ConnectionItem(Guid sourceId, ConnectorOrientation sourceOrientation, Type sourceType, double sourceXRatio, double sourceYRatio, bool sourceInnerPoint,
// Guid sinkId, ConnectorOrientation sinkOrientation, Type sinkType, double sinkXRatio, double sinkYRatio, bool sinkInnerPoint, ConnectorViewModel viewmodel) : base(viewmodel)
//{
// this.SourceId = sourceId;
// this.SourceOrientation = sourceOrientation;
// this.SourceType = sourceType;
// this.SourceTypeName = sourceType.FullName;
// this.SourceXRatio = sourceXRatio;
// this.SourceYRatio = sourceYRatio;
// this.SourceInnerPoint = sourceInnerPoint;
// this.SinkId = sinkId;
// this.SinkOrientation = sinkOrientation;
// this.SinkType = sinkType;
// this.SinkTypeName = sinkType.FullName;
// this.SinkXRatio = sinkXRatio;
// this.SinkYRatio = sinkYRatio;
// this.SinkInnerPoint = sinkInnerPoint;
// this.RouterMode = viewmodel.RouterMode;
// this.DrawMode = viewmodel.DrawMode;
//}
[XmlAttribute]
public Guid SourceId { get; set; }
@@ -116,5 +96,25 @@ namespace AIStudio.Wpf.DiagramDesigner
{
get; set;
}
[XmlIgnore]
public List<Point> Vertices
{
get; set;
}
[JsonIgnore]
[XmlAttribute("Vertices")]
public string XmlVertices
{
get
{
return SerializeHelper.SerializePointList(Vertices);
}
set
{
Vertices = SerializeHelper.DeserializePointList(value);
}
}
}
}