Example #1
0
 private void VisitIBusInvocationExpression(InvocationExpressionSyntax node, SyntaxNode[] childNodes)
 {
     if (node.IsInvocationOfSend(_semanticModel, _context.CancellationToken))
     {
         var argumentExpression = node.ArgumentList.Arguments[0].Expression;
         var typeInfo           = _semanticModel.GetTypeInfo(argumentExpression);
         if (typeInfo.Type != null && typeInfo.Type.ImplementsInterface <IEvent>())
         {
             _context.ReportDiagnostic(node.CreateDiagnostic(RuleMp0112, argumentExpression.ToString()));
         }
     }
     else if (node.IsInvocationOfMethod(RequestAsyncMethodInfos, _semanticModel, _context.CancellationToken))
     {
         var argumentExpression = node.ArgumentList.Arguments[0].Expression;
         var typeInfo           = _semanticModel.GetTypeInfo(argumentExpression);
         if (typeInfo.Type != null && typeInfo.Type.ImplementsInterface <IEvent>())
         {
             _context.ReportDiagnostic(node.CreateDiagnostic(RuleMp0103, argumentExpression.ToString()));
         }
     }
 }