${iServerJava6R_ThemeGraphItem_Title}
${iServerJava6R_ThemeGraphItem_Description}
internal static ThemeGraphItem FromJson(JsonObject json) { if (json == null) return null; ThemeGraphItem graphItem = new ThemeGraphItem(); graphItem.Caption = (string)json["caption"]; graphItem.GraphExpression = (string)json["graphExpression"]; if (json["memoryDoubleValues"] != null) { List<double> memoryValues = new List<double>(); foreach (JsonObject item in (JsonArray)json["memoryDoubleValues"]) { memoryValues.Add((double)item); } graphItem.MemoryDoubleValues = memoryValues; } graphItem.UniformStyle = ServerStyle.FromJson((JsonObject)json["uniformStyle"]); return graphItem; }
internal static string ToJson(ThemeGraphItem graphItem) { string json = "{"; List<string> list = new List<string>(); if (!string.IsNullOrEmpty(graphItem.Caption)) { list.Add(string.Format("\"caption\":\"{0}\"", graphItem.Caption)); } else { list.Add("\"caption\":null"); } if (!string.IsNullOrEmpty(graphItem.GraphExpression)) { list.Add(string.Format("\"graphExpression\":\"{0}\"", graphItem.GraphExpression)); } else { list.Add("\"graphExpression\":null"); } //if (graphItem.RangeSetting != null) //{ // list.Add(string.Format("\"rangeSetting\":{0}", ThemeRange.ToJson(graphItem.RangeSetting))); //} //else //{ // list.Add("\"rangeSetting\":null"); //} if (graphItem.UniformStyle != null) { list.Add(string.Format("\"uniformStyle\":{0}", ServerStyle.ToJson(graphItem.UniformStyle))); } else { list.Add(string.Format("\"uniformStyle\":{0}", ServerStyle.ToJson(new ServerStyle()))); } if (graphItem.MemoryDoubleValues != null && graphItem.MemoryDoubleValues.Count > 0) { list.Add(string.Format("\"memoryDoubleValues\":[{0}]", string.Join(",", graphItem.MemoryDoubleValues))); } else { list.Add("\"memoryDoubleValues\":null"); } json += string.Join(",", list.ToArray()); json += "}"; return json; }