System.Web.Handlers.ScriptResourceHandler.AssemblyResourceLoader.DecryptAssemblyResource C# (CSharp) Method

DecryptAssemblyResource() static private method

static private DecryptAssemblyResource ( string val, AssemblyEmbeddedResources &entry ) : EmbeddedResource
val string
entry AssemblyEmbeddedResources
return EmbeddedResource
		static EmbeddedResource DecryptAssemblyResource (string val, out AssemblyEmbeddedResources entry)
		{
			entry = null;
			
			string[] parts = val.Split ('_');
			if (parts.Length != 3)
				return null;

			Encoding enc = Encoding.UTF8;
			string asmNameHash = parts [0];
			string resNameHash = parts [1];
			bool debug = parts [2] == "t";
			
			try {
				_embeddedResourcesLock.EnterReadLock ();
				if (!_embeddedResources.TryGetValue (asmNameHash, out entry) || entry == null)
					return null;
				
				EmbeddedResource res;
				if (!entry.Resources.TryGetValue (resNameHash, out res) || res == null) {
#if SYSTEM_WEB_EXTENSIONS
					if (!debug)
						return null;

					if (!entry.Resources.TryGetValue (resNameHash.Substring (0, resNameHash.Length - 1), out res))
						return null;
#else
					return null;
#endif
				}
				
				return res;
			} finally {
				_embeddedResourcesLock.ExitReadLock ();
			}
		}