J
Joe
This my seems stupid because it should be very obvious but I'm going to ask
anyway...
I have a class MyCollection which inherits from CollectionBase and another
class MyObject which is stored in MyCollection and yet another class
MyOtherObject which references MyObject from MyCollection like this:
MyCollection.Add(new MyObject("somename") );
MyOtherObject.myObject = MyCollection["somename"];
The problem I get is the instance that MyOtherObject.myObject seems to be a
copy of the original object from the collection and not a reference to it. I
noticed this because I changed a member of the object from the collection
but the MyOtherObject.myObject doesn't reflect the changes.
I thought that .NET typically passes objects by reference.
Maybe I'm working too much and just drawing blanks...
Thanks,
Joe
anyway...
I have a class MyCollection which inherits from CollectionBase and another
class MyObject which is stored in MyCollection and yet another class
MyOtherObject which references MyObject from MyCollection like this:
MyCollection.Add(new MyObject("somename") );
MyOtherObject.myObject = MyCollection["somename"];
The problem I get is the instance that MyOtherObject.myObject seems to be a
copy of the original object from the collection and not a reference to it. I
noticed this because I changed a member of the object from the collection
but the MyOtherObject.myObject doesn't reflect the changes.
I thought that .NET typically passes objects by reference.
Maybe I'm working too much and just drawing blanks...
Thanks,
Joe