private T GetDefaultConversion <T>(IXmlReadWriteWrapper element, Type type) { if (type == typeof(string)) { return((T)(object)element.GetAttributeValue(ElementName)); } if (type == typeof(bool)) { return((T)(object)element.GetBoolAttributeValue(ElementName)); } if (type == typeof(int?)) { return((T)(object)element.GetIntAttributeValue(ElementName)); } throw new SmartAPIInternalException(string.Format("No matching conversion for element {0} to type {1}", ElementName, type.Name)); }