public override void Initialize(IComponent component)
{
Debug.Assert(component != null);
// Validate the parameter reference
if (component == null) throw new ArgumentNullException("component");
// Let base class do standard stuff
base.Initialize(component);
// Cast to correct type
_headerGroup = component as KryptonHeaderGroup;
if (_headerGroup != null)
{
// Hook into header event
_headerGroup.GetViewManager().MouseUpProcessed += new MouseEventHandler(OnHeaderGroupMouseUp);
_headerGroup.GetViewManager().DoubleClickProcessed += new PointHandler(OnHeaderGroupDoubleClick);
}
// The resizing handles around the control need to change depending on the
// value of the AutoSize and AutoSizeMode properties. When in AutoSize you
// do not get the resizing handles, otherwise you do.
AutoResizeHandles = true;
// Acquire service interfaces
_designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
_changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
_selectionService = (ISelectionService)GetService(typeof(ISelectionService));
// We need to know when we are being removed
_changeService.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving);
// Let the internal panel in the container be designable
if (_headerGroup != null)
EnableDesignMode(_headerGroup.Panel, "Panel");
}