mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-26 09:47:54 +08:00
破坏性更新,移除了Core/Framework(对应的上下文类移动到了Library)
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
<!--调用控制点,方法名称,下一个方法调用控制点-->
|
||||
<Grid x:Name="HeaderGrid" Grid.Row="0" ColumnDefinitions="auto,*,auto" VerticalAlignment="Center">
|
||||
<cv:NodeJunctionView Grid.Column="0" JunctionType="Execute" MyNode="{Binding NodeMoel}" Width="30" Height="15" Margin="4,0,2,0" />
|
||||
<cv:NodeJunctionView x:Name="ExecuteJunctionControl" Grid.Column="0" JunctionType="Execute" MyNode="{Binding NodeMoel}" Width="30" Height="15" Margin="4,0,2,0" />
|
||||
<StackPanel Grid.Column="1" Grid.RowSpan="2" >
|
||||
<TextBlock Text="{Binding NodeMoel.DisplayName}" FontSize="17" HorizontalAlignment="Center">
|
||||
<ToolTip.Tip>
|
||||
@@ -31,7 +31,7 @@
|
||||
</ToolTip.Tip>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<cv:NodeJunctionView Grid.Column="2" JunctionType="NextStep" MyNode="{Binding NodeMoel}" Width="30" Height="15" Margin="2,0,8,0"/>
|
||||
<cv:NodeJunctionView x:Name="NextStepJunctionControl" Grid.Column="2" JunctionType="NextStep" MyNode="{Binding NodeMoel}" Width="30" Height="15" Margin="2,0,8,0"/>
|
||||
</Grid>
|
||||
|
||||
<!--入参信息-->
|
||||
|
||||
@@ -5,10 +5,11 @@ using Serein.Library;
|
||||
using Serein.NodeFlow.Model;
|
||||
using Serein.Workbench.Avalonia.Api;
|
||||
using Serein.Workbench.Avalonia.Custom.Node.ViewModels;
|
||||
using Serein.Workbench.Avalonia.Custom.Views;
|
||||
|
||||
namespace Serein.Workbench.Avalonia.Custom.Node.Views;
|
||||
|
||||
public partial class ActionNodeView : NodeControlBase
|
||||
public partial class ActionNodeView : NodeControlBase, INodeJunction
|
||||
{
|
||||
private ActionNodeViewModel _vm;
|
||||
|
||||
@@ -20,4 +21,11 @@ public partial class ActionNodeView : NodeControlBase
|
||||
//DataContext = _vm;
|
||||
}
|
||||
|
||||
public NodeJunctionView ExecuteJunction => this.ExecuteJunctionControl;
|
||||
|
||||
public NodeJunctionView NextStepJunction => this.NextStepJunctionControl;
|
||||
|
||||
public NodeJunctionView[] ArgDataJunction => throw new System.NotImplementedException();
|
||||
|
||||
public NodeJunctionView ReturnDataJunction => throw new System.NotImplementedException();
|
||||
}
|
||||
@@ -14,13 +14,62 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.Workbench.Avalonia.Custom.Node.Views
|
||||
{
|
||||
public class NodeControlBase : UserControl
|
||||
public abstract class NodeControlBase : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 记录与该节点控件有关的所有连接
|
||||
/// </summary>
|
||||
private readonly List<NodeConnectionLineControl> connectionControls = new List<NodeConnectionLineControl>();
|
||||
|
||||
protected NodeControlBase()
|
||||
{
|
||||
this.Background = Brushes.Transparent;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加与该节点有关的连接后,记录下来
|
||||
/// </summary>
|
||||
/// <param name="connection"></param>
|
||||
public void AddConnection(NodeConnectionLineControl connection)
|
||||
{
|
||||
connectionControls.Add(connection);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除了连接之后,还需要从节点中的记录移除
|
||||
/// </summary>
|
||||
/// <param name="connection"></param>
|
||||
public void RemoveConnection(NodeConnectionLineControl connection)
|
||||
{
|
||||
connectionControls.Remove(connection);
|
||||
connection.Remove();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除所有连接
|
||||
/// </summary>
|
||||
public void RemoveAllConection()
|
||||
{
|
||||
foreach (var connection in this.connectionControls)
|
||||
{
|
||||
connection.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新与该节点有关的数据
|
||||
/// </summary>
|
||||
public void UpdateLocationConnections()
|
||||
{
|
||||
foreach (var connection in this.connectionControls)
|
||||
{
|
||||
connection.RefreshLineDsiplay(); // 主动更新连线位置
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 放置在某个节点容器中
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user