示例#1
0
        public void Stylize(IStylizerSource source)
        {
            if (source.Document.CreateFace(this, "c-keyword") != null)
            {
                keywordFace = source.Document.FindFace("c-keyword");
                keywordFace.FaceStyle.Foreground = Color.Green;
                keywordFace.FaceStyle.FontStyle  = FontStyle.Bold;
            }

            foreach (var line in source.Range.Lines)
            {
                stylizeLine(source, line);
            }
        }
示例#2
0
        public void Stylize(IStylizerSource source)
        {
            if (source.Document.CreateFace(this, "scharp-keyword") != null)
            {
                keywordFace = source.Document.FindFace("scharp-keyword");
                keywordFace.FaceStyle.Background = Color.GhostWhite;
                keywordFace.FaceStyle.Foreground = Color.FromArgb(0, 0, 150);
                keywordFace.FaceStyle.FontStyle  = FontStyle.Bold;
            }

            foreach (var line in source.Range.Lines)
            {
                stylizeLine(source, line);
            }
        }
示例#3
0
        public void Stylize(IStylizerSource source)
        {
            if (source.Document.CreateFace(this, "scharp-keyword") != null)
            {
                keywordFace = source.Document.FindFace("scharp-keyword");
                keywordFace.FaceStyle.Background = Color.GhostWhite;
                keywordFace.FaceStyle.Foreground = Color.FromArgb(0, 0, 150);
                keywordFace.FaceStyle.FontStyle = FontStyle.Bold;
            }

            foreach (var line in source.Range.Lines)
            {
                stylizeLine(source, line);
            }
        }
            private IStyleFace getFace(IStylizerSource source, int count)
            {
                var faceName = count > 0 ? CoveredStyle : UncoveredStyle;

                var face = source.Document.CreateFace(this, faceName);

                if (face == null)
                {
                    return(source.Document.FindFace(faceName));
                }

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

                return(face);
            }
            public void Stylize(IStylizerSource source)
            {
                foreach (var b in points)
                {
                    if (b.File <= 0)
                    {
                        continue;
                    }

                    var range = new DocumentRange
                    {
                        Start = new DocumentPoint(b.Start.Line - 1, b.Start.Column - 1),
                        End   = new DocumentPoint(b.End.Line - 1, b.End.Column - 1)
                    };

                    source.AssignFace(range, getFace(source, b.VisitCount));
                }
            }
示例#6
0
        private void stylizeLine(IStylizerSource source, int line)
        {
            var row = source.Document.Rows[line];

            foreach (var s in Keywors)
            {
                var index = 0;
                while (-1 != (index = row.Raw.IndexOf(s, index, StringComparison.OrdinalIgnoreCase)))
                {
                    var docRange = new DocumentRange
                    {
                        Start = new DocumentPoint(line, index),
                        End   = new DocumentPoint(line, index + s.Length)
                    };

                    source.AssignFace(docRange, keywordFace);

                    index += s.Length;
                }
            }
        }
示例#7
0
        private void stylizeLine(IStylizerSource source, int line)
        {
            var row = source.Document.Rows[line];
            foreach (var s in Keywors)
            {
                var index = 0;
                while (-1 != (index = row.Raw.IndexOf(s, index, StringComparison.OrdinalIgnoreCase)))
                {
                    var docRange = new DocumentRange
                    {
                        Start = new DocumentPoint(line, index),
                        End = new DocumentPoint(line, index + s.Length)
                    };

                    source.AssignFace(docRange, keywordFace);

                    index += s.Length;
                }
            }
        }
示例#8
0
        public void Stylize(IStylizerSource source)
        {
            if (source.Document.CreateFace(this, "c-keyword") != null)
            {
                keywordFace = source.Document.FindFace("c-keyword");
                keywordFace.FaceStyle.Foreground = Color.Green;
                keywordFace.FaceStyle.FontStyle = FontStyle.Bold;
            }

            foreach (var line in source.Range.Lines)
            {
                stylizeLine(source, line);
            }
        }
示例#9
0
            private IStyleFace getFace(IStylizerSource source, int count)
            {
                var faceName = count > 0 ? CoveredStyle : UncoveredStyle;

                var face = source.Document.CreateFace(this, faceName);
                if (face == null)
                    return source.Document.FindFace(faceName);

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

                return face;
            }
示例#10
0
            public void Stylize(IStylizerSource source)
            {
                foreach (var b in points)
                {
                    if (b.File <= 0)
                        continue;

                    var range = new DocumentRange
                    {
                        Start = new DocumentPoint(b.Start.Line - 1, b.Start.Column - 1),
                        End = new DocumentPoint(b.End.Line - 1, b.End.Column - 1)
                    };

                    source.AssignFace(range, getFace(source, b.VisitCount));
                }
            }