コード例 #1
0
 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);
     }
 }
コード例 #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);
            }
        }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
 public bool Equals(QueryClauseInfo other)
 {
     return(_castInfo.Equals(other._castInfo) &&
            _operationInfo.Equals(other._operationInfo));
 }