@@ -33,25 +33,25 @@ public class RazorFormat : ITemplateResolver, IActivator, IViewEngine, IPlugin,
3333 public static string TemplatePlaceHolder = "@RenderBody()" ;
3434
3535 // ~/View - Dynamic Pages
36- public Dictionary < string , RazorPage > ViewPages = new Dictionary < string , RazorPage > (
36+ public Dictionary < string , ViewPage > ViewPages = new Dictionary < string , ViewPage > (
3737 StringComparer . CurrentCultureIgnoreCase ) ;
3838
3939 // ~/View/Shared - Dynamic Shared Pages
40- public Dictionary < string , RazorPage > ViewSharedPages = new Dictionary < string , RazorPage > (
40+ public Dictionary < string , ViewPage > ViewSharedPages = new Dictionary < string , ViewPage > (
4141 StringComparer . CurrentCultureIgnoreCase ) ;
4242
4343 //Content Pages outside of ~/View
44- public Dictionary < string , RazorPage > ContentPages = new Dictionary < string , RazorPage > (
44+ public Dictionary < string , ViewPage > ContentPages = new Dictionary < string , ViewPage > (
4545 StringComparer . CurrentCultureIgnoreCase ) ;
4646
47- public Dictionary < string , RazorPage > PageTemplates = new Dictionary < string , RazorPage > (
47+ public Dictionary < string , ViewPage > PageTemplates = new Dictionary < string , ViewPage > (
4848 StringComparer . CurrentCultureIgnoreCase ) ;
4949
5050 public IAppHost AppHost { get ; set ; }
5151
5252 public Dictionary < string , string > MarkdownReplaceTokens { get ; set ; }
5353
54- public Func < string , IEnumerable < RazorPage > > FindRazorPagesFn { get ; set ; }
54+ public Func < string , IEnumerable < ViewPage > > FindRazorPagesFn { get ; set ; }
5555
5656 public RazorFormat ( )
5757 {
@@ -80,7 +80,7 @@ public void Configure(IAppHost appHost)
8080 appHost . HtmlProviders . Add ( ( requestContext , dto , httpRes ) => {
8181
8282 var httpReq = requestContext . Get < IHttpRequest > ( ) ;
83- RazorPage razorPage ;
83+ ViewPage razorPage ;
8484 if ( ( razorPage = GetViewPageByResponse ( dto , httpReq ) ) == null )
8585 return false ;
8686
@@ -90,7 +90,7 @@ public void Configure(IAppHost appHost)
9090 } ) ;
9191
9292 appHost . CatchAllHandlers . Add ( ( httpMethod , pathInfo , filePath ) => {
93- RazorPage razorPage ;
93+ ViewPage razorPage ;
9494 if ( filePath == null || ( razorPage = GetContentPage ( filePath . WithoutExtension ( ) ) ) == null ) return null ;
9595 return new RazorHandler {
9696 RazorFormat = this ,
@@ -118,15 +118,15 @@ public void Init(Type razorBaseType = null)
118118 }
119119 else
120120 {
121- Razor . SetTemplateBase ( typeof ( RazorPageBase < > ) ) ;
121+ Razor . SetTemplateBase ( typeof ( ViewPage < > ) ) ;
122122 }
123123
124124 Razor . DefaultTemplateService . RazorFormat = this ;
125125 Razor . AddResolver ( this ) ;
126126 Razor . SetActivator ( this ) ;
127127 }
128128
129- public IEnumerable < RazorPage > FindRazorPages ( string dirPath )
129+ public IEnumerable < ViewPage > FindRazorPages ( string dirPath )
130130 {
131131 var di = new DirectoryInfo ( dirPath ) ;
132132 var razorFiles = di . GetMatchingFiles ( "*.cshtml" ) ;
@@ -148,7 +148,7 @@ public IEnumerable<RazorPage> FindRazorPages(string dirPath)
148148
149149 var templatePath = GetTemplatePath ( fileInfo . DirectoryName ) ;
150150
151- yield return new RazorPage ( this , razorFile , pageName , pageContents , pageType ) {
151+ yield return new ViewPage ( this , razorFile , pageName , pageContents , pageType ) {
152152 TemplatePath = templatePath ,
153153 LastModified = fileInfo . LastWriteTime ,
154154 } ;
@@ -183,7 +183,7 @@ private string GetTemplatePath(string fileDirPath)
183183 return null ;
184184 }
185185
186- public bool ProcessRazorPage ( IHttpRequest httpReq , RazorPage razorPage , object dto , IHttpResponse httpRes )
186+ public bool ProcessRazorPage ( IHttpRequest httpReq , ViewPage razorPage , object dto , IHttpResponse httpRes )
187187 {
188188 httpRes . AddHeaderLastModified ( razorPage . GetLastModified ( ) ) ;
189189
@@ -202,15 +202,15 @@ public bool ProcessRazorPage(IHttpRequest httpReq, RazorPage razorPage, object d
202202 return true ;
203203 }
204204
205- public void ReloadModifiedPageAndTemplates ( RazorPage razorPage )
205+ public void ReloadModifiedPageAndTemplates ( ViewPage razorPage )
206206 {
207207 var lastWriteTime = File . GetLastWriteTime ( razorPage . FilePath ) ;
208208 if ( lastWriteTime > razorPage . LastModified )
209209 {
210210 razorPage . Reload ( ) ;
211211 }
212212
213- RazorPage template ;
213+ ViewPage template ;
214214 if ( razorPage . DirectiveTemplatePath != null
215215 && this . PageTemplates . TryGetValue ( razorPage . DirectiveTemplatePath , out template ) )
216216 {
@@ -227,7 +227,7 @@ public void ReloadModifiedPageAndTemplates(RazorPage razorPage)
227227 }
228228 }
229229
230- private void ReloadTemplate ( RazorPage template )
230+ private void ReloadTemplate ( ViewPage template )
231231 {
232232 var contents = File . ReadAllText ( template . FilePath ) ;
233233 foreach ( var markdownReplaceToken in MarkdownReplaceTokens )
@@ -237,7 +237,7 @@ private void ReloadTemplate(RazorPage template)
237237 template . Reload ( contents ) ;
238238 }
239239
240- private RazorPage GetViewPageByResponse ( object dto , IHttpRequest httpRequest )
240+ private ViewPage GetViewPageByResponse ( object dto , IHttpRequest httpRequest )
241241 {
242242 var httpResult = dto as IHttpResult ;
243243 if ( httpResult != null )
@@ -258,9 +258,9 @@ private RazorPage GetViewPageByResponse(object dto, IHttpRequest httpRequest)
258258 return httpRequest != null ? GetViewPage ( httpRequest . OperationName ) : null ;
259259 }
260260
261- public RazorPage GetViewPage ( string pageName )
261+ public ViewPage GetViewPage ( string pageName )
262262 {
263- RazorPage razorPage ;
263+ ViewPage razorPage ;
264264
265265 ViewPages . TryGetValue ( pageName , out razorPage ) ;
266266 if ( razorPage != null ) return razorPage ;
@@ -277,7 +277,7 @@ private void RegisterRazorPages(string razorSearchPath)
277277 }
278278 }
279279
280- public void AddPage ( RazorPage page )
280+ public void AddPage ( ViewPage page )
281281 {
282282 try
283283 {
@@ -308,7 +308,7 @@ public void AddPage(RazorPage page)
308308 AddTemplate ( templatePath , File . ReadAllText ( templatePath ) ) ;
309309 }
310310
311- public RazorPage AddTemplate ( string templatePath , string templateContents )
311+ public ViewPage AddTemplate ( string templatePath , string templateContents )
312312 {
313313 var templateFile = new FileInfo ( templatePath ) ;
314314 var templateName = templateFile . FullName . WithoutExtension ( ) ;
@@ -318,7 +318,7 @@ public RazorPage AddTemplate(string templatePath, string templateContents)
318318 templateContents = templateContents . Replace ( markdownReplaceToken . Key , markdownReplaceToken . Value ) ;
319319 }
320320
321- var template = new RazorPage ( this , templatePath , templateName , templateContents , RazorPageType . Template ) {
321+ var template = new ViewPage ( this , templatePath , templateName , templateContents , RazorPageType . Template ) {
322322 LastModified = templateFile . LastWriteTime ,
323323 } ;
324324 PageTemplates . Add ( templatePath , template ) ;
@@ -334,17 +334,17 @@ public RazorPage AddTemplate(string templatePath, string templateContents)
334334 }
335335 }
336336
337- public RazorPage GetContentPage ( string pageFilePath )
337+ public ViewPage GetContentPage ( string pageFilePath )
338338 {
339- RazorPage razorPage ;
339+ ViewPage razorPage ;
340340 ContentPages . TryGetValue ( pageFilePath , out razorPage ) ;
341341 return razorPage ;
342342 }
343343
344344 public string GetTemplate ( string name )
345345 {
346346 Console . WriteLine ( "GetTemplate(): " + name ) ;
347- RazorPage template ;
347+ ViewPage template ;
348348 PageTemplates . TryGetValue ( name , out template ) ;
349349 return template != null ? template . Contents : null ;
350350 }
@@ -371,14 +371,14 @@ public string RenderStaticPage(string filePath)
371371
372372 filePath = filePath . WithoutExtension ( ) ;
373373
374- RazorPage razorPage ;
374+ ViewPage razorPage ;
375375 if ( ! ContentPages . TryGetValue ( filePath , out razorPage ) )
376376 throw new InvalidDataException ( ErrorPageNotFound . FormatWith ( filePath ) ) ;
377377
378378 return RenderStaticPage ( razorPage ) ;
379379 }
380380
381- private string RenderStaticPage ( RazorPage markdownPage )
381+ private string RenderStaticPage ( ViewPage markdownPage )
382382 {
383383 var template = ExecuteTemplate ( ( object ) null ,
384384 markdownPage . PageName , markdownPage . TemplatePath ) ;
0 commit comments