// Methods public void AddService(object service) { Object[] objs = null; Type type; Type[] interfaces; if (service == null) { throw new ArgumentNullException("service is a null reference "); } interfaces = service.GetType().GetInterfaces(); for (int i = 0; i < interfaces.Length; i++) { objs = interfaces[i].GetCustomAttributes(typeof(ExternalDataExchangeAttribute), true); if (objs.Length > 0) { break; } } if (objs == null || objs.Length == 0) { throw new InvalidOperationException("Service does not implement an interface with the ExternalDataExchange attribute."); } Runtime.AddService(service); }
protected virtual void AddServices() { ExternalDataExchangeService dataService = new ExternalDataExchangeService(); Runtime.AddService(dataService); //OrderService orderService = OrderService.Instance; //dataService.AddService(orderService); //OrderTransactionService txnService = new OrderTransactionService(); //Runtime.AddService(txnService); //ContextService = new HttpContextWrapper(); }