internal static string ToJson(NAResultMapParameter param)
{
if (param != null)
{
string json = "{";
List<string> list = new List<string>();
list.Add(string.Format("\"backgroundTransparent\":{0}", param.BackgroundTransparent.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLower()));
list.Add(string.Format("\"useDefaultParameter\":{0}", param.UseDefaultParameter));
if (param.Bounds != Rectangle2D.Empty)
list.Add(string.Format("\"bounds\":{0}", JsonHelper.FromRectangle2D(param.Bounds)));
if (param.Center != Point2D.Empty)
list.Add(string.Format("\"center\":{0}", JsonHelper.FromPoint2D(param.Center)));
list.Add(string.Format("\"format\":\"{0}\"", param.Format));
if (param.Scale != 0)
list.Add(string.Format(System.Globalization.CultureInfo.InvariantCulture, "\"scale\":\"{0}\"", param.Scale));
if (param.Style != null)
list.Add(string.Format("\"style\":\"{0}\"", ServerStyle.ToJson(param.Style)));
if (param.Viewer != null)
list.Add(string.Format("\"viewer\":{0}", string.Format(System.Globalization.CultureInfo.InvariantCulture, "{{\"leftTop\":{{\"x\":0,\"y\":0}},\"rightBottom\":{{\"x\":{0},\"y\":{1}}}}}", param.Viewer.Width, param.Viewer.Height)));
json += string.Join(",", list.ToArray());
json += "}";
return json;
}
return null;
}