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;
}