private void OnComponentRemoving(object sender, ComponentEventArgs e)
{
// If our item collection is being removed
if ((_crumbItem != null) && (e.Component == _crumbItem))
{
// Need access to host in order to delete a component
IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
// We need to remove all items from the child item collection
for (int j = _crumbItem.Items.Count - 1; j >= 0; j--)
{
Component item = _crumbItem.Items[j] as Component;
_crumbItem.Items.Remove(item);
host.DestroyComponent(item);
}
}
}