Understand cicular referencing properties!
- From: "Özden Irmak" <ozdenirmak(at)isnet.net.tr>
- Date: Sun, 31 Dec 2006 02:25:43 +0200
Hello,
In my task, I'm scanning all properties of an object and picking up to show
their names in a treeview if it fits some criterias I defined. When
scanning, I've a problem which causes stack overflow error...
This happens when a class does have a circular reference...The best sample
for this can be the treenode class. This class has a refence to it's parent
node also to the treeview control itself. When scanning treenode class,
because of this circular reference, I keep getting back to treeview control
and start scannig all of it's properties which happens infinite times and at
last getting a stack overflow error. The WindowsForms serializer somehow
understands these kind of circular references and instead of trying to
serialize that property, it just sets a reference to the original class.
I'm trying to detect the same sitution and stop going through these circular
referenced properties. Is there any method in .Net to let me understand this
or any method anybody knows?
Thanks in advance...
Regards,
Özden
.
- Follow-Ups:
- Re: Understand cicular referencing properties!
- From: Mario Vázquez
- Re: Understand cicular referencing properties!
- Prev by Date: Accessing designer propertyGrid
- Next by Date: Re: Understand cicular referencing properties!
- Previous by thread: Accessing designer propertyGrid
- Next by thread: Re: Understand cicular referencing properties!
- Index(es):