I have difficulties figuring out a useful app.config structures for my program.
What I am doing is writing a windows service, which watches several directories on a server for files being uploaded.
My problem is making my program configurable for n folders when in each of those n folders, i need to watch for a different collection of filetypes e.g. folder1: .dwg; folder2: .dwg;.doc;.xls;
then when a new file is uploaded, for example a .dwg file to folder1, then i need to run program1 to convert the dwg to a dwf, and program2 to convert the dwg to a .swf. but that only if filetype is .dwg and folder = folder1
if a .dwg is uploaded for example to folder2, then it needs to be converted to a pdf
The closes i have come to make this configurable in a app.config file is this:
<Folder2 name="C:\inetpub\wwwroot\CAFM\Fotos" filetypes=".dwg;.pdf;">
<action>
<add key="ExecutableAndPath" value="C:\Users\Me\Desktop\verydoc\dwg2vec.exe"/>
<add key="AtCommandBegin" value=""/>
<add key="AtCommandMiddle" value=""/>
<add key="AtCommandEnd" value=""/>
</action>
</Folder2>
</Folders>
</Raumplaner>
<DMS>
<Folders>
<Folder name="C:\inetpub\wwwroot\CAFM\Dokumente" filetypes=".dwg;.pdf;">
<action>
<add key="ExecutableAndPath" value="C:\Users\Me\Desktop\verydoc\dwg2vec.exe"/>
<add key="AtCommandBegin" value=""/>
<add key="AtCommandMiddle" value=""/>
<add key="AtCommandEnd" value=""/>
</action>
</Folder>
</Folders>
</DMS>
</Projects>
enter code here
But that's not quite what I want. I have difficulties bringing this to a usable from in app.config