Esempio n. 1
0
    // Token: 0x06004735 RID: 18229 RVA: 0x0010D434 File Offset: 0x0010B634
    protected override void _PerformLayoutImpl(global::dfMarkupBox container, global::dfMarkupStyle style)
    {
        if (base.ChildNodes.Count == 0)
        {
            return;
        }
        float x = container.Size.x;
        global::dfMarkupBox dfMarkupBox = new global::dfMarkupBox(this, global::dfMarkupDisplayType.listItem, style);

        dfMarkupBox.Margins.top = 10;
        container.AddChild(dfMarkupBox);
        global::dfMarkupTagList dfMarkupTagList = base.Parent as global::dfMarkupTagList;

        if (dfMarkupTagList == null)
        {
            base._PerformLayoutImpl(container, style);
            return;
        }
        style.VerticalAlign = global::dfMarkupVerticalAlign.Baseline;
        string text = "•";

        if (dfMarkupTagList.TagName == "ol")
        {
            text = container.Children.Count + ".";
        }
        global::dfMarkupStyle style2 = style;

        style2.VerticalAlign = global::dfMarkupVerticalAlign.Baseline;
        style2.Align         = global::dfMarkupTextAlign.Right;
        global::dfMarkupBoxText dfMarkupBoxText = global::dfMarkupBoxText.Obtain(this, global::dfMarkupDisplayType.inlineBlock, style2);

        dfMarkupBoxText.SetText(text);
        dfMarkupBoxText.Width        = dfMarkupTagList.BulletWidth;
        dfMarkupBoxText.Margins.left = style.FontSize * 2;
        dfMarkupBox.AddChild(dfMarkupBoxText);
        global::dfMarkupBox dfMarkupBox2 = new global::dfMarkupBox(this, global::dfMarkupDisplayType.inlineBlock, style);
        int   fontSize = style.FontSize;
        float num      = x - dfMarkupBoxText.Size.x - (float)dfMarkupBoxText.Margins.left - (float)fontSize;

        dfMarkupBox2.Size         = new Vector2(num, (float)fontSize);
        dfMarkupBox2.Margins.left = (int)((float)style.FontSize * 0.5f);
        dfMarkupBox.AddChild(dfMarkupBox2);
        for (int i = 0; i < base.ChildNodes.Count; i++)
        {
            base.ChildNodes[i].PerformLayout(dfMarkupBox2, style);
        }
        dfMarkupBox2.FitToContents(false);
        dfMarkupBox2.Parent.FitToContents(false);
        dfMarkupBox.FitToContents(false);
    }
    // Token: 0x06004731 RID: 18225 RVA: 0x0010D288 File Offset: 0x0010B488
    protected override void _PerformLayoutImpl(global::dfMarkupBox container, global::dfMarkupStyle style)
    {
        if (base.ChildNodes.Count == 0)
        {
            return;
        }
        style.Align = global::dfMarkupTextAlign.Left;
        global::dfMarkupBox dfMarkupBox = new global::dfMarkupBox(this, global::dfMarkupDisplayType.block, style);

        container.AddChild(dfMarkupBox);
        this.calculateBulletWidth(style);
        for (int i = 0; i < base.ChildNodes.Count; i++)
        {
            global::dfMarkupTag dfMarkupTag = base.ChildNodes[i] as global::dfMarkupTag;
            if (dfMarkupTag != null && !(dfMarkupTag.TagName != "li"))
            {
                dfMarkupTag.PerformLayout(dfMarkupBox, style);
            }
        }
        dfMarkupBox.FitToContents(false);
    }
Esempio n. 3
0
    // Token: 0x0600473E RID: 18238 RVA: 0x0010D7E0 File Offset: 0x0010B9E0
    protected override void _PerformLayoutImpl(global::dfMarkupBox container, global::dfMarkupStyle style)
    {
        global::dfMarkupBorders margins = default(global::dfMarkupBorders);
        global::dfMarkupStyle   style2  = this.applyDefaultStyles(style, ref margins);

        style2 = base.applyTextStyleAttributes(style2);
        global::dfMarkupAttribute dfMarkupAttribute = base.findAttribute(new string[]
        {
            "margin"
        });

        if (dfMarkupAttribute != null)
        {
            margins = global::dfMarkupBorders.Parse(dfMarkupAttribute.Value);
        }
        global::dfMarkupBox dfMarkupBox = new global::dfMarkupBox(this, global::dfMarkupDisplayType.block, style2);

        dfMarkupBox.Margins = margins;
        container.AddChild(dfMarkupBox);
        base._PerformLayoutImpl(dfMarkupBox, style2);
        dfMarkupBox.FitToContents(false);
    }