예제 #1
0
 public RazorTemplateBase()
 {
     Response = new RazorResponse();
     Request = new RazorRequest();
 }
예제 #2
0
		/////////////////////////////////////////////////////////////////////////////	
		
		public void DefineSection( string name, Action action )
		{
			/*

			Anonymous Functions 

			Lambda Expression

			*/

			// ******
			//
			// 'args' can be passed in as the arguments passed to RenderSection() after
			// the the 'required' parameter
			//
			// or as the normal arguments if invoked as a macro
			//
			Func<object [], string> wrapper =
			
				(args) =>
				{
					this.args = args;

					var temp = Response;
					Response = new RazorResponse();

					action();

					string result = FileReader.FixText( Response.GetText );
					Response = temp;

					return result;
				};

			// ******
			mp.AddObjectMacro( name, wrapper );
		}