Beispiel #1
0
        private void WriteOutputFile(AnalyzedResults results)
        {
            var serializer = JsonSerializer.Create(new JsonSerializerSettings {
                Formatting = Formatting.Indented
            });

            using (var file = File.Open(_outputFile, FileMode.Create))
                using (var stream = new StreamWriter(file)) {
                    serializer.Serialize(stream, results);
                }
        }
Beispiel #2
0
        private async Task <AnalyzedResults> AnalyzeProjects()
        {
            var projectFiles = GetProjectPaths();

            var tasks   = projectFiles.Select(AnalyzeProject);
            var results = await Task.WhenAll(tasks);

            var combinedResult = results
                                 .SelectMany(r => r)
                                 .ToArray();

            var finalResult = new AnalyzedResults(combinedResult);

            return(finalResult);
        }