private static void CreateDiagnosticIfExpressionsMatch(SyntaxNodeAnalysisContext context, Location diagnosticLocation, SymbolInfo ifConditionIdentifier, SymbolInfo memberAccessIdentifier)
 {
     if ((ifConditionIdentifier.Symbol ?? memberAccessIdentifier.Symbol) == null)
     {
         return;
     }
     if (ifConditionIdentifier.Equals(memberAccessIdentifier))
     {
         var diagnostic = Diagnostic.Create(Rule, diagnosticLocation, "You can use the existence operator.");
         context.ReportDiagnostic(diagnostic);
     }
 }
Esempio n. 2
0
        public void StartSymbol(Receiver receiver, SymbolInfo symbol, object eventDetail)
        {
            StartSymbolDetail detail = (StartSymbolDetail)eventDetail;

            if (!symbol.Equals(Symbol))
            {
                throw new ApplicationException("Mismatching symbol.");
            }
            if (detail.LastTime != StartTime)
            {
                throw new ApplicationException("Mismatching start time. Expected: " + StartTime + " but was " + detail.LastTime);
            }
        }
 private static void CreateDiagnosticIfExpressionsMatch(SyntaxNodeAnalysisContext context, Location diagnosticLocation, SymbolInfo ifConditionIdentifier, SymbolInfo memberAccessIdentifier)
 {
     if ((ifConditionIdentifier.Symbol ?? memberAccessIdentifier.Symbol) == null) return;
     if (ifConditionIdentifier.Equals(memberAccessIdentifier))
     {
         var diagnostic = Diagnostic.Create(Rule, diagnosticLocation, "You can use the existence operator.");
         context.ReportDiagnostic(diagnostic);
     }
 }
Esempio n. 4
0
 public bool Equals(QueryClauseInfo other)
 {
     return(_castInfo.Equals(other._castInfo) &&
            _operationInfo.Equals(other._operationInfo));
 }