Exemplo n.º 1
0
        /// <summary>实例化预编译视图程序集</summary>
        /// <param name="assembly"></param>
        /// <param name="baseVirtualPath"></param>
        public PrecompiledViewAssembly(Assembly assembly, String baseVirtualPath)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException("assembly");
            }

            // 为了实现物理文件“重载覆盖”的效果,强制使用物理文件
            PreemptPhysicalFiles    = false;
            UsePhysicalViewsIfNewer = false;

            _baseVirtualPath       = PrecompiledMvcEngine.NormalizeBaseVirtualPath(baseVirtualPath);
            _assembly              = assembly;
            _assemblyLastWriteTime = new Lazy <DateTime>(() => _assembly.GetLastWriteTimeUtc(DateTime.MaxValue));
        }
Exemplo n.º 2
0
 /// <summary>物理文件是否更新</summary>
 /// <param name="virtualPath"></param>
 /// <returns></returns>
 public Boolean IsPhysicalFileNewer(String virtualPath)
 {
     return(PrecompiledMvcEngine.IsPhysicalFileNewer(virtualPath, _baseVirtualPath, _assemblyLastWriteTime));
 }
Exemplo n.º 3
0
 /// <summary>遍历获取所有类型映射</summary>
 /// <returns></returns>
 public IDictionary <String, Type> GetTypeMappings()
 {
     return(PrecompiledMvcEngine.GetTypeMappings(_assembly, _baseVirtualPath));
 }