views:

51

answers:

1

I have code that was previously adding ExtendedProperties to components like

component.ExtendedProperties( new { prop = someObject });

This method is no longer available and the constructor for Property is marked internal.

Is there a new way of doing this for v2.5?

Specifically, I have a custom ComponentActivator that needs some instance information at resolution time from the initial registration. I have been storing this information in the ExtendedProperties then retrieving it in the ComponentActivator constructor using

model.ExtendedProperties["prop"] as MyObjectType;
+1  A: 

This was never changed in .NET version, so I'm assuming you're talking about version for Silverlight.

This method will be back in version 2.5.1, however due to restrictive behavior of Silverlight runtime you will have to make internal types in your assembly visible to Castle.Core.

Alternative way, that works across all versions is this:

component.ExtendedProperties( Property.ForKey("prop").Eq(someObject));
Krzysztof Koźmic
Perfect, thanks. Yes, it's for SL, but I'm using the same Castle dlls for a SL 4 compiled assembly which is used both by my full .NET web application and my SL 4 client application (because of the binary compatibility).
JeffN825