Guys i'm really embaraced to ask for this, but i got stuck and i can't think for solution:
I found an IniParser library that i use for parsing settings from file. However the default approach is this:
FileIniDataParser parser = new FileIniDataParser();
//Parse the ini file
IniData parsedData = parser.LoadFile("TestIniFile.ini");
parsetData['some']['settings'];
In my project though, i don't want to call everywhere the parser, so i made a class that load up the file at start-up and all i have 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();
// Parse the ini file with the settings
IniData settings = parser.LoadFile(login);
//*strptr = settings;
return settings;
}
}
}
so i could access the settings like this:
settings.ini['some']['settings'];
Bit i get an error:
Error 329 'settings.ini()' is a 'method' but is used like a 'type'
I know its probably too noobish, but im currently trying to learn C# and experiments like this teach more than reading a 500 page book.