mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
连接线
This commit is contained in:
@@ -15,7 +15,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ConnectorValueType valueTypePoint = ConnectorValueType.Real) : base(root, dataItem, orientation, isInnerPoint, isPortless)
|
||||
{
|
||||
this.ConnectorValueType = valueTypePoint;
|
||||
}
|
||||
}
|
||||
|
||||
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, SelectableItemBase designer) : base(root, dataItem, designer)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public double _connectorValue;
|
||||
private double _connectorValue;
|
||||
public double ConnectorValue
|
||||
{
|
||||
get
|
||||
@@ -55,7 +55,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public string _connectorString;
|
||||
private string _connectorString;
|
||||
public string ConnectorString
|
||||
{
|
||||
get
|
||||
@@ -68,7 +68,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public ConnectorValueType _connectorValueType;
|
||||
private ConnectorValueType _connectorValueType;
|
||||
public ConnectorValueType ConnectorValueType
|
||||
{
|
||||
get
|
||||
@@ -81,9 +81,42 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsError
|
||||
public bool ConnectorError
|
||||
{
|
||||
get;set;
|
||||
get; set;
|
||||
}
|
||||
|
||||
public bool ValueError
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string ErrorMessage
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public override bool CanAttachTo(FullyCreatedConnectorInfo port)
|
||||
{
|
||||
if (!base.CanAttachTo(port))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (port is LogicalConnectorInfo logical)
|
||||
{
|
||||
if (logical.ConnectorValueType == ConnectorValueType.String && this.ConnectorValueType == logical.ConnectorValueType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (logical.ConnectorValueType <= ConnectorValueType.ValueType && this.ConnectorValueType <= ConnectorValueType.ValueType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user