private Dictionary<string, string> GetParameters(ChartQueryParameters parameter)
{
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("queryMode", parameter.QueryMode.ToString());
if (parameter.QueryMode == ChartQueryMode.ChartBoundsQuery)
{
dic.Add("bounds", JsonHelper.FromRectangle2D(parameter.Bounds));
}
dic.Add("chartLayerNames", JsonHelper.FromIList(parameter.ChartLayerNames));
List<string> filters = new List<string>();
foreach (var v in parameter.ChartQueryFilterParameters)
{
filters.Add(ChartQueryFilterParameter.ToJson(v));
}
string filter = string.Format("[{0}]", string.Join(",", filters.ToArray()));
dic.Add("chartQueryParameters", "{" + string.Format("\"chartQueryParams\":{0},\"startRecord\":{1},\"expectCount\":{2}", filter,parameter.StartRecord.ToStringEx(),parameter.ExpectCount.ToStringEx()) + "}");
return dic;
}