Ejemplo n.º 1
0
        public void Draw()
        {
            PreDrawEvent?.Invoke(this, EventArgs.Empty);

            Console.WriteLine("Drawing...");

            PostDrawEvent?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 2
0
        // For the sake of simplicity this one method
        // implements both interfaces.
        public void Draw()
        {
            // Raise IDrawingObject's event before the object is drawn.
            PreDrawEvent?.Invoke(this, EventArgs.Empty);

            Console.WriteLine("Drawing a shape.");

            // Raise IShape's event after the object is drawn.
            PostDrawEvent?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 3
0
        public void Draw()
        {
            EventHandler handler = PreDrawEvent;

            if (handler != null)
            {
                handler(this, new EventArgs());
            }
            Console.WriteLine("Drawing a shape.");

            PostDrawEvent?.Invoke(this, new EventArgs());
        }
Ejemplo n.º 4
0
 public void Draw()
 {
     PreDrawEvent?.Invoke(this, new EventArgs());
     Console.WriteLine("Drawing a shape.");
     PostDrawEvent?.Invoke(this, new EventArgs());
 }
 public void PostDraw(Player player, SpriteBatch spriteBatch)
 {
     PostDrawEvent?.Invoke(player, Main.spriteBatch);
 }