protected void CalculateRectangles(Nodes oNodes, RectangleF oParentRectangle, Node oParentNode, int iTopPaddingPx, int iLeftRightBottomPaddingPx, int iPenWidthPx, ILayoutEngine oLayoutEngine)
        {
            Debug.Assert(oNodes != null);
            Debug.Assert(iTopPaddingPx > 0);
            Debug.Assert(iLeftRightBottomPaddingPx > 0);
            Debug.Assert(iPenWidthPx > 0);
            Debug.Assert(oLayoutEngine != null);
            this.AssertValid();
            int num = iTopPaddingPx;

            if (oParentNode == null)
            {
                iTopPaddingPx = iLeftRightBottomPaddingPx;
            }
            if (!this.AddPaddingToParentRectangle(ref oParentRectangle, ref iTopPaddingPx, ref iLeftRightBottomPaddingPx))
            {
                oLayoutEngine.SetNodeRectanglesToEmpty(oNodes, true);
            }
            else
            {
                if (oParentNode == null)
                {
                    iTopPaddingPx = num;
                }
                oLayoutEngine.CalculateNodeRectangles(oNodes, oParentRectangle, oParentNode, this.m_eEmptySpaceLocation);
                int num2           = this.DecrementPadding(iLeftRightBottomPaddingPx);
                int iPenWidthPx2   = this.DecrementPenWidth(iPenWidthPx);
                int iTopPaddingPx2 = 0;
                switch (this.m_eTextLocation)
                {
                case TextLocation.CenterCenter:
                {
                    iTopPaddingPx2 = num2;
                    break;
                }

                case TextLocation.Top:
                {
                    iTopPaddingPx2 = iTopPaddingPx;
                    break;
                }

                default:
                {
                    Debug.Assert(false);
                    break;
                }
                }
                foreach (Node current in oNodes)
                {
                    if (!current.Rectangle.IsEmpty)
                    {
                        RectangleF rectangle = current.Rectangle;
                        if (!this.AddPaddingToChildRectangle(ref rectangle, oParentRectangle, iLeftRightBottomPaddingPx))
                        {
                            current.Rectangle  = this.FixSmallRectangle(current.Rectangle);
                            current.PenWidthPx = 1;
                            oLayoutEngine.SetNodeRectanglesToEmpty(current.Nodes, true);
                        }
                        else
                        {
                            current.Rectangle  = rectangle;
                            current.PenWidthPx = iPenWidthPx;
                            RectangleF oParentRectangle2 = RectangleF.Inflate(rectangle, (float)(-(float)iPenWidthPx), (float)(-(float)iPenWidthPx));
                            this.CalculateRectangles(current.Nodes, oParentRectangle2, current, iTopPaddingPx2, num2, iPenWidthPx2, oLayoutEngine);
                        }
                    }
                }
            }
        }