protected string GetAttributes(IDictionary attributes)
{
if (attributes == null || attributes.Count == 0) return string.Empty;
StringBuilder contents = new StringBuilder();
foreach(DictionaryEntry entry in attributes)
{
if (entry.Value == null || entry.Value.ToString() == string.Empty)
{
contents.Append(entry.Key);
}
else
{
contents.AppendFormat("{0}=\"{1}\"", entry.Key, entry.Value);
}
contents.Append(' ');
}
return contents.ToString();
}