Class AbstractConverter<S, T>
public abstract class AbstractConverter<S, T> : AbstractGenericConditionalConverter, IConditionalGenericConverter, IConditionalConverter, IGenericConverter, IConverter<S, T>
Type Parameters
S
T
- Inheritance
-
AbstractConverter<S, T>
- Implements
-
IConverter<S, T>
- Derived
- Inherited Members
Constructors
AbstractConverter()
protected AbstractConverter()
Methods
Convert(object, Type, Type)
Convert the source object to the target type.
public override object Convert(object source, Type sourceType, Type targetType)
Parameters
source
objectthe object to convert; the source can be null
sourceType
Typethe type of the source that should be used during the conversion. Can be null, and defaults to the type of the source object
targetType
Typethe type we are converting to
Returns
- object
the converted object
Convert(S)
Convert the source object of type S to a target object of type T.
public abstract T Convert(S source)
Parameters
source
Sthe source object to convert; can not be null
Returns
- T
the converted object which must be type T
Matches(Type, Type)
Can the conversion from source type to target type be performed by this converter
public override bool Matches(Type sourceType, Type targetType)
Parameters
sourceType
Typethe type of the source object to convert from
targetType
Typethe type of the target object to conver to
Returns
- bool
true if the conversion can be performed