16 using System.Collections.Generic;
18 using System.Text.RegularExpressions;
27 private IReadOnlyDictionary<string, string> _parameters;
28 private readonly
string _template;
44 if (liveConfiguration !=
null)
48 else if (backtestConfiguration !=
null)
50 _parameters = backtestConfiguration.
Parameters;
55 _parameters =
new Dictionary<string, string>();
65 var items =
new List<string>();
67 var columns = (
new Regex(
@"{{\$KEY(\d+?)}}")).Matches(_template).Count;
69 for (parameterIndex = 0; parameterIndex < _parameters.Count;)
71 var
template = _template;
73 for (column = 0; column < columns; column++)
75 var currTemplateKey =
"{{$KEY" + column.ToString() +
"}}";
76 var currTemplateValue =
"{{$VALUE" + column.ToString() +
"}}";
78 if (parameterIndex < _parameters.Count)
80 var parameter = _parameters.ElementAt(parameterIndex);
81 template =
template.Replace(currTemplateKey, parameter.Key);
82 template =
template.Replace(currTemplateValue, parameter.Value);
86 template =
template.Replace(currTemplateKey,
string.Empty);
87 template =
template.Replace(currTemplateValue,
string.Empty);
101 if (
Key == ReportKey.ParametersPageStyle)
103 if (items.Count == 0)
105 return "display: none;";
111 var parameters=
string.Join(
"\n", items);