I'm a bit new to C# (coming from PHP) and I was a bit shocked that, by looping through a list I can't pass a reference to that varialbe, i.e. the following code is not valid:

```
foreach (ref string var in arr) {
    var = "new value";
}

```

I researched a bit and [I found a suggestion to create a "updatable enumerator"](https://stackoverflow.com/questions/1078103/c-reference-to-loop-variable/1078159#1078159) but I can't figure out how exactly I should do that. I followed an example and tried to add a setter for the Current for both the IEnumerator.Current method and my custom enumerator (PeopleEnum.Current), but, to be honest, that was blind guessing and didn't work. I'm pasting the whole code at pastebin, as it's quite long to paste here - [custom enumerator attempt](http://pastebin.com/3s9qYipN). In this code, trying to access the current element by 

```
badClass baddie = new badClass(ref tmp.Current);

```

results in an expected error that "A property or indexer may not be passed as an out or ref parameter"

What I'm aiming to do in the end is something like this - iterate through a list of objects, generate a button for each of them and add an onclick event for that button which will open a new form, passing the reference for that object, so that its contents can be edited in that new form. I did all this, but passing the object as a reference, instead of read-only data, is killing me. I would appreciate any answers, links where I can read about updatable enumerators or ideas.