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;
}