SuperMap.Web.iServerJava2.EditResult.FromJson C# (CSharp) Method

FromJson() public static method

${iServer2_EditResult_method_FromJson_D}
public static FromJson ( System.Json.JsonObject jsonObject ) : EditResult
jsonObject System.Json.JsonObject ${iServer2_EditResult_method_FromJson_param_jsonObject}
return EditResult
        public static EditResult FromJson(JsonObject jsonObject)
        {
            if (jsonObject == null)
            {
                return null;
            }

            EditResult result = new EditResult();

            result.Succeed = (bool)jsonObject["succeed"];

            JsonArray idsInJson = (JsonArray)jsonObject["ids"];
            if (idsInJson.Count > 0 && idsInJson != null)
            {
                result.IDs = new List<int>();
                for (int i = 0; i < idsInJson.Count; i++)
                {
                    result.IDs.Add(idsInJson[i]);
                }
            }

            if (jsonObject["editBounds"] != null)
            {
                double mbMinX = (double)jsonObject["editBounds"]["leftBottom"]["x"];
                double mbMinY = (double)jsonObject["editBounds"]["leftBottom"]["y"];
                double mbMaxX = (double)jsonObject["editBounds"]["rightTop"]["x"];
                double mbMaxY = (double)jsonObject["editBounds"]["rightTop"]["y"];
                result.EditBounds = new Rectangle2D(mbMinX, mbMinY, mbMaxX, mbMaxY);
            }

            result.Message = (string)jsonObject["message"];
            return result;
        }