SuperMap.Web.iServerJava6R.NetworkAnalyst.PathGuideItem.FromJson C# (CSharp) Method

FromJson() public static method

${iServerJava6R_PathGuideItem_method_fromJson_D}
public static FromJson ( System.Json.JsonObject json ) : PathGuideItem
json System.Json.JsonObject ${iServerJava6R_PathGuideItem_method_fromJson_param_jsonObject}
return PathGuideItem
        public static PathGuideItem FromJson(JsonObject json)
        {
            if (json == null)
            {
                return null;
            }
            PathGuideItem item = new PathGuideItem();

            if (json.ContainsKey("bounds"))
            {
                item.Bounds = JsonHelper.ToRectangle2D((JsonObject)json["bounds"]);
            }

            if (json.ContainsKey("directionType"))
            {
                item.DirectionType = (DirectionType)Enum.Parse(typeof(DirectionType), (string)json["directionType"], true);
            }

            if (json.ContainsKey("distance"))
            {
                item.Distance = (double)json["distance"];
            }

            if (json.ContainsKey("id"))
            {
                item.ID = (int)json["id"];
            }

            if (json.ContainsKey("index"))
            {
                item.Index = (int)json["index"];
            }

            if (json.ContainsKey("isEdge"))
            {
                item.IsEdge = (bool)json["isEdge"];
            }

            if (json.ContainsKey("isStop"))
            {
                item.IsStop = (bool)json["isStop"];
            }

            if (json.ContainsKey("length"))
            {
                item.Length = (double)json["length"];
            }

            if (json.ContainsKey("name"))
            {
                item.Name = (string)json["name"];
            }

            if (json.ContainsKey("sideType"))
            {
                item.SideType = (SideType)Enum.Parse(typeof(SideType), (string)json["sideType"], true);
            }
            try
            {
                if (json.ContainsKey("turnAngle"))
                {
                    item.TurnAngle = (double)json["turnAngle"];
                }
            }
            finally
            {
                item.TurnAngle = 0.0;
            }

            if (json.ContainsKey("turnType"))
            {
                item.TurnType = (TurnType)Enum.Parse(typeof(TurnType), (string)json["turnType"], true);
            }

            if (json.ContainsKey("weight"))
            {
                item.Weight = (double)json["weight"];
            }
            return item;
        }