C# Класс Qowaiv.Web.Mvc.TypeConverterModelBinder

A modelbinder for types with a custom type converter.
This binder supports models that have there own TypeConverter. The message of the exception thrown by there type converter in case of failure is the error message added to the model state. This binder is needed because the default modelbinder don't call a type converter in case the input is String.Empty.
Наследование: System.Web.Mvc.DefaultModelBinder
Показать файл Открыть проект

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

Метод Описание
AddAssembly ( Assembly assembly ) : void

Adds the types of the assembly that are marked with teh SingleValueObjectAttribute.

AddType ( Type tp ) : void

Adds the specified type.

Only adds the types that are supported by the model binder.

AddTypes ( ) : void

Adds the specified types.

Only adds the types that are supported by the model binder.

RegisterForAll ( ModelBinderDictionary binders ) : void

Registers the model binder to the specified model binder dictionary.

Typical usage: protected override void Application_Start() { base.Application_Start(); TypeConverterModelBinder.RegisterForAll(ModelBinders.Binders); }

RemoveType ( Type tp ) : void

Removes the specified type.

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

Метод Описание
BindModel ( System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext ) : object
TypeConverterModelBinder ( ) : System

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

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

Adds the types of the assembly that are marked with teh SingleValueObjectAttribute.
public static AddAssembly ( Assembly assembly ) : void
assembly System.Reflection.Assembly /// Assembly to add. ///
Результат void

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

Adds the specified type.
Only adds the types that are supported by the model binder.
public static AddType ( Type tp ) : void
tp System.Type /// Type to add. ///
Результат void

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

Adds the specified types.
Only adds the types that are supported by the model binder.
public static AddTypes ( ) : void
Результат void

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

Registers the model binder to the specified model binder dictionary.
Typical usage: protected override void Application_Start() { base.Application_Start(); TypeConverterModelBinder.RegisterForAll(ModelBinders.Binders); }
public static RegisterForAll ( ModelBinderDictionary binders ) : void
binders ModelBinderDictionary The model binder dictionary to add to.
Результат void

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

Removes the specified type.
public static RemoveType ( Type tp ) : void
tp System.Type /// Type to remove. ///
Результат void