示例#1
0
 public override void DragAndDrop_HoverLeave(Package p)
 {
     if (m_TabDragControl != null)
     {
         RemoveChild(m_TabDragControl, false); // [omeg] need to do that explicitely
         m_TabDragControl.Dispose();
     }
     m_TabDragControl = null;
 }
示例#2
0
        /// <summary>
        /// Detaches specified control from this one.
        /// </summary>
        /// <param name="child">Child to be removed.</param>
        /// <param name="dispose">Determines whether the child should be disposed (added to delayed delete queue).</param>
        public virtual void RemoveChild(ControlBase child, bool dispose)
        {
            if (child == null)
            {
                throw new NullReferenceException("Cannot remove null child");
            }
            Children.Remove(child);// The collection will run events.

            if (dispose)
            {
                var canvas = GetCanvas();
                if (canvas != null)
                {
                    canvas.AddDelayedDelete(child);
                }
                else
                {
                    child.Dispose();
                }
            }
        }