Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }