// Token: 0x06004784 RID: 18308 RVA: 0x0010E6F4 File Offset: 0x0010C8F4
 protected internal override void OnMouseUp(global::dfMouseEventArgs args)
 {
     base.OnMouseUp(args);
     this.isMouseDown = false;
     if (Vector2.Distance(this.scrollPosition, this.mouseDownScrollPosition) <= 2f && this.hitTestTag(args) == this.mouseDownTag)
     {
         global::dfMarkupTag dfMarkupTag = this.mouseDownTag;
         while (dfMarkupTag != null && !(dfMarkupTag is global::dfMarkupTagAnchor))
         {
             dfMarkupTag = (dfMarkupTag.Parent as global::dfMarkupTag);
         }
         if (dfMarkupTag is global::dfMarkupTagAnchor)
         {
             base.Signal("OnLinkClicked", new object[]
             {
                 dfMarkupTag
             });
             if (this.LinkClicked != null)
             {
                 this.LinkClicked(this, dfMarkupTag as global::dfMarkupTagAnchor);
             }
         }
     }
     this.mouseDownTag            = null;
     this.mouseDownScrollPosition = this.scrollPosition;
 }
    // Token: 0x060046FC RID: 18172 RVA: 0x0010C054 File Offset: 0x0010A254
    private global::dfMarkupElement parseElement(Queue <global::dfMarkupElement> tokens)
    {
        global::dfMarkupElement dfMarkupElement = tokens.Dequeue();

        if (dfMarkupElement is global::dfMarkupString)
        {
            return(((global::dfMarkupString)dfMarkupElement).SplitWords());
        }
        global::dfMarkupTag dfMarkupTag = (global::dfMarkupTag)dfMarkupElement;

        if (dfMarkupTag.IsClosedTag || dfMarkupTag.IsEndTag)
        {
            return(this.refineTag(dfMarkupTag));
        }
        while (tokens.Count > 0)
        {
            global::dfMarkupElement dfMarkupElement2 = this.parseElement(tokens);
            if (dfMarkupElement2 is global::dfMarkupTag)
            {
                global::dfMarkupTag dfMarkupTag2 = (global::dfMarkupTag)dfMarkupElement2;
                if (dfMarkupTag2.IsEndTag)
                {
                    if (dfMarkupTag2.TagName == dfMarkupTag.TagName)
                    {
                        break;
                    }
                    return(this.refineTag(dfMarkupTag));
                }
            }
            dfMarkupTag.AddChildNode(dfMarkupElement2);
        }
        return(this.refineTag(dfMarkupTag));
    }
 // Token: 0x060046FD RID: 18173 RVA: 0x0010C10C File Offset: 0x0010A30C
 private global::dfMarkupTag refineTag(global::dfMarkupTag original)
 {
     if (original.IsEndTag)
     {
         return(original);
     }
     if (global::dfMarkupParser.tagTypes == null)
     {
         global::dfMarkupParser.tagTypes = new Dictionary <string, Type>();
         foreach (Type type in Assembly.GetExecutingAssembly().GetExportedTypes())
         {
             if (typeof(global::dfMarkupTag).IsAssignableFrom(type))
             {
                 object[] customAttributes = type.GetCustomAttributes(typeof(global::dfMarkupTagInfoAttribute), true);
                 if (customAttributes != null && customAttributes.Length != 0)
                 {
                     for (int j = 0; j < customAttributes.Length; j++)
                     {
                         string tagName = ((global::dfMarkupTagInfoAttribute)customAttributes[j]).TagName;
                         global::dfMarkupParser.tagTypes[tagName] = type;
                     }
                 }
             }
         }
     }
     if (global::dfMarkupParser.tagTypes.ContainsKey(original.TagName))
     {
         Type type2 = global::dfMarkupParser.tagTypes[original.TagName];
         return((global::dfMarkupTag)Activator.CreateInstance(type2, new object[]
         {
             original
         }));
     }
     return(original);
 }
    // Token: 0x060046FF RID: 18175 RVA: 0x0010C3B4 File Offset: 0x0010A5B4
    private void parseStyleAttribute(global::dfMarkupTag element, string text)
    {
        MatchCollection matchCollection = global::dfMarkupParser.STYLE_PATTERN.Matches(text);

        for (int i = 0; i < matchCollection.Count; i++)
        {
            Match  match = matchCollection[i];
            string name  = match.Groups["key"].Value.ToLowerInvariant();
            string value = match.Groups["value"].Value;
            element.Attributes.Add(new global::dfMarkupAttribute(name, value));
        }
    }
    // Token: 0x060046FE RID: 18174 RVA: 0x0010C210 File Offset: 0x0010A410
    private global::dfMarkupElement parseTag(Match tag)
    {
        string text = tag.Groups["tag"].Value.ToLowerInvariant();

        if (tag.Value.StartsWith("</"))
        {
            return(new global::dfMarkupTag(text)
            {
                IsEndTag = true
            });
        }
        global::dfMarkupTag dfMarkupTag = new global::dfMarkupTag(text);
        string          value           = tag.Groups["attr"].Value;
        MatchCollection matchCollection = global::dfMarkupParser.ATTR_PATTERN.Matches(value);

        for (int i = 0; i < matchCollection.Count; i++)
        {
            Match  match  = matchCollection[i];
            string value2 = match.Groups["key"].Value;
            string text2  = global::dfMarkupEntity.Replace(match.Groups["value"].Value);
            if (text2.StartsWith("\""))
            {
                text2 = text2.Trim(new char[]
                {
                    '"'
                });
            }
            else if (text2.StartsWith("'"))
            {
                text2 = text2.Trim(new char[]
                {
                    '\''
                });
            }
            if (!string.IsNullOrEmpty(text2))
            {
                if (value2 == "style")
                {
                    this.parseStyleAttribute(dfMarkupTag, text2);
                }
                else
                {
                    dfMarkupTag.Attributes.Add(new global::dfMarkupAttribute(value2, text2));
                }
            }
        }
        if (tag.Value.EndsWith("/>") || text == "br" || text == "img")
        {
            dfMarkupTag.IsClosedTag = true;
        }
        return(dfMarkupTag);
    }
    // Token: 0x06004711 RID: 18193 RVA: 0x0010CB50 File Offset: 0x0010AD50
    public dfMarkupTag(global::dfMarkupTag original)
    {
        this.TagName     = original.TagName;
        this.Attributes  = original.Attributes;
        this.IsEndTag    = original.IsEndTag;
        this.IsClosedTag = original.IsClosedTag;
        this.IsInline    = original.IsInline;
        this.id          = original.id;
        List <global::dfMarkupElement> childNodes = original.ChildNodes;

        for (int i = 0; i < childNodes.Count; i++)
        {
            global::dfMarkupElement node = childNodes[i];
            base.AddChildNode(node);
        }
    }
    // Token: 0x06004732 RID: 18226 RVA: 0x0010D324 File Offset: 0x0010B524
    private void calculateBulletWidth(global::dfMarkupStyle style)
    {
        if (base.TagName == "ul")
        {
            this.BulletWidth = Mathf.CeilToInt(style.Font.MeasureText("•", style.FontSize, style.FontStyle).x);
            return;
        }
        int num = 0;

        for (int i = 0; i < base.ChildNodes.Count; i++)
        {
            global::dfMarkupTag dfMarkupTag = base.ChildNodes[i] as global::dfMarkupTag;
            if (dfMarkupTag != null && dfMarkupTag.TagName == "li")
            {
                num++;
            }
        }
        string text = new string('X', num.ToString().Length) + ".";

        this.BulletWidth = Mathf.CeilToInt(style.Font.MeasureText(text, style.FontSize, style.FontStyle).x);
    }
    // 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);
    }
