private ServiceInspector GetServiceInspector(Service service) { ServiceInspector inspector = null; if (!m_serviceInspectors.TryGetValue(BTServiceInspectorFactory.GetInspectorTypeForService(service.GetType()), out inspector)) { inspector = BTServiceInspectorFactory.CreateInspectorForService(service); m_serviceInspectors.Add(inspector.GetType(), inspector); } inspector.Target = service; return(inspector); }
public static ServiceInspector CreateInspectorForService(Service service) { if (service != null) { Type inspectorType = GetInspectorTypeForService(service.GetType()); if (inspectorType != null) { ServiceInspector inspector = Activator.CreateInstance(inspectorType) as ServiceInspector; inspector.Target = service; return(inspector); } } return(null); }