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

FromJson() public static method

${iServerJava6R_GetLayersInfoResult_method_FromJson_D}
public static FromJson ( string strResult ) : GetLayersInfoResult
strResult string ${iServerJava6R_GetLayersInfoResult_method_FromJson_param_jsonObject}
return GetLayersInfoResult
        public static GetLayersInfoResult FromJson(string strResult)
        {
            GetLayersInfoResult result = new GetLayersInfoResult();

            var json = (System.Json.JsonValue)System.Json.JsonValue.Parse(strResult);
            if (json == null)
            {
                return null;
            }

            List<ServerLayer> layers = new List<ServerLayer>();
            foreach (JsonObject layerJson in json)
            {
                if (layerJson.ContainsKey("subLayers"))
                {
                    foreach (JsonObject item in (JsonArray)layerJson["subLayers"]["layers"])
                    {
                        layers.Add(ServerLayer.FromJson(item));
                    }
                }
            }
            result.LayersInfo = layers;
            return result;
        }