Exemple #9
0
 // Token: 0x06004734 RID: 18228 RVA: 0x0010D428 File Offset: 0x0010B628
 public dfMarkupTagListItem(global::dfMarkupTag original) : base(original)
 {
 }
 // Token: 0x0600474F RID: 18255 RVA: 0x0010DE4C File Offset: 0x0010C04C
 public dfMarkupTagFont(global::dfMarkupTag original) : base(original)
 {
 }
 // Token: 0x0600473A RID: 18234 RVA: 0x0010D76C File Offset: 0x0010B96C
 public dfMarkupTagBold(global::dfMarkupTag original) : base(original)
 {
 }
Exemple #12
0
 // Token: 0x0600472A RID: 18218 RVA: 0x0010D184 File Offset: 0x0010B384
 public dfMarkupTagAnchor(global::dfMarkupTag original) : base(original)
 {
 }
 // Token: 0x06004744 RID: 18244 RVA: 0x0010DA30 File Offset: 0x0010BC30
 public dfMarkupTagPre(global::dfMarkupTag original) : base(original)
 {
 }
Exemple #14
0
 // Token: 0x0600473D RID: 18237 RVA: 0x0010D7D4 File Offset: 0x0010B9D4
 public dfMarkupTagHeading(global::dfMarkupTag original) : base(original)
 {
 }
 // Token: 0x06004737 RID: 18231 RVA: 0x0010D5F0 File Offset: 0x0010B7F0
 public dfMarkupTagParagraph(global::dfMarkupTag original) : base(original)
 {
 }
Exemple #16
0
 // Token: 0x0600474A RID: 18250 RVA: 0x0010DB84 File Offset: 0x0010BD84
 public dfMarkupTagImg(global::dfMarkupTag original) : base(original)
 {
     this.IsClosedTag = true;
 }
 // Token: 0x06004741 RID: 18241 RVA: 0x0010D9C8 File Offset: 0x0010BBC8
 public dfMarkupTagItalic(global::dfMarkupTag original) : base(original)
 {
 }
 // Token: 0x06004724 RID: 18212 RVA: 0x0010D090 File Offset: 0x0010B290
 public dfMarkupTagSpan(global::dfMarkupTag original) : base(original)
 {
 }