示例#1
0
        /// <summary>
        /// Display name for the property.
        /// </summary>
        public string GetDisplayName()
        {
            if (DisplayName != null)
            {
                return(DisplayName.GetString());
            }

            return(PropertyName.SplitPascalCase());
        }
示例#2
0
        /// <summary>
        /// Display name for the property.
        /// </summary>
        public string GetDisplayName(object model)
        {
            string result = null;

            if (DisplayName != null)
            {
                result = DisplayName.GetString(model);
            }

            if (result == null)
            {
                result = propertyDisplayName;
            }

            return(result);
        }
示例#3
0
        /// <summary>
        /// Display name for the property.
        /// </summary>
        public string GetDisplayName()
        {
            string result = null;

            if (DisplayName != null)
            {
                result = DisplayName.GetString(null /*We don't have a model object at this point*/);
            }

            if (result == null)
            {
                result = propertyDisplayName;
            }

            return(result);
        }
示例#4
0
        /// <summary>
        /// Display name for the property.
        /// </summary>
        public string GetDisplayName(IValidationContext context)
        {
            string result = null;

            if (DisplayName != null)
            {
                result = DisplayName.GetString(context);
            }

            if (result == null)
            {
                result = _propertyDisplayName;
            }

            return(result);
        }
示例#5
0
        /// <summary>
        /// Display name for the property.
        /// </summary>
        public string GetDisplayName()
        {
            string result = null;

            if (DisplayName != null)
            {
                result = DisplayName.GetString(null);
            }

            if (result == null)
            {
                result = _propertyDisplayName;
            }

            return(result);
        }
示例#6
0
        /// <summary>
        /// Display name for the property.
        /// </summary>
        public string GetDisplayName()
        {
            string result = null;

            if (DisplayName != null)
            {
                result = DisplayName.GetString();
            }

            if (result == null)
            {
                result = PropertyName.SplitPascalCase();
            }

            return(result);
        }
示例#7
0
 private string BuildPropertyName(ValidationContext context)
 {
     return(context.PropertyChain.BuildPropertyName(PropertyName ?? DisplayName.GetString()));
 }