C# Class Sakura.AspNetCore.Mvc.TagHelpers.EnumSelectTagHelper

Generate the item list for a "select" element with all items defined in an enum type.
Inheritance: Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
Mostra file Open project: sgjsakura/AspNetCore

Private Properties

Property Type Description

Protected Methods

Method Description
GenerateListForEnumType ( ) : IEnumerable

Generate a list of SelectListItem for a specified enum type.

GetEnumType ( ) : Type

When derived, return the actual enum type for generating the list.

GetItemForMember ( MemberInfo memberInfo ) : SelectListItem

Generate a SelectListItem for a specified MemberInfo.

GetTextForMember ( MemberInfo memberInfo ) : string

Get the text of the option associated with the specified enum item.

GetValueForMember ( MemberInfo memberInfo ) : string

Get the value of the option associated with the specified enum item.

Method Details

GenerateListForEnumType() protected method

Generate a list of SelectListItem for a specified enum type.
protected GenerateListForEnumType ( ) : IEnumerable
return IEnumerable

GetEnumType() protected abstract method

When derived, return the actual enum type for generating the list.
protected abstract GetEnumType ( ) : Type
return System.Type

GetItemForMember() protected method

Generate a SelectListItem for a specified MemberInfo.
protected GetItemForMember ( MemberInfo memberInfo ) : SelectListItem
memberInfo System.Reflection.MemberInfo The object represents as the enum item.
return SelectListItem

GetTextForMember() protected method

Get the text of the option associated with the specified enum item.
protected GetTextForMember ( MemberInfo memberInfo ) : string
memberInfo System.Reflection.MemberInfo The object represents as the enum item.
return string

GetValueForMember() protected method

Get the value of the option associated with the specified enum item.
protected GetValueForMember ( MemberInfo memberInfo ) : string
memberInfo System.Reflection.MemberInfo The object represents as the enum item.
return string