bool IHtmlRenderAdapter.Render(IHtmlNode node, HtmlRenderContext context) { var element = node as IHtmlElement; if (element == null) { return(false); } if (element.Name.EqualsIgnoreCase("content")) { GetContentBody(element).RenderChilds(context.Writer, RenderAdapters); return(true); } else if (element.Name.EqualsIgnoreCase("head")) { View.ViewContext.HttpContext.Trace.Write("ContentView", "Begin Merge Head"); var head = MergeHead(element, Document.FindSingle("head")); View.ViewContext.HttpContext.Trace.Write("ContentView", "End Merge Head"); head.Render(context.Writer, RenderAdapters); return(true); } else { return(false); } }
bool IHtmlRenderAdapter.Render( IHtmlNode node, HtmlRenderContext context ) { var element = node as IHtmlElement; if ( element == null ) return false; if ( element.Name.EqualsIgnoreCase( "content" ) ) { GetContentBody( element ).RenderChilds( context.Writer, RenderAdapters ); return true; } else if ( element.Name.EqualsIgnoreCase( "head" ) ) { View.ViewContext.HttpContext.Trace.Write( "ContentView", "Begin Merge Head" ); var head = MergeHead( element, Document.FindSingle( "head" ) ); View.ViewContext.HttpContext.Trace.Write( "ContentView", "End Merge Head" ); head.Render( context.Writer, RenderAdapters ); return true; } else return false; }
/// <summary> /// 渲染 partial 标签 /// </summary> /// <param name="element">partial 标签</param> /// <param name="context">渲染上下文</param> protected override void Render(IHtmlElement element, HtmlRenderContext context) { var partialTag = ContentExtensions.GenerateTagHtml(element, true); ViewContext.HttpContext.Trace.Write("Jumony View Engine", string.Format("Begin Render Partial: {0}", partialTag)); RenderPartial(element, context.Writer); ViewContext.HttpContext.Trace.Write("Jumony View Engine", string.Format("End Render Partial: {0}", partialTag)); }
bool IHtmlRenderAdapter.Render(IHtmlNode node, HtmlRenderContext context) { var term = Terms.FirstOrDefault(t => t.TextNode.Equals(node)); if (term != null) { context.Write(term.TranslatedTerm); return(true); } return(false); }
/// <summary> /// 渲染 partial 标签 /// </summary> /// <param name="element">partial 标签</param> /// <param name="context">渲染上下文</param> protected override void Render( IHtmlElement element, HtmlRenderContext context ) { var partialTag = ContentExtensions.GenerateTagHtml( element, true ); ViewContext.HttpContext.Trace.Write( "Jumony View Engine", string.Format( "Begin Render Partial: {0}", partialTag ) ); RenderPartial( element, context.Writer ); ViewContext.HttpContext.Trace.Write( "Jumony View Engine", string.Format( "End Render Partial: {0}", partialTag ) ); }