C# Класс Sdl.Web.Common.Models.MediaItem

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

Защищенные свойства (Protected)

Свойство Тип Описание
FontAwesomeMimeTypeToIconClassMapping string>.IDictionary

Private Properties

Свойство Тип Описание

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

Метод Описание
GetFriendlyFileSize ( ) : string

Gets the file size with units.

GetIconClass ( ) : string

Gets the name of a CSS class representing the Icon for this Media Item.

ReadFromXhtmlElement ( XmlElement xhtmlElement ) : void

Read properties from XHTML element.

ToHtml ( ) : string

Renders an HTML representation of the Entity Model.

This method is used when the Entity Model is part of a RichText instance which is mapped to a string property. In this case HTML rendering happens during model mapping, which is not ideal. Preferably, the model property should be of type RichText and the View should use @Html.DxaRichText() to get the rich text rendered as HTML.

ToHtml ( string widthFactor, double aspect, string cssClass = null, int containerSize ) : string

Renders an HTML representation of the Media Item.

This method is used by the IRichTextFragment.ToHtml() implementation and by the HtmlHelperExtensions.Media implementation. Both cases should be avoided, since HTML rendering should be done in View code rather than in Model code.

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

GetFriendlyFileSize() публичный Метод

Gets the file size with units.
public GetFriendlyFileSize ( ) : string
Результат string

GetIconClass() публичный Метод

Gets the name of a CSS class representing the Icon for this Media Item.
public GetIconClass ( ) : string
Результат string

ReadFromXhtmlElement() публичный Метод

Read properties from XHTML element.
public ReadFromXhtmlElement ( XmlElement xhtmlElement ) : void
xhtmlElement System.Xml.XmlElement XHTML element
Результат void

ToHtml() публичный Метод

Renders an HTML representation of the Entity Model.
This method is used when the Entity Model is part of a RichText instance which is mapped to a string property. In this case HTML rendering happens during model mapping, which is not ideal. Preferably, the model property should be of type RichText and the View should use @Html.DxaRichText() to get the rich text rendered as HTML.
public ToHtml ( ) : string
Результат string

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

Renders an HTML representation of the Media Item.
This method is used by the IRichTextFragment.ToHtml() implementation and by the HtmlHelperExtensions.Media implementation. Both cases should be avoided, since HTML rendering should be done in View code rather than in Model code.
public abstract ToHtml ( string widthFactor, double aspect, string cssClass = null, int containerSize ) : string
widthFactor string The factor to apply to the width - can be % (eg "100%") or absolute (eg "120").
aspect double The aspect ratio to apply.
cssClass string Optional CSS class name(s) to apply.
containerSize int The size (in grid column units) of the containing element.
Результат string

Описание свойств

FontAwesomeMimeTypeToIconClassMapping защищенное статическое свойство

protected static IDictionary FontAwesomeMimeTypeToIconClassMapping
Результат string>.IDictionary