using Serein.Library;
using Serein.Library.Api;
using Serein.Library.Utils.SereinExpression;
using System.ComponentModel;
namespace Serein.NodeFlow.Model
{
///
/// 条件节点(用于条件控件)
///
[NodeProperty(ValuePath = NodeValuePath.Node)]
public partial class SingleConditionNode : NodeModelBase
{
///
/// 是否为自定义参数
///
[PropertyInfo(IsNotification = true)]
private bool _isCustomData;
///
/// 自定义参数值
///
[PropertyInfo(IsNotification = true)]
private object? _customData;
///
/// 条件表达式
///
[PropertyInfo(IsNotification = true)]
private string _expression;
}
public partial class SingleConditionNode : NodeModelBase
{
public SingleConditionNode(IFlowEnvironment environment):base(environment)
{
this.IsCustomData = false;
this.CustomData = null;
this.Expression = "PASS";
}
///
/// 加载完成后调用的方法
///
public override void OnLoading()
{
var pd = new ParameterDetails
{
Index = 0,
Name = "Exp",
DataType = typeof(object),
ExplicitType = typeof(object),
IsExplicitData = false,
DataValue = string.Empty,
ArgDataSourceNodeGuid = string.Empty,
ArgDataSourceType = ConnectionArgSourceType.GetPreviousNodeData,
NodeModel = this,
Convertor = null,
ExplicitTypeName = "Value",
Items = Array.Empty(),
};
this.MethodDetails.ParameterDetailss = new ParameterDetails[] { pd };
}
///
/// 重写节点的方法执行
///
///
///
public override Task