public void CopyTo(BaseStateProvider[] array, int index)
 {
     base.CopyTo(array, index);
 }
        /// <summary>
        /// Initializes the managed application and session state.
        /// </summary>
        private static void InitializeApplicationState()
        {
            try
            {
                //Get the feature's configuration info
                StateProviderConfiguration qc =
                    (StateProviderConfiguration)ConfigurationManager.GetSection("StateProvider");

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

                //Instantiate the providers
                providerCollection = new StateProviderCollection();
                ProvidersHelper.InstantiateProviders(qc.Providers, providerCollection, typeof(BaseStateProvider));
                providerCollection.SetReadOnly();
                defaultProvider = providerCollection[qc.DefaultProvider];

                if (HttpContext.Current != null && HttpContext.Current.Request != null)
                {
                    defaultProvider.ApplicationPath = HttpContext.Current.Request.ApplicationPath;
                    defaultProvider.PhysicalApplicationPath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath);
                }

                if (defaultProvider == null)
                {
                    throw new ConfigurationErrorsException(
                        "You must specify a default provider for the feature.",
                        qc.ElementInformation.Properties["defaultProvider"].Source,
                        qc.ElementInformation.Properties["defaultProvider"].LineNumber);
                }

                StateAccess.State = defaultProvider;
            }
            catch (Exception ex)
            {
                initializationException = ex;
                isInitialized = false;
                throw ex;
            }
        }