Accessing objects by recursive search
As a delphi programmer I got charmed by the fact that you can find objects using a recursive search for memory objects in two ways :
-using the control tree in the GUI - this stays working in dotnet
-using the memory ownership tree - in delphi you'd be talking about the Components tree - this appears not to stay working in dotnet.
In delphi this feature did allow me to flag controls by simply making them owner of an object. I'd create objects - say by the classname 'MyFlag', and let them be owned by controls that I want to find later.
I'd search the ownership tree for objects of type 'MyFlag', take their owner and was able to manipulate the control as needed.
In dotnet it appears to me that you can define a datamember inside an (control-)object and use the new operator to initialize it. This appears to me as to be the only way that you can avoid automatic cleanup by the dotnet memory manager.
Is there a way I can select all (control-)objects for which such a datamember has been initialized ?
Thank you for your attention - I hope such can be realized in a way I did not see.
The context in which this would be used is described next :
-in the context of insurance prime calculation panels calculation results must be hidden when retyping occurs. Flagging the calculated controls is a comfortable way to hide them groupwise and to make them reappear when necessary.
-We'd create 'Condition objects' to be processed by some processor that would decide by the contents of the 'Condition objects' and data conditions if a control should be visible or hidden.
|