System.Web.Caching.OutputCache.Init C# (CSharp) Method

Init() static private method

static private Init ( ) : void
return void
		static void Init ()
		{
			if (initialized)
				return;

			lock (initLock) {
				if (initialized)
					return;
				
				var cfg = WebConfigurationManager.GetWebApplicationSection ("system.web/caching/outputCache") as OutputCacheSection;
				ProviderSettingsCollection cfgProviders = cfg.Providers;

				defaultProviderName = cfg.DefaultProviderName;
				if (cfgProviders != null && cfgProviders.Count > 0) {
					var coll = new OutputCacheProviderCollection ();

					foreach (ProviderSettings ps in cfgProviders)
						coll.Add (LoadProvider (ps));

					coll.SetReadOnly ();
					providers = coll;
				}

				initialized = true;
			}
		}