Provides the required shimming to duck a dictionary object to an interface.
More...
|
| DictionaryShimSham (IDictionary< string, object > toWrap, Type typeToMimic) |
| Constructs an instance of the DictionaryShimSham.
|
| DictionaryShimSham (IDictionary< string, object >[] toWrap, Type typeToMimic) |
| Constructs an instance of the DictionaryShimSham.
|
object | GetPropertyValue (string propertyName) |
| Gets the value of a property by name.
|
void | SetPropertyValue (string propertyName, object newValue) |
| Attempts to set the value of the named property.
|
void | CallThroughVoid (string methodName, params object[] arguments) |
| Required to implement the IShimSham interface, but not implemented for dictionaries as the concept doesn't make sense.
|
object | CallThrough (string methodName, object[] arguments) |
| Required to implement the IShimSham interface, but not implemented for dictionaries as the concept doesn't make sense.
|
|
static object | GetDefaultValueFor (Type correctType) |
| Gets the default value for a type.
|
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.
|
Provides the required shimming to duck a dictionary object to an interface.
◆ DictionaryShimSham() [1/2]
PeanutButter.DuckTyping.Shimming.DictionaryShimSham.DictionaryShimSham |
( |
IDictionary< string, object > | toWrap, |
|
|
Type | typeToMimic ) |
Constructs an instance of the DictionaryShimSham.
- Parameters
-
toWrap | Dictionary to wrap |
typeToMimic | Interface that must be mimicked |
◆ DictionaryShimSham() [2/2]
PeanutButter.DuckTyping.Shimming.DictionaryShimSham.DictionaryShimSham |
( |
IDictionary< string, object >[] | toWrap, |
|
|
Type | typeToMimic ) |
Constructs an instance of the DictionaryShimSham.
- Parameters
-
toWrap | Dictionaries to wrap (wip: only the first is considered) |
typeToMimic | Interface that must be mimicked |
◆ CallThrough()
object PeanutButter.DuckTyping.Shimming.DictionaryShimSham.CallThrough |
( |
string | methodName, |
|
|
object[] | arguments ) |
Required to implement the IShimSham interface, but not implemented for dictionaries as the concept doesn't make sense.
- Parameters
-
methodName | Name of the method to not call through to |
arguments | Parameters to ignore |
- Exceptions
-
NotImplementedException | Exception which is always thrown |
Implements PeanutButter.DuckTyping.Shimming.IShimSham.
◆ CallThroughVoid()
void PeanutButter.DuckTyping.Shimming.DictionaryShimSham.CallThroughVoid |
( |
string | methodName, |
|
|
params object[] | arguments ) |
Required to implement the IShimSham interface, but not implemented for dictionaries as the concept doesn't make sense.
- Parameters
-
methodName | Name of the method to not call through to |
arguments | Parameters to ignore |
- Exceptions
-
NotImplementedException | Exception which is always thrown |
Implements PeanutButter.DuckTyping.Shimming.IShimSham.
◆ GetPropertyValue()
object PeanutButter.DuckTyping.Shimming.DictionaryShimSham.GetPropertyValue |
( |
string | propertyName | ) |
|
Gets the value of a property by name.
- Parameters
-
propertyName | Name of the property to get the value of |
- Returns
- The value of the property, where possible. May return the default value for the property type when it is not found and may attempt automatic conversion when the type to represent does not match the underlying type
Implements PeanutButter.DuckTyping.Shimming.IShimSham.
◆ SetPropertyValue()
void PeanutButter.DuckTyping.Shimming.DictionaryShimSham.SetPropertyValue |
( |
string | propertyName, |
|
|
object | newValue ) |
Attempts to set the value of the named property.
- Parameters
-
propertyName | Name of the property to set |
newValue | Value to set. The value may be converted to match the underlying type when required. |
Implements PeanutButter.DuckTyping.Shimming.IShimSham.
The documentation for this class was generated from the following file:
- source/Utils/PeanutButter.DuckTyping/Shimming/DictionaryShimSham.cs