public Draw(int actionToChange, Tool tool, Point startingPosition, IDrawingStrategy strategy) { _tool = tool; _startingPoint = startingPosition; _currentPoint = startingPosition; _drawingStrategy = strategy; _actionToChange = actionToChange; _addedElements = new List<UIElement>(); }
public void DrawShape(IShape shape, string s) { IDrawingStrategy strategy = null; if (s.ToLower() == "circle") { strategy = new Circle(); } else if (s.ToLower() == "square") { strategy = new Square(); } else if (s.ToLower() == "rectangle") { strategy = new Rectangle(); } strategy.DrawShape(shape); }
public VideoCard(bool isColorful, IDrawingStrategy drawingStrategy) { this.IsColorful = isColorful; this.DrawingStrategy = drawingStrategy; }
public void Draw(IShape shape) { IDrawingStrategy drawer = strategies.First(s => s.isMatch(shape)); drawer.Draw(shape); }