public static bool? GetBoolAttributeValue(this XmlElement xmlElement, string attributeName)
{
int? value = xmlElement.GetIntAttributeValue(attributeName);
if (value == null)
{
return null;
}
if (value == 1)
{
return true;
}
if (value == 0)
{
return false;
}
throw new SmartAPIException((ServerLogin) null,
string.Format(
"Could not convert value '{0}' of attribute '{1}' to a boolean value", value,
attributeName));
}