BoC.Web.Mvc.MetaData.ExtraModelMetadataProvider.GetDisplayAttributeName C# (CSharp) Méthode

GetDisplayAttributeName() private static méthode

private static GetDisplayAttributeName ( Type containerType, string propertyName, System.ComponentModel.DataAnnotations.DisplayAttribute displayAttribute ) : string
containerType System.Type
propertyName string
displayAttribute System.ComponentModel.DataAnnotations.DisplayAttribute
Résultat string
        private static string GetDisplayAttributeName(Type containerType, string propertyName, DisplayAttribute displayAttribute)
        {
            if (containerType != null)
            {
                if (String.IsNullOrEmpty(displayAttribute.Name))
                {
                    // check to see that resource key exists.
                    string resourceKey = GetResourceKey(containerType, propertyName);
                    if (displayAttribute.ResourceType.PropertyExists(resourceKey))
                    {
                        return resourceKey;
                    }
                    else
                    {
                        return propertyName;
                    }
                }

            }
            return null;
        }