variable reference in array... strings?
Hi,
I am trying to access a variable I have stored in ListArray. If I use classes, like this:
Code:
MyClass mc = new MyClass();
MyListArray.Add("mc",mc);
mc.MyValue = 4;
everything works, and ((MyClass)MyListArray["mc"]).MyValue is 4.
However, if I store string (or eg. TimeSpan) like this, (object MyString = "") I can not modify it without creating new copy... and MyString contains something else than (string)MyArray["MyString"]
How to access my string variable by name?
Do I have to create my own class for every variable I cannot modify without creating copy?