Commits

Jordan Earls committed aa46e74

Updated ViewEngine for nicer formatting from BarelyMVC
Updated BarelyMVC and fixed breaking change

  • Participants
  • Parent commits 3cb4f10

Comments (0)

Files changed (4)

Barebones/Global.asax.cs

 		
 		protected virtual void Application_Start (Object sender, EventArgs e)
 		{
-			Routing.AddRoute("index", "/",()=>{return new IndexHandler();});
-			Routing.AddRoute("custom", "/{var}", () => {return new IndexHandler();});
+			Routing.AddRoute("index", "/",(p)=>{return new IndexHandler();});
+			Routing.AddRoute("custom", "/{var}", (p) => {return new IndexHandler();});
 		}
 		
 		protected virtual void Session_Start (Object sender, EventArgs e)

Barebones/Views/ViewEngine.cs

 		//Basically, this will go to hell if there is ever more than 1 partial view with a Layout set. 
 	}
 	TextWriter __Writer;
-	bool __RenderDirectly=true;
+	bool __RenderDirectly=false;
 	public override bool RenderedDirectly{
 		get{
 			return __RenderDirectly;

Barebones/Views/ViewEngine.tt

 
 <#
 /*CONFIGURATION VARIABLES*/
-	string Namespace="Earlz.BarelyMVC.Examples.Barebone.Views"; //default namespace to use
-	string DefaultBaseClass="Earlz.BarelyMVC.ViewEngine.Internal.BarelyViewDummy"; //default base class name to use (You must specify a valid class implementing IBarelyView!)
-	string SearchPattern="*.html"; //What files to process. Use the | symbol to match multiple filters.
-	string TemplateDirectory=""; //Note! This is relative to the location of the T4 template, not the project! (usually you want "" here)
-		//If true, will render to HttpContext.Current.Response while building the view, instead	
-		//of building a huge string. If you will be rendering views directly to the Response stream, set to true. 
-		//If youre using this not as a view engine, but as a templating engine, set to false. 
-	bool DefaultRenderDirectly=true;
-		//If true, NullReferenceExceptions will attempt to be detected(and ignored) 
-		//This makes development much easier, but has performance penalty because a 
-		//try-catch attempt is needed at each variable output block `{= =}` Note, only the variable output block is affected by this setting.
-		//There is no attempts to detect nulls anywhere else. 
+	//default namespace to use for views
+	string Namespace="Earlz.BarelyMVC.Examples.Barebone.Views"; 
+	
+	//default base class name to use (You must specify a valid class implementing IBarelyView!)
+	string DefaultBaseClass="Earlz.BarelyMVC.ViewEngine.Internal.BarelyViewDummy"; 
+	
+	//What files to process as views. Use the | symbol to match multiple filetypes
+	string SearchPattern="*.html"; 
+	
+	//The path relative to THIS file to look for View files (you almost always just want "" here)
+	string TemplateDirectory=""; 
+	
+	//Specifies if to default to rendering directly to the HttpResponse or instead building a string and 
+	//then writing the final string out to response all at one time. 
+	bool DefaultRenderDirectly=false;
+	
+	//Specifies if `{= =}` output blocks should swallow and ignore null reference exceptions
+	//This makes development much easier, but has a performance penalty because a 
+	//try-catch attempt is needed at each variable output block `{= =}` Note, only the variable output block is affected by this setting.
+	//There is no attempts to detect nulls anywhere else. 
 	bool DefaultDetectNulls=true;
-		//The default writer object to use(when direct rendering) 
+	
+	//The default writer object to use(when direct rendering) 
+	//you should only need to change this if you're not integrating this viewengine with BarelyMVC
 	string DefaultWriterReference="Earlz.BarelyMVC.HttpHandler.CurrentWriter";
+	
+	//If your views require using statements, put them here.
+	//A few essential namespaces are automatically included already
 	string CustomUsing=@"
 		//custom using statements for your views go here:
 		

lib/BarelyMVC.dll

Binary file modified.