System.Web.Configuration.WebConfigurationManager.AddSectionToCache C# (CSharp) Method

AddSectionToCache() static private method

static private AddSectionToCache ( int key, object section ) : void
key int
section object
return void
		static void AddSectionToCache (int key, object section)
		{
			object cachedSection;

			bool locked = false;
			try {
				if (!sectionCacheLock.TryEnterWriteLock (SECTION_CACHE_LOCK_TIMEOUT))
					return;
				locked = true;

				if (sectionCache.TryGetValue (key, out cachedSection) && cachedSection != null)
					return;

				sectionCache.Add (key, section);
			} finally {
				if (locked) {
					sectionCacheLock.ExitWriteLock ();
				}
			}
		}