public static PropertyNameValuePair PropertyToNVPair(PropertyInfo pinfo)
        {
            var nv = new PropertyNameValuePair();
            nv.Value = pinfo;
            nv.Name = pinfo.Name;

            var attr = pinfo.GetCustomAttribute(typeof(DisplayAttribute)) as DisplayAttribute;
            if (attr != null)
            {
                if (!string.IsNullOrEmpty(attr.Name))
                {
                    nv.Name = attr.Name;
                }
                if (!string.IsNullOrEmpty(attr.Description))
                {
                    nv.Description = attr.Description;
                }
            }
            return nv;
        }
        static public PropertyNameValuePair PropertyToNVPair(PropertyInfo pinfo)
        {
            var nv = new PropertyNameValuePair();

            nv.Value = pinfo;
            nv.Name  = pinfo.Name;

            var attr = pinfo.GetCustomAttribute(typeof(DisplayAttribute)) as DisplayAttribute;

            if (attr != null)
            {
                if (!string.IsNullOrEmpty(attr.Name))
                {
                    nv.Name = attr.Name;
                }
                if (!string.IsNullOrEmpty(attr.Description))
                {
                    nv.Description = attr.Description;
                }
            }
            return(nv);
        }