using System;

public class Shop
{
    // Delegatentyp für Ereignis
    public delegate void ShopOpenedEventHandler(object source, EventArgs e);

    // Ereignis-Feld
    public event ShopOpenedEventHandler Opened;

    private bool open = false;
    public bool Open
    {
        get
        {
            return open;
        }
        set
        {
            open = value;

            if (open == true)
            {
                // Ereignis ist eingetreten

                Console.WriteLine("\n Laden wurde geöffnet\n");

                if (Opened != null)
                    Opened(this, new EventArgs());
            }
            else
                Console.WriteLine("\n Laden wurde geschlossen\n");
        }
    }
}

class Program
{
    static void Main(string[] args)
    {
        Shop shop = new Shop();
        Employee maria = new Employee(shop);
        Customer sean = new Customer(shop);

        shop.Open = !shop.Open;
        shop.Open = !shop.Open;
        shop.Open = !shop.Open;
    }
}

