mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
mind的拷贝完成
This commit is contained in:
@@ -63,10 +63,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
this.ShapeViewModel.PropertyChanged += ConnectorViewModel_PropertyChanged;
|
||||
this.PropertyChanged += ConnectorViewModel_PropertyChanged;
|
||||
|
||||
var routetype = GlobalType.AllTypes.Where(p => typeof(IRouter).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == RouterMode);
|
||||
var routetype = TypeHelper.GetType(RouterMode);
|
||||
Router = routetype != null ? (System.Activator.CreateInstance(routetype) as IRouter) : new RouterNormal();
|
||||
|
||||
var pathGeneratortype = GlobalType.AllTypes.Where(p => typeof(IPathGenerator).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == PathMode);
|
||||
var pathGeneratortype = TypeHelper.GetType(PathMode);
|
||||
PathGenerator = pathGeneratortype != null ? (System.Activator.CreateInstance(pathGeneratortype) as IPathGenerator) : new ConnectingLineSmooth();
|
||||
|
||||
this.SourceConnectorInfo = sourceConnectorInfo;
|
||||
@@ -497,12 +497,12 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
break;
|
||||
case nameof(RouterMode):
|
||||
var routetype = GlobalType.AllTypes.Where(p => typeof(IRouter).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == RouterMode);
|
||||
var routetype = TypeHelper.GetType(RouterMode);
|
||||
Router = routetype != null ? (System.Activator.CreateInstance(routetype) as IRouter) : new RouterNormal();
|
||||
UpdatePathGeneratorResult();
|
||||
break;
|
||||
case nameof(PathMode):
|
||||
var pathGeneratortype = GlobalType.AllTypes.Where(p => typeof(IPathGenerator).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == PathMode);
|
||||
var pathGeneratortype = TypeHelper.GetType(PathMode);
|
||||
PathGenerator = pathGeneratortype != null ? (System.Activator.CreateInstance(pathGeneratortype) as IPathGenerator) : new ConnectingLineSmooth();
|
||||
UpdatePathGeneratorResult();
|
||||
break;
|
||||
@@ -729,6 +729,35 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
SinkConnectorInfo = sink;
|
||||
}
|
||||
|
||||
public void SetPathGeneratorParameter(double smoothMargin, double smoothAutoSlope, double orthogonalShapeMargin, double orthogonalGlobalBoundsMargin)
|
||||
{
|
||||
bool hasChanged = false;
|
||||
if (SmoothMargin != smoothMargin)
|
||||
{
|
||||
hasChanged = true;
|
||||
SmoothMargin = smoothMargin;
|
||||
}
|
||||
if (SmoothAutoSlope != smoothAutoSlope)
|
||||
{
|
||||
hasChanged = true;
|
||||
SmoothAutoSlope = smoothAutoSlope;
|
||||
}
|
||||
if (OrthogonalShapeMargin != orthogonalShapeMargin)
|
||||
{
|
||||
hasChanged = true;
|
||||
OrthogonalShapeMargin = orthogonalShapeMargin;
|
||||
}
|
||||
if (OrthogonalGlobalBoundsMargin != orthogonalGlobalBoundsMargin)
|
||||
{
|
||||
hasChanged = true;
|
||||
OrthogonalGlobalBoundsMargin = orthogonalGlobalBoundsMargin;
|
||||
}
|
||||
if (hasChanged)
|
||||
{
|
||||
UpdatePathGeneratorResult();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVisible(bool visible)
|
||||
{
|
||||
Visible = visible;
|
||||
|
||||
Reference in New Issue
Block a user