25 references to ThrowIfTrue
Microsoft.CodeAnalysis.Workspaces (25)
FindSymbols\Declarations\DeclarationFinder.cs (2)
28
Contract.
ThrowIfTrue
(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API");
78
Contract.
ThrowIfTrue
(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API");
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (1)
28
Contract.
ThrowIfTrue
(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API");
FindSymbols\IStreamingFindReferencesProgress.cs (1)
36
Contract.
ThrowIfTrue
(symbols.IsDefaultOrEmpty, "Symbols should be non empty");
FindSymbols\SymbolTree\SymbolTreeInfo.cs (3)
123
Contract.
ThrowIfTrue
(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API");
135
Contract.
ThrowIfTrue
(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API");
147
Contract.
ThrowIfTrue
(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API");
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (1)
136
Contract.
ThrowIfTrue
(info.Checksum != checksum, "How could the info stored for a particular PEReference now have a different checksum?");
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
180
Contract.
ThrowIfTrue
(info.Checksum != checksum, "If we computed a SymbolTreeInfo, then its checksum must match our checksum.");
202
Contract.
ThrowIfTrue
(info.Checksum != checksum, "If we computed a SymbolTreeInfo, then its checksum must match our checksum.");
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (1)
61
Contract.
ThrowIfTrue
(relatedDocuments.Length == 1, "We should have skipped non-linked files in the prior loop.");
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
160
Contract.
ThrowIfTrue
(conflictLocations.Count != 0, "We're the first phase, so we should have no conflict locations yet");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
139
Contract.
ThrowIfTrue
(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (4)
54
Contract.
ThrowIfTrue
(nodes.IsDefault, $"{nameof(nodes)}.{nameof(nodes.IsDefault)}");
55
Contract.
ThrowIfTrue
(edges.IsDefault, $"{nameof(edges)}.{nameof(edges.IsDefault)}");
68
Contract.
ThrowIfTrue
(_nodes.IsDefault, $"{nameof(_nodes)}.{nameof(_nodes.IsDefault)}");
69
Contract.
ThrowIfTrue
(_edges.IsDefault, $"{nameof(_edges)}.{nameof(_edges.IsDefault)}");
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
772
Contract.
ThrowIfTrue
(analyzersRemoved.Count == 0 && analyzersAdded.Count == 0, "Should only be called when there is work to do");
Workspace\Solution\Solution.cs (1)
95
Contract.
ThrowIfTrue
(this.WorkspaceKind == CodeAnalysis.WorkspaceKind.RemoteWorkspace, "Access .Workspace off of a RemoteWorkspace Solution is not supported.");
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (3)
203
Contract.
ThrowIfTrue
(generatedDocument.GetOriginalSourceTextContentHash() != contentIdentity.OriginalSourceTextContentHash, "Checksums must match!");
210
Contract.
ThrowIfTrue
(existingDocument.Identity != documentIdentity, "Identities must match!");
211
Contract.
ThrowIfTrue
(existingDocument.GetOriginalSourceTextContentHash() != contentIdentity.OriginalSourceTextContentHash, "Checksums must match!");
Workspace\Solution\SolutionState.cs (2)
325
Contract.
ThrowIfTrue
(projectInfos.HasDuplicates(static p => p.Id), "Duplicate ProjectId provided");
426
Contract.
ThrowIfTrue
(projectIds.HasDuplicates(), "Duplicate ProjectId provided");
Workspace\Solution\StateChecksums.cs (1)
314
Contract.
ThrowIfTrue
(