public TabTextWord(HighlightColor color) { length = 1; base.SyntaxColor = color; }
/// <summary> /// Creates a new instance of <see cref="HighlightColor"/> /// </summary> public HighlightColor(XmlElement el, HighlightColor defaultColor) { Debug.Assert(el != null, "Revsoft.TextEditor.Document.SyntaxColor(XmlElement el) : el == null"); if (el.Attributes["bold"] != null) { bold = Boolean.Parse(el.Attributes["bold"].InnerText); } else { bold = defaultColor.Bold; } if (el.Attributes["italic"] != null) { italic = Boolean.Parse(el.Attributes["italic"].InnerText); } else { italic = defaultColor.Italic; } if (el.Attributes["color"] != null) { string c = el.Attributes["color"].InnerText; if (c[0] == '#') { color = ParseColor(c); } else if (c.StartsWith("SystemColors.")) { color = ParseColorString(c.Substring("SystemColors.".Length)); } else { color = (Color)(Color.GetType()).InvokeMember(c, BindingFlags.GetProperty, null, Color, new object[0]); } hasForeground = true; } else { color = defaultColor.color; } if (el.Attributes["bgcolor"] != null) { string c = el.Attributes["bgcolor"].InnerText; if (c[0] == '#') { backgroundcolor = ParseColor(c); } else if (c.StartsWith("SystemColors.")) { backgroundcolor = ParseColorString(c.Substring("SystemColors.".Length)); } else { backgroundcolor = (Color)(Color.GetType()).InvokeMember(c, BindingFlags.GetProperty, null, Color, new object[0]); } hasBackground = true; } else { backgroundcolor = defaultColor.BackgroundColor; } }
// TAB public TextWord(IDocument document, LineSegment line, int offset, int length, HighlightColor color, bool hasDefaultColor) { Debug.Assert(document != null); Debug.Assert(line != null); Debug.Assert(color != null); this.document = document; this.line = line; this.offset = offset; this.length = length; this.color = color; this.hasDefaultColor = hasDefaultColor; }