添加画布信息视图

This commit is contained in:
fengjiayi
2025-05-27 23:46:06 +08:00
parent d055add74c
commit f7cae3493f
33 changed files with 532 additions and 155 deletions

View File

@@ -2,6 +2,7 @@
using Serein.Library.FlowNode;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -27,9 +28,21 @@ namespace Serein.Library
public IFlowEnvironment Env { get; }
/// <summary>
/// 标识画布ID
/// 画布拥有的节点
/// </summary>
[PropertyInfo(IsProtection = true)]
private System.Collections.ObjectModel.ObservableCollection<NodeModelBase> _nodes = [];
/// <summary>
/// 画布公开的节点
/// </summary>
[PropertyInfo(IsProtection = true)]
private System.Collections.ObjectModel.ObservableCollection<NodeModelBase> _publicNodes = [];
/// <summary>
/// 标识画布ID
/// </summary>
[PropertyInfo(IsProtection = false)]
private string _guid;
/// <summary>
@@ -54,19 +67,19 @@ namespace Serein.Library
/// 预览位置X
/// </summary>
[PropertyInfo(IsNotification = true)]
private double _viewX ;
private double _viewX;
/// <summary>
/// 预览位置Y
/// </summary>
[PropertyInfo(IsNotification = true)]
private double _viewY ;
private double _viewY;
/// <summary>
/// 缩放比例X
/// </summary>
[PropertyInfo(IsNotification = true)]
private double _scaleX = 1;
private double _scaleX = 1;
/// <summary>
/// 缩放比例Y
@@ -85,7 +98,7 @@ namespace Serein.Library
public partial class FlowCanvasDetails
{
}

View File

@@ -14,7 +14,7 @@ namespace Serein.Library
/// <summary>
/// 节点基类(数据)
/// </summary>
[NodeProperty(ValuePath = NodeValuePath.None)]
[NodeProperty(ValuePath = NodeValuePath.Node)]
public abstract partial class NodeModelBase : IDynamicFlowNode
{
/// <summary>
@@ -35,13 +35,11 @@ namespace Serein.Library
[PropertyInfo(IsProtection = true)]
private NodeControlType _controlType;
/// <summary>
/// 所属画布
/// </summary>
[PropertyInfo(IsProtection = true)]
private string _canvasGuid ;
[PropertyInfo(IsProtection = true)]
private FlowCanvasDetails _canvasDetails ;
/// <summary>
/// 在画布中的位置
@@ -56,10 +54,10 @@ namespace Serein.Library
private string _displayName;
/// <summary>
/// 是否为起点控件
/// 是否公开
/// </summary>
[PropertyInfo]
private bool _isStart;
[PropertyInfo(IsNotification = true, CustomCodeAtEnd = "NodePublicStateChanged();")]
private bool _isPublic;
/// <summary>
/// 附加的调试功能
@@ -68,7 +66,7 @@ namespace Serein.Library
private NodeDebugSetting _debugSetting ;
/// <summary>
/// 方法描述。不包含Method与委托需要通过MethodName从环境中获取委托进行调用。
/// 方法描述。包含参数信息。不包含Method与委托如若需要调用对应的方法,需要通过MethodName从环境中获取委托进行调用。
/// </summary>
[PropertyInfo(IsProtection = true)]
private MethodDetails _methodDetails ;
@@ -122,7 +120,29 @@ namespace Serein.Library
/// </summary>
public List<NodeModelBase> ChildrenNode { get; }
/// <summary>
/// 节点公开状态发生改变
/// </summary>
private void NodePublicStateChanged()
{
if (IsPublic)
{
// 公开节点
if (!CanvasDetails.PublicNodes.Contains(this))
{
CanvasDetails.PublicNodes.Add(this);
}
}
else
{
// 取消公开
if (CanvasDetails.PublicNodes.Contains(this))
{
CanvasDetails.PublicNodes.Remove(this);
}
}
}
}
}

View File

@@ -23,7 +23,7 @@ namespace Serein.Library
/// <summary>
/// 节点基类(数据):条件控件,动作控件,条件区域,动作区域
/// 节点基类
/// </summary>
public abstract partial class NodeModelBase : IDynamicFlowNode
{

View File

@@ -197,6 +197,11 @@ namespace Serein.Library
/// </summary>
public string Guid { get; set; }
/// <summary>
/// 是否全局公开
/// </summary>
public bool IsPublic { get; set; }
/// <summary>
/// 节点方法所属的程序集名称
/// </summary>