Rock.Reflection.GetDisplayName C# (CSharp) Method

GetDisplayName() public static method

Returns the DisplayName Attribute value for a given type
public static GetDisplayName ( Type type ) : string
type System.Type
return string
        public static string GetDisplayName( Type type )
        {
            foreach ( var nameAttribute in type.GetCustomAttributes( typeof( DisplayNameAttribute ), true ) )
            {
                return ( (DisplayNameAttribute)nameAttribute ).DisplayName;
            }
            return null;
        }