Files
serein-flow/Library/Ex/FlipflopException.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2024-09-15 22:07:10 +08:00
using System;
using System.CodeDom;
2024-09-15 22:07:10 +08:00
namespace Serein.Library
2024-09-15 22:07:10 +08:00
{
/// <summary>
2024-10-11 19:31:34 +08:00
/// 触发器异常
2024-09-15 22:07:10 +08:00
/// </summary>
public class FlipflopException: Exception
{
/// <summary>
/// 触发器取消类型
/// </summary>
2024-10-07 15:15:18 +08:00
public enum CancelClass
{
2024-10-11 19:31:34 +08:00
/// <summary>
/// 取消触发器当前所在分支的继续执行
/// </summary>
2024-10-28 21:52:45 +08:00
CancelBranch,
2024-10-11 19:31:34 +08:00
/// <summary>
/// 取消整个触发器流程的再次执行(用于停止全局触发器)
/// </summary>
2024-10-28 21:52:45 +08:00
CancelFlow,
2024-10-07 15:15:18 +08:00
}
2024-10-11 19:31:34 +08:00
/// <summary>
/// 是否已取消
/// </summary>
2024-09-15 22:07:10 +08:00
public bool IsCancel { get; }
2024-10-11 19:31:34 +08:00
/// <summary>
/// 取消类型
/// </summary>
public CancelClass Type { get; }
/// <summary>
/// 触发器异常构造函数
/// </summary>
/// <param name="message"></param>
/// <param name="isCancel"></param>
/// <param name="clsss"></param>
2024-10-28 21:52:45 +08:00
public FlipflopException(string message, bool isCancel = true,CancelClass clsss = CancelClass.CancelBranch) :base(message)
2024-09-15 22:07:10 +08:00
{
IsCancel = isCancel;
2024-10-11 19:31:34 +08:00
Type = clsss;
2024-09-15 22:07:10 +08:00
}
}
}