Exemple #1
0
 public RazorView(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable<string> viewStartFileExtensions, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, viewPageActivator) {
     LayoutPath = layoutPath ?? String.Empty;
     RunViewStartPages = runViewStartPages;
     StartPageLookup = StartPage.GetStartPage;
     ViewStartFileExtensions = viewStartFileExtensions ?? Enumerable.Empty<string>();
 }
        public WebFormViewEngine(IViewPageActivator viewPageActivator)
            :base(viewPageActivator){
            MasterLocationFormats = new[] {
                "~/Views/{1}/{0}.master",
                "~/Views/Shared/{0}.master"
            };

            AreaMasterLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.master",
                "~/Areas/{2}/Views/Shared/{0}.master",
            };

            ViewLocationFormats = new[] {
                "~/Views/{1}/{0}.aspx",
                "~/Views/{1}/{0}.ascx",
                "~/Views/Shared/{0}.aspx",
                "~/Views/Shared/{0}.ascx"
            };

            AreaViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.aspx",
                "~/Areas/{2}/Views/{1}/{0}.ascx",
                "~/Areas/{2}/Views/Shared/{0}.aspx",
                "~/Areas/{2}/Views/Shared/{0}.ascx",
            };

            PartialViewLocationFormats = ViewLocationFormats;
            AreaPartialViewLocationFormats = AreaViewLocationFormats;

            FileExtensions = new[] {
                "aspx",
                "ascx",
                "master",
            };
        }
        public PrecompiledMvcEngine(Assembly assembly, string baseVirtualPath, IViewPageActivator viewPageActivator)
        {
            if (!Assemblies.Contains(assembly))
                Assemblies.Add(assembly);

            _assemblyLastWriteTime = new Lazy<DateTime>(() => assembly.GetLastWriteTimeUtc(fallback: DateTime.MaxValue));
            _baseVirtualPath = NormalizeBaseVirtualPath(baseVirtualPath);
            BaseLocationFormats();
            #if DEBUG
            var map = (from type in assembly.GetTypes()
                       where typeof(WebPageRenderingBase).IsAssignableFrom(type)
                       let pageVirtualPath =
                           type.GetCustomAttributes(inherit: false).OfType<PageVirtualPathAttribute>().FirstOrDefault()
                       where pageVirtualPath != null
                       select pageVirtualPath.VirtualPath);
            #endif

            _mappings = (from type in assembly.GetTypes()
                         where typeof(WebPageRenderingBase).IsAssignableFrom(type)
                         let pageVirtualPath = type.GetCustomAttributes(inherit: false).OfType<PageVirtualPathAttribute>().FirstOrDefault()
                         where pageVirtualPath != null
                         select new KeyValuePair<string, Type>(CombineVirtualPaths(_baseVirtualPath, pageVirtualPath.VirtualPath), type)
                         ).ToDictionary(t => t.Key, t => t.Value, StringComparer.OrdinalIgnoreCase);

            this.ViewLocationCache = new PrecompiledViewLocationCache(assembly.FullName, this.ViewLocationCache);
            _viewPageActivator = viewPageActivator
                ?? DependencyResolver.Current.GetService<IViewPageActivator>() /* For compatibility, remove this line within next version */
                ?? DefaultViewPageActivator.Current;
        }
        internal BuildManagerViewEngine(IViewPageActivator viewPageActivator, IResolver<IViewPageActivator> activatorResolver,
            IDependencyResolver dependencyResolver, VirtualPathProvider pathProvider)
        {
            if (viewPageActivator != null)
            {
                _viewPageActivator = viewPageActivator;
            }
            else
            {
                _activatorResolver = activatorResolver ?? new SingleServiceResolver<IViewPageActivator>(
                                                              () => null,
                                                              new DefaultViewPageActivator(dependencyResolver),
                                                              "BuildManagerViewEngine constructor");
            }

            if (pathProvider != null)
            {
                Func<VirtualPathProvider> providerFunc = () => pathProvider;
                _fileExistsCache = new FileExistenceCache(providerFunc);
                VirtualPathProviderFunc = providerFunc;
            }
            else
            {
                if (_sharedFileExistsCache == null)
                {
                    // Startup initialization race is OK providing service remains read-only
                    _sharedFileExistsCache = new FileExistenceCache(() => HostingEnvironment.VirtualPathProvider);
                }

                _fileExistsCache = _sharedFileExistsCache;
            }
        }
 public DbRazorEngine(IViewPageActivator viewPageActivator)
     : base(viewPageActivator)
 {
     FileExtensions = new[] {
         "dbcs",
         "dbvb",
     };
 }
Exemple #6
0
        public MrCMSRazorViewEngine(IViewPageActivator viewPageActivator)
        {
            ViewPageActivator = viewPageActivator;

            ViewLocationCache = HttpContext.Current == null
                ? DefaultViewLocationCache.Null
                : new DefaultViewLocationCache();
        }
 //call the base constructors
 public DebugInfoRazorView(ControllerContext controllerContext, 
     string viewPath, 
     string layoutPath, 
     bool runViewStartPages, 
     IEnumerable<string> viewStartFileExtensions,
     IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, layoutPath, runViewStartPages, viewStartFileExtensions, viewPageActivator)
 {
 }
Exemple #8
0
        ///// <summary>实例化预编译视图</summary>
        ///// <param name="virtualPath"></param>
        ///// <param name="type"></param>
        ///// <param name="runViewStartPages"></param>
        ///// <param name="fileExtension"></param>
        //public PrecompiledMvcView(String virtualPath, Type type, Boolean runViewStartPages, IEnumerable<String> fileExtension) : this(virtualPath, null, type, runViewStartPages, fileExtension) { }

        ///// <summary>实例化预编译视图</summary>
        ///// <param name="virtualPath"></param>
        ///// <param name="masterPath"></param>
        ///// <param name="type"></param>
        ///// <param name="runViewStartPages"></param>
        ///// <param name="fileExtension"></param>
        //public PrecompiledMvcView(String virtualPath, String masterPath, Type type, Boolean runViewStartPages, IEnumerable<String> fileExtension) : this(virtualPath, masterPath, type, runViewStartPages, fileExtension, null) { }

        /// <summary>实例化预编译视图</summary>
        /// <param name="virtualPath"></param>
        /// <param name="masterPath"></param>
        /// <param name="type"></param>
        /// <param name="runViewStartPages"></param>
        /// <param name="fileExtension"></param>
        /// <param name="viewPageActivator"></param>
        public PrecompiledMvcView(String virtualPath, String masterPath, Type type, Boolean runViewStartPages, IEnumerable<String> fileExtension, IViewPageActivator viewPageActivator)
        {
            _type = type;
            _virtualPath = virtualPath;
            _masterPath = masterPath;
            RunViewStartPages = runViewStartPages;
            ViewStartFileExtensions = fileExtension;
            //_viewPageActivator = (viewPageActivator ?? (DependencyResolver.Current.GetService<IViewPageActivator>() ?? DefaultViewPageActivator.Current));
            _viewPageActivator = viewPageActivator;
        }
