/// <summary>
        /// Closes/removes the smart part.
        /// </summary>
        protected virtual void OnClose(Control smartPart)
        {
            // find the group we contained the smartpart within
            NavBarGroup group = composer[smartPart];

            // clean up the group<=>smartpart references
            composer.Remove(group, smartPart);

            if (DesignMode == false)
            {
                // reparent the control
                if (smartPart.Disposing == false && smartPart.IsDisposed == false)
                {
                    smartPart.Parent = null;
                }

                // remove the BavBarGroup
                if (Groups.IndexOf(group) > -1)
                {
                    Groups.Remove(group);
                    group.Dispose();
                }
            }
        }