public PictureDraft CreateDraft(TextReader inputData) { PictureDraft draft = new PictureDraft(); while (true) { try { var command = inputData.ReadLine().ToLower(); if (command == null || command == CommandExit) { break; } draft.AddShape(_factory.CreateShape(command)); Console.WriteLine("Successfuly added!"); } catch (Exception ex) { Console.WriteLine($"Sth went wrong... {ex.Message}"); } } return(draft); }
public void DrawPicture(PictureDraft pictureDraft, ICanvas canvas) { for (var i = 0; i < pictureDraft.ShapeCount; ++i) { var shape = pictureDraft.GetShapeByIndex(i); Console.WriteLine($"type: {shape.GetType().Name}"); shape.Draw(canvas); Console.WriteLine("----------------------"); } }
public void CreatePictureDraft(IDesigner designer, TextReader inStrm) { ShowHelpInfo(); _draft = designer.CreateDraft(inStrm); }