556 references to Contains
aspire (2)
Projects\DotNetAppHostProject.cs (2)
92if (ProjectExtensions.Contains(extension)) 533if (!ProjectExtensions.Contains(projectFile.Extension.ToLowerInvariant()))
Aspire.Components.Common.TestUtilities (2)
ConformanceTests.cs (2)
339var found = loggerFactory.Categories.Contains(category); 348var found = loggerFactory.Categories.Contains(category);
Aspire.Dashboard.Tests (1)
Integration\ResponseCompressionTests.cs (1)
53Assert.Contains(response.Content.Headers, h => h.Key == "Content-Encoding" && h.Value.Contains("br"));
Aspire.Hosting (11)
ApplicationModel\CommandsConfigurationExtensions.cs (3)
135static bool IsStopped(string? state) => KnownResourceStates.TerminalStates.Contains(state) || state == KnownResourceStates.NotStarted || state == "Unknown"; 170return state is not null && KnownResourceStates.BuildableStates.Contains(state) 248KnownResourceStates.TerminalStates.Contains(evt.Snapshot.State?.Text))
ApplicationModel\ResourceNotificationService.cs (1)
329KnownResourceStates.TerminalStates.Contains(snapshot.State?.Text) ||
Backchannel\AuxiliaryBackchannelRpcTarget.cs (2)
289re => re.Snapshot.State?.Text == KnownResourceStates.Running || KnownResourceStates.TerminalStates.Contains(re.Snapshot.State?.Text) || re.Snapshot.ExitCode is not null, 308re => KnownResourceStates.TerminalStates.Contains(re.Snapshot.State?.Text) || re.Snapshot.ExitCode is not null,
Health\ResourceHealthCheckService.cs (2)
73else if (KnownResourceStates.TerminalStates.Contains(resourceEvent.Snapshot.State?.Text)) 85&& KnownResourceStates.TerminalStates.Contains(evt.Snapshot.State?.Text));
Orchestrator\ApplicationOrchestrator.cs (2)
510KnownResourceStates.TerminalStates.Contains(currentState) && 513!KnownResourceStates.TerminalStates.Contains(previousState)))
Orchestrator\ParameterProcessor.cs (1)
111var dependentParameters = referencedParameters.Values.Where(p => !explicitParameters.Contains(p));
Aspire.Hosting.Azure (1)
AzurePublishingContext.cs (1)
379else if (resource is IResourceWithParameters rwp && !bicepResourcesToPublish.Contains(resource))
Aspire.Hosting.Containers.Tests (1)
DockerSocketBindMountTests.cs (1)
42e => KnownResourceStates.TerminalStates.Contains(e.Snapshot.State?.Text),
Aspire.Hosting.Tests (1)
Dcp\TestKubernetesService.cs (1)
40if (DeletedResources.Contains(name))
CodeStyleConfigFileGenerator (4)
Program.cs (4)
172isEnabledInNonDefaultMode = !rule.CustomTags.Contains(s_neverTag); 177isEnabledInNonDefaultMode = rule.CustomTags.Contains(s_highlyRecommendedTag); 182isEnabledInNonDefaultMode = rule.CustomTags.Contains(s_highlyRecommendedTag) || rule.CustomTags.Contains(s_recommendedTag);
CSharpSyntaxGenerator (3)
Grammar\GrammarGenerator.cs (3)
116if (!majorRules.Concat(lexicalRules).Contains(referencedRule)) 151var keywords = JoinWords(GetMembers<SyntaxKind>().Where(k => SyntaxFacts.IsReservedKeyword(k)).Select(SyntaxFacts.GetText).Where(t => !modifierWords.Contains(t))); 159.Where(m => SyntaxFacts.IsLanguagePunctuation(m) && !operatorTokens.Contains(m) && !m.ToString().StartsWith("Xml"))
dotnet (7)
Commands\Workload\Install\FileBasedInstaller.cs (1)
516!featureBandsWithWorkloadInstallationRecords.Contains(referencingFeatureBand))
Commands\Workload\Install\WorkloadInstallCommand.cs (1)
113if (!availableWorkloads.Select(workload => workload.Id.ToString()).Contains(workloadId))
Commands\Workload\Install\WorkloadManifestUpdater.cs (2)
258var unrecognizedManifestIds = manifestRollbacks.Where(rollbackManifest => !currentManifestIds.Contains(rollbackManifest.Id)); 262manifestRollbacks = manifestRollbacks.Where(rollbackManifest => currentManifestIds.Contains(rollbackManifest.Id));
Commands\Workload\List\WorkloadListCommand.cs (1)
149if (installedList.Contains(workloadId))
Commands\Workload\Uninstall\WorkloadUninstallCommand.cs (1)
64var unrecognizedWorkloads = _workloadIds.Where(workloadId => !installedWorkloads.Contains(workloadId));
NugetPackageDownloader\NuGetPackageDownloader.cs (1)
526defaultSources = [.. defaultSources.Where(source => sources.Contains(source.Name))];
dotnet-format (2)
Analyzers\AnalyzerFormatter.cs (1)
75.Where(codefix => codefix.GetFixAllProvider()?.GetSupportedFixAllScopes()?.Contains(FixAllScope.Solution) == true)
Analyzers\SolutionCodeFixApplier.cs (1)
25if (fixAllProvider?.GetSupportedFixAllScopes()?.Contains(FixAllScope.Solution) != true)
dotnet-svcutil-lib (8)
CmdCredentialsProvider.cs (2)
154if (!_validatedClientCerts.Keys.Contains(certhash)) 225if (!_validatedServerCerts.Keys.Contains(certhash))
CommandProcessorOptions.cs (1)
638if (!references.Contains(this.References[idx]))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (1)
485if (Enumerable.Contains(s_knownSerializableTypeNames, type.FullName))
Shared\MSBuildProj.cs (3)
975if (!propertyNames.All(p => this._resolvedProperties.Keys.Contains(p))) 977var propertyTable = this._resolvedProperties.Where(p => propertyNames.Contains(p.Key)); 990return this._resolvedProperties.Where(p => propertyNames.Contains(p.Key));
Shared\ProjectPropertyResolver.cs (1)
246if (string.IsNullOrWhiteSpace(propertyName) || propertyName.Any(c => chars.Contains(c) || !char.IsLetterOrDigit(c)))
GenerateDocumentationAndConfigFiles (25)
Program.cs (3)
1303return !rule.CustomTags.Contains(customTag); 1307return rule.CustomTags.Contains(customTag); 1499isEnabledRuleForNonDefaultAnalysisMode = rule.CustomTags.Contains(WellKnownDiagnosticTagsExtensions.EnabledRuleInAggressiveMode);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
374!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
764type?.AllInterfaces.Contains(iDisposableType) == true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
ILLink.CodeFixProvider (2)
DynamicallyAccessedMembersCodeFixProvider.cs (2)
114addAsReturnAttribute: AttributeOnReturn.Contains(diagnostic.Id), 115addGenericParameterAttribute: AttributeOnGeneric.Contains(diagnostic.Id),
Infrastructure.Common (1)
ConditionalWcfTest.cs (1)
57else if (TestProperties.PropertyNames.Contains(conditionName))
installer.tasks (2)
GenerateTestSharedFrameworkDepsFile.cs (1)
122if (ridFallback.Contains(runtime))
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
171.Where(r => r.Content?.Sections.Contains(s) == true)
Microsoft.Agents.AI.ProjectTemplates.Tests (3)
test\ProjectTemplates\Infrastructure\TemplateTestUtilities.cs (3)
90args.Contains($"{option}={value}"); 94args.Contains(option) || args.Contains($"{option}=true");
Microsoft.AspNetCore.SignalR.Core (4)
DefaultHubLifetimeManager.cs (4)
264DefaultHubLifetimeManager<THub>.SendToGroupConnections(methodName, args, group, (connection, state) => !((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), excludedConnectionIds, ref tasks, ref message, cancellationToken); 318return SendToAllConnections(methodName, args, (connection, state) => !((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), excludedConnectionIds, cancellationToken); 324return SendToAllConnections(methodName, args, (connection, state) => ((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), connectionIds, cancellationToken); 330return SendToAllConnections(methodName, args, (connection, state) => ((IReadOnlyList<string>)state!).Contains(connection.UserIdentifier), userIds, cancellationToken);
Microsoft.Build (5)
BackEnd\Components\Communications\RarNodeLauncher.cs (1)
64return pipeNames.Contains(Path.Combine(NamedPipeRoot, _pipeName));
BackEnd\Components\Scheduler\Scheduler.cs (1)
1712blockingRequest.RequestsWeAreBlockedBy.Contains(blockedRequest))
BackEnd\Shared\BuildResult.cs (1)
573if (!targetsToKeep.Contains(target))
BuildCheck\Infrastructure\BuildEventsProcessor.cs (1)
250if (!checkWrapper.Check.SupportedRules.Contains(result.CheckRule))
Graph\ProjectInterpretation.cs (1)
264if (outerBuildReferencingProject.ProjectReferences.Contains(innerBuild))
Microsoft.Build.Framework (5)
Collections\ReadOnlyCollection.cs (1)
121return _backing.Contains<T>(item);
Utilities\FrameworkLocationHelper.cs (4)
671if (!visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion)) 686if (!visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion)) 716if (!visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion)) 731if (!visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion))
Microsoft.Build.Tasks.Core (1)
AssemblyDependency\ReferenceTable.cs (1)
996if ((_enableCustomCulture && !_nonCultureResourceDirectories.Contains(cultureName))
Microsoft.CodeAnalysis (4)
CommandLine\Feature.cs (1)
43Debug.Assert(flags.Contains(s), $"Unknown feature flag: {s}");
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1081Debug.Assert(suppressableDiagnostics.Contains(diagnostic));
Syntax\GreenNode.cs (2)
495if (annotationKinds.Contains(a.Kind)) 572if (annotationKinds.Contains(annotation.Kind))
Microsoft.CodeAnalysis.Analyzers (26)
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
122if (!diagnosticAnalyzerTypes.Contains(declaredType))
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (1)
284if (!range.Contains('-'))
MetaAnalyzers\ReportDiagnosticAnalyzer.cs (1)
188if (field.Type is INamedTypeSymbol fieldType && fieldType.GetBaseTypesAndThis().Contains(_diagnosticDescriptorType))
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
660if (pathParts.Contains(ThisDirectory))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
374!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
764type?.AllInterfaces.Contains(iDisposableType) == true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Microsoft.CodeAnalysis.AnalyzerUtilities (38)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
660if (pathParts.Contains(ThisDirectory))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
374!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (3)
172if (DisposeOwnershipTransferLikelyTypes.Contains(parameter.Type) || 388DisposeOwnershipTransferLikelyTypes.Contains(operation.Parameter.Type), 391IsDisposableCreationSpecialCase(invocation.TargetMethod) && DisposeOwnershipTransferLikelyTypes.Contains(operation.Parameter.Type),
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
156containingMethod.Parameters.Any(p => _disposeOwnershipTransferLikelyTypes.Contains(p.Type));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (7)
153if (this.TrackedTypeSymbols.Any(s => operation.Type.GetBaseTypesAndThis().Contains(s))) 224&& this.TrackedTypeSymbols.Any(s => operation.Target.Type.GetBaseTypesAndThis().Contains(s)) 285&& this.TrackedTypeSymbols.Any(s => propertyReferenceOperation.Instance.Type.GetBaseTypesAndThis().Contains(s)) 465if (visitedArgument.Value?.Type != null && this.TrackedTypeSymbols.Any(s => visitedArgument.Value.Type.GetBaseTypesAndThis().Contains(s))) 480&& this.TrackedTypeSymbols.Any(s => visitedInstance.Type.GetBaseTypesAndThis().Contains(s)) 539if (this.TrackedTypeSymbols.Any(s => argumentTypeSymbol.GetBaseTypesAndThis().Contains(s)) 656&& this.TrackedTypeSymbols.Any(s => returnValue.Type.GetBaseTypesAndThis().Contains(s))
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (3)
179analysisEntity = _interproceduralCallStack != null && _interproceduralCallStack.Peek().DescendantsAndSelf().Contains(instanceReference) ? 421Debug.Assert(_interproceduralCallStack.Last().Descendants().Contains(flowCaptureOrReference)); 425Debug.Assert(_controlFlowGraph.DescendantOperations().Contains(flowCaptureOrReference));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2581originalOperation.Descendants().Contains(operation)) 3678!deconstructionAncestor.Target.Descendants().Contains(operation))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
764type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.CodeStyle (25)
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (1)
87Debug.Assert(option is { Definition.DefaultValue: ICodeStyleOption2 } == descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomSeverityConfigurable));
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
207if (descriptor.CustomTags.Contains(WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (4)
551if (!ineligibleFieldUsages.All(loc => loc.Ancestors().Contains(result.PropertyDeclaration))) 571NonConstructorLocations(writeLocations1).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 584NonConstructorLocations(writeLocations2).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 629if (!node.AncestorsAndSelf().Contains(propertyDeclaration))
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
660if (pathParts.Contains(ThisDirectory))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
764type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
122.LastOrDefault(a => a.AncestorsAndSelf().Contains(node));
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
146.Any(nameAttributes => nameAttributes.Select(GetValueFromNameAttribute).Contains(name));
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
273.Contains(State.TypeToGenerateIn);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
175.Contains(state.TypeToGenerateIn);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
220if (!ContainingType.Interfaces.OfType<INamedTypeSymbol>().Contains(TypeToGenerateIn))
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
166n => !memberNames.Contains(n) &&
src\roslyn\src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
87fieldDeclarators.Contains(declarator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Microsoft.CodeAnalysis.CSharp (6)
Binder\Binder_Statements.cs (1)
158Debug.Assert(System.Linq.Enumerable.Contains(result.Syntax.AncestorsAndSelf(), node), @"Bound statement (or one of its parents)
FlowAnalysis\DefiniteAssignment.cs (1)
2299if (!_usedLocalFunctions.Contains(symbol))
Symbols\Metadata\PE\PEAssemblySymbol.cs (1)
211if (visitedAssemblies != null && visitedAssemblies.Contains(firstSymbol))
Symbols\Metadata\PE\PENamedTypeSymbol.cs (2)
1453Debug.Assert(!nonEventFields.Contains(associatedField)); 1975=> MemberNames.Contains(WellKnownMemberNames.CloneMethodName);
Symbols\Source\SourceAssemblySymbol.cs (1)
2906if (visitedAssemblies != null && visitedAssemblies.Contains(firstSymbol))
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
241type.AllInterfaces.Contains(convertedType)) 264if (CollectionExpressionUtilities.IsWellKnownCollectionInterface(convertedType) && type.AllInterfaces.Contains(convertedType))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
383nodesAndTokens[^1] = lastNode.WithTrailingTrivia(lastNode.GetTrailingTrivia().Where(t => !trailingWhitespaceAndComments.Contains(t)));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
70var statementToUpdateIndex = IndexOf(originalBlockStatements, s => topmostUsingStatements.Contains(s));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
450if (attributes.Contains(attributeToRemove))
Microsoft.CodeAnalysis.CSharp.Features (10)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
245tupleExpression.Arguments.Count(a => nonConflictReferences.Contains(a.Expression)) == 1)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (1)
112if (!containingType.Interfaces.Contains(symbol))
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (1)
53Debug.Assert(context.CodeBlock.DescendantNodesAndSelf().Contains(root));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
463localFunctionIdentifiers.Contains(rightmostName.Identifier.ValueText));
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
241type.AllInterfaces.Contains(convertedType)) 264if (CollectionExpressionUtilities.IsWellKnownCollectionInterface(convertedType) && type.AllInterfaces.Contains(convertedType))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
383nodesAndTokens[^1] = lastNode.WithTrailingTrivia(lastNode.GetTrailingTrivia().Where(t => !trailingWhitespaceAndComments.Contains(t)));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
70var statementToUpdateIndex = IndexOf(originalBlockStatements, s => topmostUsingStatements.Contains(s));
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
70node.AncestorsAndSelf().Contains(containingLambda.Body))
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (1)
104if (token.GetRequiredParent().Ancestors().Contains(listSyntax))
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
450if (attributes.Contains(attributeToRemove))
Microsoft.CodeAnalysis.Extensions.Package (2)
Symbols\ISymbolExtensions.cs (1)
264&& kinds.Contains(symbol.Kind);
Symbols\ITypeSymbolExtensions.cs (1)
764type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.Features (24)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
111.Contains(compilation.GetTypeByMetadataName("System.Diagnostics.DebuggerDisplayAttribute"));
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
101=> symbol.DeclaringSyntaxReferences.Any(static (r, compilation) => compilation.SyntaxTrees.Contains(r.SyntaxTree), compilation);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
117if (property.Ancestors().Contains(typeBlock))
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
279if (collectionType.TypeKind == TypeKind.Interface && knownCollectionInterfaces.Contains(collectionType.OriginalDefinition)) 295if (!knownCollectionInterfaces.Contains(current.OriginalDefinition))
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
476return containingFunction.AncestorsAndSelf().Contains(forStatement);
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
58var orderedFeatureProviders = ExtensionOrderer.Order(allServices).WhereAsArray(c => c.Metadata.Languages.Contains(languageName));
GenerateType\AbstractGenerateTypeService.cs (1)
150.FirstOrDefault(node.GetAncestorsOrThis<SyntaxNode>().Contains);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
552if (symbolSyntax.Ancestors().Contains(typeDeclaration))
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
498if (initializer?.DescendantNodesAndSelf().Contains(calleeMethodInvocationNode) is true &&
MetadataAsSource\MetadataAsSourceFileService.cs (1)
214if (workspace.GetOpenDocumentIds().Contains(documentId))
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (1)
87Debug.Assert(option is { Definition.DefaultValue: ICodeStyleOption2 } == descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomSeverityConfigurable));
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
207if (descriptor.CustomTags.Contains(WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (4)
551if (!ineligibleFieldUsages.All(loc => loc.Ancestors().Contains(result.PropertyDeclaration))) 571NonConstructorLocations(writeLocations1).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 584NonConstructorLocations(writeLocations2).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 629if (!node.AncestorsAndSelf().Contains(propertyDeclaration))
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
122.LastOrDefault(a => a.AncestorsAndSelf().Contains(node));
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
146.Any(nameAttributes => nameAttributes.Select(GetValueFromNameAttribute).Contains(name));
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
273.Contains(State.TypeToGenerateIn);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
175.Contains(state.TypeToGenerateIn);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
220if (!ContainingType.Interfaces.OfType<INamedTypeSymbol>().Contains(TypeToGenerateIn))
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
166n => !memberNames.Contains(n) &&
src\roslyn\src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
87fieldDeclarators.Contains(declarator)
Microsoft.CodeAnalysis.ResxSourceGenerator (23)
AbstractResxGenerator.cs (1)
43var hasAggressiveInlining = methodImplOptions?.MemberNames.Contains(nameof(MethodImplOptions.AggressiveInlining)) ?? false;
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
660if (pathParts.Contains(ThisDirectory))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
374!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
764type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.Workspaces (45)
FindSymbols\SymbolFinder_Hierarchy.cs (1)
165if (interfaceType.MemberNames.Contains(nameToLookFor))
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
89var referencingProjects = new HashSet<ProjectId>(solution.Projects.Where(p => p.MetadataReferences.Contains(reference)).Select(p => p.Id));
Rename\ConflictEngine\MutableConflictResolution.cs (1)
55RelatedLocations.RemoveAll(r => conflictLocationDocumentIds.Contains(r.DocumentId));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
764type?.AllInterfaces.Contains(iDisposableType) == true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Workspace\Host\EventListener\EventListenerTracker.cs (1)
27.Where(l => l.Metadata.WorkspaceKinds.Contains(workspaceKind))
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
1321return _projectSystemProjectFactory.Workspace.CurrentSolution.GetRequiredProject(Id).AllProjectReferences.Contains(projectReference);
Workspace\Solution\ProjectDependencyGraph.cs (1)
577return GetProjectsThatTransitivelyDependOnThisProject(potentialDependency).Contains(id);
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
180if (referencedProjectIds.Contains(projectIdToUpdate) || existingReverseTransitiveReferences?.Overlaps(referencedProjectIds) == true)
Workspace\Solution\Solution.cs (5)
698if (!oldProject.ProjectReferences.Contains(projectReference)) 790if (!oldProject.MetadataReferences.Contains(metadataReference)) 877if (!oldProject.AnalyzerReferences.Contains(analyzerReference)) 932if (this.SolutionState.AnalyzerReferences.Contains(analyzerReference)) 952if (!this.SolutionState.AnalyzerReferences.Contains(analyzerReference))
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (2)
105Contract.ThrowIfTrue(this.CompilationWithoutGeneratedDocuments.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None))); 205Contract.ThrowIfTrue(compilationWithoutGeneratedDocuments.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None)));
Workspace\Solution\SolutionState.cs (3)
1403=> GetRequiredProjectState(projectId).ProjectReferences.Contains(projectReference); 1406=> GetRequiredProjectState(projectId).MetadataReferences.Contains(metadataReference); 1409=> GetRequiredProjectState(projectId).AnalyzerReferences.Contains(analyzerReference);
Workspace\Workspace.cs (9)
1477if (!project.ProjectReferences.Contains(newProjRef)) 2361if (!this.CurrentSolution.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference)) 2374if (this.CurrentSolution.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference)) 2401if (!this.CurrentSolution.GetProject(projectId)!.MetadataReferences.Contains(metadataReference)) 2412if (this.CurrentSolution.GetProject(projectId)!.MetadataReferences.Contains(metadataReference)) 2423if (!this.CurrentSolution.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference)) 2434if (this.CurrentSolution.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference)) 2445if (!solution.AnalyzerReferences.Contains(analyzerReference)) 2456if (solution.AnalyzerReferences.Contains(analyzerReference))
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildWorkspace.cs (1)
642if (!project.MetadataReferences.Contains(metadataReference))
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
MSBuild\ProjectFile\ProjectCommandLineReader.cs (1)
22if (!knownCommandLineParserLanguages.Contains(languageName))
Microsoft.Diagnostics.NETCore.Client (4)
DiagnosticsClient\EventPipeProvider.cs (4)
70string escapedKey = a.Key.Contains(';') || a.Key.Contains('=') ? $"\"{a.Key}\"" : a.Key; 71string escapedValue = a.Value.Contains(';') || a.Value.Contains('=') ? $"\"{a.Value}\"" : a.Value;
Microsoft.DotNet.Build.Tasks.Workloads (1)
Swix\SwixComponent.cs (1)
200if (pack.IsAlias && pack.AliasTo != null && !pack.AliasTo.Keys.Any(rid => s_SupportedRids.Contains(rid)))
Microsoft.DotNet.Cli.Definitions (2)
Commands\New\CommandDefinitionExtensions.cs (2)
33if (!except.Contains(optionName)) 41if (!except.Contains(argumentName))
Microsoft.DotNet.Cli.Utils (1)
DependencyProvider.cs (1)
68public bool HasVisualStudioDependency => Dependents.Contains(VisualStudioDependentKeyName);
Microsoft.DotNet.GenFacades (6)
GenPartialFacadeSourceGenerator.cs (1)
53referenceTypes = referenceTypes.Where(type => !OmitTypes.Contains(type));
NotSupportedAssemblyGenerator.cs (4)
118if (_exclusionApis != null && _exclusionApis.Contains(GetMethodDefinition(node))) 135if (_exclusionApis != null && _exclusionApis.Contains(GetPropertyDefinition(node))) 143if (_exclusionApis != null && _exclusionApis.Contains(GetEventDefinition(node))) 151if (_exclusionApis != null && _exclusionApis.Contains(GetFullyQualifiedName(node)))
SourceGenerator.cs (1)
73if (_seedTypePreferences.Keys.Contains(type))
Microsoft.DotNet.HotReload.Watch (7)
AppModels\HotReloadAppModel.cs (5)
27if (capabilities.Contains(ProjectCapability.WebAssembly)) 33if (capabilities.Contains(ProjectCapability.AspNetCore)) 35if (projectNode.GetDescendantsAndSelf().FirstOrDefault(static p => p.GetCapabilities().Contains(ProjectCapability.WebAssembly)) is { } clientProject) 45if (capabilities.Contains(ProjectCapability.HotReloadWebSockets)) 73!project.GetCapabilities().Contains(ProjectCapability.WebAssembly))
HotReload\HotReloadDotNetWatcher.cs (1)
160if (projectGraph.Graph.GraphRoots.Single()?.GetCapabilities().Contains(AspireServiceFactory.AppHostProjectCapability) == true)
Process\WebServerProcessStateObserver.cs (1)
29bool isAspireHost = serverProject.GetCapabilities().Contains(AspireServiceFactory.AppHostProjectCapability);
Microsoft.DotNet.SharedFramework.Sdk (1)
src\GenerateSharedFrameworkDepsFile.cs (1)
103.Where(expansion => expansion.Contains(RuntimeIdentifier))
Microsoft.DotNet.XliffTasks (1)
Model\XamlRuleDocument.cs (1)
110if (localizableProperties.Contains(attribute.Name.LocalName))
Microsoft.Extensions.AI.Templates.Tests (3)
test\ProjectTemplates\Infrastructure\TemplateTestUtilities.cs (3)
90args.Contains($"{option}={value}"); 94args.Contains(option) || args.Contains($"{option}=true");
Microsoft.Extensions.Configuration (1)
ConfigurationManager.cs (1)
311return _properties.Contains(item);
Microsoft.Extensions.Http.Resilience (1)
Polly\HttpRetryStrategyOptionsExtensions.cs (1)
57return !methods.Contains(request.Method);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Program.cs (1)
14.Where(t => t.GetInterfaces().Contains(typeof(IFuzzer)))
Microsoft.Gen.Logging (1)
Parsing\TypeSymbolExtensions.cs (1)
74symbols.IgnorePropertiesSymbols.Contains(typeSymbol);
Microsoft.Interop.SourceGeneration (4)
Marshalling\ElementsMarshalling.cs (1)
578if (UsesLastIndexMarshalled(CollectionSource.TypeInfo, CollectionSource.CodeContext) && stagesToGeneratePerElement.Contains(StubIdentifierContext.Stage.Marshal))
TypeSymbolExtensions.cs (3)
332if (typeName.Contains('<') || typeName.Contains('+') || typeName.Contains('/'))
Microsoft.Maui (1)
VisualDiagnostics\VisualDiagnosticsOverlay.cs (1)
54 if (!ScrollViews.Contains(scrollBar))
Microsoft.Maui.Controls (13)
BindingExpression.cs (1)
407 if (bindablePropertyField != null && bindablePropertyField.FieldType == typeof(BindableProperty) && sourceType.ImplementedInterfaces.Contains(typeof(IElementController)))
BindingExpressionHelper.cs (2)
34 if (stringValue.EndsWith(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator, StringComparison.Ordinal) && DecimalTypes.Contains(convertTo)) 41 if (stringValue == "-0" && DecimalTypes.Contains(convertTo))
ListProxy.cs (1)
81 return _items.Values.Contains(item);
MultiPage.cs (1)
351 if (selected == null || !ItemsSource.Cast<object>().Contains(selected))
NavigationPage\NavigationPage.cs (1)
525 var rootPage = this.FindParentWith(x => (x is IWindow te || Window.Navigation.ModalStack.Contains(x)), true);
ReadOnlyListAdapter.cs (1)
63 return _list.Contains(value);
ResourceDictionary.cs (1)
169 || (_mergedInstance != null && _mergedInstance.Contains(item));
Shell\BaseShellItem.cs (1)
134 return shell.GetItems().Contains(this);
Shell\ShellItem.cs (1)
267 if (CurrentItem == null && ((IShellItemController)this).GetItems().Contains(child))
Shell\ShellSection.cs (2)
436 if (Navigation.ModalStack.Contains(navStack[navStack.Count - 1])) 709 if (CurrentItem == null && ((IShellSectionController)this).GetItems().Contains(child))
StyleSheets\TextReaderExtensions.cs (1)
66 if (limit != null && limit.Contains(c))
Microsoft.Maui.Controls.Build.Tasks (3)
SetPropertiesVisitor.cs (1)
245 attributes.FirstOrDefault(cad => ContentPropertyAttribute.ContentPropertyTypes.Contains(cad.AttributeType.FullName));
TypeReferenceExtensions.cs (2)
227 if (arrayInterfaces.Contains(baseClass.FullName)) 230 arrayGenericInterfaces.Contains(baseClass.ResolveCached(cache).FullName) &&
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
486 if (!new[] { "private", "public", "internal", "protected" }.Contains(accessModifier)) //quick validation
Microsoft.Maui.Controls.Xaml (1)
ApplyPropertiesVisitor.cs (1)
291 attributes.FirstOrDefault(cad => ContentPropertyAttribute.ContentPropertyTypes.Contains(cad.AttributeType.FullName));
Microsoft.Maui.Essentials (1)
Preferences\Preferences.shared.cs (1)
288 if (!SupportedTypes.Contains(type))
Microsoft.McpServer.ProjectTemplates.Tests (3)
test\ProjectTemplates\Infrastructure\TemplateTestUtilities.cs (3)
90args.Contains($"{option}={value}"); 94args.Contains(option) || args.Contains($"{option}=true");
Microsoft.ML.AutoML (9)
API\AutoCatalog.cs (1)
825var booleanFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.NumericFeature && !numericFeatures.Contains(c));
Experiment\OptimizingMetricInfo.cs (3)
31IsMaximizing = !_minimizingRegressionMetrics.Contains(regressionMetric); 36IsMaximizing = !_minimizingBinaryMetrics.Contains(binaryMetric); 41IsMaximizing = !_minimizingMulticlassMetrics.Contains(multiMetric);
TrainerExtensions\TrainerExtensionCatalog.cs (1)
107trainers = trainers.Where(t => allowList.Contains(GetTrainerName(t)));
TrainerExtensions\TrainerExtensionUtil.cs (2)
92var boosterParams = sweepParams.Where(p => _lightGbmBoosterParamNames.Contains(p.Name)); 170var boosterParams = sweepParams.Where(p => _lightGbmBoosterParamNames.Contains(p.Name));
Utils\UserInputValidationUtil.cs (2)
150if (columns?.Contains(null) == true) 269if (!allowedTypes.Contains(itemType))
Microsoft.ML.AutoML.Tests (1)
Utils\TaskAgnosticIterationResult.cs (1)
76if (!supportedTypes.Contains(metric.GetType()))
Microsoft.ML.Core (6)
ComponentModel\ComponentCatalog.cs (5)
741.Where(info => info.SignatureTypes.Contains(typeSig) && typeBase.IsAssignableFrom(info.Type)) 784.Where(ci => ci.LoadNames.Select(n => n.ToLowerInvariant().Trim()).Contains(name)) 793.Where(ci => ci.SignatureTypes.Contains(typeof(TSig))) 803.Where(ci => ci.ArgType == typeof(TArgs) && ci.SignatureTypes.Contains(typeof(TSig))) 875component = _components.FirstOrDefault(x => x.InterfaceType == interfaceType && (x.Name == alias || (x.Aliases != null && x.Aliases.Contains(alias))));
Utilities\ReservoirSampler.cs (1)
195Contracts.Assert(_counts.Contains(0));
Microsoft.ML.Data (18)
DataLoadSave\Text\TextLoader.cs (4)
1245if (!options.AllowQuoting && options.DecimalMarker == ',' && _separators.Contains(',')) 1249if (_separators.Contains(_escapeChar)) 1456if (_separators.Contains(':')) 1471host.CheckDecode(!_separators.Contains(_escapeChar));
DataLoadSave\Text\TextLoaderParser.cs (1)
1359Contracts.Assert(_seps.Contains(span[ichCur]));
DataView\CompositeRowToRowMapper.cs (2)
64bool wantsActive = activeIndices.Contains(c); 78deps[deps.Length - 1] = OutputSchema.Where(c => activeIndices.Contains(c.Index));
DataView\TypedCursor.cs (2)
193return col => _columnIndices.Contains(col) || additionalColumnsPredicate(col); 208var inputs = _data.GetRowCursorSet(_data.Schema.Where(col => _columnIndices.Contains(col.Index) || additionalColumnsPredicate(col.Index)), n, rand);
Dirty\PredictionUtils.cs (1)
74if (!arg.Contains(';') || arg.IndexOfAny(_dontSplitChars) >= 0)
Scorers\FeatureContributionCalculation.cs (1)
371if (activeColumns.Select(c => c.Index).Contains(_outputGenericSchema.Count))
Scorers\SchemaBindablePredictorWrapper.cs (1)
241if (activeColumns.Select(c => c.Index).Contains(0))
Training\TrainerUtils.cs (1)
231data.Data.Schema.Where(c => extraCols.Contains(c.Index)).ToList();
Transforms\ColumnBindingsBase.cs (1)
190if (src.Contains(':'))
Transforms\ColumnSelecting.cs (4)
102_selectPredicate = (name) => (keepColumns != null) ? keepColumns.Contains(name) : !dropColumns.Contains(name); 463var missing = selectColumns.Where(x => !inputColumns.Contains(x)); 605if (selectedColumns.Contains(inputSchema[colIdx].Name))
Microsoft.ML.FastTree (3)
TreeEnsembleFeaturizer.cs (3)
195if (activeIndices.Contains(OutputSchema[_treesColumnName].Index)) 205if (activeIndices.Contains(OutputSchema[_leavesColumnName].Index)) 215if (activeIndices.Contains(OutputSchema[_pathsColumnName].Index))
Microsoft.ML.GenAI.LLaMA (1)
Llama3_1ChatTemplateBuilder.cs (1)
28if (messages.Any(m => m.GetRole() is null || availableRoles.Contains(m.GetRole()!.Value) == false))
Microsoft.ML.GenAI.Phi (1)
Phi3\Phi3ChatTemplateBuilder.cs (1)
33if (messages.Any(m => m.GetRole() is null || availableRoles.Contains(m.GetRole()!.Value) == false))
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckNameofFixProvider.cs (1)
156if (shortName.Split(',').Contains(nameArgValue))
Microsoft.ML.OnnxConverter (1)
OnnxExportExtensions.cs (1)
31if (!outputColumnNamesToKeep.Contains(sink.Schema[i].Name))
Microsoft.ML.SearchSpace (2)
Parameter.cs (1)
334return (_value as Dictionary<string, Parameter>).Contains(item);
SearchSpace.cs (1)
304Contract.Assert(supportTypes.Contains(type) || type.IsEnum, $"[Option:{optionName}] ChoiceAttribute can only apply to enum or the following types {string.Join(",", supportTypes.Select(x => x.Name))}");
Microsoft.ML.StandardTrainers (3)
FactorizationMachine\FactorizationMachineTrainer.cs (1)
478var columns = data.Schema.Schema.Where(x => fieldColumnIndexes.Contains(x.Index)).ToList();
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (2)
109var active0 = activeIndices.Contains(0); 110var active1 = activeIndices.Contains(1);
Microsoft.ML.Sweeper (1)
Parameters.cs (1)
527if (paramValue.Contains(','))
Microsoft.ML.TimeSeries (2)
SrCnnEntireAnomalyDetector.cs (2)
911if (!anomalyIdxList.Contains(i)) 925if (!anomalyIdxList.Contains(i))
Microsoft.ML.TorchSharp (2)
Utils\DefaultDictionary.cs (1)
67return _dictionary.Contains(item);
Utils\FileUtils.cs (1)
48if (!_validTypes.Contains(typeof(T)))
Microsoft.ML.Transforms (4)
Dracula\CountTargetEncodingTransformer.cs (2)
406return columns.All(c => HashingTransformer.Columns.Select(hc => hc.InputColumnName).Contains(c.InputColumnName)) 407&& columns.All(c => HashingTransformer.Columns.Select(hc => hc.Name).Contains(c.OutputColumnName));
StatefulFilterTransform.cs (1)
166_appendedRow = appendedDataView.GetRowCursor(appendedDataView.Schema.Where(c => !c.IsHidden && columnNames.Contains(c.Name)));
Text\WordEmbeddingsExtractor.cs (1)
716if (!firstValue.Contains(Single.NaN))
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
329var cols = input.Schema.Where(c => inputColIndices.Contains(c.Index));
Microsoft.NET.Build.Tasks (3)
AllowEmptyTelemetry.cs (2)
44var hasValue = availableNames.Contains("Value"); 46var hasHash = availableNames.Contains("Hash");
DependencyContextBuilder.cs (1)
498.Where(expansion => expansion.Contains(_runtimeIdentifier))
Microsoft.Private.Windows.Core (1)
System\Private\Windows\Ole\DataObjectExtensions.cs (1)
26if (string.IsNullOrEmpty(path) || path.Contains('\0'))
Microsoft.TemplateEngine.Cli (16)
Commands\create\InstantiateCommand.cs (1)
188IEnumerable<TemplateGroup> selectedTemplateGroups = allTemplateGroups.Where(template => template.ShortNames.Contains(instantiateArgs.ShortName));
Commands\create\InstantiateCommand.Help.cs (1)
40IEnumerable<TemplateGroup> selectedTemplateGroups = allTemplateGroups.Where(template => template.ShortNames.Contains(instantiateCommandArgs.ShortName));
Commands\create\InstantiateCommand.TabCompletion.cs (2)
48foreach (TemplateGroup templateGroup in templateGroups.Where(template => template.ShortNames.Contains(args.ShortName))) 120if (templateGroups.Any(template => template.ShortNames.Contains(instantiateArgs.ShortName)))
Commands\create\InstantiateCommandArgs.cs (1)
42if (s_passByOptionNames.Contains(optionResult.Option.Name))
Commands\create\TemplateCommand.cs (1)
268return template.PostActions.Contains(ProcessStartPostActionProcessor.ActionProcessorId);
Commands\install\InstallCommandArgs.cs (2)
22if (installCommand is LegacyInstallCommand && (TemplatePackages.Contains(installCommand.Name) || installCommand.Aliases.Any(alias => TemplatePackages.Contains(alias))))
Commands\list\ListCommandArgs.cs (1)
32if (AppliedFilters.Contains(FilterOptionDefinition.LanguageFilter))
Commands\NewCommand.cs (1)
36if (templateGroups.Any(template => template.ShortNames.Contains(instantiateCommandArgs.ShortName)))
Commands\NewCommandArgs.cs (2)
34if (!LegacyOptions.AllNames.Contains(o.Option.Name) && !s_passByOptionNames.Contains(o.Option.Name))
Commands\search\SearchCommandArgs.cs (1)
31if (AppliedFilters.Contains(FilterOptionDefinition.LanguageFilter))
Commands\uninstall\UninstallCommandArgs.cs (2)
18if (uninstallCommand is LegacyUninstallCommand && (TemplatePackages.Contains(uninstallCommand.Name) || uninstallCommand.Aliases.Any(alias => TemplatePackages.Contains(alias))))
TabularOutput\TabularOutput.cs (1)
61if ((_settings.ColumnsToDisplay.Count == 0 && defaultColumn) || showAlways || (!string.IsNullOrWhiteSpace(columnName) && _settings.ColumnsToDisplay.Contains(columnName)) || _settings.DisplayAllColumns)
Microsoft.TemplateEngine.Core (2)
Util\Orchestrator.cs (2)
130bool checkingDirWithPlaceholderFile = spec.IgnoreFileNames.Contains(fileName); 201bool checkingDirWithPlaceholderFile = spec.IgnoreFileNames.Contains(fileName);
Microsoft.TestPlatform.Filter.Source (2)
FastFilter.cs (2)
71return FilterProperties.Keys.All(name => properties.Contains(name)) 73: FilterProperties.Keys.Where(name => !properties.Contains(name)).ToArray();
Microsoft.VisualStudio.TestPlatform.Common (2)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FastFilter.cs (2)
71return FilterProperties.Keys.All(name => properties.Contains(name)) 73: FilterProperties.Keys.Where(name => !properties.Contains(name)).ToArray();
Microsoft.VisualStudio.TestPlatform.ObjectModel (1)
Nuget.Frameworks\FrameworkReducer.cs (1)
364pair.Value.Contains(nearestProfileFramework))
NuGet.Build.Tasks.Pack (3)
PackTaskLogic.cs (3)
701var isPackagePathSpecified = packageFile.Properties.Contains("PackagePath"); 830if (packageFile.Properties.Contains("MSBuildSourceProjectFile")) 862if (src.Properties.Contains("MSBuildSourceProjectFile"))
NuGet.CommandLine.XPlat (3)
Commands\PackageSearch\Table.cs (1)
145if (_columnsToHighlight.Contains(column) && highlight[column].Contains(CharacterIndex))
Program.cs (1)
74if (args.Contains(DebugOption) || string.Equals(bool.TrueString, debugNuGetXPlat, StringComparison.OrdinalIgnoreCase))
Utility\CommandLineUtility.cs (1)
59if (hashAlgorithm == HashAlgorithmName.Unknown || !spec.AllowedHashAlgorithms.Contains(hashAlgorithm))
NuGet.Commands (10)
CommandRunners\PackCommandRunner.cs (1)
329if (!reference.SupportedFrameworks.Contains(framework))
RestoreCommand\DependencyGraphResolver.cs (7)
414if (resolvedDependencyGraphItem.Path.Contains(currentRangeIndex)) 459if (resolvedDependencyGraphItem.Path.Contains(parent)) 479if (resolvedDependencyGraphItem.Path.Contains(parentLibraryRangeIndex) && !resolvedDependencyGraphItem.IsRootPackageReference) 1068if (currentDependencyGraphItem.Path.Contains(parentRangeIndex)) 1098if (evicteePath.Contains(evictedLibraryRangeIndex)) 1125if (chosenItem.Value.Path.Contains(evictedLibraryRangeIndex)) 1158if (!item.Path.Contains(evictedLibraryRangeIndex))
RestoreCommand\Utility\BuildAssetsUtils.cs (1)
581if (pkg?.Value?.Package != null && (packagesWithTools.Contains(pkg.Value.Package.Id) || packageIdsToCreatePropertiesFor.Contains(pkg.Value.Package.Id)) && pkg.Exists())
TrustedSignersCommand\TrustedSignersCommandRunner.cs (1)
346if (hashAlgorithm == HashAlgorithmName.Unknown || !SigningSpecifications.V1.AllowedHashAlgorithms.Contains(hashAlgorithm))
NuGet.Configuration (12)
PackageSourceMapping\PackageSourceMappingProvider.cs (1)
97if (!packageSourceMappingsSourceItems.Contains(sourceItem))
Settings\SettingElement.cs (7)
200if (!AllowedAttributes.Contains(attributeName)) 208if (value == null && RequiredAttributes.Contains(attributeName)) 217if (AllowedValues.TryGetValue(attributeName, out var allowed) && (value is null || !allowed.Contains(value.Trim()))) 225if (DisallowedValues.TryGetValue(attributeName, out var disallowed) && value is not null && disallowed.Contains(value.Trim())) 247if (!AllowedAttributes.Contains(attribute.Name.LocalName)) 275if (attribute != null && !attributeValues.Value.Contains(attribute.Value.Trim())) 289if (attribute != null && attributeValues.Value.Contains(attribute.Value.Trim()))
Settings\Settings.cs (4)
71if (_computedSections.TryGetValue(sectionName, out var section) && section.Items.Contains(item)) 130if (!section.Items.Contains(item)) 160if (!section.Items.Contains(item)) 226}).Where(s => s != null && s.Items.Contains(new ClearItem()));
NuGet.Credentials (1)
SecurePluginCredentialProvider.cs (1)
116_isAnAuthenticationPlugin = creationResult.Claims.Contains(OperationClaim.Authentication);
NuGet.Frameworks (1)
FrameworkReducer.cs (1)
364pair.Value.Contains(nearestProfileFramework))
NuGet.PackageManagement (5)
NuGetPackageManager.cs (4)
1458newPackagesToInstall = newListOfInstalledPackages.Where(p => !oldListOfInstalledPackages.Contains(p)); 1462newPackagesToUninstall = oldListOfInstalledPackages.Where(p => !newListOfInstalledPackages.Contains(p)); 1463newPackagesToInstall = newListOfInstalledPackages.Where(p => !oldListOfInstalledPackages.Contains(p)); 1967var newPackagesToInstall = newListOfInstalledPackages.Where(p => !oldListOfInstalledPackages.Contains(p));
Utility\JsonConfigUtility.cs (1)
224return list.Contains(framework);
NuGet.Packaging (12)
PackageCreation\Authoring\ManifestMetadata.cs (1)
322if ((Authors == null || !Authors.Any(author => !String.IsNullOrEmpty(author))) && !PackageTypes.Contains(PackageType.SymbolsPackage))
PackageCreation\Authoring\ManifestReader.cs (1)
56if (requiredElement.Equals("authors", StringComparison.Ordinal) && manifestMetadata.PackageTypes.Contains(PackageType.SymbolsPackage))
PackageCreation\Xml\PackageMetadataXmlExtensions.cs (2)
43if (!metadata.PackageTypes.Contains(PackageType.SymbolsPackage)) 52if (!metadata.PackageTypes.Contains(PackageType.SymbolsPackage))
Rules\DependenciesGroupsForEachTFMRule.cs (1)
82noExactMatchesFromFile.AddRange(tfmsFromFiles.Where(t => !tfmsFromNuspec.Contains(t)));
Rules\ReferencesInNuspecMatchRefAssetsRule.cs (5)
64var subfolder = nuspecReferences.Where(t => missingSubfolderInFiles.Contains(t.Key)); 86missingNuspecReferences = files.Where(m => !anyReferences.Contains(m)).ToArray(); 87missingFiles = anyReferences.Where(t => !files.Contains(t)).ToArray(); 91missingNuspecReferences = files.Where(m => !currentReferences!.Contains(m)).ToArray(); 92missingFiles = currentReferences!.Where(t => !files.Contains(t)).ToArray();
Signing\Timestamp\Rfc3161TimestampProvider.cs (1)
176if (!spec.AllowedHashAlgorithmOids.Contains(signerInfo.DigestAlgorithm.Value))
Signing\Utility\VerificationUtility.cs (1)
144if (!spec.AllowedHashAlgorithmOids.Contains(signerInfo.DigestAlgorithm.Value))
NuGet.ProjectModel (2)
PackageSpecOperations.cs (2)
129if (frameworksToAdd == null || frameworksToAdd.Contains(targetFramework.FrameworkName)) 155if (frameworksToAdd == null || frameworksToAdd.Contains(targetFramework.TargetAlias))
NuGet.Protocol (3)
Plugins\PluginManager.cs (1)
211if (cacheEntry.OperationClaims == null || cacheEntry.OperationClaims.Contains(requestedOperationClaim))
Resources\PluginResource.cs (1)
78if (result.Claims.Contains(requiredClaim))
Utility\CachingUtility.cs (1)
92value.Select(ch => invalid.Contains(ch) ? '_' : ch).ToArray()
Roslyn.Diagnostics.Analyzers (23)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
660if (pathParts.Contains(ThisDirectory))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
374!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
764type?.AllInterfaces.Contains(iDisposableType) == true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
450if (attributes.Contains(attributeToRemove))
sdk-tasks (1)
EnvironmentVariableFilter.cs (1)
45.Where(e => _environmentVariablesToRemove.Contains(e));
System.CommandLine (1)
ParseResult.cs (1)
395return optionResult.Tokens.Contains(tokenToComplete);
System.CommandLine.StaticCompletions (2)
CompletionsCommandDefinition.cs (1)
32if (!ShellNames.All.Contains(singleToken.Value))
ShellName.cs (1)
35if (All.Contains(shellName))
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\FileExtensionsAttribute.cs (1)
50return ExtensionsParsed.Contains(Path.GetExtension(fileName).ToLowerInvariant());
System.Linq (12)
System\Linq\AppendPrepend.SpeedOpt.cs (2)
182_source.Contains(value); 299return _source.Contains(value);
System\Linq\Concat.SpeedOpt.cs (3)
153_first.Contains(value) || 154_second.Contains(value); 356if (node._head.Contains(value))
System\Linq\DefaultIfEmpty.SpeedOpt.cs (1)
92_source.Contains(value) :
System\Linq\Distinct.SpeedOpt.cs (1)
25_comparer is null ? _source.Contains(value) :
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
231_source.Contains(value);
System\Linq\Reverse.SpeedOpt.cs (1)
120public override bool Contains(TSource value) => _source.Contains(value);
System\Linq\SelectMany.SpeedOpt.cs (1)
70if (_selector(element).Contains(value))
System\Linq\Shuffle.SpeedOpt.cs (1)
89return _source.Contains(value);
System\Linq\Union.SpeedOpt.cs (1)
60if (source.Contains(value))
System.Linq.Expressions (2)
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (1)
88(_scope.MergedScopes == null || !_scope.MergedScopes.Contains(node)))
System\Linq\Expressions\Interpreter\TypeOperations.cs (1)
398}.Contains(Convert.GetTypeCode(from)));
System.Linq.Queryable (1)
System\Linq\EnumerableRewriter.cs (1)
129if (t.IsGenericType && t.GetGenericTypeDefinition().GetInterfaces().Contains(typeof(IGrouping<,>)))
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
462if (onLoadData.NamedTypesToBeProtected.Contains(symbol.ContainingSymbol))
System.Windows.Forms (5)
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (1)
41bool IList.Contains(object? value) => _items.Contains(value);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (1)
43bool IList.Contains(object? value) => _items.Contains(value);
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
299bool IList.Contains(object? value) { return InnerList.Contains(value); }
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelRowCollection.cs (1)
113bool IList.Contains(object? value) { return InnerList.Contains(value); }
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.cs (1)
176bool IList.Contains(object? value) { return InnerList.Contains(value); }
System.Windows.Forms.Design (3)
System\ComponentModel\Design\SelectionService.cs (1)
333return _selection is not null && _selection.Contains(component);
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (2)
198if (_ignoreAddingList is not null && _ignoreAddingList.Contains(e.Component)) 243if (_ignoreAddedList is not null && _ignoreAddedList.Contains(e.Component))
System.Windows.Forms.Primitives (1)
System\Windows\Forms\NonNullCollection.cs (1)
71if (items is null || items.Contains(default))