GConfCompile creates a .cs (csharp) file from a GConf schema.
There are some GConf keys:
First, you have to create the .cs file:
$ gconfcompile.exe /usr/share/gconf/schemas/gataxx.schemas Gataxx > GataxConfig.cs
- this creates the class `GataxxConfigGConf' and the interface `IGataxxConfig'
(and the class `GataxxConfigXmlFile', but this is not important at the moment).
In your Application you create the configuration class,...
IGataxxConfig cfg = new GataxxConfigGConf();
...access the configuration options...
cfg.Quickmoves = true; Console.WriteLine( cfg.Tileset ); cfg.Whitelevel = cfg.Blacklevel;
...and don't care about GConf.
There is a more suffisticated way to create the config class:
#if GCONF IGataxxConfig cfg = new GataxxConfigGConf(); #elif XML_FILE IGataxxConfig cfg = GataxxConfigXmlFile.Load( "/home/user/.gataxx.xml" ); #else #error define `GCONF' or `XML_FILE' eg. `-define:GCONF' #endif
Now it is possible to choose the configuration backend at compile time. The generated sourcefile
(`GataxConfig.cs') uses the same define options and you compile just the class you need.
The GConf keys and the C# properties differ:
`/' is used (`/apps/gataxx/whitelevel' -> `whitelevel')Why? I wanted the properties to feel lile C#, not like C
this software is released under the terms of the Lesser Gnu Public License. YOU USE THIS SOFTWARE ON YOUR OWN RISK.