mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 09:21:24 +08:00
26 lines
546 B
C#
26 lines
546 B
C#
using System;
|
|
|
|
namespace AntBlazor
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
} |