One of the things that suck in C# as compared to C++ is that you always have to create a new structure when you want to update a value property:
l.Bounds.X += 10; // this doesn't work as l.Bounds (property) returns a value type
What would be interesting to have:
class Item
{ Rectangle bounds;
public ref Rectangle GetBounds()
{ return bounds; // OK
}
public ref Rectangle GetBounds2()
{ Rectangle r = bounds;
return r; // illegal
}
// or
public virtual Rectangle Bounds
{
get ref { return bounds; }
set { bounds = value; }
}
}