Exposing IConfigurationSource via App Block Facades

Topics: General discussion
Oct 21, 2008 at 2:30 PM
Edited Oct 21, 2008 at 2:32 PM

I use several of the Enterprise Library application blocks and have found them all to be tremendously useful. However, I can't use the facades for these application blocks, because I can't access the underlying IConfigurationSource if I do. I want to wire up a section handler to perform certain operations whenever configuration sections are changed, but the facades don't allow me to access the IConfigurationSource instance. Instead, I study the source code in each facade and effectively copy this into my own application (I suppose I could use reflection, but that seems needlessly complex). Since each facade uses a factory and IConfigurationSource internally, I use the same pattern in my application so that I can access the IConfigurationSource. It would be great if I could use the facades but still access the IConfigurationSource that the facade is using internally. Is there any chance of this happening in a future release (maybe even release 4.1, fingers crossed)? Thanks very much,

- Daniel
Oct 24, 2008 at 2:14 PM
Oct 24, 2008 at 4:03 PM
Hi Daniel,

Facades use the default configuration source, so you could access ConfigurationSourceFactory.Create() and register your event handlers there; even though it's a different instance, you'd get the same notifications.

Hope this helps,