Just tried to create ArrayList and to populate it with objects, but hit this error:
Cannot create an instance of the static class 'diamondmine.MyObject'
The code so far:
public static class MySettings
{
//some lines
public static ArrayList myObjects { get; set; }
static MySettings()
{
//some lines
myObjects = new ArrayList();
}
}
public static class MyObject
{
public static int a { get; set; }
public static int b { get; set; }
static MyObject()
{
a = 1;
b = 2;
}
}
And this is how I am trying to add a new object:
//some code
MySettings.myObjecs.Add(new MyObject());
//more code
Rly don't have a clue where's the problem, I am doing the things written in MSDN :(