分离逻辑与常规连接点

This commit is contained in:
艾竹
2023-01-31 22:45:50 +08:00
parent 5ee0c1ce26
commit 50eab5e091
18 changed files with 292 additions and 235 deletions

View File

@@ -28,7 +28,6 @@ namespace AIStudio.Wpf.DiagramDesigner
YRatio = viewmodel.YRatio;
IsInnerPoint = viewmodel.IsInnerPoint;
IsPortless = viewmodel.IsPortless;
ValueTypePoint = viewmodel.ValueTypePoint;
}
@@ -55,13 +54,5 @@ namespace AIStudio.Wpf.DiagramDesigner
{
get; set;
}
[XmlAttribute]
public ValueTypePoint ValueTypePoint
{
get; set;
}
}
}

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
namespace AIStudio.Wpf.DiagramDesigner
{
/// <summary>
/// 完整连接点
/// </summary>
[Serializable]
[XmlInclude(typeof(LogicalConnectorInfoItem))]
public class LogicalConnectorInfoItem : FullyCreatedConnectorInfoItem
{
public LogicalConnectorInfoItem()
{
}
public LogicalConnectorInfoItem(LogicalConnectorInfo viewmodel) : base(viewmodel)
{
ValueTypePoint = viewmodel.ValueTypePoint;
}
[XmlAttribute]
public ValueTypePoint ValueTypePoint
{
get; set;
}
}
}

View File

@@ -15,10 +15,10 @@ namespace AIStudio.Wpf.DiagramDesigner
}
public LogicalGateDesignerItemBase(LogicalGateItemViewModelBase item) : base(item)
{
this.Connectors = new List<FullyCreatedConnectorInfoItem>();
foreach (var fullyCreatedConnectorInfo in item.Connectors)
this.Connectors = new List<LogicalConnectorInfoItem>();
foreach (var fullyCreatedConnectorInfo in item.Connectors.OfType<LogicalConnectorInfo>())
{
FullyCreatedConnectorInfoItem connector = new FullyCreatedConnectorInfoItem(fullyCreatedConnectorInfo);
LogicalConnectorInfoItem connector = new LogicalConnectorInfoItem(fullyCreatedConnectorInfo);
this.Connectors.Add(connector);
}
this.OrderNumber = item.OrderNumber;
@@ -28,7 +28,7 @@ namespace AIStudio.Wpf.DiagramDesigner
}
[XmlArray]
public List<FullyCreatedConnectorInfoItem> Connectors { get; set; }
public List<LogicalConnectorInfoItem> Connectors { get; set; }
[XmlAttribute]
public int OrderNumber { get; set; }

View File

@@ -22,6 +22,7 @@ namespace AIStudio.Wpf.DiagramDesigner
{
ColorItem = new ColorItem() { LineColor = new ColorObjectItem(), FillColor = new ColorObjectItem() };
FontItem = new FontItem();
SharpItem = new SharpItem() { SourceMarker = new LinkMarkerItem(), SinkMarker = new LinkMarkerItem() };
}
public SelectableItemBase(SelectableViewModelBase viewmodel)
@@ -776,6 +777,7 @@ namespace AIStudio.Wpf.DiagramDesigner
get; set;
}
[XmlAttribute]
public ArrowSizeStyle SizeStyle
{
get; set;