73 references to Condition
Microsoft.CodeAnalysis.CSharp (11)
Binder\Binder_Statements.cs (1)
2583
var condition = binder.BindBooleanExpression(node.
Condition
, diagnostics);
Binder\ExpressionVariableFinder.cs (1)
205
VisitNodeToBind(node.
Condition
);
Binder\LocalBinderFactory.cs (1)
819
Visit(node.
Condition
, enclosing);
Syntax.xml.Main.Generated.cs (1)
1915
=> 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));
Syntax.xml.Syntax.Generated.cs (7)
8372
if (attributeLists != this.AttributeLists || ifKeyword != this.IfKeyword || openParenToken != this.OpenParenToken || condition != this.
Condition
|| closeParenToken != this.CloseParenToken || statement != this.Statement || @else != this.Else)
8383
public new IfStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.IfKeyword, this.OpenParenToken, this.
Condition
, this.CloseParenToken, this.Statement, this.Else);
8384
public IfStatementSyntax WithIfKeyword(SyntaxToken ifKeyword) => Update(this.AttributeLists, ifKeyword, this.OpenParenToken, this.
Condition
, this.CloseParenToken, this.Statement, this.Else);
8385
public IfStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.IfKeyword, openParenToken, this.
Condition
, this.CloseParenToken, this.Statement, this.Else);
8387
public IfStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.
Condition
, closeParenToken, this.Statement, this.Else);
8388
public IfStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.
Condition
, this.CloseParenToken, statement, this.Else);
8389
public IfStatementSyntax WithElse(ElseClauseSyntax? @else) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.
Condition
, this.CloseParenToken, this.Statement, @else);
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
56
if (!ifStatement.
Condition
.IsKind(SyntaxKind.NotEqualsExpression))
95
var condition = (BinaryExpressionSyntax)ifStatement.
Condition
;
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (1)
39
=> ifStatement.
Condition
;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
36
condition = ifStatement.
Condition
;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
134
if (!IsReferenceEqualsNullCheck(semanticModel, ifStatement.
Condition
, cancellationToken, out var testedExpression))
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
93
condition = ifStatement.
Condition
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
169
(nodeParent is IfStatementSyntax ifStatement && ifStatement.
Condition
== node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501
if (originalIfStatement.
Condition
== previousOriginalNode)
504
if (!TypesAreCompatible(originalIfStatement.
Condition
, newIfStatement.
Condition
))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
502
var condition = IndentExpression(ifStatement, ifStatement.
Condition
, preferredIndentation).Parenthesize(includeElasticTrivia: false);
782
yield return ifStatement.
Condition
;
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
46
if (operation.Syntax is IfStatementSyntax {
Condition
: CheckedExpressionSyntax exp })
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
59
var isExpression = (BinaryExpressionSyntax)ifStatement.
Condition
;
90
var newIf = currentIf.ReplaceNode(currentIf.
Condition
, updatedCondition);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\ExtensionOperatorsTests.cs (1)
2179
var opNode = tree.GetRoot().DescendantNodes().OfType<Syntax.IfStatementSyntax>().First().
Condition
;
Microsoft.CodeAnalysis.CSharp.Features (23)
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (2)
88
ifStatement.
Condition
.WithCommentsFrom(ifStatement.OpenParenToken, ifStatement.CloseParenToken))
276
ifStatement.
Condition
.WithCommentsFrom(ifStatement.OpenParenToken, ifStatement.CloseParenToken))
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
48
=> AddExpressionTerms(node.
Condition
, _expressions);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
828
return AreEquivalentIgnoringLambdaBodies(oldNode.
Condition
, newNode.
Condition
);
EditAndContinue\SyntaxComparer.cs (2)
882
distance = ComputeWeightedDistance(leftIf.
Condition
, leftIf.Statement, rightIf.
Condition
, rightIf.Statement);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
173
return node.WithCondition(VisitNode(node.
Condition
))
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
40
=> ifNode.
Condition
;
Snippets\CSharpIfSnippetProvider.cs (1)
31
=> node.
Condition
;
SplitOrMergeIfStatements\CSharpIfLikeStatementGenerator.cs (2)
33
if (expression.Parent is IfStatementSyntax ifStatement && ifStatement.
Condition
== expression)
71
return ifStatement.
Condition
;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
56
if (!ifStatement.
Condition
.IsKind(SyntaxKind.NotEqualsExpression))
95
var condition = (BinaryExpressionSyntax)ifStatement.
Condition
;
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (1)
39
=> ifStatement.
Condition
;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
36
condition = ifStatement.
Condition
;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
134
if (!IsReferenceEqualsNullCheck(semanticModel, ifStatement.
Condition
, cancellationToken, out var testedExpression))
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
93
condition = ifStatement.
Condition
;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
502
var condition = IndentExpression(ifStatement, ifStatement.
Condition
, preferredIndentation).Parenthesize(includeElasticTrivia: false);
782
yield return ifStatement.
Condition
;
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
46
if (operation.Syntax is IfStatementSyntax {
Condition
: CheckedExpressionSyntax exp })
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
59
var isExpression = (BinaryExpressionSyntax)ifStatement.
Condition
;
90
var newIf = currentIf.ReplaceNode(currentIf.
Condition
, updatedCondition);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\GetSemanticInfoTests.cs (1)
975
var condition = ifStatement.
Condition
;
Compilation\SemanticModelAPITests.cs (2)
4463
var originalTypeInfo = model.GetTypeInfo(ifStatement.
Condition
);
4466
var speculativeTypeInfo = specModel.GetTypeInfo(replacementIfStatement.
Condition
);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
Generated\Syntax.Test.xml.Generated.cs (2)
12772
Assert.NotNull(node.
Condition
);
12776
var newNode = node.WithAttributeLists(node.AttributeLists).WithIfKeyword(node.IfKeyword).WithOpenParenToken(node.OpenParenToken).WithCondition(node.
Condition
).WithCloseParenToken(node.CloseParenToken).WithStatement(node.Statement).WithElse(node.Else);
Parsing\StatementParsingTests.cs (8)
2026
Assert.NotNull(ss.
Condition
);
2027
Assert.Equal("a", ss.
Condition
.ToString());
2049
Assert.NotNull(ss.
Condition
);
2050
Assert.Equal("a", ss.
Condition
.ToString());
2075
Assert.NotNull(ss.
Condition
);
2076
Assert.Equal("a", ss.
Condition
.ToString());
2088
Assert.NotNull(subIf.
Condition
);
2089
Assert.Equal("b", subIf.
Condition
.ToString());
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
169
(nodeParent is IfStatementSyntax ifStatement && ifStatement.
Condition
== node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501
if (originalIfStatement.
Condition
== previousOriginalNode)
504
if (!TypesAreCompatible(originalIfStatement.
Condition
, newIfStatement.
Condition
))
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
96
if (containingIfStatement.
Condition
.Kind() != SyntaxKind.LessThanOrEqualExpression)
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
169
(nodeParent is IfStatementSyntax ifStatement && ifStatement.
Condition
== node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501
if (originalIfStatement.
Condition
== previousOriginalNode)
504
if (!TypesAreCompatible(originalIfStatement.
Condition
, newIfStatement.
Condition
))
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
586
if (HandleConditionalCase(ifStatement.
Condition
, ifStatement.Statement, ifStatement.Else))