471,350 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

Enterprise Library Configuration: ConfigurationChanged event subscription

Version: Microsoft Enterprise Library June 2005

I use the ConfigurationManager's static CreateContext methods to create
my own ConfigurationContext, passing in the required values in the
ConfigurationDictionary parameter.

I want to subscribe to ConfigurationChanged events on that newly
created ConfigurationContext.

Taking a closer look how CreateContext works, it's a simple passthrough
to the ConfigurationContext's contructor. That constructor creates a
new DisposingWrapper (ConfigurationContext.cs Line 76) but does not
bind the wrapper's ConfigurationBuilder's ConfigurationChanged events
to the ConfigurationContext's eventhandlers like it does for the
internal constructor with an IDisposableWrapper parameter
(ConfigurationContext.cs Lines 47 - 48).

Any reason why this was left out in the construction with the
ConfigurationDictionary param?

in short, i'd like to change:
[ConfigurationContext.cs Line 76]
public ConfigurationContext(ConfigurationDictionary dictionary)
{
this.disposableWrapper = new DisposingWrapper(new
ConfigurationBuilder(dictionary));
}

--- TO ---

public ConfigurationContext(ConfigurationDictionary dictionary)
{
this.disposableWrapper = new DisposingWrapper(new
ConfigurationBuilder(dictionary));
this.disposableWrapper.ConfigurationBuilder.Config urationChanged +=
new
ConfigurationChangedEventHandler(OnConfigurationBu ilderConfigurationChanged);
this.disposableWrapper.ConfigurationBuilder.Config urationChanging
+= new
ConfigurationChangingEventHandler(OnConfigurationB uilderConfigurationChanging);
}
any advise would be greatly appreciated

Dec 13 '05 #1
0 833

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by veera sekhar kota | last post: by
6 posts views Thread by Jonathan Crawford | last post: by
3 posts views Thread by bungle | last post: by
reply views Thread by =?Utf-8?B?UG9sbHkgQW5uYQ==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.