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

FromJson() public static method

${iServerJava6R_MTSPPath_method_fromJson_D}
public static FromJson ( System.Json.JsonObject json ) : MTSPPath
json System.Json.JsonObject ${iServerJava6R_MTSPPath_method_fromJson_param_jsonObject}
return MTSPPath
        public static MTSPPath FromJson(JsonObject json)
        {
            if (json == null)
                return null;
            MTSPPath result = new MTSPPath();
            result.Center = json["center"];

            if (json["nodesVisited"] != null)
            {
                result.NodesVisited = new List<object>();
                for (int i = 0; i < json["nodesVisited"].Count; i++)
                {
                    result.NodesVisited.Add(json["nodesVisited"][i]);
                }
            }

            if (json["stopIndexes"] != null)
            {
                result.StopIndexes = new List<int>();
                for (int i = 0; i < json["stopIndexes"].Count; i++)
                {
                    result.StopIndexes.Add(json["stopIndexes"][i]);
                }
            }

            //对应父类中的属性;
            ServerPath path = ServerPath.ServerPathFromJson(json);
            result.EdgeFeatures = path.EdgeFeatures;
            result.EdgeIDs = path.EdgeIDs;
            result.NodeFeatures = path.NodeFeatures;
            result.NodeIDs = path.NodeIDs;
            result.PathGuideItems = path.PathGuideItems;
            result.Route = path.Route;
            result.StopWeights = path.StopWeights;
            result.Weight = path.Weight;

            return result;
        }