internal static string ToJson(ThemeGraduatedSymbol param)
{
if (param == null)
{
return null;
}
string json = "{";
List<string> list = new List<string>();
list.Add(string.Format("\"baseValue\":{0}", param.BaseValue));
if (!string.IsNullOrEmpty(param.Expression))
{
list.Add(string.Format("\"expression\":\"{0}\"", param.Expression));
}
else
{
list.Add(string.Format("\"expression\":null"));
}
list.Add(string.Format("\"graduatedMode\":{0}", (int)param.GraduatedMode));
list.Add(string.Format("\"isFlowEnabled\":{0}", param.IsFlowEnabled));
list.Add(string.Format("\"isLeaderLineDisplayed\":{0}", param.IsLeaderLineDisplayed));
list.Add(string.Format("\"isNegativeDisplayed\":{0}", param.IsNegativeDisplayed));
list.Add(string.Format("\"isZeroDisplayed\":{0}", param.IsZeroDisplayed));
if (param.LeaderLineStyle != null)
{
list.Add(string.Format("\"leaderLineStyle\":{0}", ServerStyle.ToJson(param.LeaderLineStyle)));
}
else
{
list.Add(string.Format("\"leaderLineStyle\":null"));
}
if (param.NegativeStyle != null)
{
list.Add(string.Format("\"negativeStyle\":{0}", ServerStyle.ToJson(param.NegativeStyle)));
}
else
{
list.Add(string.Format("\"negativeStyle\":null"));
}
if (!string.IsNullOrEmpty(param.OffsetX))
{
list.Add(string.Format("\"offsetX\":\"{0}\"", param.OffsetX));
}
else
{
list.Add(string.Format("\"offsetX\":null"));
}
if (!string.IsNullOrEmpty(param.OffsetY))
{
list.Add(string.Format("\"offsetY\":\"{0}\"", param.OffsetY));
}
else
{
list.Add(string.Format("\"offsetY\":null"));
}
if (param.PositiveStyle != null)
{
list.Add(string.Format("\"positiveStyle\":{0}", ServerStyle.ToJson(param.PositiveStyle)));
}
else
{
list.Add(string.Format("\"positiveStyle\":null"));
}
if (param.ZeroStyle != null)
{
list.Add(string.Format("\"zeroStyle\":{0}", ServerStyle.ToJson(param.ZeroStyle)));
}
else
{
list.Add(string.Format("\"zeroStyle\":null"));
}
json += string.Join(",", list.ToArray());
json += "}";
return json;
}