Click here to Skip to main content
Click here to Skip to main content

WPF HTML Supported TextBlock

By , 7 Feb 2009
 
/*
 * Created by SharpDevelop.
 * User: LYCJ
 * Date: 19/10/2007
 * Time: 2:53
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Collections.Generic;

namespace QuickZip.MiniHtml2
{
	/// <summary>
	/// Represent owner of all HtmlTag.
	/// </summary>
	public class HtmlTagTree : HtmlTagNode
	{
		public HtmlTagTree() : base(null, null)
		{
			isRoot = true;
			tag = new HtmlTag("master","");
		}
		
		public override bool CanAdd(HtmlTag aTag)
		{
			return true;
		}		
		
		static string printNode(Int32 level, HtmlTagNode node)
		{
			string spacing = " ";
			string retVal = "";
			for (int i = 0; i < level; i++)
				spacing += "  ";
			
			retVal += spacing + node.ToString() + '\r'+'\n';
			
			foreach (HtmlTagNode subnode in node)
				retVal += HtmlTagTree.printNode(level+1, subnode);			
			
			return retVal;
		}
		
		public override string ToString()
		{
			string retVal = "";
			
			foreach (HtmlTagNode subnode in this)
				retVal += HtmlTagTree.printNode(0, subnode);
			
			return retVal;
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of use 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.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)

About the Author

Leung Yat Chun
Software Developer
Hong Kong Hong Kong
Member

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 7 Feb 2009
Article Copyright 2009 by Leung Yat Chun
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid