protected string GetPropertyName(PropertyInfo propertyInfo) { string result = string.Empty; XmlNameAttribute customerAtt = (XmlNameAttribute)propertyInfo.GetCustomAttribute(typeof(XmlNameAttribute)); if (customerAtt != null) { result = customerAtt.Name; } else { result = propertyInfo.Name; } return(result); }
protected string GetTypeName(Type type) { string result = string.Empty; XmlNameAttribute customerAtt = (XmlNameAttribute)type.GetCustomAttribute(typeof(XmlNameAttribute)); if (customerAtt != null) { result = customerAtt.Name; } else { result = type.Name; } return(result); }