private RichLabelFormattingOptions FromString(object value) { string[] values = ((string)value).Split(','); if (values.Length != 2) { throw new ArgumentException("Could not convert the value"); } try { RichLabelTextType type = (RichLabelTextType)Enum.Parse(typeof(RichLabelTextType), values[0], true); string tag = values[1].Trim(new char[] { ' ', '<', '>' }); return(new RichLabelFormattingOptions(type, tag)); } catch { throw new ArgumentException("Could not convert the value"); } }
public RichLabelFormattingOptions(RichLabelTextType type, string highlightTag) { this.highlightTag = highlightTag; this.type = type; }