PeanutButter
Loading...
Searching...
No Matches
PeanutButter.DuckTyping.Shimming.ShimShamBase Class Referenceabstract

Base class for common shim functionality. More...

Inheritance diagram for PeanutButter.DuckTyping.Shimming.ShimShamBase:
PeanutButter.DuckTyping.Shimming.DictionaryShimSham PeanutButter.DuckTyping.Shimming.ShimSham

Static Public Member Functions

static object GetDefaultValueFor (Type correctType)
 Gets the default value for a type.

Protected Member Functions

object ConvertWith (IConverter converter, object propValue, Type toType)
 Converts a property value from original type to another type using the provided converter.
Type MakeTypeToImplement (Type type, bool isFuzzy)
 Creates a new type to implement the requested interface type Used internally when fleshing out non-primitive properties.

Detailed Description

Base class for common shim functionality.

Member Function Documentation

◆ ConvertWith()

object PeanutButter.DuckTyping.Shimming.ShimShamBase.ConvertWith ( IConverter converter,
object propValue,
Type toType )
protected

Converts a property value from original type to another type using the provided converter.

Parameters
converterConverts the value
propValueValue to convert
toTypeRequired output type
Returns
Value converted to required output type, where possible

◆ GetDefaultValueFor()

object PeanutButter.DuckTyping.Shimming.ShimShamBase.GetDefaultValueFor ( Type correctType)
static

Gets the default value for a type.

Parameters
correctTypeType to find the default value for
Returns
The value that would be returned by default(T) for that type

◆ MakeTypeToImplement()

Type PeanutButter.DuckTyping.Shimming.ShimShamBase.MakeTypeToImplement ( Type type,
bool isFuzzy )
protected

Creates a new type to implement the requested interface type Used internally when fleshing out non-primitive properties.

Parameters
typeType to implement
isFuzzyFlag to allow (or not) approximate / fuzzy ducking
Returns
Type implementing requested interface

The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.DuckTyping/Shimming/ShimShamBase.cs