public AnalyzerViewModel(AnalyzerModel modelModel, NodeView nodeView) { _analyzerModelModel = modelModel; modelModel.PropertyChanged += model_PropertyChanged; InitializeDelegateCommands(); }
private void RunMappingTest(string resourceFileName, Platform platform) { var analyzerResult = RoslynCompiler.Run(resourceFileName, platform); AnalyzerModel analyzerModel = new AnalyzerModel() { CallGraph = analyzerResult.CallGraph }; CodeModel codeModel = new CodeModel() { AnalyzerModel = analyzerModel }; var cache = new Cache() { SemanticModel = analyzerResult.SemanticModel, SyntaxRoot = analyzerResult.SemanticModel.SyntaxTree.GetRoot() }; foreach (SyntaxNode node in analyzerResult.SemanticModel.SyntaxTree.GetRoot().DescendantNodes()) { var symbol = cache.SemanticModel.GetSymbolInfo(node).Symbol; if (symbol == null || (symbol.Kind != SymbolKind.Method && symbol.Kind != SymbolKind.Property && symbol.Kind != SymbolKind.NamedType)) { continue; } if ((symbol as IMethodSymbol)?.MethodKind == MethodKind.BuiltinOperator) { continue; } if (symbol.Kind == SymbolKind.NamedType && node.FirstAncestorOrSelf <ObjectCreationExpressionSyntax>() == null || node.FirstAncestorOrSelf <TypeArgumentListSyntax>() != null) { continue; } var method = codeModel.GetMethodCall(cache, node.Span); if (method == null) { Console.WriteLine("Platform " + platform); Console.WriteLine("No mapped Method found for " + node.ToString()); Console.WriteLine("Events:\r\n"); foreach (var e in analyzerResult.CallGraph.EventDetails) { Console.WriteLine(e.ToString()); } Assert.Fail("No mapped Method found for " + node.ToString()); } } }
public AnalyzerView(AnalyzerModel Model, NodeView nodeView) { InitializeComponent(); }