//---------------------------------------------------------------------
 public OpenCppCoverageRunner(
     OutputWindowWriter outputWindowWriter,
     OpenCppCoverageCmdLine openCppCoverageCmdLine)
 {
     this.outputWindowWriter     = outputWindowWriter;
     this.openCppCoverageCmdLine = openCppCoverageCmdLine;
 }
        //---------------------------------------------------------------------
        void RunCoverage(ProjectSelectionKind kind)
        {
            IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));

            var errorHandler = new ErrorHandler(uiShell);

            errorHandler.Execute(() =>
            {
                var dte          = (DTE2)GetService(typeof(EnvDTE.DTE));
                var outputWindow = (IVsOutputWindow)GetService(typeof(SVsOutputWindow));
                var outputWriter = new OutputWindowWriter(dte, outputWindow);

                errorHandler.OutputWriter = outputWriter;
                var mainSettingsManager   = new MainSettingsManager(this, dte);
                var coverageViewManager   = GetCoverageViewManager();
                var coverageTreeManager   = new CoverageTreeManager(this, dte, coverageViewManager);
                var projectBuilder        = new ProjectBuilder(dte, errorHandler, outputWriter);
                var deserializer          = new CoverageDataDeserializer();
                var openCppCoverageRunner = new CoverageRunner(
                    dte, outputWriter, coverageTreeManager, projectBuilder,
                    coverageViewManager, deserializer, errorHandler);

                mainSettingsManager.ShowSettingsWindows(openCppCoverageRunner, kind);
            });
        }
Beispiel #3
0
 //---------------------------------------------------------------------
 public ProjectBuilder(
     DTE2 dte,
     ErrorHandler errorHandler,
     OutputWindowWriter outputWindowWriter)
 {
     this.dte                = dte;
     this.errorHandler       = errorHandler;
     this.outputWindowWriter = outputWindowWriter;
     this.buildEvents        = this.dte.Events.BuildEvents;
 }
Beispiel #4
0
 //---------------------------------------------------------------------
 public CoverageRunner(
     DTE2 dte,
     OutputWindowWriter outputWindowWriter,
     CoverageTreeManager coverageTreeManager,
     ProjectBuilder projectBuilder,
     CoverageViewManager coverageViewManager,
     CoverageDataDeserializer coverageDataDeserializer,
     ErrorHandler errorHandler)
 {
     this.outputWindowWriter       = outputWindowWriter;
     this.coverageTreeManager      = coverageTreeManager;
     this.projectBuilder           = projectBuilder;
     this.coverageViewManager      = coverageViewManager;
     this.coverageDataDeserializer = coverageDataDeserializer;
     this.errorHandler             = errorHandler;
 }
Beispiel #5
0
        //---------------------------------------------------------------------
        void RunCommand(
            Action <MainWindowsManager> action)
        {
            IVsUIShell uiShell = (IVsUIShell)serviceProvider.GetService(typeof(SVsUIShell));

            var errorHandler = new ErrorHandler(uiShell);

            errorHandler.Execute(() =>
            {
                var dte          = (DTE2)serviceProvider.GetService(typeof(EnvDTE.DTE));
                var outputWindow = (IVsOutputWindow)serviceProvider.GetService(typeof(SVsOutputWindow));
                var outputWriter = new OutputWindowWriter(dte, outputWindow);

                errorHandler.OutputWriter  = outputWriter;
                var coverageViewManager    = GetCoverageViewManager(serviceProvider);
                var coverageTreeManager    = new CoverageTreeManager(windowFinder);
                var projectBuilder         = new ProjectBuilder(dte, errorHandler, outputWriter);
                var deserializer           = new CoverageDataDeserializer();
                var openCppCoverageCmdLine = new OpenCppCoverageCmdLine(this.configFile);
                var openCppCoverageRunner  = new OpenCppCoverageRunner(outputWriter, openCppCoverageCmdLine);

                var coverageRunner = new CoverageRunner(
                    dte, outputWriter, coverageTreeManager, projectBuilder,
                    coverageViewManager, deserializer, errorHandler, openCppCoverageRunner);

                var configurationManager  = new ConfigurationManager();
                var settingsBuilder       = new StartUpProjectSettingsBuilder(dte, configurationManager);
                var mainSettingController = new MainSettingController(
                    new SettingsStorage(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)),
                    openCppCoverageCmdLine,
                    settingsBuilder,
                    coverageRunner);

                var mainWindowsManager = new MainWindowsManager(windowFinder, mainSettingController);

                action(mainWindowsManager);
            });
        }
 //---------------------------------------------------------------------
 public OpenCppCoverage(OutputWindowWriter outputWindowWriter)
 {
     this.outputWindowWriter = outputWindowWriter;
 }