Exemple #9
0
 public CsRazorViewEngine(IViewPageActivator viewPageActivator)
     : base(viewPageActivator)
 {
     AreaViewLocationFormats = AreaViewLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray();
     AreaMasterLocationFormats = AreaMasterLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray();
     AreaPartialViewLocationFormats = AreaPartialViewLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray();
     ViewLocationFormats = ViewLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray();
     MasterLocationFormats = MasterLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray();
     PartialViewLocationFormats = PartialViewLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray();
     FileExtensions = FileExtensions.Where(f => f.EndsWith("cshtml")).ToArray();
 }
        public RazorDatabaseViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            viewLocations = DependencyResolver.Current.GetService<IProvideViewLocations>();
            viewKeyProcessor = DependencyResolver.Current.GetService<IViewKeyProcessor>();
            service = DependencyResolver.Current.GetService<IDatabaseViewService>();

            FileExtensions = new[] { "dbhtml" };

            ViewLocationCache = new NullViewLocationCache();
        }
Exemple #11
0
 internal BuildManagerViewEngine(IViewPageActivator viewPageActivator, IResolver<IViewPageActivator> activatorResolver, IDependencyResolver dependencyResolver) {
     if (viewPageActivator != null) {
         _viewPageActivator = viewPageActivator;
     }
     else {
         _activatorResolver = activatorResolver ?? new SingleServiceResolver<IViewPageActivator>(
             () => null,
             new DefaultViewPageActivator(dependencyResolver),
             "BuildManagerViewEngine constructor"
         );
     }
 }
        public RazorViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            AreaViewLocationFormats = new[]
            {
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/{1}/{0}.vbhtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.vbhtml"
            };
            AreaMasterLocationFormats = new[]
            {
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/{1}/{0}.vbhtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.vbhtml"
            };
            AreaPartialViewLocationFormats = new[]
            {
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/{1}/{0}.vbhtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.vbhtml"
            };

            ViewLocationFormats = new[]
            {
                "~/Views/{1}/{0}.cshtml",
                "~/Views/{1}/{0}.vbhtml",
                "~/Views/Shared/{0}.cshtml",
                "~/Views/Shared/{0}.vbhtml"
            };
            MasterLocationFormats = new[]
            {
                "~/Views/{1}/{0}.cshtml",
                "~/Views/{1}/{0}.vbhtml",
                "~/Views/Shared/{0}.cshtml",
                "~/Views/Shared/{0}.vbhtml"
            };
            PartialViewLocationFormats = new[]
            {
                "~/Views/{1}/{0}.cshtml",
                "~/Views/{1}/{0}.vbhtml",
                "~/Views/Shared/{0}.cshtml",
                "~/Views/Shared/{0}.vbhtml"
            };

            FileExtensions = new[]
            {
                "cshtml",
                "vbhtml",
            };
        }
