SuperMap.Web.iServerJava6R.ThemeGraph.FromJson C# (CSharp) Method

FromJson() static private method

static private FromJson ( System.Json.JsonObject json ) : ThemeGraph
json System.Json.JsonObject
return ThemeGraph
        internal static ThemeGraph FromJson(JsonObject json)
        {
            if (json == null) return null;

            ThemeGraph themeGraph = new ThemeGraph();
            themeGraph.BarWidth = (double)json["barWidth"];
            themeGraph.Flow = ThemeFlow.FromJson(json);
            if (json["graduatedMode"] != null)
            {
                themeGraph.GraduatedMode = (GraduatedMode)Enum.Parse(typeof(GraduatedMode), json["graduatedMode"], true);
            }
            else
            {
                //不处理null的情况
            }
            themeGraph.GraphAxes = ThemeGraphAxes.FromJson(json);
            themeGraph.GraphSize = ThemeGraphSize.FromJson(json);
            themeGraph.GraphSizeFixed = (bool)json["graphSizeFixed"];
            themeGraph.GraphText = ThemeGraphText.FromJson(json);
            if (json["graphType"] != null)
            {
                themeGraph.GraphType = (ThemeGraphType)Enum.Parse(typeof(ThemeGraphType), json["graphType"], true);
            }
            else
            {
                //不处理null的情况
            }

            if (json["items"] != null)
            {
                List<ThemeGraphItem> graphItems = new List<ThemeGraphItem>();
                foreach (JsonObject item in (JsonArray)json["items"])
                {
                    graphItems.Add(ThemeGraphItem.FromJson(item));
                }
                themeGraph.Items = graphItems;
            }

            if (json["memoryKeys"] != null)
            {
                List<int> memoryKeysLsit = new List<int>();
                foreach (JsonObject item in (JsonArray)json["memoryKeys"])
                {
                    memoryKeysLsit.Add((int)item);
                }
                themeGraph.MemoryKeys = memoryKeysLsit;
            }

            themeGraph.NegativeDisplayed = (bool)json["negativeDisplayed"];
            themeGraph.Offset = ThemeOffset.FromJson(json);
            themeGraph.OverlapAvoided = (bool)json["overlapAvoided"];
            themeGraph.RoseAngle = (double)json["roseAngle"];
            themeGraph.StartAngle = (double)json["startAngle"];
            return themeGraph;
        }