Add() публичный Метод

public Add ( ProviderBase provider ) : void
provider ProviderBase
Результат void
Пример #1
0
		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));
        }
Пример #4
0
 public static void InstantiateProviders(ProviderSettingsCollection providerSettings, ProviderCollection providers, Type type)
 {
     foreach (ProviderSettings settings in providerSettings)
     {
         providers.Add(ProvidersHelper.InstantiateProvider(settings, type));
     }
 }
Пример #5
0
 private static void CreateProviders(ProviderCollection collection, IEnumerable providerSettings)
 {
     foreach (ProviderSettings settings in providerSettings)
     {
         collection.Add(CreateProvider(settings));
     }
 }
Пример #6
0
		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");
		}
Пример #7
0
		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");
		}
Пример #8
0
        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);
        }
Пример #9
0
		private static void InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, CacheSettings cacheSettings)
		{
			foreach (ProviderSettings settings in configProviders)
			{
				providers.Add(InstantiateProvider(settings, cacheSettings));
			}
		}