C# using indexers
<p>I have a class something like this (This is a subset of the code)</p>

<pre><code>public struct overlay
{
    [FieldOffset(0)]
    public Byte[] b;
    [FieldOffset(0)]
    public Int32[] i;
}



 class MyClass
    {
    private overlay data;    \\Initialised using data.b=new Byte[4096]

    public Int32 site0 { set { data.i[0] = value; } get { return data.i[0]; } }
    public Int32 site1 { set { data.i[1] = value; } get { return data.i[1]; } }
    public String s
    {
        get { return System.Text.Encoding.ASCII.GetString(data.b, 8, 16).TrimEnd(' '); }
        set { System.Text.Encoding.ASCII.GetBytes(value.PadRight(16)).CopyTo(data.b, 8); }
    }
    public Int32 site2 { set { data.i[5] = value; } get { return data.i[5]; } }

    }
</code></pre>

<p>I currently access the site variables like this...</p>

<pre><code>MyClass m=new MyClass();
m.site0=1;
m.site1=1;
m.site2=1;
</code></pre>

<p>I would like to access them like this..</p>

<pre><code>MyClass m=new MyClass();
for (Int32 i=0; i&lt;m.sites.Count; ++i)
    m.sites[i]=1;
</code></pre>

<p>Can anyone suggest how I would do that?</p>
