Exemple #1
0
 public void AddHighlight(string id, IHighlight highlight)
 {
     if (!highlightDic.ContainsKey(id))
     {
         highlightDic.Add(id, highlight);
     }
 }
Exemple #2
0
        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);
                    }
                }
            }
        }
Exemple #3
0
 void IParser.SetHighlight(IHighlight highlight)
 {
     defaultAttr = highlight.getDefault();
     this.lex.AddRule(highlight.getRules());
     if (HighlightChangeEvent != null) {
         HighlightChangeEvent();
     }
 }
Exemple #4
0
 void IParser.SetHighlight(IHighlight highlight)
 {
     defaultAttr = highlight.getDefault();
     this.lex.AddRule(highlight.getRules());
     if (HighlightChangeEvent != null)
     {
         HighlightChangeEvent();
     }
 }
Exemple #5
0
 public void setd(string id)
 {
     if (curID != id)
     {
         IHighlight highlight = highlightDic[id];
         defaultAttr = highlight.getDefault();
         lex.ClearRule();
         this.lex.AddRule(highlight.getRules());
         curID = id;
     }
 }
Exemple #6
0
        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);
                    }
                }
            }
        }
Exemple #7
0
 /// <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;
 }
Exemple #8
0
 public DefaultPartition(IHighlight Highlight)
 {
     this.ID        = Document.DEFAULT_ID;
     this.Highlight = Highlight;
 }
Exemple #9
0
 public void AddHighlight(string id, IHighlight highlight)
 {
     if (!highlightDic.ContainsKey(id)) {
         highlightDic.Add(id, highlight);
     }
 }
Exemple #10
0
 public void AddHighlight(string partionID, IHighlight highlight)
 {
 }
Exemple #11
0
 public void SetHighlight(IHighlight highlight)
 {
     throw new NotImplementedException();
 }
Exemple #12
0
 public Partition(MultiLineRule rule, IHighlight Highlight)
 {
     this.rule      = rule;
     this.ID        = this.rule.id;
     this.Highlight = Highlight;
 }
Exemple #13
0
 public void SetHighlight(IHighlight highlight)
 {
     throw new NotImplementedException();
 }
Exemple #14
0
 public Partition(MultiLineRule rule, IHighlight Highlight)
 {
     this.rule = rule;
     this.ID = this.rule.id;
     this.Highlight = Highlight;
 }
Exemple #15
0
 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 DefaultPartition(IHighlight Highlight)
 {
     this.ID = Document.DEFAULT_ID;
     this.Highlight = Highlight;
 }
Exemple #19
0
 public void AddHighlight(string partionID, IHighlight highlight)
 {
 }
Exemple #20
0
 public void SetHighlight(IHighlight highlight)
 {
     defaultAttr = highlight.getDefault();
 }
Exemple #21
0
 public Partition(String ID, IHighlight Highlight)
 {
     this.ID = ID;
     this.Highlight = Highlight;
 }
Exemple #22
0
 public void SetHighlight(IHighlight highlight)
 {
     defaultAttr = highlight.getDefault();
 }
Exemple #23
0
 void IParser.AddHighlight(string partionID, IHighlight highlight)
 {
     throw new NotImplementedException();
 }
Exemple #24
0
 void IParser.AddHighlight(string partionID, IHighlight highlight)
 {
     throw new NotImplementedException();
 }