Exemplo n.º 1
0
        private void ParseFile(uint file, IEnumerable<CoverageReport.InnerBlock> filePoints)
        {
            string filePath = Services.GetService<ICoverageReportService>().Report.GetFilePath(file);
            if (filePath == null || !File.Exists(filePath))
                return;

            ViewControl sourceViewer = GetFileTextBox(file);

            if (sourceViewer == null)
            {
                sourceViewer = new ViewControl();
                sourceViewer.Dock = DockStyle.Fill;
                sourceViewer.Document = CreateDocument(filePath);
                sourceViewer.BorderStyle = BorderStyle.FixedSingle;
                sourceViewer.View.ViewStyle.HideInactiveCursor = false;
                sourceViewer.View.ViewStyle.HideInactiveSelection = false;

                FileTag record = new FileTag();
                record.fileId = file;

                TabPage page = new TabPage();
                page.Tag = record;
                page.Text = Path.GetFileName(filePath);
                page.Controls.Add(sourceViewer);

                pnTabs.TabPages.Add(page);

                pnTabs.SelectedTab = page;
            }

            List<CoverageReport.InnerBlock> bList;

            if (Settings.Default.HighlightAllFile)
            {
                bList = new List<CoverageReport.InnerBlock>();

                Services.GetService<ICoverageReportService>().Report.ForEachBlock(
                    delegate(CoverageReport.InnerBlock bd)
                    {
                        if (bd.fileId == file) bList.Add(bd);
                    });
            }
            else
            {
                sourceViewer.Document.removeStylizers();
                bList = new List<CoverageReport.InnerBlock>(filePoints);
            }

            sourceViewer.Document.addStylizer(new BlockStylizer(bList.ToArray()));
        }
Exemplo n.º 2
0
 public ScrollHostProxy(ViewControl owner)
 {
     this.owner = owner;
 }
Exemplo n.º 3
0
 public ScrollHostProxy(ViewControl owner)
 {
     this.owner = owner;
 }
Exemplo n.º 4
0
        private void ParseFile(int file, IEnumerable<MethodBlock> filePoints)
        {
            var filePath = Services.getService<IReportService>().Report.ResolveFilePath(file);
            if (filePath == null || !File.Exists(filePath))
                return;

            var sourceViewer = GetFileTextBox(file);
            if (sourceViewer == null)
            {
                sourceViewer = new ViewControl
                {
                    Dock = DockStyle.Fill,
                    Document = CreateDocument(filePath),
                    BorderStyle = BorderStyle.FixedSingle
                };
                sourceViewer.View.ViewStyle.HideInactiveCursor = false;
                sourceViewer.View.ViewStyle.HideInactiveSelection = false;

                var record = new FileTag
                {
                    FileId = file
                };

                var page = new TabPage
                {
                    Tag = record,
                    Text = Path.GetFileName(filePath)
                };
                page.Controls.Add(sourceViewer);

                pnTabs.TabPages.Add(page);

                pnTabs.SelectedTab = page;
            }

            List<MethodBlock> bList;

            if (Settings.Default.HighlightAllFile)
            {
                bList = new List<MethodBlock>();

                ReportHelper.ForEachBlock(Services.getService<IReportService>().Report,
                    bd => { if (bd.File == file) bList.Add(bd); });
            }
            else
            {
                sourceViewer.Document.RemoveStylizerAll();
                bList = new List<MethodBlock>(filePoints);
            }

            sourceViewer.Document.Add(new BlockStylizer(bList.ToArray()));
        }