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

Represents a Registry of View Model Types and associated Semantics.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
GetMappedModelTypes ( string semanticTypeName ) : IEnumerable

Gets the Model Types mapped to a given semantic type name.

GetSemanticPropertyNames ( Type modelType, string propertyName ) : string[]

Gets the semantic property names for a given Model Type and property name.

GetSemanticTypes ( Type modelType, string>.IDictionary &prefixMappings ) : string[]

Gets the semantic types (and prefix mappings) for a given Model Type.

GetViewModelType ( MvcData viewData ) : Type

Get the View Model Type for a given View.

RegisterViewModel ( MvcData viewData, Type modelType ) : void

Registers a View Model and associated View.

RegisterViewModel ( MvcData viewData, string viewVirtualPath ) : void

Registers a View Model mapping by compiling a given view file and obtaining its model type.

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

Метод Описание
ExtractSemanticInfo ( Type modelType ) : SemanticInfo
GetSemanticInfo ( Type modelType ) : SemanticInfo
RegisterModelType ( Type modelType ) : SemanticInfo

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

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

Gets the Model Types mapped to a given semantic type name.
public static GetMappedModelTypes ( string semanticTypeName ) : IEnumerable
semanticTypeName string The semantic type name qualified with vocabulary ID.
Результат IEnumerable

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

Gets the semantic property names for a given Model Type and property name.
public static GetSemanticPropertyNames ( Type modelType, string propertyName ) : string[]
modelType System.Type The Model Type.
propertyName string The property name.
Результат string[]

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

Gets the semantic types (and prefix mappings) for a given Model Type.
public static GetSemanticTypes ( Type modelType, string>.IDictionary &prefixMappings ) : string[]
modelType System.Type The Model Type.
prefixMappings string>.IDictionary The prefix mappings for the prefixes used by the types.
Результат string[]

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

Get the View Model Type for a given View.
public static GetViewModelType ( MvcData viewData ) : Type
viewData MvcData The data for the View.
Результат System.Type

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

Registers a View Model and associated View.
public static RegisterViewModel ( MvcData viewData, Type modelType ) : void
viewData MvcData The data for the View to register or null if only the Model Type is to be registered.
modelType System.Type The model Type used by the View.
Результат void

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

Registers a View Model mapping by compiling a given view file and obtaining its model type.
public static RegisterViewModel ( MvcData viewData, string viewVirtualPath ) : void
viewData MvcData The data for the View to register.
viewVirtualPath string The (virtual) path to the View file.
Результат void