public static DrawingObject MakeComposite(DrawingCanvas canvas, DrawingObject[] drawables) { if (drawables.Length < 2) { return(drawables[0]); } CompositeShape composite = new CompositeShape(drawables); return(composite); }
public static DrawingObject FromTokenString(Dictionary <int, DrawingObject> drawingPool, string[] token) { List <DrawingObject> compositeObjects = new List <DrawingObject>(); for (int i = 20; i < token.Length; i++) { int id = int.Parse(token[i]); compositeObjects.Add(drawingPool[id]); drawingPool.Remove(id); } CompositeShape composite = new CompositeShape(compositeObjects); SetBaseProperties(composite, token); composite.UpdateDerived(); return(composite); }