I have finally migrated
ClassFromConfig project to
SourceForge.net
Now there's version control (Subversion), Issue Tracker, Wiki, Forum and more. So, if you want to contribute to the project -
let me know.
As for the update - it's a minor release, which includes:
- ability to load linked config files (via configSource attribute).
- node collection can now be any tag (not limited to "<add ...", can use "<item ...", etc.) - must be at least 2 in the config to recognise it as a collection.
I've got several enhancements on my to-do list:
Ability to create nested classes for AppSettings keys that contain dots
E.g. if
appSettings has:
<add key="Smtp.Host" value="locahost" />
<add key="Smtp.Port" value="25" />
<add key="Smtp.Sender" value="webmaster@domina.com" />
then the output should be something like
public static class Config {
public static class Smtp {
public string Host;
public int Port;
public string Sender;
}
}
so it can be accessed like Config.Smtp.Host
Add "options file" support
Instead of providing options via command line, add support for an "options file" which configures config class generation options on project by project basis.
E.g:
ClassFromConfig.exe /opt:MyProject\ClassFromConfig.xml
A possible format for the ClassFromConfig.xml:
<cfc.config>
<source
path="App.config">
<output
namespace="WebGear"
class="Config"
file="Config.cs"
safe="true"
recognizeTypes="b,i,d,t,a"
arrayDelimiter="|" >
<customSections
generate="true"
nestedClasses="false"
createFile="true">
<section name="sampleSection" option="include" />
<section name="*" option="exclude" />
</customSections>
</output>
</source>
</cfc.config>
Let me know if you have something to add.