Exemple #1
0
        /// <summary>
        /// Gets the child leaf window found at given screen location
        /// </summary>
        /// <param name="screenPoint">point in screen coordinates</param>
        /// <param name="ignored">control to be ignored from search</param>
        /// <returns>found dockable container</returns>
        public DockingContainer GetLeafDockedContainerFromPoint(Point screenPoint, Control ignored)
        {
            for (int childIndex = 0; childIndex < ControlsCount; childIndex++)
            {
                Control child = GetControlAt(childIndex);

                if (child == ignored)
                {
                    continue;
                }

                if (child.Visible == false)
                {
                    continue;
                }

                DockingContainer container = child as DockingContainer;
                if (container == null)
                {
                    continue;
                }

                if (container.RectangleToScreen(container.ClientRectangle).Contains(screenPoint) == false)
                {
                    continue;
                }

                if (container.SingleChild != null)
                {
                    if (container.SingleChild.IsDocked == false)
                    {
                        continue;
                    }

                    return(container);
                }

                return(GetLeafDockedContainerFromPoint(container, screenPoint));
            }

            return(null);
        }