Exemple #13
0
        /// <summary>实例化预编译Mvc引擎</summary>
        /// <param name="assembly"></param>
        /// <param name="baseVirtualPath"></param>
        /// <param name="viewPageActivator"></param>
        public PrecompiledMvcEngine(Assembly assembly, String baseVirtualPath, IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            // 为了实现物理文件“重载覆盖”的效果,强制使用物理文件
            PreemptPhysicalFiles = false;
            UsePhysicalViewsIfNewer = false;

            _assemblyLastWriteTime = new Lazy<DateTime>(() => assembly.GetLastWriteTimeUtc(DateTime.MaxValue));
            _baseVirtualPath = NormalizeBaseVirtualPath(baseVirtualPath);
            AreaViewLocationFormats = new String[]
			{
				"~/Areas/{2}/Views/{1}/{0}.cshtml",
				"~/Areas/{2}/Views/Shared/{0}.cshtml"
			};
            AreaMasterLocationFormats = new String[]
			{
				"~/Areas/{2}/Views/{1}/{0}.cshtml",
				"~/Areas/{2}/Views/Shared/{0}.cshtml"
			};
            AreaPartialViewLocationFormats = new String[]
			{
				"~/Areas/{2}/Views/{1}/{0}.cshtml",
				"~/Areas/{2}/Views/Shared/{0}.cshtml"
			};
            ViewLocationFormats = new String[]
			{
				"~/Views/{1}/{0}.cshtml",
				"~/Views/Shared/{0}.cshtml"
			};
            MasterLocationFormats = new String[]
			{
				"~/Views/{1}/{0}.cshtml",
				"~/Views/Shared/{0}.cshtml"
			};
            PartialViewLocationFormats = new String[]
			{
				"~/Views/{1}/{0}.cshtml",
				"~/Views/Shared/{0}.cshtml"
			};
            FileExtensions = new String[]
			{
				"cshtml"
			};
            //_mappings = (
            //    from type in assembly.GetTypes()
            //    where typeof(WebPageRenderingBase).IsAssignableFrom(type)
            //    let pageVirtualPath = type.GetCustomAttributes(false).OfType<PageVirtualPathAttribute>().FirstOrDefault()
            //    where pageVirtualPath != null
            //    select new KeyValuePair<String, Type>(CombineVirtualPaths(_baseVirtualPath, pageVirtualPath.VirtualPath), type)).ToDictionary(t => t.Key, t => t.Value, StringComparer.OrdinalIgnoreCase);
            _mappings = GetTypeMappings(assembly, _baseVirtualPath);
            ViewLocationCache = new PrecompiledViewLocationCache(assembly.FullName, ViewLocationCache);
            //_viewPageActivator = (viewPageActivator ?? (DependencyResolver.Current.GetService<IViewPageActivator>() ?? DefaultViewPageActivator.Current));
        }
        /// <summary>复合预编译Mvc引擎</summary>
        /// <param name="viewAssemblies"></param>
        /// <param name="viewPageActivator"></param>
        public CompositePrecompiledMvcEngine(IEnumerable<PrecompiledViewAssembly> viewAssemblies, IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            AreaViewLocationFormats = new String[]
			{
				"~/Areas/{2}/Views/{1}/{0}.cshtml",
				"~/Areas/{2}/Views/Shared/{0}.cshtml"
			};
            AreaMasterLocationFormats = new String[]
			{
				"~/Areas/{2}/Views/{1}/{0}.cshtml",
				"~/Areas/{2}/Views/Shared/{0}.cshtml"
			};
            AreaPartialViewLocationFormats = new String[]
			{
				"~/Areas/{2}/Views/{1}/{0}.cshtml",
				"~/Areas/{2}/Views/Shared/{0}.cshtml"
			};
            ViewLocationFormats = new String[]
			{
				"~/Views/{1}/{0}.cshtml",
				"~/Views/Shared/{0}.cshtml"
			};
            MasterLocationFormats = new String[]
			{
				"~/Views/{1}/{0}.cshtml",
				"~/Views/Shared/{0}.cshtml"
			};
            PartialViewLocationFormats = new String[]
			{
				"~/Views/{1}/{0}.cshtml",
				"~/Views/Shared/{0}.cshtml"
			};
            FileExtensions = new String[]
			{
				"cshtml"
			};
            foreach (var asm in viewAssemblies)
            {
                foreach (var type in asm.GetTypeMappings())
                {
                    _mappings[type.Key] = new ViewMapping
                    {
                        Type = type.Value,
                        ViewAssembly = asm
                    };
                }
            }
            //_viewPageActivator = (viewPageActivator ?? (DependencyResolver.Current.GetService<IViewPageActivator>() ?? DefaultViewPageActivator.Current));
        }
        public ExtendedRazorViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            FileExtensions = new[]
                                 {
                                     "html", "cshtml", "vbhtml"
                                 };

            ViewLocationFormats = new[]
                                      {
                                          "~/public/{0}.html",
                                          "~/public/Shared/{0}.html",
                                      }.Concat(ViewLocationFormats).ToArray();
        }
        internal BuildManagerCompiledView(ControllerContext controllerContext, string viewPath, IViewPageActivator viewPageActivator, IDependencyResolver dependencyResolver){
            if (controllerContext == null) {
                throw new ArgumentNullException("controllerContext");
            }
            if (String.IsNullOrEmpty(viewPath)) {
                throw new ArgumentException(MvcResources.Common_NullOrEmpty, "viewPath");
            }

            _controllerContext = controllerContext;

            ViewPath = viewPath;

            _viewPageActivator = viewPageActivator ?? new BuildManagerViewEngine.DefaultViewPageActivator(dependencyResolver);
        }
 internal MyBuildManagerView(ControllerContext controllerContext, string viewPath, IViewPageActivator viewPageActivator, IDependencyResolver dependencyResolver)
 {
     if (controllerContext == null)
     {
         throw new ArgumentNullException("controllerContext");
     }
     if (string.IsNullOrEmpty(viewPath))
     {
         throw new ArgumentException("MvcResources.Common_NullOrEmpty", "viewPath");
     }
     this._controllerContext = controllerContext;
     this.ViewPath = viewPath;
     this.ViewPageActivator = viewPageActivator ?? new MyBuildManagerView.DefaultViewPageActivator(dependencyResolver);
 }
 public PrecompiledView(
     string virtualPath,
     Type type,
     bool runViewStartPages,
     IEnumerable<string> fileExtensions,
     IVirtualPathFactory virtualPathFactory,
     IViewPageActivator viewPageActivator)
 {
     this.type = type;
     this.virtualPathFactory = virtualPathFactory;
     this.virtualPath = virtualPath;
     RunViewStartPages = runViewStartPages;
     ViewStartFileExtensions = fileExtensions;
     this.viewPageActivator = viewPageActivator;
 }
        public UaRazorViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            foreach (var token in UaRoutes)
            {
                Func<string[], string[]> tokenizer = formats => formats;
                if (!string.IsNullOrEmpty(token))
                    tokenizer = formats => formats.Select(format => Regex.Replace(format, ".(vb|cs)html$", "." + token + ".$1html")).ToArray();

                EntryTokenizeFormats(token, tokenizer, () => AreaViewLocationFormats);
                EntryTokenizeFormats(token, tokenizer, () => AreaMasterLocationFormats);
                EntryTokenizeFormats(token, tokenizer, () => AreaPartialViewLocationFormats);
                EntryTokenizeFormats(token, tokenizer, () => ViewLocationFormats);
                EntryTokenizeFormats(token, tokenizer, () => MasterLocationFormats);
                EntryTokenizeFormats(token, tokenizer, () => PartialViewLocationFormats);
            }
        }
 public PrecompiledMvcView(
     string virtualPath,
     string masterPath,
     Type type,
     bool runViewStartPages,
     IEnumerable<string> fileExtension,
     IViewPageActivator viewPageActivator)
 {
     _type = type;
     _virtualPath = virtualPath;
     _masterPath = masterPath;
     RunViewStartPages = runViewStartPages;
     ViewStartFileExtensions = fileExtension;
     _viewPageActivator = viewPageActivator
         ?? DependencyResolver.Current.GetService<IViewPageActivator>() /* For compatibility, remove this line within next version */
         ?? DefaultViewPageActivator.Current;
 }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="controllerContext"></param>
 /// <param name="viewPath"></param>
 /// <param name="layoutPath"></param>
 /// <param name="isPartialView"></param>
 /// <param name="applicationKey"></param>
 /// <param name="findLayoutPathOfThemeDelegate"></param>
 /// <param name="themeAppearance"></param>
 /// <param name="viewPageActivator"></param>
 public ThemedRazorView(ControllerContext controllerContext, string viewPath, string layoutPath, bool isPartialView, string applicationKey, Func<ThemeAppearance, string, string, string> findLayoutPathOfThemeDelegate, ThemeAppearance themeAppearance, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, viewPageActivator)
 {
     IsPartialView = isPartialView;
     ApplicationKey = applicationKey;
     if (!IsPartialView)
     {
         if (!string.IsNullOrEmpty(layoutPath))
             OverridenLayoutPath = layoutPath;
         else
         {
             OverridenLayoutPath = string.Empty;
             ThemeAppearance = themeAppearance;
             FindLayoutPathOfThemeDelegate = findLayoutPathOfThemeDelegate;
         }
     }
 }
        public PrecompiledMvcEngine(Assembly assembly, string baseVirtualPath, IViewPageActivator viewPageActivator)
        {
            _assemblyLastWriteTime = new Lazy<DateTime>(() => assembly.GetLastWriteTimeUtc(fallback: DateTime.MaxValue));
            _baseVirtualPath = NormalizeBaseVirtualPath(baseVirtualPath);

            base.AreaViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };

            base.AreaMasterLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };

            base.AreaPartialViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };
            base.ViewLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.MasterLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.PartialViewLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.FileExtensions = new[] {
                "cshtml", 
            };

            _mappings = (from type in assembly.GetTypes()
                         where typeof(WebPageRenderingBase).IsAssignableFrom(type)
                         let pageVirtualPath = type.GetCustomAttributes(inherit: false).OfType<PageVirtualPathAttribute>().FirstOrDefault()
                         where pageVirtualPath != null
                         select new KeyValuePair<string, Type>(CombineVirtualPaths(_baseVirtualPath, pageVirtualPath.VirtualPath), type)
                         ).ToDictionary(t => t.Key, t => t.Value, StringComparer.OrdinalIgnoreCase);
            this.ViewLocationCache = new PrecompiledViewLocationCache(assembly.FullName, this.ViewLocationCache);
            _viewPageActivator = viewPageActivator 
                ?? DependencyResolver.Current.GetService<IViewPageActivator>() /* For compatibility, remove this line within next version */
                ?? DefaultViewPageActivator.Current;
        }
        /// <summary>
        /// 初始化视图引擎
        /// </summary>
        /// <param name="viewPageActivator"></param>
        public PluginRazorViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            base.AreaViewLocationFormats = _areaViewLocationFormats;
            base.AreaMasterLocationFormats = _areaViewLocationFormats;
            base.AreaPartialViewLocationFormats = _areaViewLocationFormats;

            base.ViewLocationFormats = _viewLocationFormats;
            base.MasterLocationFormats = _viewLocationFormats;
            base.PartialViewLocationFormats = _viewLocationFormats;

            base.FileExtensions = new string[]
            {
                "cshtml",
                "vbhtml"
            };
        }
        public CompositePrecompiledMvcEngine(IEnumerable<PrecompiledViewAssembly> viewAssemblies, IViewPageActivator viewPageActivator)
        {
            base.AreaViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };

            base.AreaMasterLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };

            base.AreaPartialViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };
            base.ViewLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.MasterLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.PartialViewLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.FileExtensions = new[] {
                "cshtml", 
            };

            foreach (var viewAssembly in viewAssemblies)
            {
                foreach (var mapping in viewAssembly.GetTypeMappings())
                {
                    _mappings[mapping.Key] = new ViewMapping { Type = mapping.Value, ViewAssembly = viewAssembly };
                }
            }
            
            _viewPageActivator = viewPageActivator
                ?? DependencyResolver.Current.GetService<IViewPageActivator>() /* For compatibility, remove this line within next version */
                ?? DefaultViewPageActivator.Current;
        }
        public AppRazorViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            ViewLocationFormats = new[] {
                "~/Views/{0}.cshtml",
            };

            MasterLocationFormats = new[] {
                "~/Views/{0}.cshtml",
            };

            PartialViewLocationFormats = new[] {
                "~/Views/{0}.cshtml",
            };

            FileExtensions = new[] {
                "cshtml"
            };
        }
        public PrecompiledViewEngine(Assembly assembly, string baseVirtualPath)
        {
            this.baseVirtualPath = NormalizeBaseVirtualPath(baseVirtualPath);

            base.AreaViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };

            base.AreaMasterLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };

            base.AreaPartialViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml", 
                "~/Areas/{2}/Views/Shared/{0}.cshtml", 
            };
            base.ViewLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.MasterLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.PartialViewLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml", 
                "~/Views/Shared/{0}.cshtml", 
            };
            base.FileExtensions = new[] {
                "cshtml", 
            };

            mappings = (from type in assembly.GetTypes()
                         where typeof(WebPageRenderingBase).IsAssignableFrom(type)
                         let pageVirtualPath = type.GetCustomAttributes(inherit: false).OfType<PageVirtualPathAttribute>().FirstOrDefault()
                         where pageVirtualPath != null
                         select new KeyValuePair<string, Type>(CombineVirtualPaths(this.baseVirtualPath, pageVirtualPath.VirtualPath), type)
                         ).ToDictionary(t => t.Key, t => t.Value, StringComparer.OrdinalIgnoreCase);
            this.viewPageActivator = new ViewPageActivator();
        }
