System.Web.Compilation.CachingCompiler.GetTypeFromCache C# (CSharp) Method

GetTypeFromCache() public static method

public static GetTypeFromCache ( string filename ) : Type
filename string
return System.Type
		public static Type GetTypeFromCache (string filename)
		{
			return (Type) HttpRuntime.InternalCache [cacheTypePrefix + filename];
		}

Usage Example

Example #1
0
            Type LoadType()
            {
                if (type != null)
                {
                    return(type);
                }

                HttpContext context = HttpContext.Current;
                string      vpath;
                string      realpath;

                if (VirtualPathUtility.IsAppRelative(source))
                {
                    vpath    = source;
                    realpath = context.Request.MapPath(source);
                }
                else
                {
                    vpath    = VirtualPathUtility.ToAppRelative(source);
                    realpath = source;
                }

                if ((type = CachingCompiler.GetTypeFromCache(realpath)) != null)
                {
                    return(type);
                }

                type = BuildManager.GetCompiledType(vpath);
                if (type != null)
                {
                    AspGenerator.AddTypeToCache(null, realpath, type);
                    BuildManager.AddToReferencedAssemblies(type.Assembly);
                }
                return(type);
            }
All Usage Examples Of System.Web.Compilation.CachingCompiler::GetTypeFromCache