public void Add_duplicate () { ProviderCollection col = new ProviderCollection(); TestProvider provider; provider = new TestProvider(); provider.Initialize ("test", null); col.Add (provider); col.Add (provider); }
public static void InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType) { foreach (ProviderSettings settings in configProviders) { providers.Add(InstantiateProvider(settings, providerType)); } }
public static void InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType) { if (!typeof(ProviderBase).IsAssignableFrom(providerType)) throw new ConfigurationErrorsException(String.Format("type '{0}' must subclass from ProviderBase", providerType)); foreach (ProviderSettings settings in configProviders) providers.Add(InstantiateProvider(settings, providerType)); }
public static void InstantiateProviders(ProviderSettingsCollection providerSettings, ProviderCollection providers, Type type) { foreach (ProviderSettings settings in providerSettings) { providers.Add(ProvidersHelper.InstantiateProvider(settings, type)); } }
private static void CreateProviders(ProviderCollection collection, IEnumerable providerSettings) { foreach (ProviderSettings settings in providerSettings) { collection.Add(CreateProvider(settings)); } }
public void Get_nonexistant () { ProviderCollection col = new ProviderCollection(); TestProvider provider; provider = new TestProvider(); provider.Initialize ("test", null); col.Add (provider); Assert.AreEqual (provider, col["test"], "A1"); Assert.IsNull (col["test2"], "A2"); }
public void Add_providerbase () { ProviderCollection col = new ProviderCollection(); TestProviderBase provider; provider = new TestProviderBase(); provider.Initialize ("test", null); col.Add (provider); Assert.AreEqual (provider, col["test"], "A1"); }
public void RegisterClientDependencies(List<IClientDependencyFile> dependencies, IEnumerable<IClientDependencyPath> paths) { //We will combine both the MVC and web forms providers here to pass in to the method since this method could be executing //under the webforms context or the mvc context. This list as a parameter is used only for forced providers and wont //matter if it includes the webforms and mvc ones together since they will only ever render when they are in their own //context. This is better than checking if it is a System.Web.UI.Page handler currently IMO, plus the provider names //between mvc and webforms are generally different. var combinedCollection = new ProviderCollection(); foreach (ProviderBase p in ClientDependencySettings.Instance.MvcRendererCollection) combinedCollection.Add(p); foreach (ProviderBase p in ClientDependencySettings.Instance.FileRegistrationProviderCollection) combinedCollection.Add(p); RegisterClientDependencies(Provider, dependencies, paths, combinedCollection); }
private static void InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, CacheSettings cacheSettings) { foreach (ProviderSettings settings in configProviders) { providers.Add(InstantiateProvider(settings, cacheSettings)); } }