Provides duck-typing around NameValueCollections.
More...
|
static T | DuckAs< T > (this NameValueCollection src) |
| Ducks a NameValueCollection onto an interface.
|
static T | DuckAs< T > (this NameValueCollection src, bool throwOnError) |
| Ducks a NameValueCollection onto an interface.
|
static T | FuzzyDuckAs< T > (this NameValueCollection src) |
| Fuzzy-Ducks a NameValueCollection onto an interface, not caring about case or whitespace in property names.
|
static T | FuzzyDuckAs< T > (this NameValueCollection src, bool throwOnError) |
| Fuzzy-Ducks a NameValueCollection onto an interface, not caring about case or whitespace in property names.
|
static T | ForceDuckAs< T > (this NameValueCollection src) |
| Forces ducking onto the NameValueCollection. Missing properties return default values when queried and can be set with new values.
|
static T | ForceFuzzyDuckAs< T > (this NameValueCollection src) |
| Forces fuzzy ducking onto the NameValueCollection. Missing properties return default values when queried and can be set with new values.
|
static T | DuckAs< T > (this NameValueCollection src, TransformFunc toNativeTransform, TransformFunc fromNativeTransform) |
| Performs ducking with property name redirection.
|
static T | DuckAs< T > (this NameValueCollection src, TransformFunc toNativeTransform, TransformFunc fromNativeTransform, bool throwOnError) |
| Performs ducking with property name redirection.
|
static T | FuzzyDuckAs< T > (this NameValueCollection src, TransformFunc toNativeTransform, TransformFunc fromNativeTransform) |
| Performs fuzzy ducking with property name redirection.
|
static T | FuzzyDuckAs< T > (this NameValueCollection src, TransformFunc toNativeTransform, TransformFunc fromNativeTransform, bool throwOnError) |
| Performs fuzzy ducking with property name redirection.
|
Provides duck-typing around NameValueCollections.
◆ DuckAs< T >() [1/4]
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.DuckAs< T > |
( |
this NameValueCollection | src | ) |
|
|
static |
Ducks a NameValueCollection onto an interface.
- Parameters
-
src | NameValueCollection to operate on |
- Template Parameters
-
T | Interface you wish to work through |
- Returns
- New instance of an object implementing the required interface, if possible; otherwise null
◆ DuckAs< T >() [2/4]
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.DuckAs< T > |
( |
this NameValueCollection | src, |
|
|
bool | throwOnError ) |
|
static |
Ducks a NameValueCollection onto an interface.
- Parameters
-
src | NameValueCollection to operate on |
throwOnError | Flag: throw an exception instead of just returning null |
- Template Parameters
-
T | Interface you wish to work through |
- Returns
- New instance of an object implementing the required interface
◆ DuckAs< T >() [3/4]
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.DuckAs< T > |
( |
this NameValueCollection | src, |
|
|
TransformFunc | toNativeTransform, |
|
|
TransformFunc | fromNativeTransform ) |
|
static |
Performs ducking with property name redirection.
- Parameters
-
src | Dictionary to duck |
toNativeTransform | Func to transform from keys corresponding to T's interface properties to keys that are found in src |
fromNativeTransform | Reverse of toNativeTransform |
- Template Parameters
-
T | Interface to duck this dictionary as |
- Returns
- New instance of an object implementing T, passing through to the dictionary, or null if unable to duck
◆ DuckAs< T >() [4/4]
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.DuckAs< T > |
( |
this NameValueCollection | src, |
|
|
TransformFunc | toNativeTransform, |
|
|
TransformFunc | fromNativeTransform, |
|
|
bool | throwOnError ) |
|
static |
Performs ducking with property name redirection.
- Parameters
-
src | Dictionary to duck |
toNativeTransform | Func to transform from keys corresponding to T's interface properties to keys that are found in src |
fromNativeTransform | Reverse of toNativeTransform |
throwOnError | Flag to throw exception on error instead of just silent failure |
- Template Parameters
-
T | Interface to duck this dictionary as |
- Returns
- New instance of an object implementing T, passing through to the dictionary, or null if unable to duck
◆ ForceDuckAs< T >()
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.ForceDuckAs< T > |
( |
this NameValueCollection | src | ) |
|
|
static |
Forces ducking onto the NameValueCollection. Missing properties return default values when queried and can be set with new values.
- Parameters
-
src | NameValueCollection to operate on |
- Template Parameters
-
- Returns
- New instance of an object implementing the required interface, if possible
◆ ForceFuzzyDuckAs< T >()
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.ForceFuzzyDuckAs< T > |
( |
this NameValueCollection | src | ) |
|
|
static |
Forces fuzzy ducking onto the NameValueCollection. Missing properties return default values when queried and can be set with new values.
- Parameters
-
src | NameValueCollection to operate on |
- Template Parameters
-
- Returns
- New instance of an object implementing the required interface, if possible
◆ FuzzyDuckAs< T >() [1/4]
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.FuzzyDuckAs< T > |
( |
this NameValueCollection | src | ) |
|
|
static |
Fuzzy-Ducks a NameValueCollection onto an interface, not caring about case or whitespace in property names.
- Parameters
-
src | NameValueCollection to operate on |
- Template Parameters
-
T | Interface you wish to work through |
- Returns
- New instance of an object implementing the required interface, if possible; otherwise null
◆ FuzzyDuckAs< T >() [2/4]
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.FuzzyDuckAs< T > |
( |
this NameValueCollection | src, |
|
|
bool | throwOnError ) |
|
static |
Fuzzy-Ducks a NameValueCollection onto an interface, not caring about case or whitespace in property names.
- Parameters
-
src | NameValueCollection to operate on |
throwOnError | Flag: throw an exception if cannot duck instead of just returning null |
- Template Parameters
-
T | Interface you wish to work through |
- Returns
- New instance of an object implementing the required interface, if possible
◆ FuzzyDuckAs< T >() [3/4]
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.FuzzyDuckAs< T > |
( |
this NameValueCollection | src, |
|
|
TransformFunc | toNativeTransform, |
|
|
TransformFunc | fromNativeTransform ) |
|
static |
Performs fuzzy ducking with property name redirection.
- Parameters
-
src | Dictionary to duck |
toNativeTransform | Func to transform from keys corresponding to T's interface properties to keys that are found in src |
fromNativeTransform | Reverse of toNativeTransform |
- Template Parameters
-
T | Interface to duck this dictionary as |
- Returns
- New instance of an object implementing T, passing through to the dictionary, or null if unable to duck
◆ FuzzyDuckAs< T >() [4/4]
T PeanutButter.DuckTyping.Extensions.DuckTypingNameValueCollectionExtensions.FuzzyDuckAs< T > |
( |
this NameValueCollection | src, |
|
|
TransformFunc | toNativeTransform, |
|
|
TransformFunc | fromNativeTransform, |
|
|
bool | throwOnError ) |
|
static |
Performs fuzzy ducking with property name redirection.
- Parameters
-
src | Dictionary to duck |
toNativeTransform | Func to transform from keys corresponding to T's interface properties to keys that are found in src |
fromNativeTransform | Reverse of toNativeTransform |
throwOnError | Flag to throw exception on error instead of just silent failure |
- Template Parameters
-
T | Interface to duck this dictionary as |
- Returns
- New instance of an object implementing T, passing through to the dictionary, or null if unable to duck
The documentation for this class was generated from the following file:
- source/Utils/PeanutButter.DuckTyping/Extensions/DuckTypingNameValueCollectionExtensions.cs