/// <summary>Read Element named magic. </summary>
private void ReadMagic(System.Xml.XmlElement element, MimeType mimeType)
{
// element.getValue();
System.String offset = null;
System.String content = null;
System.String type = null;
System.Xml.XmlNamedNodeMap attrs = (System.Xml.XmlAttributeCollection)element.Attributes;
for (int i = 0; i < attrs.Count; i++)
{
System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute)attrs.Item(i);
if (attr.Name.Equals("offset"))
{
offset = attr.Value;
}
else if (attr.Name.Equals("type"))
{
type = attr.Value;
if (String.Compare(type, "byte", true) == 0)
{
type = "System.Byte";
}
}
else if (attr.Name.Equals("value"))
{
content = attr.Value;
}
}
if ((offset != null) && (content != null))
{
mimeType.AddMagic(System.Int32.Parse(offset), type, content);
}
}