object IServiceProvider.GetService(System.Type serviceType) { Debug.Assert(this.serviceContainer != null, "We have no sevice container. Either the host has not been initialized yet or it has been disposed."); object service = null; if (this.serviceContainer != null) { service = this.serviceContainer.GetService(serviceType); ServiceRequests requests = (ServiceRequests)this.serviceContainer.GetService(typeof(ServiceRequests)); if (requests == null) { return(service); } if (service != null) { requests.ServiceSucceeded(serviceType); return(service); } requests.ServiceFailed(serviceType); } return(service); }