SetupChildDock() protected method

Initializes an inner docked control for the specified position.
protected SetupChildDock ( Pos pos ) : void
pos Pos Dock position.
return void
Exemplo n.º 1
0
        /// <summary>
        /// Gets an inner docked control for the specified position.
        /// </summary>
        /// <param name="pos"></param>
        /// <returns></returns>
        protected virtual DockBase GetChildDock(Pos pos)
        {
            // todo: verify
            DockBase dock = null;

            switch (pos)
            {
            case Pos.Left:
                if (m_Left == null)
                {
                    m_Left = new DockBase(this);
                    m_Left.SetupChildDock(pos);
                }
                dock = m_Left;
                break;

            case Pos.Right:
                if (m_Right == null)
                {
                    m_Right = new DockBase(this);
                    m_Right.SetupChildDock(pos);
                }
                dock = m_Right;
                break;

            case Pos.Top:
                if (m_Top == null)
                {
                    m_Top = new DockBase(this);
                    m_Top.SetupChildDock(pos);
                }
                dock = m_Top;
                break;

            case Pos.Bottom:
                if (m_Bottom == null)
                {
                    m_Bottom = new DockBase(this);
                    m_Bottom.SetupChildDock(pos);
                }
                dock = m_Bottom;
                break;
            }

            if (dock != null)
            {
                dock.IsHidden = false;
            }

            return(dock);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets an inner docked control for the specified position.
        /// </summary>
        /// <param name="pos"></param>
        /// <returns></returns>
        protected virtual DockBase GetChildDock(Pos pos)
        {
            // todo: verify
            DockBase dock = null;
            switch (pos)
            {
                case Pos.Left:
                    if (m_Left == null)
                    {
                        m_Left = new DockBase(this);
                        m_Left.SetupChildDock(pos);
                    }
                    dock = m_Left;
                    break;

                case Pos.Right:
                    if (m_Right == null)
                    {
                        m_Right = new DockBase(this);
                        m_Right.SetupChildDock(pos);
                    }
                    dock = m_Right;
                    break;

                case Pos.Top:
                    if (m_Top == null)
                    {
                        m_Top = new DockBase(this);
                        m_Top.SetupChildDock(pos);
                    }
                    dock = m_Top;
                    break;

                case Pos.Bottom:
                    if (m_Bottom == null)
                    {
                        m_Bottom = new DockBase(this);
                        m_Bottom.SetupChildDock(pos);
                    }
                    dock = m_Bottom;
                    break;
            }

            if (dock != null)
                dock.IsHidden = false;

            return dock;
        }