修改了远程环境的节点加载流程、容器节点子节点的位置关系

This commit is contained in:
fengjiayi
2024-12-26 00:26:50 +08:00
parent 5b0ba84fd6
commit 56b22be8c0
89 changed files with 1060 additions and 4953 deletions

View File

@@ -15,6 +15,17 @@ namespace Serein.Workbench.Node.View
/// </summary>
public abstract class NodeControlBase : UserControl, IDynamicFlowNode
{
/// <summary>
/// 节点所在的画布(以后需要将画布封装出来,实现多画布的功能)
/// </summary>
public Canvas NodeCanvas { get; set; }
private INodeContainerControl nodeContainerControl;
/// <summary>
/// 如果该节点放置在了某个容器节点,就会记录这个容器节点
/// </summary>
private INodeContainerControl NodeContainerControl { get; }
/// <summary>
/// 记录与该节点控件有关的所有连接
/// </summary>
@@ -36,6 +47,25 @@ namespace Serein.Workbench.Node.View
SetBinding();
}
/// <summary>
/// 放置在某个节点容器中
/// </summary>
public void PlaceToContainer(INodeContainerControl nodeContainerControl)
{
this.nodeContainerControl = nodeContainerControl;
NodeCanvas.Children.Remove(this); // 从画布上移除
nodeContainerControl.PlaceNode(this);
}
/// <summary>
/// 从某个节点容器取出
/// </summary>
public void TakeOutContainer()
{
nodeContainerControl.TakeOutNode(this);
NodeCanvas.Children.Add(this); // 重新添加到画布上
}
/// <summary>
/// 添加与该节点有关的连接后,记录下来
/// </summary>