/// <summary>
 /// render Compressed if Writer.Compress is true, otherwise render Full
 /// </summary>
 /// <param name="e"></param>
 protected override void OnRender(RenderingEventArgs e)
 {
     if (e.Writer.Compress)
     {
         e.Writer.Write(this.Compressed);
     }
     else
     {
         e.Writer.Write(this.Full);
     }
 }
		/// <summary>
		/// Renders the before, content and after objects
		/// content is indented by the InternalIndents value (default 1)
		/// </summary>
		/// <param name="e"></param>
		protected override void OnRender(RenderingEventArgs e)
		{
			base.OnRender(e);

			IScriptWriter writer = e.Writer;


			Sb.TrySetLayout(Content, ContentLayout); // try and get it to use our preferred layout

			if (Before != null)
			{
				if (this.Layout == ScriptLayout.Block && Sb.HasRenderContent(Content))
					writer.WriteNewLineAndIndent();

				writer.Write(Before);
			}

			try
			{
				writer.BeginIndent(InternalIndents);

				writer.Write(Content);
			}
			finally
			{
				writer.EndIndent(InternalIndents);
			}

			if (this.After != null)
			{
				if ((this.Layout == ScriptLayout.Block || this.Layout == ScriptLayout.InlineBlock) && Sb.HasRenderContent(Content))
					writer.WriteNewLineAndIndent();

				writer.Write(After);
			}

		}
Ejemplo n.º 3
0
		/// <summary>
		/// Renders the winner of the test
		/// </summary>
		/// <param name="e"></param>
		protected override void OnRender(RenderingEventArgs e)
        {
			base.OnRender(e);

			IScriptWriter writer = e.Writer;


			object winner = this.Winner;

			writer.Write(winner);

		}
		/// <summary>
		/// This is called when the content is to be rendered
		/// Subclasses will do what has to be done!
		/// </summary>
		/// <param name="e">includes the script writer to render content to</param>
		protected virtual void OnRender(RenderingEventArgs e)
		{
			if (Rendering != null)
				Rendering(this, e);
		}