private void ParseAttributes(XElement xel)
{
try
{
foreach (XAttribute attribute in xel.Attributes())
{
switch (attribute.Name.ToString().ToLower())
{
case "name":
this.name = attribute.Value.ToString();
continue;
case "address":
this.address = attribute.Value.ConvertHexToInt();
continue;
case "elements":
this.elements = attribute.Value.ConvertStringToInt();
continue;
case "scaling":
Scaling sca = new Scaling();
if (this.parentDef.ScalingList.TryGetValue(attribute.Value, out sca))
{
this.scaling = sca;
this.defaultScaling = sca;
}
else
Trace.WriteLine("Error finding scaling " + attribute.Value);
continue;
case "type":
this.type = attribute.Value.ToString();
continue;
case "category":
this.category = attribute.Value.ToString();
continue;
default:
continue;
}
}
}
catch (Exception e)
{
Exception ne = new Exception("Error parsing table xml attributes", e);
throw;
}
}