Nini Library API Reference -

IConfigSource.ExpandKeyValues Method 

Expands all key values.

void ExpandKeyValues();


Calling this method expands all key values with the values of other keys. See the example below for more information.


In many cases you will find that your key values are dependent on the values of other keys. For instance you have a root path configuration value and several values for files that use this path like in this example:

[File Path]
RootPath = C:\Program Files\My Program
Logging = MyApp.log
WebPage = index.html
Without Nini if you wanted to combine the value of "RootPath" with "Logging" and "WebPage" then you would have to perform ugly string concatenations to get "C:\Program Files\My Program\index.html". In Nini you do not need to do this:
[File Path]
RootPath = C:\Program Files\My Program
Logging = ${RootPath}\MyApp.log
WebPage = ${RootPath}\index.html
This can save you a lot of trouble concatenating them yourself and make your code a lot cleaner. If you want to grab a value from a different section you can do the same above but add the section name followed by a bar ("|") like so: ${section|key}.

See Also

IConfigSource Interface | Nini.Config Namespace