mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 08:10:50 +08:00
序列化继续改进
This commit is contained in:
@@ -36,6 +36,20 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
}
|
||||
|
||||
public override SelectableItemBase GetSerializableObject()
|
||||
{
|
||||
if (IsFullConnection)
|
||||
{
|
||||
ConnectionItem connection = new ConnectionItem(this);
|
||||
|
||||
return connection;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Init(FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo)
|
||||
{
|
||||
this.Root = sourceConnectorInfo.DataItem.Root;
|
||||
@@ -73,26 +87,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
Vertices = new ObservableCollection<ConnectorVertexModel>(designer.Vertices.Select(p => new ConnectorVertexModel(this.Root, this, designer)));
|
||||
Labels = new ObservableCollection<ConnectorLabelModel>(designer.Labels.Select(p => new ConnectorLabelModel(this.Root, this, designer)));
|
||||
}
|
||||
}
|
||||
|
||||
public override SelectableItemBase GetSerializableObject()
|
||||
{
|
||||
if (IsFullConnection)
|
||||
{
|
||||
ConnectionItem connection = new ConnectionItem(this);
|
||||
|
||||
return connection;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override Type GetSerializableType()
|
||||
{
|
||||
return typeof(ConnectionItem);
|
||||
}
|
||||
}
|
||||
|
||||
#region 属性
|
||||
private string _text;
|
||||
|
||||
Reference in New Issue
Block a user