Exemple #27
0
        public EyePatchViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            AreaViewLocationFormats = new string[0];
            AreaMasterLocationFormats = new string[0];
            AreaPartialViewLocationFormats = new string[0];

            ViewLocationFormats = new[]
                                      {
                                          "~/Core/Mvc/Views/{1}/{0}.cshtml",
                                          "~/Core/Mvc/Views/{1}/{0}.vbhtml",
                                          "~/Core/Mvc/Views/Shared/{0}.cshtml",
                                          "~/Core/Mvc/Views/Shared/{0}.vbhtml",
                                          "~/Templates/{0}.cshtml",
                                          "~/Templates/{0}.vbhtml",
                                          "~/Templates/Shared/{0}.cshtml",
                                          "~/Templates/Shared/{0}.vbhtml"
                                      };
            MasterLocationFormats = new[]
                                        {
                                            "~/Core/Mvc/Views/{1}/{0}.cshtml",
                                            "~/Core/Mvc/Views/{1}/{0}.vbhtml",
                                            "~/Core/Mvc/Views/Shared/{0}.cshtml",
                                            "~/Core/Mvc/Views/Shared/{0}.vbhtml",
                                            "~/Templates/{0}.cshtml",
                                            "~/Templates/{0}.vbhtml",
                                            "~/Templates/Shared/{0}.cshtml",
                                            "~/Templates/Shared/{0}.vbhtml"
                                        };
            PartialViewLocationFormats = new[]
                                             {
                                                 "~/Core/Mvc/Views/{1}/{0}.cshtml",
                                                 "~/Core/Mvc/Views/{1}/{0}.vbhtml",
                                                 "~/Core/Mvc/Views/Shared/{0}.cshtml",
                                                 "~/Core/Mvc/Views/Shared/{0}.vbhtml",
                                                 "~/Templates/{0}.cshtml",
                                                 "~/Templates/{0}.vbhtml",
                                                 "~/Templates/Shared/{0}.cshtml",
                                                 "~/Templates/Shared/{0}.vbhtml"
                                             };
            FileExtensions = new[] {"cshtml", "vbhtml"};
        }
