상속: System.Configuration.ConfigurationSection
        internal AuthenticationModulesSectionInternal(AuthenticationModulesSection section)
        {
            if (section.AuthenticationModules.Count > 0)
            {
                this.authenticationModules = new List<Type>(section.AuthenticationModules.Count);
                foreach(AuthenticationModuleElement authenticationModuleElement in section.AuthenticationModules)
                {
                    Type type = null;

                    try
                    {
                        type = Type.GetType(authenticationModuleElement.Type, true, true);

                        // verify that its of the proper type of object
                        if (!typeof(IAuthenticationModule).IsAssignableFrom(type))
                        {
                            throw new InvalidCastException(SR.GetString(SR.net_invalid_cast, type.FullName, "IAuthenticationModule"));
                        }
                    }
                    catch (Exception exception)
                    {
                        if (NclUtilities.IsFatal(exception)) throw;

                        throw new ConfigurationErrorsException(SR.GetString(SR.net_config_authenticationmodules), exception);
                    }

                    this.authenticationModules.Add(type);
                }
            }
        }
예제 #2
0
        internal AuthenticationModulesSectionInternal(AuthenticationModulesSection section)
        {
            if (section.AuthenticationModules.Count > 0)
            {
                this.authenticationModules = new List <Type>(section.AuthenticationModules.Count);
                foreach (AuthenticationModuleElement authenticationModuleElement in section.AuthenticationModules)
                {
                    Type type = null;

                    try
                    {
                        type = Type.GetType(authenticationModuleElement.Type, true, true);

                        // verify that its of the proper type of object
                        if (!typeof(IAuthenticationModule).IsAssignableFrom(type))
                        {
                            throw new InvalidCastException(SR.GetString(SR.net_invalid_cast, type.FullName, "IAuthenticationModule"));
                        }
                    }
                    catch (Exception exception)
                    {
                        if (NclUtilities.IsFatal(exception))
                        {
                            throw;
                        }

                        throw new ConfigurationErrorsException(SR.GetString(SR.net_config_authenticationmodules), exception);
                    }

                    this.authenticationModules.Add(type);
                }
            }
        }
 internal AuthenticationModulesSectionInternal(AuthenticationModulesSection section)
 {
     if (section.AuthenticationModules.Count > 0)
     {
         this.authenticationModules = new List<Type>(section.AuthenticationModules.Count);
         foreach (AuthenticationModuleElement element in section.AuthenticationModules)
         {
             Type c = null;
             try
             {
                 c = Type.GetType(element.Type, true, true);
                 if (!typeof(IAuthenticationModule).IsAssignableFrom(c))
                 {
                     throw new InvalidCastException(System.SR.GetString("net_invalid_cast", new object[] { c.FullName, "IAuthenticationModule" }));
                 }
             }
             catch (Exception exception)
             {
                 if (NclUtilities.IsFatal(exception))
                 {
                     throw;
                 }
                 throw new ConfigurationErrorsException(System.SR.GetString("net_config_authenticationmodules"), exception);
             }
             this.authenticationModules.Add(c);
         }
     }
 }
 internal AuthenticationModulesSectionInternal(AuthenticationModulesSection section)
 {
     if (section.AuthenticationModules.Count > 0)
     {
         this.authenticationModules = new List <Type>(section.AuthenticationModules.Count);
         foreach (AuthenticationModuleElement element in section.AuthenticationModules)
         {
             Type c = null;
             try
             {
                 c = Type.GetType(element.Type, true, true);
                 if (!typeof(IAuthenticationModule).IsAssignableFrom(c))
                 {
                     throw new InvalidCastException(System.SR.GetString("net_invalid_cast", new object[] { c.FullName, "IAuthenticationModule" }));
                 }
             }
             catch (Exception exception)
             {
                 if (NclUtilities.IsFatal(exception))
                 {
                     throw;
                 }
                 throw new ConfigurationErrorsException(System.SR.GetString("net_config_authenticationmodules"), exception);
             }
             this.authenticationModules.Add(c);
         }
     }
 }
 internal static AuthenticationModulesSectionInternal GetSection()
 {
     lock (ClassSyncObject)
     {
         AuthenticationModulesSection section = System.Configuration.PrivilegedConfigurationManager.GetSection(ConfigurationStrings.AuthenticationModulesSectionPath) as AuthenticationModulesSection;
         if (section == null)
         {
             return(null);
         }
         return(new AuthenticationModulesSectionInternal(section));
     }
 }