internal static void AddTypeToCache (ArrayList dependencies, string inputFile, Type type)
{
if (type == null || inputFile == null || inputFile.Length == 0)
return;
if (dependencies != null && dependencies.Count > 0) {
string [] deps = (string []) dependencies.ToArray (typeof (string));
HttpContext ctx = HttpContext.Current;
HttpRequest req = ctx != null ? ctx.Request : null;
if (req == null)
throw new HttpException ("No current context, cannot compile.");
for (int i = 0; i < deps.Length; i++)
deps [i] = req.MapPath (deps [i]);
HttpRuntime.InternalCache.Insert ("@@Type" + inputFile, type, new CacheDependency (deps));
} else
HttpRuntime.InternalCache.Insert ("@@Type" + inputFile, type);
}