예제 #1
0
 public void ParseText(List <RichTextParseRule> rules, Color?generalColor = null, Font generalFont = null)
 {
     if (generalColor == null)
     {
         generalColor = Color;
     }
     if (generalFont == null)
     {
         generalFont = Font;
     }
     Text = RichText.ParseText(Text.ToString(), generalColor.Value, generalFont, rules);
 }
예제 #2
0
        public Control(ControlConfig config, Control parent = null)
        {
            Initialize(new Rectangle(config.LocationX, config.LocationY, config.SizeWidth, config.SizeHeight), parent);
            Name  = config.Name;
            Color = config.Color;
            Text  = RichText.ParseText(config.Text, Color, Font);
            foreach (dynamic child in config.Children)
            {
                if (child is ComboBoxConfig) // TODO fix combo boxes
                {
                    continue;
                }

                Assembly          assembly    = typeof(Control).Assembly;
                Type              controlType = assembly.GetType(child.TypeName);
                ConstructorInfo[] ctors       = controlType.GetConstructors();
                ctors[1].Invoke(new object[] { child, this });
            }
        }
예제 #3
0
 public static RichText ToRichText(this string s, Color?color = null, Font font = null, List <RichTextParseRule> rules = null)
 {
     return(RichText.ParseText(s, color, font, rules));
 }