using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
var table = new table() { Status = "Customer 1" };
var reservation = new reservation();
var cust = new customer();
reservation.statusTable += customer.OnstatusTable;
reservation.status(table);
public string FirstName { get; set; }
public string Lastname { get; set; }
public static void OnstatusTable(object source, EventArgs args)
Console.WriteLine("Table is available...");
Console.WriteLine(this.FirstName + this.Lastname);
public string Status { get; set; }
public delegate void statusTableEventHandler(object source, EventArgs args);
public event statusTableEventHandler statusTable;
public void status(table table)
Console.WriteLine("Table is busy!");
System.Threading.Thread.Sleep(3000);
protected virtual void OnstatusTable()
statusTable(this, EventArgs.Empty);