I try to make this program as easy as possible.

So, there is only one class in library - BinConfig.
It writes all configuration keys to small binary file.
The name of this file you can specify in BinConfig constructor.

To create config, just follow this way:
BinConfig config = new BinConfig();
config.AutoSave = false;
config["UseMenu"] = "true";
config.Add("FirstRun", "false");
config["LastPage"] = "20";
config.Save();

AutoSave is true by default. It means, that after each operation with config it will update without any command. If it's false you should manually run Save() function.

To read from config, you should do the next:
BinConfig config = new BinConfig();
if(config.Load())
{
string lastPage = config["LastPage"];
string useMenu = config.TryGetValue("UseMenu");
}

Visual Editor allows us to create/edit/delete configuration keys from config file, which has been created with library or this editor.

Last edited Apr 21, 2011 at 6:46 PM by bkslim, version 2

Comments

No comments yet.