Exemple #28
0
        public MeshopViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            AreaMasterLocationFormats = new string[]
                                            {
                                                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                                                "~/Areas/{2}/Views/Shared/{0}.cshtml"
                                            };
            AreaViewLocationFormats = AreaMasterLocationFormats;
            AreaPartialViewLocationFormats = AreaMasterLocationFormats;

            MasterLocationFormats = new string[]
                                        {
                                            "~/Views/{1}/{0}.cshtml",
                                            "~/Views/Shared/{0}.cshtml"//,
                                            //Modules.Path + ModuleDirs + "/Views/{1}/{0}.cshtml"
                                        };
            ViewLocationFormats = MasterLocationFormats;
            PartialViewLocationFormats = MasterLocationFormats;
        }
        public PrecompiledMvcEngine(IPlugin plugin, string baseVirtualPath, IViewPageActivator viewPageActivator)
        {
            _baseVirtualPath = baseVirtualPath;
            VirtualPathProvider = new MvcVirtualPathProvider();
            base.AreaViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
            };

            base.AreaMasterLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
            };

            base.AreaPartialViewLocationFormats = new[] {
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
            };
            base.ViewLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml",
                "~/Views/Shared/{0}.cshtml",
            };
            base.MasterLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml",
                "~/Views/Shared/{0}.cshtml",
            };
            base.PartialViewLocationFormats = new[] {
                "~/Views/{1}/{0}.cshtml",
                "~/Views/Shared/{0}.cshtml",
            };
            base.FileExtensions = new[] {
                "cshtml",
            };

            RePrecomplies(plugin);

            this.ViewLocationCache = new PrecompiledViewLocationCache(PluginContext.Assembly.FullName, this.ViewLocationCache);
            _viewPageActivator = viewPageActivator
                ?? DependencyResolver.Current.GetService<IViewPageActivator>() /* For compatibility, remove this line within next version */
                ?? DefaultViewPageActivator.Current;
        }
        public CustomViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            AreaViewLocationFormats = new[]
            {
                AreaLocationPrefix + "{2}/Views/{1}/{0}.cshtml",
                AreaLocationPrefix + "{2}/Views/Shared/{0}.cshtml",
            };
            AreaMasterLocationFormats = new[]
            {
                AreaLocationPrefix + "{2}/Views/{1}/{0}.cshtml",
                AreaLocationPrefix + "{2}/Views/Shared/{0}.cshtml",
            };
            AreaPartialViewLocationFormats = new[]
            {
                AreaLocationPrefix + "{2}/Views/{1}/{0}.cshtml",
                AreaLocationPrefix + "{2}/Views/Shared/{0}.cshtml",
            };

            ViewLocationFormats = new[]
            {
                MasterLocationPrefix + "Views/{1}/{0}.cshtml",
                MasterLocationPrefix + "Views/Shared/{0}.cshtml",
            };
            MasterLocationFormats = new[]
            {
                MasterLocationPrefix + "Views/{1}/{0}.cshtml",
                MasterLocationPrefix + "Views/Shared/{0}.cshtml",
            };
            PartialViewLocationFormats = new[]
            {
                MasterLocationPrefix + "Views/{1}/{0}.cshtml",
                MasterLocationPrefix + "Views/Shared/{0}.cshtml",
            };

            FileExtensions = new[]
            {
                "cshtml",
            };
        }
Exemple #31
0
        /// <summary>
        /// Constructor for a CsQueryView
        /// </summary>
        ///
        /// <param name="controllerContext">
        /// Context for the controller.
        /// </param>
        /// <param name="viewPath">
        /// Full pathname of the view file.
        /// </param>
        /// <param name="layoutPath">
        /// Full pathname of the layout file.
        /// </param>
        /// <param name="runViewStartPages">
        /// true to run view start pages.
        /// </param>
        /// <param name="viewStartFileExtensions">
        /// The view start file extensions.
        /// </param>
        /// <param name="viewPageActivator">
        /// The view page activator.
        /// </param>
        /// <param name="isPartial">
        /// true if this object is partial.
        /// </param>

        public CsQueryView(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable <string> viewStartFileExtensions, IViewPageActivator viewPageActivator,
                           bool isPartial
                           )
            : base(controllerContext, viewPath, layoutPath, runViewStartPages, viewStartFileExtensions, viewPageActivator)
        {
            IsPartial = isPartial;
        }
Exemple #32
0
 /// <summary>Initializes a new instance of the <see cref="T:System.Web.Mvc.RazorView" /> class using the view page activator.</summary>
 /// <param name="controllerContext">The controller context.</param>
 /// <param name="viewPath">The view path.</param>
 /// <param name="layoutPath">The layout or master page.</param>
 /// <param name="runViewStartPages">A value that indicates whether view start files should be executed before the view.</param>
 /// <param name="viewStartFileExtensions">The set of extensions that will be used when looking up view start files.</param>
 /// <param name="viewPageActivator">The view page activator.</param>
 public JsxView(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable <string> viewStartFileExtensions, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, viewPageActivator)
 {
     this.LayoutPath              = layoutPath ?? string.Empty;
     this.RunViewStartPages       = runViewStartPages;
     this.ViewStartFileExtensions = viewStartFileExtensions ?? Enumerable.Empty <string>();
 }
