Example #1
0
        // Token: 0x06002AE5 RID: 10981 RVA: 0x000A6A94 File Offset: 0x000A4C94
        private void method_5(Rectangle totalArea, bool textFirst, Size textSize, Size imageSize, out Rectangle textRect, out Rectangle imageRect)
        {
            int num  = 0;
            int num2 = textSize.Height + 0 + imageSize.Height;

            if (textFirst)
            {
                num += 2;
            }
            if (textSize.Width > totalArea.Width)
            {
                textSize.Width = totalArea.Width;
            }
            if (num2 > totalArea.Height && textFirst)
            {
                imageSize = Size.Empty;
                num2      = totalArea.Height;
            }
            int num3 = totalArea.Height - num2;
            int num4 = 0;
            VerticalAlignment verticalAlignment  = Class479.smethod_2(this.TextAlign);
            VerticalAlignment verticalAlignment2 = Class479.smethod_2(base.ImageAlign);

            if (verticalAlignment2 == VerticalAlignment.Top)
            {
                num4 = 0;
            }
            else if (verticalAlignment2 == VerticalAlignment.Bottom && verticalAlignment == VerticalAlignment.Bottom)
            {
                num4 = num3;
            }
            else if (verticalAlignment2 == VerticalAlignment.Center && (verticalAlignment == VerticalAlignment.Top || verticalAlignment == VerticalAlignment.Center))
            {
                num4 += num3 / 3;
            }
            else
            {
                num4 += 2 * (num3 / 3);
            }
            Rectangle rectangle;
            Rectangle rectangle2;

            if (textFirst)
            {
                rectangle  = new Rectangle(Class479.smethod_3(totalArea, textSize, this.TextAlign).Left, totalArea.Top + num4, textSize.Width, textSize.Height);
                rectangle2 = new Rectangle(Class479.smethod_3(totalArea, imageSize, base.ImageAlign).Left, rectangle.Bottom + num, imageSize.Width, imageSize.Height);
            }
            else
            {
                rectangle2 = new Rectangle(Class479.smethod_3(totalArea, imageSize, base.ImageAlign).Left, totalArea.Top + num4, imageSize.Width, imageSize.Height);
                rectangle  = new Rectangle(Class479.smethod_3(totalArea, textSize, this.TextAlign).Left, rectangle2.Bottom + num, textSize.Width, textSize.Height);
                if (rectangle.Bottom > totalArea.Bottom)
                {
                    rectangle.Y = totalArea.Top;
                }
            }
            textRect  = rectangle;
            imageRect = rectangle2;
        }
Example #2
0
        // Token: 0x06002AE4 RID: 10980 RVA: 0x000A68FC File Offset: 0x000A4AFC
        private void method_4(Rectangle totalArea, bool textFirst, Size textSize, Size imageSize, out Rectangle textRect, out Rectangle imageRect)
        {
            int num  = 0;
            int num2 = textSize.Width + 0 + imageSize.Width;

            if (!textFirst)
            {
                num += 2;
            }
            if (num2 > totalArea.Width)
            {
                textSize.Width = totalArea.Width - num - imageSize.Width;
                num2           = totalArea.Width;
            }
            int num3 = totalArea.Width - num2;
            int num4 = 0;
            HorizontalAlignment horizontalAlignment  = Class479.smethod_1(this.TextAlign);
            HorizontalAlignment horizontalAlignment2 = Class479.smethod_1(base.ImageAlign);

            if (horizontalAlignment2 == HorizontalAlignment.Left)
            {
                num4 = 0;
            }
            else if (horizontalAlignment2 == HorizontalAlignment.Right && horizontalAlignment == HorizontalAlignment.Right)
            {
                num4 = num3;
            }
            else if (horizontalAlignment2 == HorizontalAlignment.Center && (horizontalAlignment == HorizontalAlignment.Left || horizontalAlignment == HorizontalAlignment.Center))
            {
                num4 += num3 / 3;
            }
            else
            {
                num4 += 2 * (num3 / 3);
            }
            Rectangle rectangle;
            Rectangle rectangle2;

            if (textFirst)
            {
                rectangle  = new Rectangle(totalArea.Left + num4, Class479.smethod_3(totalArea, textSize, this.TextAlign).Top, textSize.Width, textSize.Height);
                rectangle2 = new Rectangle(rectangle.Right + num, Class479.smethod_3(totalArea, imageSize, base.ImageAlign).Top, imageSize.Width, imageSize.Height);
            }
            else
            {
                rectangle2 = new Rectangle(totalArea.Left + num4, Class479.smethod_3(totalArea, imageSize, base.ImageAlign).Top, imageSize.Width, imageSize.Height);
                rectangle  = new Rectangle(rectangle2.Right + num, Class479.smethod_3(totalArea, textSize, this.TextAlign).Top, textSize.Width, textSize.Height);
            }
            textRect  = rectangle;
            imageRect = rectangle2;
        }