Exemple #1
0
        static NewsManager()
        {
            //Get the feature's configuration info
            NewsProviderConfiguration qc =
                (NewsProviderConfiguration)ConfigurationManager.GetSection("newsManager");

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

            //Instantiate the providers
            providerCollection = new NewsProviderCollection();
            ProvidersHelper.InstantiateProviders(qc.Providers, providerCollection, typeof(NewsProvider));
            providerCollection.SetReadOnly();
            defaultProvider = providerCollection[qc.DefaultProvider];
            if (defaultProvider == null)
            {
                throw new ConfigurationErrorsException(
                    "You must specify a default provider for the newsManager.",
                    qc.ElementInformation.Properties["defaultProvider"].Source,
                    qc.ElementInformation.Properties["defaultProvider"].LineNumber);
            }
        }
 public void CopyTo(NewsProvider[] array, int index)
 {
     base.CopyTo(array, index);
 }