public void Add(Product product) { products [current++] = product; //Raising or firing the event if (ProductAdded != null) ProductAdded (); }
public static void Main() { var store = new Store (); //Handling the event store.ProductAdded += OnProductAdded; store.Add (new Product ()); }