Menu

#49 No means detect if registry settings are initialised.

v1.1.0
open
nobody
Other (7)
5
2009-07-01
2009-07-01
Anonymous
No

There is now way to determine via the IConfigSource if a configuration source has been initialised. In particular, when using RegistryConfigSource there is no way to determine if a call to AddMapping will throw an exception:

RegistryConfigSource ConfigSource = new RegistryConfigSource();
ConfigSource.AddMapping(Registry.CurrentUser, registryKey);

Which throws "System.ArgumentException: The specified key does not exist ". There doesn't seem to be any programmatic way to detect whether the call to AddMapping will fail through the Nini API.

It would be nice to have one of the following options:

1. Calls to RegistryConfigSource.AddMapping automatically create the registry key path if it does not already exist.
2. Add IsInitialised property to IConfigSource interface which will allow users to detect whether or not a IConfigSource needs to be created before it is used.

Discussion


Log in to post a comment.