Exemplo n.º 1
0
        /// <summary>
        /// Computes physical edge members for a side that is on the edge of the dock.
        /// </summary>
        private void ComputePhysicalOutwardEdges()
        {
            LayoutContext peer;

            _exteriorPhysicalEdge = new LinkedList <LayoutContext>();
            _interiorPhysicalEdge = new LinkedList <LayoutContext>();

            switch (EdgesDockPosition)
            {
            case System.Windows.Controls.Dock.Bottom:
                peer = LayoutContext.BottomLeftMostChild(LayoutContext);
                break;

            case System.Windows.Controls.Dock.Right:
                peer = LayoutContext.TopRightMostChild(LayoutContext);
                break;

            case System.Windows.Controls.Dock.Left:
            case System.Windows.Controls.Dock.Top:
                peer = LayoutContext.TopLeftMostChild(LayoutContext);
                break;

            default:
                throw new NotImplementedException();
            }

            do
            {
                _interiorPhysicalEdge.AddLast(peer);
                switch (EdgesDockPosition)
                {
                case System.Windows.Controls.Dock.Bottom:
                case System.Windows.Controls.Dock.Right:
                    peer = peer.Edges[LayoutContext.MaximumOrthogonalEdge[EdgesDockPosition]].PhysicalNeighbors.LastOrDefault();
                    break;

                case System.Windows.Controls.Dock.Left:
                case System.Windows.Controls.Dock.Top:
                    peer = peer.Edges[LayoutContext.MaximumOrthogonalEdge[EdgesDockPosition]].PhysicalNeighbors.FirstOrDefault();
                    break;

                default:
                    throw new NotImplementedException();
                }
            } while (peer != null);
        }