Guys, I'm really embarrassed to ask for this, but I'm stuck and I can't think of a solution:
I found the IniParser library that I use to parse parameters from a file. However, the default approach is:
FileIniDataParser parser = new FileIniDataParser();
//Parse the ini file
IniData parsedData = parser.LoadFile("TestIniFile.ini");
parsetData['some']['settings'];
In my project, however, I do not want to name the parser everywhere, so I created a class that loads the file at startup, and all I need to do is just access the instance. This is what I want:
namespace my_project
{
public class settings
{
public IniData ini()
{
string login = "Settings.ini";
FileIniDataParser parser = new FileIniDataParser();
IniData settings = parser.LoadFile(login);
return settings;
}
}
}
so that I can access the following settings:
settings.ini['some']['settings'];
Bit, I get an error:
Error 329 'settings.ini ()' is a 'method', but used as a "type"
I know it is probably too noobish, but I'm currently trying to learn C #, and experiments like this teach more than reading a 500-page book.