public void Report(IReportingContext context)
 {
     foreach (IReporter reporter in Items)
     {
         reporter.Report(context);
     }
 }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public void Initialize(IStrategy <TExtension> strategy)
        {
            Ensure.ArgumentNotNull(strategy, "strategy");

            this.CheckAlreadyInitialized();

            this.strategy         = strategy;
            this.reportingContext = this.strategy.CreateReportingContext();
        }
 public void Report(IReportingContext context)
 {
     Console.WriteLine();
     Console.WriteLine();
     Console.WriteLine("== Bootstrapper report ==");
     Console.WriteLine();
     Console.WriteLine(Dump(context));
     Console.WriteLine();
 }
Ejemplo n.º 4
0
            private static string Dump(IReportingContext context)
            {
                var builder = new StringBuilder();

                context.Extensions.ForEach(e => Dump(e.Name, e.Description, builder, 0));

                Dump(context.Run, builder);
                Dump(context.Shutdown, builder);

                return(builder.ToString());
            }
Ejemplo n.º 5
0
            private static string Dump(IReportingContext context)
            {
                var builder = new StringBuilder();

                context.Extensions.ToList().ForEach(e => Dump(e.Name, e.Description, builder, 0));

                Dump(context.Run, builder);
                Dump(context.Shutdown, builder);

                return builder.ToString();
            }
Ejemplo n.º 6
0
        public DefaultBootstrapperTest()
        {
            this.extensionHost     = A.Fake <IExtensionHost <IExtension> >();
            this.reporter          = A.Fake <IReporter>();
            this.strategy          = A.Fake <IStrategy <IExtension> >();
            this.runExecutor       = A.Fake <IExecutor <IExtension> >();
            this.shutdownExecutor  = A.Fake <IExecutor <IExtension> >();
            this.reportingContext  = A.Fake <IReportingContext>();
            this.extensionResolver = A.Fake <IExtensionResolver <IExtension> >();

            this.testee = new DefaultBootstrapper <IExtension>(this.extensionHost, this.reporter);
        }
Ejemplo n.º 7
0
        internal /* for testing purposes */ void VsixAnalyzerReportDiagnostic(IReportingContext context)
        {
            Debug.Assert(context.SyntaxTree != null, "Not expecting to be called with a null SyntaxTree");
            Debug.Assert(context.Diagnostic != null, "Not expecting to be called with a null Diagnostic");
            Debug.Assert(GetProjectNuGetAnalyzerStatus(context.SyntaxTree) == ProjectAnalyzerStatus.NoAnalyzer,
                         "Not expecting to be called when project contains any SonarAnalyzer NuGet");

            if (this.suppressionHandler.ShouldIssueBeReported(context.SyntaxTree, context.Diagnostic))
            {
                context.ReportDiagnostic(context.Diagnostic);
            }
        }
        internal /* for testing purposes */ void VsixAnalyzerReportDiagnostic(IReportingContext context)
        {
            Debug.Assert(context.SyntaxTree != null, "Not expecting to be called with a null SyntaxTree");
            Debug.Assert(context.Diagnostic != null, "Not expecting to be called with a null Diagnostic");
            Debug.Assert(GetProjectNuGetAnalyzerStatus(context.SyntaxTree) == ProjectAnalyzerStatus.NoAnalyzer,
                         "Not expecting to be called when project contains any SonarAnalyzer NuGet");

            // A DiagnosticAnalyzer can have multiple supported diagnostics and we decided to run the rule as long as at least
            // one of the diagnostics is enabled. Therefore we need to filter the reported issues.
            if (context.Diagnostic.Descriptor.CustomTags.Contains(DiagnosticTagsHelper.SonarWayTag))
            {
                context.ReportDiagnostic(context.Diagnostic);
            }
        }
Ejemplo n.º 9
0
        internal /* for testing purposes */ void VsixAnalyzerReportDiagnostic(IReportingContext context)
        {
            Debug.Assert(context.SyntaxTree != null, "Not expecting to be called with a null SyntaxTree");
            Debug.Assert(context.Diagnostic != null, "Not expecting to be called with a null Diagnostic");
            Debug.Assert(GetProjectNuGetAnalyzerStatus(context.SyntaxTree) == ProjectAnalyzerStatus.NoAnalyzer,
                         "Not expecting to be called when project contains any SonarAnalyzer NuGet");

            // A DiagnosticAnalyzer can have multiple supported diagnostics and we decided to run the rule as long as at least
            // one of the diagnostics is enabled. Therefore we need to filter the reported issues.
            if (ShouldRegisterContextActionWithFallback(new[] { context.Diagnostic.Descriptor }) &&
                this.suppressionHandler.ShouldIssueBeReported(context.SyntaxTree, context.Diagnostic))
            {
                context.ReportDiagnostic(context.Diagnostic); // TODO: Update the diagnostic based on configuration
            }
        }
 public void Report(IReportingContext context)
 {
     this.contextInterceptor(context);
 }
 public void Report(IReportingContext context)
 {
     this.context = context;
 }
Ejemplo n.º 12
0
 /// <inheritdoc />
 public void Report(IReportingContext context)
 {
 }
Ejemplo n.º 13
0
        /// <inheritdoc />
        public void Report(IReportingContext context)
        {
            this.decoratedReporter.Report(context);

            File.WriteAllText(Path.Combine(Directory.GetCurrentDirectory(), "CustomizationReport.txt"), this.decoratedReporter.ToString());
        }
 public ReportingAdditionalInfoPage(IReportingContext context)
 {
     _context = context;
 }
 public IReportingPage[] GetPages(IReportingContext context)
 {
     return(new IReportingPage[] { new ReportingMppsDocumentationComponent(context) });
 }
 public IReportingPage[] GetPages(IReportingContext context)
 {
     return(new IReportingPage[] { new ReportingAdditionalInfoPage(context) });
 }
Ejemplo n.º 17
0
        /// <inheritdoc />
        public void Report(IReportingContext context)
        {
            this.decoratedReporter.Report(context);

            File.WriteAllText(Path.Combine(Directory.GetCurrentDirectory(), "CustomizationReport.txt"), this.decoratedReporter.ToString());
        }
 public ReportingMppsDocumentationComponent(IReportingContext context)
 {
     _reportingContext = context;
 }
Ejemplo n.º 19
0
 public void Report(IReportingContext context)
 {
     this.context = context;
 }