public void AddHighlight(string id, IHighlight highlight) { if (!highlightDic.ContainsKey(id)) { highlightDic.Add(id, highlight); } }
public void AddHighlight(string id, IHighlight highlight) { if (partitionDic.ContainsKey(id)) { var part = partitionDic[id]; //part.Highlight = highlight; part.Highlight.getRules().AddRange(highlight.getRules()); var rules = part.Highlight.getRules(); foreach (var rule in rules) { if (rule is MultiLineRule) { MultiLineRule prule = rule as MultiLineRule; var partid = prule.id; var newpart = new Partition(prule, new DefaultHighlight(prule.attr)); part.AddPartition(newpart); partitionDic.Add(partid, newpart); } } } else { var part = new Partition(id, highlight); partitionDic.Add(id, part); var rules = highlight.getRules(); foreach (var rule in rules) { if (rule is MultiLineRule) { MultiLineRule prule = rule as MultiLineRule; var partid = prule.id; var newpart = new Partition(prule, new DefaultHighlight(prule.attr)); part.AddPartition(newpart); partitionDic.Add(partid, newpart); } } } }
void IParser.SetHighlight(IHighlight highlight) { defaultAttr = highlight.getDefault(); this.lex.AddRule(highlight.getRules()); if (HighlightChangeEvent != null) { HighlightChangeEvent(); } }
public void setd(string id) { if (curID != id) { IHighlight highlight = highlightDic[id]; defaultAttr = highlight.getDefault(); lex.ClearRule(); this.lex.AddRule(highlight.getRules()); curID = id; } }
/// <summary> /// A period of a line of text that should have a highlighting applied to it. /// </summary> /// <param name="startIndex">Start index on the original body of text that this highlight should be applied.</param> /// <param name="length">The length opf text to apply this highlight to.</param> /// <param name="highlighter">The highlighter containing details of the colour and where it is applicable.</param> public HighlightSection(int startIndex, int length, IHighlight highlighter) { StartIndex = startIndex; Length = length; Highlighter = highlighter; }
public DefaultPartition(IHighlight Highlight) { this.ID = Document.DEFAULT_ID; this.Highlight = Highlight; }
public void AddHighlight(string partionID, IHighlight highlight) { }
public void SetHighlight(IHighlight highlight) { throw new NotImplementedException(); }
public Partition(MultiLineRule rule, IHighlight Highlight) { this.rule = rule; this.ID = this.rule.id; this.Highlight = Highlight; }
public Partition(String ID, IHighlight Highlight) { this.ID = ID; this.Highlight = Highlight; }
public void RemoveHighlight(IHighlight <TDocument> highlight) { highlights.Remove(highlight); }
public void AddHighlight(IHighlight <TDocument> highlight) { highlights.Add(highlight); }
public void SetHighlight(IHighlight highlight) { defaultAttr = highlight.getDefault(); }
void IParser.AddHighlight(string partionID, IHighlight highlight) { throw new NotImplementedException(); }