Exemple #33
0
 public PageView(ControllerContext controllerContext, string viewPath, string masterPath, IViewPageActivator viewPageActivator, IDependencyResolver dependencyResolver)
     : base(controllerContext, viewPath, viewPageActivator, dependencyResolver)
 {
     MasterPath = masterPath;
 }
        public ThemeViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            this.AreaViewLocationFormats = new[]
            {
                "~/Themes/{3}/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Themes/{3}/Areas/{2}/Views/{1}/{0}.vbhtml",
                "~/Themes/{3}/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Themes/{3}/Areas/{2}/Views/Shared/{0}.vbhtml",

                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/{1}/{0}.vbhtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.vbhtml"
            };
            this.AreaMasterLocationFormats = new[]
            {
                "~/Themes/{3}/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Themes/{3}/Areas/{2}/Views/{1}/{0}.vbhtml",
                "~/Themes/{3}/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Themes/{3}/Areas/{2}/Views/Shared/{0}.vbhtml",

                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/{1}/{0}.vbhtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.vbhtml"
            };
            this.AreaPartialViewLocationFormats = new[]
            { "~/Themes/{3}/Areas/{2}/Views/{1}/{0}.cshtml",
              "~/Themes/{3}/Areas/{2}/Views/{1}/{0}.vbhtml",
              "~/Themes/{3}/Areas/{2}/Views/Shared/{0}.cshtml",
              "~/Themes/{3}/Areas/{2}/Views/Shared/{0}.vbhtml",

              "~/Areas/{2}/Views/{1}/{0}.cshtml",
              "~/Areas/{2}/Views/{1}/{0}.vbhtml",
              "~/Areas/{2}/Views/Shared/{0}.cshtml",
              "~/Areas/{2}/Views/Shared/{0}.vbhtml" };
            this.ViewLocationFormats = new[]
            {
                "~/Themes/{2}/Views/{1}/{0}.cshtml",
                "~/Themes/{2}/Views/{1}/{0}.vbhtml",
                "~/Themes/{2}/Views/Shared/{0}.cshtml",
                "~/Themes/{2}/Views/Shared/{0}.vbhtml",

                "~/Views/{1}/{0}.cshtml",
                "~/Views/{1}/{0}.vbhtml",
                "~/Views/Shared/{0}.cshtml",
                "~/Views/Shared/{0}.vbhtml",

                //Admin
                "~/SiteManager/Views/{1}/{0}.cshtml",
                "~/SiteManager/Views/{1}/{0}.vbhtml",
                "~/SiteManager/Views/Shared/{0}.cshtml",
                "~/SiteManager/Views/Shared/{0}.vbhtml",
            };
            this.MasterLocationFormats = new[]
            {
                "~/Themes/{2}/Views/{1}/{0}.cshtml",
                "~/Themes/{2}/Views/{1}/{0}.vbhtml",
                "~/Themes/{2}/Views/Shared/{0}.cshtml",
                "~/Themes/{2}/Views/Shared/{0}.vbhtml",

                "~/Views/{1}/{0}.cshtml",
                "~/Views/{1}/{0}.vbhtml",
                "~/Views/Shared/{0}.cshtml",
                "~/Views/Shared/{0}.vbhtml",
                //admin
                "~/SiteManager/Views/{1}/{0}.cshtml",
                "~/SiteManager/Views/{1}/{0}.vbhtml",
                "~/SiteManager/Views/Shared/{0}.cshtml",
                "~/SiteManager/Views/Shared/{0}.vbhtml",
            };
            this.PartialViewLocationFormats = new[]
            {
                "~/Themes/{2}/Views/{1}/{0}.cshtml",
                "~/Themes/{2}/Views/{1}/{0}.vbhtml",
                "~/Themes/{2}/Views/Shared/{0}.cshtml",
                "~/Themes/{2}/Views/Shared/{0}.vbhtml",

                "~/Views/{1}/{0}.cshtml",
                "~/Views/{1}/{0}.vbhtml",
                "~/Views/Shared/{0}.cshtml",
                "~/Views/Shared/{0}.vbhtml",
                //Admin
                "~/SiteManager/Views/{1}/{0}.cshtml",
                "~/SiteManager/Views/{1}/{0}.vbhtml",
                "~/SiteManager/Views/Shared/{0}.cshtml",
                "~/SiteManager/Views/Shared/{0}.vbhtml",
            };
            this.FileExtensions = new[]
            {
                "cshtml",
                "vbhtml"
            };

            GetExtensionThunk = new Func <string, string>(VirtualPathUtility.GetExtension);
        }
Exemple #35
0
 protected RazorViewPage(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable <string> viewStartFileExtensions, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, layoutPath, runViewStartPages, viewStartFileExtensions, viewPageActivator)
 {
 }
 public TestableBuildManagerViewEngine(IViewPageActivator viewPageActivator = null, IResolver <IViewPageActivator> activatorResolver = null, IDependencyResolver dependencyResolver = null)
     : base(viewPageActivator, activatorResolver, dependencyResolver)
 {
 }
Exemple #37
0
 protected ModuleBuildManagerViewEngine(IViewPageActivator viewPageActivator) : base(viewPageActivator)
 {
 }
Exemple #38
0
 protected DynamicView(ControllerContext controllerContext, string viewPath, IViewPageActivator viewPageActivator)
     : this(controllerContext, viewPath, viewPageActivator, null)
 {
 }
