protected override void Dispose(bool disposing)
{
try
{
if (disposing)
{
// Get access to the component change service
IComponentChangeService service = (IComponentChangeService)GetService(typeof(IComponentChangeService));
// Must unhook our event from the service so we can be garbage collected
if (service != null)
service.ComponentChanged -= new ComponentChangedEventHandler(OnComponentChanged);
}
}
finally
{
// Ensure base class is always disposed
base.Dispose(disposing);
}
}