public ValueContainingUnboundColumnBuilder(
     BaseUnboundColumnBuilder <RecordT> baseUnbound,
     Func <RecordT, DataT> valueProvider,
     Func <DataT, string> textValueProvider,
     Action <DataT, ICellValueExporter> valueExporter)
 {
     BaseUnbound       = baseUnbound;
     ValueProvider     = valueProvider;
     TextValueProvider = textValueProvider;
     ValueExporter     = valueExporter;
 }
Exemplo n.º 2
0
 public static ValueContainingUnboundColumnBuilder <RecordT, int?> WithValueLocalized <RecordT>(
     this BaseUnboundColumnBuilder <RecordT> self, Func <RecordT, int?> valueProvider) where RecordT : new()
 {
     return(self.WithValue(
                valueProvider,
                x => x.HasValue ? I18n.Localize(x.Value) : I18n.Translate("(empty)"),
                (val, exp) => {
         if (val.HasValue)
         {
             exp.Export(val.Value);
         }
         else
         {
             exp.Export("");
         }
     }));
 }
Exemplo n.º 3
0
 public static ValueContainingUnboundColumnBuilder <RecordT, DecimalWithPrecision> WithValueLocalized <RecordT>(
     this BaseUnboundColumnBuilder <RecordT> self, Func <RecordT, DecimalWithPrecision> valueProvider) where RecordT : new()
 {
     return(self.WithValue(
                valueProvider,
                x => x == null ? "" : I18n.Localize(
                    x.Value, DecimalFormatExtensions.GetWithPrecision(x.Precision)),
                (val, exp) => {
         if (val == null)
         {
             exp.Export("");
         }
         else
         {
             exp.Export(val.RoundedValue);
         }
     }));
 }
Exemplo n.º 4
0
 public static ValueContainingUnboundColumnBuilder <RecordT, DateTime> WithValueLocalized <RecordT>(
     this BaseUnboundColumnBuilder <RecordT> self, Func <RecordT, DateTime> valueProvider, DateTimeFormat format) where RecordT : new()
 {
     return(self.WithValue(valueProvider, x => I18n.Localize(x, format), (val, exp) => exp.Export(val)));
 }
Exemplo n.º 5
0
 public static ValueContainingUnboundColumnBuilder <RecordT, bool> WithValueLocalized <RecordT>(
     this BaseUnboundColumnBuilder <RecordT> self, Func <RecordT, bool> valueProvider, BoolFormat format = BoolFormat.UnicodeBallotBox) where RecordT : new()
 {
     return(self.WithValue(valueProvider, x => I18n.Localize(x, format), (val, exp) => exp.Export(val)));
 }
Exemplo n.º 6
0
 public static ValueContainingUnboundColumnBuilder <RecordT, int> WithValueLocalized <RecordT>(
     this BaseUnboundColumnBuilder <RecordT> self, Func <RecordT, int> valueProvider) where RecordT : new()
 {
     return(self.WithValue(valueProvider, I18n.Localize, (val, exp) => exp.Export(val)));
 }