Hi
I have a PropertyGrid that loads one of my objects. The Object has a
TypeConverter that I build to display a list of values. If the grid
closes I would like to do some cleanup.
In the constructor of the TypeConverter I registered an event so that
the TypeConverter is notified when the list data has changed.
In the destructor I would like to deregister the event.
How do I get it to call my Dispose method?
Thanks
Gert
Jay - 10 Nov 2004 05:27 GMT
Are u creating a instance of TypeConvertor...
Jay
> Hi
>
[quoted text clipped - 11 lines]
> Thanks
> Gert
Ulrich Sprick - 13 Dec 2004 18:16 GMT
Hi Gert,
you show a component in the property grid. Your component should override
the Dispose( bool disposing ) method. This method is called when the
container (component, form, designer) is shutdown. Here is the logic:
hth,
ulrich
- - - -
public class MyDerivedComponent : MyBaseComponent
{
...
protected override void Dispose( bool disposing )
{
if ( disposing )
{
// call Dispose() on all contained objects
// that implement IDisposable
}
base.Dispose(disposing);
// free unmanaged ressources
}
}
> Hi
>
[quoted text clipped - 11 lines]
> Thanks
> Gert