The following string to string mapping works fine for me:
component x:
_parameters:
__Map:
___map(keymap) = {
____"foo": "bar"
___}
A string to component map also does:
component bar
component x:
_parameters:
__Map:
___map(keymap) = {
____"foo": @bar
___}
Now I'm trying to pass in a custom, non-primitive object:
component x:
_parameters:
__Map:
___map(keymap) = {
____"foo": MyObject()
___}
This fails with:
Castle.MicroKernel.SubSystems.Conversion.ConverterException: No
converter registered to handle the type MyObject.
I've done a little digging, and there are two remarks I have:
1. KeyMapBuilder relies on ConfigurationHelper.SetConfigurationValue,
which converts MyObject to a string, losing any reference to the
actual object. Most probably, there's a really logical explanation for
this scenario, but to me, it seems that the map gets severely limited
by the use of the said SetConfigurationValue.
2. Even if the value was not converted to a string, the
GenericDictionaryConverter might not be able to use the original
value, because it does a PerformConversion. Afaics (but I might be
wrong), this method won't handle the conversion because no converter
exist, while the value would already be of the correct type.
Could it be that I'm trying to push things? I can imagine the
ConfigurationHelper uses string conversions for a reason, but the
inability to use custom objects in the map ... well... it sucks :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---