Пример #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);
        }
Пример #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);
        }