Exemplo n.º 1
0
        internal HtmlRenderContext( TextWriter writer, IHtmlRenderAdapter[] adapters )
        {
            if ( writer == null )
            throw new ArgumentNullException( "writer" );

              Writer = writer;
              Adapters = adapters ?? new IHtmlRenderAdapter[0];
              Data = Hashtable.Synchronized( new Hashtable() );
        }
Exemplo n.º 2
0
    /// <summary>
    /// 渲染 HTML 内容。
    /// </summary>
    /// <returns></returns>
    protected virtual string RenderContent( IHtmlContainer scope, bool partialMode, IHtmlRenderAdapter[] adapters )
    {


      var document = scope as IHtmlDocument;
      if ( document == null )
      {
        var writer = new StringWriter();

        foreach ( var node in scope.Nodes() )
          node.Render( writer, adapters );

        return writer.ToString();
      }

      else
        return document.Render( adapters );

    }
Exemplo n.º 3
0
 /// <summary>
 /// 渲染 HTML 内容
 /// </summary>
 /// <returns>渲染结果</returns>
 protected virtual string RenderContent( IHtmlRenderAdapter[] adapters )
 {
   return RenderContent( Scope, IsPartialView, adapters );
 }