internal static LayoutObject ToLayoutObject(JSONObject jsonObj) { LayoutObject layoutObject = new LayoutObject(); layoutObject.Index = jsonObj["index"]; layoutObject.X = jsonObj["x"]; layoutObject.Y = jsonObj["y"]; return(layoutObject); }
internal static Layout ToLayout(JSONObject jsonObj) { var layout = new Layout(); var type = jsonObj["type"]; layout.Type = type; layout.Layouts = new Dictionary <string, LayoutObject[]>(); var layouts = jsonObj["layouts"]; foreach (var key in layouts.Keys) { var arr = layouts.GetValueOrDefault(key, new JSONArray()); var layoutObjList = new List <LayoutObject>(); foreach (var layoutObj in arr) { layoutObjList.Add(LayoutObject.ToLayoutObject(layoutObj.Value.AsObject)); } layout.Layouts[key] = layoutObjList.ToArray(); } return(layout); }