Esempio n. 1
0
        public void stylize(StylizerSource source)
        {
            if (source.Document.createFace(this, "c-keyword") != null)
            {
                keywordFace = source.Document.getFace("c-keyword");
                keywordFace.FaceStyle.Foreground = Color.Green;
                keywordFace.FaceStyle.FontStyle = FontStyle.Bold;
            }

            foreach (int line in source.Range.getLines())
            {
                stylizeLine(source, line);
            }
        }
Esempio n. 2
0
        private void stylizeLine(StylizerSource source, int line)
        {
            DocumentRow row = source.Document.Rows[line];
            foreach (string s in Keywors)
            {
                int index = 0;
                while (-1 != (index = row.Raw.IndexOf(s, index)))
                {
                    DocumentRange docRange = new DocumentRange();
                    docRange.Start = new DocumentPoint(line, index);
                    docRange.End = new DocumentPoint(line, index + s.Length);

                    source.setFace(docRange, keywordFace);

                    index += s.Length;
                }
            }
        }
Esempio n. 3
0
            private StyleFace getFace(StylizerSource source, uint count)
            {
                string faceName = count > 0 ? CoveredStyle : UncoveredStyle;

                StyleFace face = source.Document.createFace(this, faceName);
                if (face == null)
                    return source.Document.getFace(faceName);

                face.FaceStyle.Background = count > 0
                    ? Settings.Default.ViewPaneCoveredBlockBackroung
                    : Settings.Default.ViewPaneUncoveredBlockBackroung;

                return face;
            }
Esempio n. 4
0
        public void stylize(StylizerSource source)
        {
            if (source.Document.createFace(this, "scharp-keyword") != null)
            {
                keywordFace = source.Document.getFace("scharp-keyword");
                keywordFace.FaceStyle.Background = Color.GhostWhite;
                keywordFace.FaceStyle.Foreground = Color.FromArgb(0, 0, 150);
                keywordFace.FaceStyle.FontStyle = FontStyle.Bold;
            }

            foreach (int line in source.Range.getLines())
            {
                stylizeLine(source, line);
            }
        }
Esempio n. 5
0
            public void stylize(StylizerSource source)
            {
                foreach (CoverageReport.InnerBlock b in points)
                {
                    if (b.fileId <= 0)
                        continue;

                    DocumentRange range = new DocumentRange();
                    range.Start = new DocumentPoint((int)(b.startLine - 1), (int)(b.startColumn - 1));
                    range.End = new DocumentPoint((int)(b.endLine - 1), (int)(b.endColumn - 1));

                    StyleFace face = getFace(source, b.visitCount);

                    source.setFace(range, face);
                }
            }