private static void Initialize()
        {
            //try
            //{
                CaptchaConfiguration config = CaptchaConfiguration.GetConfig();

                if (
                    (config.DefaultProvider == null)
                    || (config.Providers == null)
                    || (config.Providers.Count < 1)
                    )
                {
                    throw new ProviderException("You must specify a valid default provider.");
                }

                providerCollection = new CaptchaProviderCollection();

                ProvidersHelper.InstantiateProviders(
                    config.Providers,
                    providerCollection,
                    typeof(CaptchaProvider));

                providerCollection.SetReadOnly();
                defaultProvider = providerCollection[config.DefaultProvider];

            //}
            //catch (Exception ex)
            //{
            //    initializationException = ex;
            //    isInitialized = true;
            //    throw ex;
            //}

            //isInitialized = true;
        }
Exemple #2
0
        private static void Initialize()
        {
            //try
            //{
            CaptchaConfiguration config = CaptchaConfiguration.GetConfig();

            if (
                (config.DefaultProvider == null) ||
                (config.Providers == null) ||
                (config.Providers.Count < 1)
                )
            {
                throw new ProviderException("You must specify a valid default provider.");
            }


            providerCollection = new CaptchaProviderCollection();

            ProvidersHelper.InstantiateProviders(
                config.Providers,
                providerCollection,
                typeof(CaptchaProvider));

            providerCollection.SetReadOnly();
            defaultProvider = providerCollection[config.DefaultProvider];

            //}
            //catch (Exception ex)
            //{
            //    initializationException = ex;
            //    isInitialized = true;
            //    throw ex;
            //}

            //isInitialized = true;
        }