using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using static Serein.Library.Utils.ChannelFlowInterrupt;
namespace Serein.Library
{
///
/// 节点调试设置,用于中断节点的运行
///
[NodeProperty(ValuePath = NodeValuePath.DebugSetting)]
public partial class NodeDebugSetting
{
///
/// 创建属于某个节点的调试设置
///
///
public NodeDebugSetting(NodeModelBase nodeModel)
{
NodeModel = nodeModel;
}
///
/// 对应的节点
///
[PropertyInfo(IsProtection = true)]
private NodeModelBase _nodeModel;
///
/// 是否使能
///
[PropertyInfo(IsNotification = true)]
private bool _isEnable = true;
///
/// 中断级别,暂时停止继续执行后继分支。
///
//[PropertyInfo]
//private InterruptClass _interruptClass = InterruptClass.None;
///
/// 中断级别,暂时停止继续执行后继分支。
///
[PropertyInfo(IsNotification = true)] // CustomCode = "NodeModel?.Env?.SetNodeInterruptAsync(NodeModel?.Guid, value);"
private bool _isInterrupt = false;
///
/// 取消中断的回调函数
///
[PropertyInfo]
private Action _cancelInterruptCallback;
///
/// 中断Task(用来中断)
///
[PropertyInfo]
private Func> _getInterruptTask;
}
///
/// 中断级别,暂时停止继续执行后继分支。
///
//public enum InterruptClass
//{
// ///
// /// 不中断
// ///
// None,
// ///
// /// 分支中断,中断进入当前节点的分支。
// ///
// Branch,
// ///
// /// 全局中断,中断全局所有节点的运行。(暂未实现相关)
// ///
// Global,
//}
}