Example #1
0
        private bool TrySingleInstanceFromServiceLocators <T>(out T instance) where T : class
        {
            if (UserServiceLocator != null)
            {
                instance = UserServiceLocator.GetInstance <T>();
                if (instance != null)
                {
                    return(true);
                }
            }

            if (ProviderServiceLocator != null)
            {
                instance = ProviderServiceLocator.GetInstance <T>();
                if (instance != null)
                {
                    return(true);
                }
            }

            instance = null;
            return(false);
        }