mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
39 lines
984 B
C#
39 lines
984 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Serein.NodeFlow.Tool.SereinExpression.Resolver
|
|
{
|
|
public class PassConditionResolver : SereinConditionResolver
|
|
{
|
|
public Operator Op { get; set; }
|
|
public override bool Evaluate(object obj)
|
|
{
|
|
/*return Op switch
|
|
{
|
|
Operator.Pass => true,
|
|
Operator.NotPass => false,
|
|
_ => throw new NotSupportedException("不支持的条件类型")
|
|
};*/
|
|
switch (Op)
|
|
{
|
|
case Operator.Pass:
|
|
return true;
|
|
case Operator.NotPass:
|
|
return false;
|
|
default:
|
|
throw new NotSupportedException("不支持的条件类型");
|
|
|
|
}
|
|
}
|
|
|
|
public enum Operator
|
|
{
|
|
Pass,
|
|
NotPass,
|
|
}
|
|
}
|
|
}
|