public static bool billingService_BillingSuccessfullHandler(object sender, OrderEventsArgs e) { // initiate shipping var shipmentService = new ShipmentService(); shipmentService.ShipOrder(e.Order); return true; }
static void Main(string[] args) { var orderService = new OrderService(); var billingService = new BillingService(); var shipmentService = new ShipmentService(); orderService.OrderCreated += new OrderCreatedHandler(billingService.OnOrderCreated); billingService.BillingSuccessfullHandler += shipmentService.billingService_BillingSuccessfullHandler; orderService.CreateNewOrder(); Console.Read(); }