Im pretty questioning my self about config system, do we go Specific aproch that run very good on this project and had some rock and roll to it. or do we create a generic config system.
So as you know Forcemagic, i was working on another project and i needed a config system too, i was about to try your system, but i found it was very much design to work only with DLFSS, with some modification i can be able to manage, but since i wan to answer to the first question, i created a generic config system.
I call it "4dot" config.
Here is the config File with explanation how to use.
odbc2mysql.cfg.txt
And here is the source code of the config reader, class implementation are not that good or bad... i don't know.... im still learning how is best with c#.
config_reader.cs.txt
And here is a bit of code showing how i use it.
public static class TransferInterface
{
private static List<Table> ...
private static void Initialize()
{
List<string> odbcFormat = ConfigReader.GetIdentifierList("ODBC","TableFormat");
List<string> mysqlQuery = ConfigReader.GetIdentifierList("MySQL", "TableInsertQuery");
List<string>.Enumerator itr_f = odbcFormat.GetEnumerator();
List<string>.Enumerator itr_i = odbcFormat.GetEnumerator();
while (itr_f.MoveNext() && itr_i.MoveNext())
{
tableList.Add(new Table
(
itr_f.Current,
ConfigReader.GetStringValue("ODBC", "TableFormat", itr_f.Current),
ConfigReader.GetStringValue("MySQL", "TableInsertQuery", itr_i.Current)
));
...
This example show how i call to Custom Config Identifier... So i ask for the list first and then iterate it. Into the example i do 2 into the same time.
I will wait you see my code, before doing any action to the SVN... i think we must discuct that into private will be best!
P.S. The Regex into the configReader can be much better, allready got another one.
![](/static/smilies/smile.gif)
Ho! and Don't bother to try password "dexxa" on mysql server
![](/static/smilies/wink.gif)