61 references to Condition
Microsoft.CodeAnalysis.CSharp (11)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1927=> node.Update(VisitList(node.AttributeLists), VisitToken(node.IfKeyword), VisitToken(node.OpenParenToken), (ExpressionSyntax?)Visit(node.Condition) ?? throw new ArgumentNullException("condition"), VisitToken(node.CloseParenToken), (StatementSyntax?)Visit(node.Statement) ?? throw new ArgumentNullException("statement"), (ElseClauseSyntax?)Visit(node.Else));
_generated\2\Syntax.xml.Syntax.Generated.cs (7)
8418if (attributeLists != this.AttributeLists || ifKeyword != this.IfKeyword || openParenToken != this.OpenParenToken || condition != this.Condition || closeParenToken != this.CloseParenToken || statement != this.Statement || @else != this.Else) 8429public new IfStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.IfKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement, this.Else); 8430public IfStatementSyntax WithIfKeyword(SyntaxToken ifKeyword) => Update(this.AttributeLists, ifKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement, this.Else); 8431public IfStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.IfKeyword, openParenToken, this.Condition, this.CloseParenToken, this.Statement, this.Else); 8433public IfStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.Condition, closeParenToken, this.Statement, this.Else); 8434public IfStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, statement, this.Else); 8435public IfStatementSyntax WithElse(ElseClauseSyntax? @else) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement, @else);
Binder\Binder_Statements.cs (1)
2590var condition = binder.BindBooleanExpression(node.Condition, diagnostics);
Binder\ExpressionVariableFinder.cs (1)
205VisitNodeToBind(node.Condition);
Binder\LocalBinderFactory.cs (1)
819Visit(node.Condition, enclosing);
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\roslyn\src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
56if (!ifStatement.Condition.IsKind(SyntaxKind.NotEqualsExpression)) 95var condition = (BinaryExpressionSyntax)ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (1)
38=> ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
41condition = ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
134if (!IsReferenceEqualsNullCheck(semanticModel, ifStatement.Condition, cancellationToken, out var testedExpression))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
94condition = ifStatement.Condition;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
168(nodeParent is IfStatementSyntax ifStatement && ifStatement.Condition == node) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501if (originalIfStatement.Condition == previousOriginalNode) 504if (!TypesAreCompatible(originalIfStatement.Condition, newIfStatement.Condition))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
565var condition = IndentNode(ifStatement, ifStatement.Condition, preferredIndentation).Parenthesize(includeElasticTrivia: false); 851yield return ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
46if (operation.Syntax is IfStatementSyntax { Condition: CheckedExpressionSyntax exp })
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
56var isExpression = (BinaryExpressionSyntax)ifStatement.Condition; 87var newIf = currentIf.ReplaceNode(currentIf.Condition, updatedCondition);
Microsoft.CodeAnalysis.CSharp.Features (23)
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (2)
88ifStatement.Condition.WithCommentsFrom(ifStatement.OpenParenToken, ifStatement.CloseParenToken)) 275ifStatement.Condition.WithCommentsFrom(ifStatement.OpenParenToken, ifStatement.CloseParenToken))
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
48=> AddExpressionTerms(node.Condition, _expressions);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
828return AreEquivalentIgnoringLambdaBodies(oldNode.Condition, newNode.Condition);
EditAndContinue\SyntaxComparer.cs (2)
882distance = ComputeWeightedDistance(leftIf.Condition, leftIf.Statement, rightIf.Condition, rightIf.Statement);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
173return node.WithCondition(VisitNode(node.Condition))
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
45=> ifNode.Condition;
Snippets\CSharpIfSnippetProvider.cs (1)
31=> node.Condition;
SplitOrMergeIfStatements\CSharpIfLikeStatementGenerator.cs (2)
33if (expression.Parent is IfStatementSyntax ifStatement && ifStatement.Condition == expression) 71return ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
56if (!ifStatement.Condition.IsKind(SyntaxKind.NotEqualsExpression)) 95var condition = (BinaryExpressionSyntax)ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (1)
38=> ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
41condition = ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
134if (!IsReferenceEqualsNullCheck(semanticModel, ifStatement.Condition, cancellationToken, out var testedExpression))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
94condition = ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
565var condition = IndentNode(ifStatement, ifStatement.Condition, preferredIndentation).Parenthesize(includeElasticTrivia: false); 851yield return ifStatement.Condition;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
46if (operation.Syntax is IfStatementSyntax { Condition: CheckedExpressionSyntax exp })
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
56var isExpression = (BinaryExpressionSyntax)ifStatement.Condition; 87var newIf = currentIf.ReplaceNode(currentIf.Condition, updatedCondition);
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (2)
231if (ifStatement.Condition is PrefixUnaryExpressionSyntax unary && unary.IsKind(SyntaxKind.LogicalNotExpression)) 259else if (ifStatement.Condition.IsKind(SyntaxKind.InvocationExpression) && ifStatement.Else is not null)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
168(nodeParent is IfStatementSyntax ifStatement && ifStatement.Condition == node) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501if (originalIfStatement.Condition == previousOriginalNode) 504if (!TypesAreCompatible(originalIfStatement.Condition, newIfStatement.Condition))
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
96if (containingIfStatement.Condition.Kind() != SyntaxKind.LessThanOrEqualExpression)
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
168(nodeParent is IfStatementSyntax ifStatement && ifStatement.Condition == node) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501if (originalIfStatement.Condition == previousOriginalNode) 504if (!TypesAreCompatible(originalIfStatement.Condition, newIfStatement.Condition))
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
586if (HandleConditionalCase(ifStatement.Condition, ifStatement.Statement, ifStatement.Else))