Exemplo n.º 1
0
        public override void BeforeTableExecute(FormatterTable.FormatterTableHelper helper)
        {
            var i = 0;

            //https://stackoverflow.com/questions/2245442/c-sharp-split-a-string-by-another-string
            FormatString = FormatString
                           .Split(new string[] { VariableString }, StringSplitOptions.None)
                           .Aggregate((x, y) => string.Format("{0}{{{1}}}{2}", x, i++, y))
                           //because string.format escape word is {{ }}
                           .Replace("\\{", "{{").Replace("\\}", "}}");

            //TODO don't copy
            Children.ForEach(x => x.BeforeTableExecute(helper));
        }
Exemplo n.º 2
0
 public override void AfterTableExecute(FormatterTable.FormatterTableHelper helper)
 {
     //TODO don't copy
     Children.ForEach(x => x.AfterTableExecute(helper));
 }
Exemplo n.º 3
0
        public override string FormatField(FormatterTable.FormatterTableHelper helper)
        {
            var formatArgs = Children.Select(x => helper.FormatField(x)).ToArray();

            return(string.Format(FormatString, formatArgs));
        }
Exemplo n.º 4
0
 public override void BeforeFieldExecute(FormatterTable.FormatterTableHelper helper)
 {
     //TODO don't copy
     Children.ForEach(x => x.BeforeFieldExecute(helper));
 }