Example #1
0
    private static TextCharDef ChangeDefOnDemand(TextCharDef def, XmlAttributeCollection attributes)
    {
        if (attributes [FONT_ATTRIBUTE] != null)
        {
            def.font = FontCache.GetFont(attributes [FONT_ATTRIBUTE].InnerText);
        }

        if (attributes [SIZE_ATTRIBUTE] != null)
        {
            def.size = float.Parse(attributes [SIZE_ATTRIBUTE].InnerText);
        }

        if (attributes [FONTSIZE_ATTRIBUTE] != null)
        {
            def.fontSize = int.Parse(attributes [FONTSIZE_ATTRIBUTE].InnerText);
        }

        if (attributes [SPACING_ATTRIBUTE] != null)
        {
            def.spacing = float.Parse(attributes [SPACING_ATTRIBUTE].InnerText);
        }

        if (attributes [COLOR_ATTRIBUTE] != null)
        {
            def.color = ColorExtension.ParseColor(attributes [COLOR_ATTRIBUTE].InnerText);
        }

        return(def);
    }