PeanutButter
Loading...
Searching...
No Matches
PeanutButter.DuckTyping.AutoConversion.IConverter< T1, T2 > Interface Template Reference

Implement this interface for two type to provide auto-discovered converters to be used when fuzzy-duck-typing. More...

Inheritance diagram for PeanutButter.DuckTyping.AutoConversion.IConverter< T1, T2 >:
PeanutButter.DuckTyping.AutoConversion.IConverter

Public Member Functions

T1 Convert (T2 input)
 Convert an object of type T2 to T1.
T2 Convert (T1 input)
 Convert an object of type T1 to T2.
Public Member Functions inherited from PeanutButter.DuckTyping.AutoConversion.IConverter
bool CanConvert (Type t1, Type t2)
 Should return true when this converter can convert between t1 and t2.

Additional Inherited Members

Properties inherited from PeanutButter.DuckTyping.AutoConversion.IConverter
bool IsInitialised [get]
 Should return true if the converter can be used later. For converters which rely on reflection, this is a double-check that the required underlying method has been located (which may not be the case in a trimmed executable)

Detailed Description

Implement this interface for two type to provide auto-discovered converters to be used when fuzzy-duck-typing.

Template Parameters
T1Type to convert from or to
T2Type to convert to or from

Member Function Documentation

◆ Convert() [1/2]

T2 PeanutButter.DuckTyping.AutoConversion.IConverter< T1, T2 >.Convert ( T1 input)

Convert an object of type T1 to T2.

Parameters
inputValue to convert
Returns
Converted value, as implemented by the converter

◆ Convert() [2/2]

T1 PeanutButter.DuckTyping.AutoConversion.IConverter< T1, T2 >.Convert ( T2 input)

Convert an object of type T2 to T1.

Parameters
inputValue to convert
Returns
Converted value, as implemented by the converter

The documentation for this interface was generated from the following file:
  • source/Utils/PeanutButter.DuckTyping/AutoConversion/IConverter.cs