J
Jure Bogataj
Hello!
This may be a silly question, but anyway:
If I have collection / list of objects:
public class MyCollection : List<MyObject>
{
}
public class MyObject
{
...
}
And then somewhere in the code I add object to the collection:
....
MyCollection col = new MyCollection()
MyObject obj = new MyObject()
col.Add(obj);
Is it possible now to determine which is obj's parent collection (sth like:
obj.?ParentCollection?) or must I manually track parent collections (e.g.
new MyObject(col) or sth like that). I know object can participate in more
than one collection at the same time (or not) so this may not be possible at
all?
Thanks in advance!
Best regards,
Jure
This may be a silly question, but anyway:
If I have collection / list of objects:
public class MyCollection : List<MyObject>
{
}
public class MyObject
{
...
}
And then somewhere in the code I add object to the collection:
....
MyCollection col = new MyCollection()
MyObject obj = new MyObject()
col.Add(obj);
Is it possible now to determine which is obj's parent collection (sth like:
obj.?ParentCollection?) or must I manually track parent collections (e.g.
new MyObject(col) or sth like that). I know object can participate in more
than one collection at the same time (or not) so this may not be possible at
all?
Thanks in advance!
Best regards,
Jure