C# Класс GravatarHtmlHelper, Gravatar-HtmlHelper

Globally Recognised Avatar - http://gravatar.com
This implementation by Andrew Freemantle - http://www.fatlemon.co.uk/

Source, Wiki and Issues: https://github.com/AndrewFreemantle/Gravatar-HtmlHelper

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GravatarImage ( this htmlHelper, string emailAddress, int size = 80, DefaultImage defaultImage = DefaultImage.Default, string defaultImageUrl = "", bool forceDefaultImage = false, Rating, rating = Rating.G, bool forceSecureRequest = false ) : IHtmlContent

Returns a Globally Recognised Avatar as an <img /> - http://gravatar.com

Приватные методы

Метод Описание
GetDescription ( this en ) : string

Returns the value of a DescriptionAttribute for a given Enum value

Source: http://blogs.msdn.com/b/abhinaba/archive/2005/10/21/483337.aspx

GetMd5Hash ( string input ) : string

Generates an MD5 hash of the given string

Source: http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx

Описание методов

GravatarImage() публичный статический Метод

Returns a Globally Recognised Avatar as an <img /> - http://gravatar.com
public static GravatarImage ( this htmlHelper, string emailAddress, int size = 80, DefaultImage defaultImage = DefaultImage.Default, string defaultImageUrl = "", bool forceDefaultImage = false, Rating, rating = Rating.G, bool forceSecureRequest = false ) : IHtmlContent
htmlHelper this
emailAddress string Email Address for the Gravatar
size int Size in pixels (default: 80)
defaultImage DefaultImage Default image if user hasn't created a Gravatar
defaultImageUrl string URL to a custom default image (e.g: 'Url.Content("~/images/no-grvatar.png")' )
forceDefaultImage bool Prefer the default image over the users own Gravatar
rating Rating, Gravatar content rating (note that Gravatars are self-rated)
forceSecureRequest bool Always do secure (https) requests
Результат IHtmlContent