C# Класс Castle.Components.Binder.DefaultConverter

Наследование: System.MarshalByRefObject, IConverter
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
CanConvert ( Type desiredType, Type inputType, object input, bool &exactMatch ) : bool
Convert ( Type desiredType, Type inputType, object input, bool &conversionSucceeded ) : object
Convert ( Type desiredType, object input, bool &conversionSucceeded ) : object

Convert the input param into the desired type

There are 3 possible cases when trying to convert: 1) Input data for conversion missing (input is null or an empty String) Returns default conversion value (based on desired type) and set conversionSucceeded = false 2) Has input data but cannot convert to particular type Throw exception and set conversionSucceeded = false 3) Has input data and can convert to particular type Return input converted to desired type and set conversionSucceeded = true

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

Метод Описание
ConvertDate ( object input, bool &conversionSucceeded ) : object
ConvertDecimal ( object input, bool &conversionSucceeded ) : object
ConvertEnum ( Type desiredType, object input, bool &conversionSucceeded ) : object
ConvertGenericList ( Type desiredType, object input, bool &conversionSucceeded ) : object
ConvertGuid ( object input, bool &conversionSucceeded ) : object
ConvertNullable ( Type desiredType, object input, bool &conversionSucceeded ) : object
ConvertPrimitive ( Type desiredType, object input, bool &conversionSucceeded ) : object
ConvertToArray ( Type desiredType, object input, bool &conversionSucceeded ) : object
ConvertUsingTypeConverter ( Type desiredType, object input, bool &conversionSucceeded ) : object

Support for types that specify a TypeConverter, i.e.: NullableTypes

FixInputForMonoIfNeeded ( Type elemType, object input ) : object

Fix for mod_mono issue where array values are passed as a comma seperated String.

IsBool ( Type desiredType ) : bool
NormalizeInput ( object input ) : String
SpecialBoolConversion ( string value, object input, bool &conversionSucceeded ) : object
ThrowInformativeException ( Type desiredType, object input, Exception inner ) : void

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

CanConvert() публичный Метод

public CanConvert ( Type desiredType, Type inputType, object input, bool &exactMatch ) : bool
desiredType System.Type
inputType System.Type
input object
exactMatch bool
Результат bool

Convert() публичный Метод

public Convert ( Type desiredType, Type inputType, object input, bool &conversionSucceeded ) : object
desiredType System.Type
inputType System.Type
input object
conversionSucceeded bool
Результат object

Convert() публичный Метод

Convert the input param into the desired type
There are 3 possible cases when trying to convert: 1) Input data for conversion missing (input is null or an empty String) Returns default conversion value (based on desired type) and set conversionSucceeded = false 2) Has input data but cannot convert to particular type Throw exception and set conversionSucceeded = false 3) Has input data and can convert to particular type Return input converted to desired type and set conversionSucceeded = true
public Convert ( Type desiredType, object input, bool &conversionSucceeded ) : object
desiredType System.Type Type of the desired
input object The input
conversionSucceeded bool if false the return value must be ignored
Результат object