protected override void Dispose(bool disposing)
{
if (disposing)
{
// Must unhook from the palette paint event
if (_palette != null)
{
_palette.PalettePaint -= new EventHandler<PaletteLayoutEventArgs>(OnPaletteNeedPaint);
_palette.BasePaletteChanged -= new EventHandler(OnBaseChanged);
_palette.BaseRendererChanged -= new EventHandler(OnBaseChanged);
}
UnattachGlobalEvents();
_palette = null;
_localPalette = null;
_redirector.Target = null;
_renderer = null;
}
base.Dispose(disposing);
}