Esempio n. 1
0
 public Draw(int actionToChange, Tool tool, Point startingPosition, IDrawingStrategy strategy)
 {
     _tool = tool;
     _startingPoint = startingPosition;
     _currentPoint = startingPosition;
     _drawingStrategy = strategy;
     _actionToChange = actionToChange;
     _addedElements = new List<UIElement>();
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public VideoCard(bool isColorful, IDrawingStrategy drawingStrategy)
 {
     this.IsColorful      = isColorful;
     this.DrawingStrategy = drawingStrategy;
 }
Esempio n. 4
0
        public void Draw(IShape shape)
        {
            IDrawingStrategy drawer = strategies.First(s => s.isMatch(shape));

            drawer.Draw(shape);
        }