${iServerJava6R_ThemeGridRangeItem_Title}
${iServerJava6R_ThemeGridRangeItem_Description}
internal static ThemeGridRangeItem FromJson(JsonObject json) { if (json == null) return null; ThemeGridRangeItem item = new ThemeGridRangeItem(); item.Caption = json["caption"]; item.End = (double)json["end"]; item.Start = (double)json["start"]; if (json["color"] != null) { item.Color = ServerColor.FromJson((JsonObject)json["color"]); } item.Visible = (bool)json["visible"]; return item; }
internal static string ToJson(ThemeGridRangeItem themeGridRangeItem) { string json = "{"; List<string> list = new List<string>(); if (!string.IsNullOrEmpty(themeGridRangeItem.Caption)) { list.Add(string.Format("\"caption\":\"{0}\"", themeGridRangeItem.Caption)); } else { list.Add("\"caption\":\"\""); } if (themeGridRangeItem.Color != null) { list.Add(string.Format("\"color\":{0}", ServerColor.ToJson(themeGridRangeItem.Color))); } else { list.Add(string.Format("\"color\":{0}", ServerColor.ToJson(new ServerColor()))); } list.Add(string.Format("\"visible\":{0}", themeGridRangeItem.Visible.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLower())); list.Add(string.Format("\"end\":{0}", themeGridRangeItem.End.ToString(System.Globalization.CultureInfo.InvariantCulture))); list.Add(string.Format("\"start\":{0}", themeGridRangeItem.Start.ToString(System.Globalization.CultureInfo.InvariantCulture))); json += string.Join(",", list.ToArray()); json += "}"; return json; }