Dear Viorel,
Please see here:
public struct aMyStruct: IDisposable
{
int a;
public void Dispose()
{
//
}
public int this[int i]
{
get
{
return a + i;
}
set
{
a = value - i;
}
}
}
private void button1_Click(object sender, EventArgs e)
{
using aMyStruct anObj = new aMyStruct();
anObj[1] = 2; //Cannot modify members of 'anObj' because it is a 'using variable'
}
And it is not only about indexed property, but all members actually. Even cannot read/write an int field.
Atmapuri