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
파일 보기 프로젝트 열기: Corniel/Qowaiv

공개 메소드들

메소드 설명
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