2024-10-15 10:55:41 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
2024-10-20 12:10:57 +08:00
|
|
|
|
namespace Serein.Library.Utils.SereinExpression.Resolver
|
2024-10-15 10:55:41 +08:00
|
|
|
|
{
|
|
|
|
|
|
public class BoolConditionResolver : SereinConditionResolver
|
|
|
|
|
|
{
|
|
|
|
|
|
public enum Operator
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Is
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Operator Op { get; set; }
|
|
|
|
|
|
public bool Value { get; set; }
|
2024-12-16 00:58:45 +08:00
|
|
|
|
public bool Data { get; set; }
|
2024-10-15 10:55:41 +08:00
|
|
|
|
|
|
|
|
|
|
public override bool Evaluate(object obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2024-12-18 00:05:42 +08:00
|
|
|
|
return Value.Equals(obj);
|
2024-12-16 00:58:45 +08:00
|
|
|
|
//if (obj is bool boolObj && Value is bool boolValue)
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
// /*switch (Op)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// case Operator.Is:
|
|
|
|
|
|
// return boolObj == Value;
|
|
|
|
|
|
// }*/
|
|
|
|
|
|
//}
|
|
|
|
|
|
//return false;
|
2024-10-15 10:55:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|