/// <summary>
        /// Add a child to a specific place with a specific alignment to the
        /// container. This method will create subcontainers as needed to get
        /// the layout desired.
        /// </summary>
        /// <param name="child">The child to add.</param>
        /// <param name="previous">The window to add the child relative to.</param>
        /// <param name="alignment">The alignment of child to previous.</param>
        public override void addChild(MDIWindow child, MDIWindow previous, WindowAlignment alignment)
        {
            switch (alignment)
            {
            case WindowAlignment.Left:
                if (previous._ParentContainer.Layout == MDILayoutContainer.LayoutType.Horizontal)
                {
                    //The child can simply be appended.
                    previous._ParentContainer.insertChild(child, previous, false);
                }
                else
                {
                    //The child needs a new subcontainer created.
                    MDILayoutContainer    newContainer    = new MDILayoutContainerScale(MDILayoutContainer.LayoutType.Horizontal, Padding, CurrentDockLocation);
                    MDIChildContainerBase parentContainer = previous._ParentContainer;
                    parentContainer.swapAndRemove(newContainer, previous);
                    newContainer.addChild(child);
                    newContainer.addChild(previous);
                }
                break;

            case WindowAlignment.Right:
                if (previous._ParentContainer.Layout == MDILayoutContainer.LayoutType.Horizontal)
                {
                    //The child can simply be appended.
                    previous._ParentContainer.insertChild(child, previous, true);
                }
                else
                {
                    //The child needs a new subcontainer created.
                    MDILayoutContainer    newContainer    = new MDILayoutContainerScale(MDILayoutContainer.LayoutType.Horizontal, Padding, CurrentDockLocation);
                    MDIChildContainerBase parentContainer = previous._ParentContainer;
                    parentContainer.swapAndRemove(newContainer, previous);
                    newContainer.addChild(previous);
                    newContainer.addChild(child);
                }
                break;

            case WindowAlignment.Top:
                if (previous._ParentContainer.Layout == MDILayoutContainer.LayoutType.Vertical)
                {
                    //The child can simply be appended.
                    previous._ParentContainer.insertChild(child, previous, false);
                }
                else
                {
                    //The child needs a new subcontainer created.
                    MDILayoutContainer    newContainer    = new MDILayoutContainerScale(MDILayoutContainer.LayoutType.Vertical, Padding, CurrentDockLocation);
                    MDIChildContainerBase parentContainer = previous._ParentContainer;
                    parentContainer.swapAndRemove(newContainer, previous);
                    newContainer.addChild(child);
                    newContainer.addChild(previous);
                }
                break;

            case WindowAlignment.Bottom:
                if (previous._ParentContainer.Layout == MDILayoutContainer.LayoutType.Vertical)
                {
                    //The child can simply be appended.
                    previous._ParentContainer.insertChild(child, previous, true);
                }
                else
                {
                    //The child needs a new subcontainer created.
                    MDILayoutContainer    newContainer    = new MDILayoutContainerScale(MDILayoutContainer.LayoutType.Vertical, Padding, CurrentDockLocation);
                    MDIChildContainerBase parentContainer = previous._ParentContainer;
                    parentContainer.swapAndRemove(newContainer, previous);
                    newContainer.addChild(previous);
                    newContainer.addChild(child);
                }
                break;
            }
        }