using System; using System.Reflection; namespace Szmedi.Toolkit.Assists { public class PropertyConfiguration { public MemberInfo Member { get; set; } public string Name { get; private set; } public int Order { get; set; } public object DefaultValue { get; private set; } public Func DateFormatFunc { get; set; } public Func DecimalFormatFunc { get; set; } public Func StringFormatFunc { get; set; } public Func WriteFormatFunc { get; set; } public PropertyConfiguration WithColumnName(string name) { Name = name; return this; } public PropertyConfiguration WithColumnOrder(int order) { Order = order; return this; } public PropertyConfiguration Format(Func func) { DateFormatFunc += func; return this; } public PropertyConfiguration Format(Func func) { DecimalFormatFunc += func; return this; } public PropertyConfiguration Format(Func func) { StringFormatFunc += func; return this; } public PropertyConfiguration FormatWrite(Func func) { WriteFormatFunc += func; return this; } public PropertyConfiguration SetDefaultValue(object value) { DefaultValue = value; return this; } } }