public static async Task <AsyncSolutionManager> CreateFromSourceAsync(string source)
        {
            var manager = new AsyncSolutionManager();
            await manager.LoadSourceAsync(source);

            return(manager);
        }
        public static async Task <AsyncSolutionManager> CreateFromTestAsync(string testName)
        {
            var manager = new AsyncSolutionManager();
            await manager.LoadTestAsync(testName);

            return(manager);
        }
Esempio n. 3
0
        private async Task AnalyzeOnDemandAsync()
        {
            if (this.source != null)
            {
                this.SolutionManager = await AsyncSolutionManager.CreateFromSourceAsync(this.source);
            }
            else if (this.testName != null)
            {
                this.SolutionManager = await AsyncSolutionManager.CreateFromTestAsync(this.testName);
            }
            else if (this.solutionPath != null)
            {
                this.SolutionManager = await AsyncSolutionManager.CreateFromSolutionAsync(this.solutionPath);
            }
            else
            {
                throw new Exception("We need a solutionPath, source code or testName to analyze");
            }

            var roots = await this.SolutionManager.GetRootsAsync(this.RootKind);

            var orchestator = new AnalysisOrchestrator(this.SolutionManager);
            await orchestator.AnalyzeAsync(roots);
        }