public virtual object Clone() { ShapeCollection shapeCollection = new ShapeCollection(); foreach (IShape current in this) { shapeCollection.Add(current.Clone() as IShape); } return(shapeCollection); }
public static ShapeCollection GetSelectedShapes(ShapeCollection shapes) { ShapeCollection shapeCollection = new ShapeCollection(); foreach (IShape current in shapes) { if (current.Selected) { shapeCollection.Add(current); } } return(shapeCollection); }