private IEnumerable <Control> PackControls() { IEnumerable <Control> result = null; canvas.AddRange(GetMemento()); switch (cbPackingTypeList.SelectedIndex) { case 0: FlowLayoutPackage package = new FlowLayoutPackage(); result = package.Pack(canvas); lCoef.Text = package.GetPackingCoefficient(canvas.Size.Height).ToString(); break; case 1: master = new RectangleMaster(canvas.Rects); result = master.PackRectangles(canvas.Size); lCoef.Text = canvas.GetPackingCoefficient().ToString(); break; default: break; } return(result); }