C# 클래스 Sdl.Web.Common.Models.MediaItem

상속: EntityModel
파일 보기 프로젝트 열기: sdl/dxa-web-application-dotnet 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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