a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
69 lines
2.7 KiB
C#
69 lines
2.7 KiB
C#
namespace System.Web.Mvc {
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
public class RazorViewEngine : BuildManagerViewEngine {
|
|
internal static readonly string ViewStartFileName = "_ViewStart";
|
|
|
|
public RazorViewEngine()
|
|
: this(null) {
|
|
}
|
|
|
|
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",
|
|
};
|
|
}
|
|
|
|
protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath) {
|
|
return new RazorView(controllerContext, partialPath,
|
|
layoutPath: null, runViewStartPages: false, viewStartFileExtensions: FileExtensions, viewPageActivator: ViewPageActivator);
|
|
}
|
|
|
|
protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath) {
|
|
var view = new RazorView(controllerContext, viewPath,
|
|
layoutPath: masterPath, runViewStartPages: true, viewStartFileExtensions: FileExtensions, viewPageActivator: ViewPageActivator);
|
|
return view;
|
|
}
|
|
}
|
|
}
|