public static bool IsMethodActive(this ISocialAuthenticationMethod method,
                                          SocialSettings settings)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            if (settings.ActiveAuthenticationMethodSystemNames == null)
            {
                return(false);
            }
            foreach (string activeMethodSystemName in settings.ActiveAuthenticationMethodSystemNames)
            {
                if (method.IsMethodActive(settings))
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 2
0
        public ISocialAuthenticationMethod GetEntryPoint(string assemblyName, string namespaceName, string typeName, string methodName)
        {
            ISocialAuthenticationMethod task = null;
            Type calledType = Type.GetType(namespaceName + "." + typeName + "," + assemblyName);
            var  scope      = ContextHelper.Current.ContainerManager.Scope();

            if (calledType != null)
            {
                object instance;
                if (!ContextHelper.Current.ContainerManager.TryResolve(calledType, scope, out instance))
                {
                    instance = ContextHelper.Current.ContainerManager.ResolveUnregistered(calledType, scope);
                }
                task = instance as ISocialAuthenticationMethod;
            }
            return(task);
            //calledType.InvokeMember(methodName, BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static, null, null, new Object[] { actionname, controllerName, routeValues });
        }