mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +08:00
26 lines
546 B
C#
26 lines
546 B
C#
using System;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public class ClassBuilderRuleIf<T> : ClassBuilderRule<T>
|
|
{
|
|
public string ClassName { get; set; }
|
|
public Func<T, bool> Func { get; set; }
|
|
|
|
public ClassBuilderRuleIf(string className, Func<T, bool> func)
|
|
{
|
|
ClassName = className;
|
|
Func = func;
|
|
}
|
|
|
|
public override string GetClass(T data)
|
|
{
|
|
if (Func(data))
|
|
{
|
|
return ClassName;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
} |