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