Exemple #39
0
 /// <summary>复合预编译Mvc引擎</summary>
 /// <param name="viewAssemblies"></param>
 /// <param name="viewPageActivator"></param>
 public CompositePrecompiledMvcEngine(IEnumerable <PrecompiledViewAssembly> viewAssemblies, IViewPageActivator viewPageActivator)
     : base(viewPageActivator)
 {
     AreaViewLocationFormats = new String[]
     {
         "~/Areas/{2}/Views/{1}/{0}.cshtml",
         "~/Areas/{2}/Views/Shared/{0}.cshtml"
     };
     AreaMasterLocationFormats = new String[]
     {
         "~/Areas/{2}/Views/{1}/{0}.cshtml",
         "~/Areas/{2}/Views/Shared/{0}.cshtml"
     };
     AreaPartialViewLocationFormats = new String[]
     {
         "~/Areas/{2}/Views/{1}/{0}.cshtml",
         "~/Areas/{2}/Views/Shared/{0}.cshtml"
     };
     ViewLocationFormats = new String[]
     {
         "~/Views/{1}/{0}.cshtml",
         "~/Views/Shared/{0}.cshtml"
     };
     MasterLocationFormats = new String[]
     {
         "~/Views/{1}/{0}.cshtml",
         "~/Views/Shared/{0}.cshtml"
     };
     PartialViewLocationFormats = new String[]
     {
         "~/Views/{1}/{0}.cshtml",
         "~/Views/Shared/{0}.cshtml"
     };
     FileExtensions = new String[]
     {
         "cshtml"
     };
     foreach (var asm in viewAssemblies)
     {
         foreach (var type in asm.GetTypeMappings())
         {
             _mappings[type.Key] = new ViewMapping
             {
                 Type         = type.Value,
                 ViewAssembly = asm
             };
         }
     }
     //_viewPageActivator = (viewPageActivator ?? (DependencyResolver.Current.GetService<IViewPageActivator>() ?? DefaultViewPageActivator.Current));
 }
 /// <summary>Initializes a new instance of the <see cref="T:System.Web.Mvc.RazorView" /> class using the view page activator.</summary>
 /// <param name="controllerContext">The controller context.</param>
 /// <param name="viewPath">The view path.</param>
 /// <param name="layoutPath">The layout or master page.</param>
 /// <param name="runViewStartPages">A value that indicates whether view start files should be executed before the view.</param>
 /// <param name="viewStartFileExtensions">The set of extensions that will be used when looking up view start files.</param>
 /// <param name="viewPageActivator">The view page activator.</param>
 public JsxView(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable <string> viewStartFileExtensions, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, viewPageActivator)
 {
     LayoutPath              = layoutPath ?? string.Empty;
     RunViewStartPages       = runViewStartPages;
     ViewStartFileExtensions = viewStartFileExtensions ?? Enumerable.Empty <string>();
     _baseCacheManager       = ServiceLocator.ServiceProvider.GetService <BaseCacheManager>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CompositePrecompiledMvcEngineWrapper"/> class.
 /// </summary>
 /// <param name="viewAssemblies">The view assemblies.</param>
 /// <param name="viewPageActivator">The view page activator.</param>
 /// <param name="packageName">Name of the package.</param>
 public CompositePrecompiledMvcEngineWrapper(IEnumerable <PrecompiledViewAssemblyWrapper> viewAssemblies, IViewPageActivator viewPageActivator, string packageName)
     : base(viewAssemblies.Select(a => a.PrecompiledViewAssembly), viewPageActivator)
 {
     this.precompiledAssemblies = viewAssemblies.ToArray();
     this.packageName           = packageName;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CompositePrecompiledMvcEngineWrapper"/> class.
 /// </summary>
 /// <param name="viewAssemblies">The view assemblies.</param>
 /// <param name="viewPageActivator">The view page activator.</param>
 public CompositePrecompiledMvcEngineWrapper(IEnumerable <PrecompiledViewAssemblyWrapper> viewAssemblies, IViewPageActivator viewPageActivator)
     : this(viewAssemblies, viewPageActivator, string.Empty)
 {
 }
Exemple #43
0
 public WebFormView(ControllerContext controllerContext, string viewPath, string masterPath, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, viewPageActivator)
 {
     MasterPath = masterPath ?? String.Empty;
 }
 public TestableBuildManagerCompiledView(ControllerContext controllerContext, string viewPath, IViewPageActivator viewPageActivator = null, IDependencyResolver dependencyResolver = null)
     : base(controllerContext, viewPath, viewPageActivator, dependencyResolver)
 {
 }
Exemple #45
0
 protected BuildManagerViewEngine(IViewPageActivator viewPageActivator)
     : this(viewPageActivator, null, null)
 {
 }
Exemple #46
0
        /// <summary>
        /// 模版引擎构造
        /// </summary>
        public MicuaViewEngine(IViewPageActivator viewPageActivator)
            : base(viewPageActivator)
        {
            #region 移到配置文件

            string themeRoot = "~" + Config.GetString("theme_root", "/Themes/")
                               + Setting.GetString("site_theme", "default");

            #region 完整版

            AreaViewLocationFormats = new[] {
                themeRoot + "/Areas/{2}/Views/{1}/{0}.cshtml",
                themeRoot + "/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
            };
            AreaMasterLocationFormats = new[] {
                themeRoot + "/Areas/{2}/Views/{1}/{0}.cshtml",
                themeRoot + "/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
            };
            AreaPartialViewLocationFormats = new[] {
                themeRoot + "/Areas/{2}/Views/{1}/{0}.cshtml",
                themeRoot + "/Areas/{2}/Views/Shared/{0}.cshtml",
                "~/Areas/{2}/Views/{1}/{0}.cshtml",
                "~/Areas/{2}/Views/Shared/{0}.cshtml",
            };
            ViewLocationFormats = new[] {
                themeRoot + "/Views/{0}.cshtml",
                themeRoot + "/Views/{1}/{0}.cshtml",
                themeRoot + "/Views/Shared/{0}.cshtml",
                "~/Views/{0}.cshtml",
                "~/Views/{1}/{0}.cshtml",
                "~/Views/Shared/{0}.cshtml",
            };
            MasterLocationFormats = new[] {
                themeRoot + "/Views/{0}.cshtml",
                themeRoot + "/Views/{1}/{0}.cshtml",
                themeRoot + "/Views/Shared/{0}.cshtml",
                "~/Views/{0}.cshtml",
                "~/Views/{1}/{0}.cshtml",
                "~/Views/Shared/{0}.cshtml",
            };
            PartialViewLocationFormats = new[] {
                themeRoot + "/Views/{0}.cshtml",
                themeRoot + "/Views/{1}/{0}.cshtml",
                themeRoot + "/Views/Shared/{0}.cshtml",
                "~/Views/{0}.cshtml",
                "~/Views/{1}/{0}.cshtml",
                "~/Views/Shared/{0}.cshtml",
            };
            FileExtensions = new[] { "cshtml" };

            #endregion

            #region 精简版

            //this.AreaViewLocationFormats = new[]
            //{
            //    areaRoot + "/{2}/Views/{1}/{0}.cshtml",
            //    themeRoot + "/Areas/{2}/Views/{1}/{0}.cshtml",
            //    "~/Plugins/{2}/Views/{1}/{0}.cshtml",
            //    "~/Areas/{2}/Views/{1}/{0}.cshtml",
            //};
            //this.AreaMasterLocationFormats = new[]
            //{
            //    areaRoot + "/{2}/Views/Shared/{0}.cshtml",
            //    themeRoot + "/Areas/{2}/Views/Shared/{0}.cshtml",
            //    "~/Plugins/{2}/Views/Shared/{0}.cshtml",
            //    "~/Areas/{2}/Views/Shared/{0}.cshtml",
            //};
            //this.AreaPartialViewLocationFormats = new[]
            //{
            //    areaRoot + "/{2}/Views/{1}/{0}.cshtml",
            //    areaRoot + "/{2}/Views/Shared/{0}.cshtml",
            //    themeRoot + "/Areas/{2}/Views/{1}/{0}.cshtml",
            //    themeRoot + "/Areas/{2}/Views/Shared/{0}.cshtml",
            //    "~/Plugins/{2}/Views/{1}/{0}.cshtml",
            //    "~/Plugins/{2}/Views/Shared/{0}.cshtml",
            //    "~/Areas/{2}/Views/{1}/{0}.cshtml",
            //    "~/Areas/{2}/Views/Shared/{0}.cshtml",
            //};
            //this.ViewLocationFormats = new[]
            //{
            //    themeRoot + "/Views/{0}.cshtml", themeRoot + "/Views/{1}/{0}.cshtml",
            //    "~/Views/{0}.cshtml", "~/Views/{1}/{0}.cshtml",
            //};
            //this.MasterLocationFormats = new[]
            //{
            //    themeRoot + "/Views/Shared/{0}.cshtml",
            //    "~/Views/Shared/{0}.cshtml",
            //};
            //this.PartialViewLocationFormats = new[]
            //{
            //    themeRoot + "/Views/{0}.cshtml", themeRoot + "/Views/{1}/{0}.cshtml",
            //    themeRoot + "/Views/Shared/{0}.cshtml", "~/Views/{0}.cshtml",
            //    "~/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml",
            //};
            //this.FileExtensions = new[] { "cshtml" };

            #endregion

            #endregion
        }
 public TestableBuildManagerViewEngine(IViewPageActivator viewPageActivator)
     : base(viewPageActivator)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DummyBuildManagerCompiledView"/> class.
 /// </summary>
 /// <param name="controllerContext">The controller context.</param>
 /// <param name="viewPath">The view path.</param>
 /// <param name="viewPageActivator">The view page activator.</param>
 protected DummyBuildManagerCompiledView(ControllerContext controllerContext, string viewPath, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, viewPageActivator)
 {
 }
 public ExtendedRazorViewEngine(IViewPageActivator viewPageActivator) : base(viewPageActivator)
 {
 }
 public CustomViewEngine(IViewPageActivator viewPageActivator)
     : this(null, viewPageActivator)
 {
 }
 public PathRazorViewEngine(IViewPageActivator viewPageActivator, PathSettings settings)
     : base(viewPageActivator)
 {
     controllerPathResolver = new PathResolver(settings);
 }
Exemple #52
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocalizationWebFormView"/> class.
 /// </summary>
 /// <param name="controllerContext">The controller context.</param>
 /// <param name="viewPath">The view path.</param>
 /// <param name="masterPath">The master path.</param>
 /// <param name="viewPageActivator">The view page activator.</param>
 public LocalizationWebFormView(ControllerContext controllerContext, string viewPath, string masterPath, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, masterPath, viewPageActivator)
 {
 }
Exemple #53
0
 public PageView(ControllerContext controllerContext, string viewPath, string masterPath, IViewPageActivator viewPageActivator)
     : this(controllerContext, viewPath, masterPath, viewPageActivator, null)
 {
 }
Exemple #54
0
 public RazorView(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable <string> viewStartFileExtensions, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, viewPageActivator)
 {
     LayoutPath              = layoutPath ?? String.Empty;
     RunViewStartPages       = runViewStartPages;
     StartPageLookup         = StartPage.GetStartPage;
     ViewStartFileExtensions = viewStartFileExtensions ?? Enumerable.Empty <string>();
 }
Exemple #55
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompilationPerformanceRazorView"/> class.
 /// </summary>
 /// <param name="controllerContext">The controller context.</param>
 /// <param name="viewPath">The view path.</param>
 /// <param name="layoutPath">The layout or master page.</param>
 /// <param name="runViewStartPages">A value that indicates whether view start files should be executed before the view.</param>
 /// <param name="viewStartFileExtensions">The set of extensions that will be used when looking up view start files.</param>
 /// <param name="viewPageActivator">The view page activator.</param>
 public CompilationPerformanceRazorView(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable <string> viewStartFileExtensions, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, layoutPath, runViewStartPages, viewStartFileExtensions, viewPageActivator)
 {
     this.controllerContext = controllerContext;
     this.viewPageActivator = viewPageActivator;
 }
 ///-------------------------------------------------------------------------------------------------
 /// <summary>
 ///     Initializes a new instance of the MustacheView class.
 /// </summary>
 ///
 /// <remarks>
 ///     Anwar Javed, 09/16/2013 7:55 PM.
 /// </remarks>
 ///
 /// <param name="controllerContext">
 ///     Context for the controller.
 /// </param>
 /// <param name="viewPath">
 ///     Full pathname of the view file.
 /// </param>
 /// <param name="masterPath">
 ///     Full pathname of the master file.
 /// </param>
 /// <param name="viewPageActivator">
 ///     The view page activator.
 /// </param>
 ///-------------------------------------------------------------------------------------------------
 public MustacheView(ControllerContext controllerContext, string viewPath, string masterPath, IViewPageActivator viewPageActivator)
     : base(controllerContext, viewPath, viewPageActivator)
 {
     this.masterPath = masterPath;
 }
Exemple #57
0
 public TestableRazorViewEngine(IViewPageActivator viewPageActivator)
     : base(viewPageActivator)
 {
 }
 protected BuildManagerCompiledView(ControllerContext controllerContext, string viewPath, IViewPageActivator viewPageActivator)
     : this(controllerContext, viewPath, viewPageActivator, null)
 {
 }
        internal BuildManagerCompiledView(ControllerContext controllerContext, string viewPath, IViewPageActivator viewPageActivator, IDependencyResolver dependencyResolver)
        {
            if (controllerContext == null)
            {
                throw new ArgumentNullException("controllerContext");
            }
            if (String.IsNullOrEmpty(viewPath))
            {
                throw new ArgumentException(MvcResources.Common_NullOrEmpty, "viewPath");
            }

            _controllerContext = controllerContext;

            ViewPath = viewPath;

            ViewPageActivator = viewPageActivator ?? new BuildManagerViewEngine.DefaultViewPageActivator(dependencyResolver);
        }
 public TestableWebFormViewEngine(IViewPageActivator viewPageActivator)
     : base(viewPageActivator)
 {
 }