Catel.IoC.ServiceLocator.GetRegistrationInfo C# (CSharp) Method

GetRegistrationInfo() public method

Gets the registration info about the specified type.
The is null.
public GetRegistrationInfo ( Type serviceType, object tag = null ) : Catel.IoC.RegistrationInfo
serviceType System.Type Type of the service.
tag object The tag the service is registered with. The default value is null.
return Catel.IoC.RegistrationInfo
        public RegistrationInfo GetRegistrationInfo(Type serviceType, object tag = null)
        {
            Argument.IsNotNull("serviceType", serviceType);

            lock (_lockObject)
            {
                // Always check via IsTypeRegistered, allow late-time registration
                if (!IsTypeRegistered(serviceType, tag))
                {
                    return null;
                }

                var serviceInfo = new ServiceInfo(serviceType, tag);
                var registeredTypeInfo = _registeredTypes[serviceInfo];
                bool hasSingletonInstance = (registeredTypeInfo.RegistrationType == RegistrationType.Singleton) && _registeredInstances.ContainsKey(serviceInfo);

                return new RegistrationInfo(registeredTypeInfo.DeclaringType, registeredTypeInfo.ImplementingType, registeredTypeInfo.RegistrationType, hasSingletonInstance);
            }
        }