using System.Collections.Generic;
public delegate string MyDelcount(string ItemName);
public int Itemid {get; set;}
public string Name {get; set;}
public Decimal Price{get; set;}
public int StockInHand{ get; set;}
public event MyDelcount MyEvent;
this.MyEvent += new MyDelcount(this.RefillRequest);
public string RefillRequest(string ItemName)
return "Item " + ItemName+ " Ordered";
public static void Main(string[] args) {
Order obj1 = new Order();
List<Item> itemlist = new List<Item>();
item.Price = Convert.ToDecimal(50.00);
item1.Price = Convert.ToDecimal(250.00);
item2.Price = Convert.ToDecimal(25.00);
foreach(var items in itemlist)
if(items.StockInHand < 5)
string result = obj1.MyEvent(items.Name);
Console.WriteLine(result);