C# Class Our.Umbraco.Picture.PictureExtensions

Exibir arquivo Open project: rasmuseeg/Our.Umbraco.Picture

Public Methods

Method Description
Alt ( this picture, string alt ) : IPictureElement

Sets the alt attribute on the img element.

Attr ( this picture, string key, string value ) : IPictureElement

Adds the following attribute and value to picture element.

Attrs ( this picture, string>.Dictionary attrs ) : IPictureElement

Adds the following attributes and values to picture element.

Html ( this picture ) : IHtmlString

Convert to HtmlString

Picture ( this helper ) : IPictureElement

Creates an empty picture element.

RenderPicture ( this helper, IPictureElement picture ) : IHtmlString

Returns the html of picture element with sources and attributes.

Source ( this picture, string media ) : IPictureElement

Adds new source with specified media and srcsets.

Src ( this picture, string src ) : IPictureElement

You should leave this empty

Srcset ( this picture ) : IPictureElement

Add multiple sources in the srcset attribute on img element

Private Methods

Method Description
RenderHere ( this picture ) : void

Method Details

Alt() public static method

Sets the alt attribute on the img element.
public static Alt ( this picture, string alt ) : IPictureElement
picture this
alt string
return IPictureElement

Attr() public static method

Adds the following attribute and value to picture element.
public static Attr ( this picture, string key, string value ) : IPictureElement
picture this
key string
value string
return IPictureElement

Attrs() public static method

Adds the following attributes and values to picture element.
public static Attrs ( this picture, string>.Dictionary attrs ) : IPictureElement
picture this
attrs string>.Dictionary
return IPictureElement

Html() public static method

Convert to HtmlString
public static Html ( this picture ) : IHtmlString
picture this
return IHtmlString

Picture() public static method

Creates an empty picture element.
public static Picture ( this helper ) : IPictureElement
helper this
return IPictureElement

RenderPicture() public static method

Returns the html of picture element with sources and attributes.
public static RenderPicture ( this helper, IPictureElement picture ) : IHtmlString
helper this
picture IPictureElement
return IHtmlString

Source() public static method

Adds new source with specified media and srcsets.
public static Source ( this picture, string media ) : IPictureElement
picture this
media string
return IPictureElement

Src() public static method

You should leave this empty
public static Src ( this picture, string src ) : IPictureElement
picture this
src string
return IPictureElement

Srcset() public static method

Add multiple sources in the srcset attribute on img element
public static Srcset ( this picture ) : IPictureElement
picture this
return IPictureElement