Files
HTMLParser/Plan B Html Parser (XNA 3.1)/Plan B Html Parser/Nodes/HtmlTextNode.cs
headhunter45_cp d280868fc8
2010-09-26 06:31:06 +00:00

63 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace PlanB.Html.Nodes
{
public class HtmlTextNode: HtmlNode
{
public String Text { get; set; }
public override string ToString()
{
return Text;
}
public HtmlTextNode()
{
Text = String.Empty;
Type = HtmlNodeType.Text_;
}
public HtmlTextNode(String text)
{
Text = text;
Type = HtmlNodeType.Text_;
}
public override string InnerHtml
{
get
{
return String.Empty;
}
}
public override string OuterHtml
{
get
{
return Entitize(Text);
}
}
public override string TagName
{
get { return "_Text"; }
}
private string Entitize(string Text)
{
string temp = Text;
temp = temp.Replace("&", "&");
temp = temp.Replace("<", "&lt;");
temp = temp.Replace(">", "&gt;");
temp = temp.Replace("\"", "&quot;");
return temp;
}
}
}