public model(dynamic o) { this.objects = new List <CeadeCObject>(); for (int i = 0; i < o.objects.Count; i++) { dynamic ob = o.objects[i]; CeadeCObject castedOb; switch (ob.type.Value) { case "points": castedOb = new CeadeCPoints(ob); break; case "lines": castedOb = new CeadeCLines(ob); break; case "polylines": castedOb = new CeadeCPolylines(ob); break; case "Gpolylines": castedOb = new CeadeCGpolylines(ob); break; case "rectangles": castedOb = new CeadeCRectangles(ob); break; case "circles": castedOb = new CeadeCCircles(ob); break; case "arcs": castedOb = new CeadeCArcs(ob); break; case "shapes": castedOb = new CeadeCShapes(ob); break; default: castedOb = null; break; } if (castedOb != null) { this.objects.Add(castedOb); } } }
public CeadeCGpolylines(dynamic o) { this.children = new List <CeadeCObject>(); for (int i = 0; i < o.children.Count; i++) { dynamic ob = o.children[i]; CeadeCObject castedOb; switch (ob.type.Value) { case "points": castedOb = new CeadeCPoints(ob); break; case "lines": castedOb = new CeadeCLines(ob); break; case "polylines": castedOb = new CeadeCPolylines(ob); break; case "rectangles": castedOb = new CeadeCRectangles(ob); break; case "circles": castedOb = new CeadeCCircles(ob); break; case "arcs": castedOb = new CeadeCArcs(ob); break; default: castedOb = null; break; } if (castedOb != null) { this.children.Add(castedOb); } } if (o.Name != null) { this.Name = o.Name.Value; } if (o.shapeChildType != null) { this.shapeChildType = o.shapeChildType.Value; } }