51 references to ThrowIfTrue
Microsoft.CodeAnalysis.CodeStyle (51)
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (2)
213Contract.ThrowIfTrue(additionalLocations.IsEmpty()); 214Contract.ThrowIfTrue(tagIndices.IsEmpty());
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
147Contract.ThrowIfTrue(seenInvocation && seenIndexAssignment);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
229Contract.ThrowIfTrue(arguments.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
237Contract.ThrowIfTrue(leftMaxEndValue < 0 && rightMaxEndValue < 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.NodeEnumerator.cs (2)
78Contract.ThrowIfTrue(_currentNodeHasValue); 79Contract.ThrowIfTrue(_stack.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (1)
27Contract.ThrowIfTrue(nodesAndTokens.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
106Contract.ThrowIfTrue(b1 != b2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
110Contract.ThrowIfTrue(semanticModel.ParentModel.IsSpeculativeSemanticModel); 111Contract.ThrowIfTrue(semanticModel.ParentModel.ParentModel != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
179Contract.ThrowIfTrue(node1.RawKind == 0 || node2.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
41Contract.ThrowIfTrue(token1.RawKind == 0 || token2.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
94Contract.ThrowIfTrue(treeData.Root.IsInvalidTokenRange(startToken, endToken));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
478Contract.ThrowIfTrue(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (1)
23Contract.ThrowIfTrue(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (1)
26Contract.ThrowIfTrue(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (3)
18Contract.ThrowIfTrue(anchorToken.RawKind == 0); 19Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0); 21Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (6)
19Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0); 20Contract.ThrowIfTrue(startToken.RawKind == 0); 21Contract.ThrowIfTrue(endToken.RawKind == 0); 41Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0); 42Contract.ThrowIfTrue(startToken.RawKind == 0); 43Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (3)
22Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0); 23Contract.ThrowIfTrue(startToken.RawKind == 0); 24Contract.ThrowIfTrue(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
79Contract.ThrowIfTrue(token1 == default && token2 == default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (1)
55Contract.ThrowIfTrue(RoslynString.IsNullOrEmpty(editorConfigStringForValue));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (3)
23Contract.ThrowIfTrue(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty); 62Contract.ThrowIfTrue(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty); 258Contract.ThrowIfTrue(semanticModel.SyntaxTree != containerDeclaration.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 433Contract.ThrowIfTrue(_contextualSymbolStack.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
524Contract.ThrowIfTrue(_methodSymbolStack.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (3)
165Contract.ThrowIfTrue(_requests != null && 174Contract.ThrowIfTrue(_cachedResult != null && 179Contract.ThrowIfTrue(_asynchronousComputeFunction == null && _synchronousComputeFunction != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (6)
85Contract.ThrowIfTrue(textSpan.IsEmpty); 149Contract.ThrowIfTrue(token.RawKind == 0); 170Contract.ThrowIfTrue(token1.RawKind == 0 && token2.RawKind == 0); 171Contract.ThrowIfTrue(token1.Equals(token2)); 290Contract.ThrowIfTrue(nextToken.RawKind == 0); 316Contract.ThrowIfTrue(previousToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (5)
52Contract.ThrowIfTrue(_index + values.Length > _values.Length); 59Contract.ThrowIfTrue(_index + values.Count > _values.Length); 66Contract.ThrowIfTrue(_index + values.Count > _values.Length); 73Contract.ThrowIfTrue(_index + values.Count > _values.Length); 107Contract.ThrowIfTrue(_index != _values.Length);