using System; namespace AntDesign { public class ClassBuilderRuleIf : ClassBuilderRule { public string ClassName { get; set; } public Func Func { get; set; } public ClassBuilderRuleIf(string className, Func func) { ClassName = className; Func = func; } public override string GetClass(T data) { if (Func(data)) { return ClassName; } return null; } } }