|
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace iiuga.Web.UI
{
/// <summary>
/// TreeWebWriter class.
///
/// Copyright � Iulian Iuga, 2003. All Rights Reserved.
/// </summary>
/// <author>
/// Created by Iulian Iuga; 04 January, 2003
/// </author>
internal class TreeWebWriter : WebControl, ITreeWebWriter
{
private TreeWeb _tree;
/// <summary>
///
/// </summary>
public TreeWebWriter() : base( HtmlTextWriterTag.Div )
{}
/// <summary>
///
/// </summary>
/// <param name="writer"></param>
/// <param name="tree"></param>
public void RenderTree( HtmlTextWriter writer, TreeWeb tree )
{
_tree = tree;
RenderControl( writer );
}
/// <summary>
///
/// </summary>
/// <param name="writer"></param>
/// <author>
/// Created by Iulian Iuga; 27 December, 2002
/// </author>
protected override void RenderContents( HtmlTextWriter writer )
{
writer.AddAttribute( HtmlTextWriterAttribute.Width, "100%" );
writer.AddAttribute( HtmlTextWriterAttribute.Cellpadding, "0" );
writer.AddAttribute( HtmlTextWriterAttribute.Cellspacing, "0" );
writer.RenderBeginTag( HtmlTextWriterTag.Table );
// render tree Root's children
RenderChildren( writer );
writer.RenderEndTag();
}
/// <summary>
///
/// </summary>
/// <param name="writer"></param>
/// <author>
/// Created by Iulian Iuga; 28 December, 2002
/// </author>
protected override void RenderChildren( HtmlTextWriter writer )
{
foreach( TreeElement _elem in _tree.Elements )
_elem.Render( writer );
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.