private void ParseAttributes(HtmlTag tag)
{
char ch = this.Current;
while (!this.IsEOF &&
ch != CloseTagChar &&
ch != OpenTagChar)
{
string name = this.ParseAttributeName();
if (name.Length == 1 &&
name[0] == EndTagChar)
{
tag.SetFullTag();
name = String.Empty;
}
this.ParseSyncPoint();
object value = String.Empty;
ch = this.Current;
if (ch != CloseTagChar &&
ch != OpenTagChar)
{
// Get the value(if any)
value = this.ParseAttributeValue();
}
this.ParseSyncPoint();
if (!String.IsNullOrEmpty(name))
{
if (value is String &&
HtmlTag.StyleAttrib.Equals(name, StringComparison.OrdinalIgnoreCase))
{
this.ParseStyles(tag, value.ToString());
}
else
{
tag.Attributes[name] = value;
}
}
ch = this.Current;
}
}