mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
Portless序列化
This commit is contained in:
@@ -10,16 +10,17 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class FullyCreatedConnectorInfo : ConnectorInfoBase
|
||||
{
|
||||
public FullyCreatedConnectorInfo(DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, ValueTypePoint valueTypePoint = 0)
|
||||
: this(null, dataItem, orientation, isInnerPoint, valueTypePoint)
|
||||
public FullyCreatedConnectorInfo(DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ValueTypePoint valueTypePoint = 0)
|
||||
: this(null, dataItem, orientation, isInnerPoint, isPortless, valueTypePoint)
|
||||
{
|
||||
}
|
||||
|
||||
public FullyCreatedConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, ValueTypePoint valueTypePoint = 0)
|
||||
public FullyCreatedConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ValueTypePoint valueTypePoint = 0)
|
||||
: base(root, orientation)
|
||||
{
|
||||
this.Parent = dataItem;
|
||||
this.IsInnerPoint = isInnerPoint;
|
||||
this.IsPortless = IsPortless;
|
||||
this.ValueTypePoint = valueTypePoint;
|
||||
if (IsInnerPoint == true)
|
||||
{
|
||||
@@ -69,6 +70,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
XRatio = designer.XRatio;
|
||||
YRatio = designer.YRatio;
|
||||
IsInnerPoint = designer.IsInnerPoint;
|
||||
IsPortless = designer.IsPortless;
|
||||
ValueTypePoint = designer.ValueTypePoint;
|
||||
}
|
||||
}
|
||||
@@ -231,18 +233,30 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
return XRatio;
|
||||
}
|
||||
else if (IsPortless)
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Orientation)
|
||||
{
|
||||
case ConnectorOrientation.Top:
|
||||
return 0.5;
|
||||
case ConnectorOrientation.Left:
|
||||
return 0;
|
||||
case ConnectorOrientation.Bottom:
|
||||
case ConnectorOrientation.TopLeft:
|
||||
return 0;
|
||||
case ConnectorOrientation.Top:
|
||||
return 0.5;
|
||||
case ConnectorOrientation.TopRight:
|
||||
return 1;
|
||||
case ConnectorOrientation.Right:
|
||||
return 1;
|
||||
case ConnectorOrientation.BottomRight:
|
||||
return 1;
|
||||
case ConnectorOrientation.Bottom:
|
||||
return 0.5;
|
||||
case ConnectorOrientation.BottomLeft:
|
||||
return 0;
|
||||
default: return XRatio;
|
||||
}
|
||||
}
|
||||
@@ -254,18 +268,30 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
return YRatio;
|
||||
}
|
||||
else if (IsPortless)
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Orientation)
|
||||
{
|
||||
case ConnectorOrientation.Top:
|
||||
return 0;
|
||||
case ConnectorOrientation.Left:
|
||||
return 0.5;
|
||||
case ConnectorOrientation.Bottom:
|
||||
return 1;
|
||||
case ConnectorOrientation.TopLeft:
|
||||
return 0;
|
||||
case ConnectorOrientation.Top:
|
||||
return 0;
|
||||
case ConnectorOrientation.TopRight:
|
||||
return 0;
|
||||
case ConnectorOrientation.Right:
|
||||
return 0.5;
|
||||
case ConnectorOrientation.BottomRight:
|
||||
return 1;
|
||||
case ConnectorOrientation.Bottom:
|
||||
return 1;
|
||||
case ConnectorOrientation.BottomLeft:
|
||||
return 1;
|
||||
default: return YRatio;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user