Implemented interface members:
property
Count
System.Collections.Generic.ICollection<T>.Count
property
Count
System.Collections.Generic.IReadOnlyCollection<T>.Count
property
Count
System.Collections.ICollection.Count
1426 references to Count
aspire (24)
Commands\ConfigCommand.cs (3)
241if (localConfig.Count == 0 && globalConfig.Count == 0) 333if (config.Count > 0)
Commands\PipelineCommandBase.cs (1)
990var earliestStartTime = steps.Count > 0
Commands\ResourceCommand.cs (2)
421if (ShouldValidateChoiceOptions(argument, parseMode) && argument.Options is { Count: > 0 } options) 878if (argument.Options is { Count: > 0 } options)
Commands\Sdk\SdkGenerateCommand.cs (1)
191InteractionService.DisplaySuccess($"Generated {generatedFiles.Count} files in {outputDir.FullName}");
Commands\TelemetryTracesCommand.cs (2)
297InteractionService.DisplayMarkupLine($"[grey]Showing {traceInfos.Count} of {response?.TotalCount ?? traceInfos.Count} traces[/]");
Configuration\AspireConfigFile.cs (1)
296return profiles.Count > 0 ? profiles : null;
Documentation\Docs\DocsIndexService.cs (1)
266var idf = new Dictionary<string, float>(documentFrequency.Count, StringComparer.Ordinal);
Mcp\McpResourceToolRefreshService.cs (2)
126var changed = _resourceToolMap.Count != refreshedMap.Count;
Projects\GuestAppHostProject.cs (6)
913if (aspireConfig?.Profiles is { Count: > 0 }) 988if (result.Count == 0) 993_logger.LogDebug("Read {Count} environment variables from {ConfigPath}", result.Count, configPath); 1037if (result.Count == 0) 1042_logger.LogDebug("Read {Count} environment variables from aspire.config.json", result.Count); 1690files.Count, codeGenerator, outputPath, writtenCount);
Projects\GuestRuntime.cs (1)
581if (_spec.MigrationFiles is null or { Count: 0 })
Scaffolding\ScaffoldingService.cs (2)
215_logger.LogDebug("Wrote {Count} scaffold files", scaffoldFiles.Count); 499_logger.LogDebug("Generated {Count} code files in {Path}", generatedFiles.Count, outputPath);
src\Shared\UserSecrets\SecretsStore.cs (1)
36public int Count => _secrets.Count;
Utils\ConsoleActivityLogger.cs (1)
284var totalSteps = _stepStates.Count;
Aspire.Cli.Tests (2)
Utils\CliTestHelper.cs (1)
777public bool IsBundleModeAvailable(string? projectDirectory = null) => _layout is not null || _componentPaths.Count > 0;
Utils\ResourceColorMapTests.cs (1)
13Assert.Equal(ColorGenerator.s_variableNames.Length, ResourceColorMap.s_hexColors.Count);
Aspire.Components.Common.TestUtilities (1)
ConformanceTests.cs (1)
435var detail = results.Details?.FirstOrDefault(x => x.Errors is { Count: > 0 });
Aspire.Dashboard (12)
Components\Controls\Chart\ChartContainer.razor.cs (1)
440if (instrument.KnownAttributeValues.Count != DimensionFilters.Count)
Components\Dialogs\ManageDataDialog.razor.cs (2)
396if (_resourceDataRows.Count == 0) 457return _resourceDataRows.Count > 0;
Components\Pages\Resources.razor.cs (2)
603if (_resourceUnviewedErrorCounts == null || _resourceUnviewedErrorCounts.Count != newResourceUnviewedErrorCounts.Count)
Model\GenAI\GenAIItemPartViewModel.cs (1)
133var content = additionalProperties.Count > 0 ? ToJsonObject(additionalProperties).ToJsonString(s_jsonSerializerOptions) : string.Empty;
Model\TraceHelpers.cs (1)
110new OrderedResource(resource, resourceFirstTimes.Count, currentMinDate, totalSpans: 1, erroredSpans: span.Status == OtlpSpanStatusCode.Error ? 1 : 0));
Otlp\Model\OtlpHelpers.cs (1)
526if (scopes.Count >= TelemetryRepositoryLimits.MaxScopeCount)
Otlp\Storage\SqliteTelemetryRepository.Caching.cs (1)
591resource.InstrumentCount = resource.Scopes.Values.Sum(scope => scope.Instruments.Count);
Otlp\Storage\SqliteTelemetryRepository.Runtime.cs (1)
68changed = _resourceUnviewedErrorLogs.Count > 0;
Otlp\Storage\SqliteTelemetryRepository.Traces.Writes.cs (1)
164if (existingTraces.Count == 0)
Otlp\Storage\TelemetryRepositoryLimits.cs (1)
29if (_values.Count + newKeyCount > TelemetryRepositoryLimits.MaxKnownAttributeValueCount)
Aspire.Dashboard.Tests (24)
Model\GenAISchemaHelpersTests.cs (1)
189Assert.Equal(2, schema.Properties.Count);
Model\GenAIVisualizerDialogViewModelTests.cs (4)
1166Assert.Equal(2, tool.ToolDefinition.Parameters.Properties.Count); 1528Assert.Equal(3, tool.ToolDefinition.Parameters.Properties.Count); 1634Assert.Equal(3, tool.ToolDefinition.Parameters.Properties.Count); 2119Assert.Equal(2, tool.ToolDefinition.Parameters.Properties.Count);
Model\TelemetryExportServiceTests.cs (1)
1478Assert.Equal(2, deserialized.Environment.Count);
Telemetry\ComponentTelemetryContextTests.cs (5)
27for (var i = 0; i < telemetryService._defaultProperties.Count; i++) 37Assert.Equal(3, telemetryContext.Properties.Count); 43Assert.Equal(4, telemetryContext.Properties.Count); 50Assert.Equal(4, telemetryContext.Properties.Count); 54Assert.Equal(4, telemetryContext.Properties.Count);
TelemetryRepositoryTests\LogTests.cs (4)
336Assert.True(expected.Count == actual.Count, $"Field '{field}' expected {expected.Count} values but found {actual.Count}.");
TelemetryRepositoryTests\MetricsTests.cs (3)
209Assert.Equal(10, instrument.KnownAttributeValues.Count); 286Assert.Equal(6, instrument.KnownAttributeValues.Count); 1626Assert.Equal(pointAttributeCount + scopeAttributeCount, instrument!.KnownAttributeValues.Count);
TelemetryRepositoryTests\TraceTests.cs (2)
1651Assert.Equal(expected.Count, actual.Count);
tests\Shared\Telemetry\InMemoryTelemetryRepository.cs (4)
241if (_resourceUnviewedErrorLogs.Count > 0) 1952else if (resourceEntry.Instruments.Count < TelemetryRepositoryLimits.MaxInstrumentCount) 2682if (Dimensions.Count >= TelemetryRepositoryLimits.MaxDimensionCount) 2696var isFirst = Dimensions.Count == 0;
Aspire.Hosting (10)
ApplicationModel\ExecutionConfigurationGathererContext.cs (1)
47Dictionary<string, (object Unprocessed, string Value)> resolvedEnvironmentVariables = new(EnvironmentVariables.Count);
ApplicationModel\ProjectLaunchDefaultsAnnotation.cs (1)
35internal bool HasKestrelEndpoints => KestrelEndpointAnnotationHosts.Count > 0;
ApplicationModel\ResourceNotificationService.cs (2)
507if (pendingDependencyCounts.Count == 0) 567clearRemainingDependencies = pendingDependencyCounts.Count > 0;
Dashboard\InteractionFileUploadStore.cs (1)
299if (fileReferences.Length != filesById.Count)
Dcp\ExecutableConfigurationResolver.cs (1)
97if (certificateTrustConfiguration.CustomBundlesFactories.Count > 0)
Publishing\ManifestPublishingContext.cs (3)
405if (annotation.BuildArguments.Count > 0) 428if (annotation.BuildSecrets.Count > 0) 856if (_formattedParameters.Count == 0)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
125if (launchSettings == null || launchSettings.Profiles.Count == 0)
Aspire.Hosting.Azure (3)
AzureBicepResource.cs (1)
251if (Parameters.Count > 0)
AzureResourcePreparer.cs (2)
307if (roleAssignments.Count > 0) 355if (globalRoleAssignments.Count > 0)
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppExtensions.cs (2)
429if (resource.VolumeNames.Count > 0) 762if (appEnvResource.VolumeNames.Count > 0)
BaseContainerAppContext.cs (1)
429if (EnvironmentVariables.Count > 0)
Aspire.Hosting.Azure.Functions (1)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
125if (launchSettings == null || launchSettings.Profiles.Count == 0)
Aspire.Hosting.Azure.Kubernetes (1)
AzureKubernetesEnvironmentExtensions.cs (1)
619var hasSubnetConfig = hasDefaultSubnet || aksResource.NodePoolSubnets.Count > 0;
Aspire.Hosting.Azure.Kubernetes.Tests (1)
AzureKubernetesHelmChartTests.cs (1)
51Assert.Equal(2, chart.Resource.Values.Count);
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusRule.cs (1)
136if (rule.CorrelationFilter.Properties.Count != 0)
Aspire.Hosting.Browsers (11)
BrowserLogsSessionManager.cs (11)
86if (resourceState.ActiveSessions.Count == 0) 128stateText: resourceState.ActiveSessions.Count > 0 ? KnownResourceStates.Running : KnownResourceStates.FailedToStart, 129stateStyle: resourceState.ActiveSessions.Count > 0 ? KnownResourceStateStyles.Success : KnownResourceStateStyles.Error, 131stopTimeStamp: resourceState.ActiveSessions.Count == 0 ? _timeProvider.GetUtcNow().UtcDateTime : null, 200: resourceState.ActiveSessions.Count == 0 344var hasActiveSessions = resourceState.ActiveSessions.Count > 0; 389StopTimeStamp = resourceState.ActiveSessions.Count > 0 || pendingSession is not null ? null : stopTimeStamp, 390ExitCode = resourceState.ActiveSessions.Count > 0 || pendingSession is not null ? null : exitCode, 399var reports = new List<HealthReportSnapshot>(resourceState.ActiveSessions.Count + (pendingSession is null ? 0 : 1)); 441yield return new ResourcePropertySnapshot(BrowserLogsBuilderExtensions.ActiveSessionCountPropertyName, resourceState.ActiveSessions.Count); 515if (resourceState.ActiveSessions.Count > 0)
Aspire.Hosting.Browsers.Tests (11)
src\Aspire.Hosting.Browsers\BrowserLogsSessionManager.cs (11)
86if (resourceState.ActiveSessions.Count == 0) 128stateText: resourceState.ActiveSessions.Count > 0 ? KnownResourceStates.Running : KnownResourceStates.FailedToStart, 129stateStyle: resourceState.ActiveSessions.Count > 0 ? KnownResourceStateStyles.Success : KnownResourceStateStyles.Error, 131stopTimeStamp: resourceState.ActiveSessions.Count == 0 ? _timeProvider.GetUtcNow().UtcDateTime : null, 200: resourceState.ActiveSessions.Count == 0 344var hasActiveSessions = resourceState.ActiveSessions.Count > 0; 389StopTimeStamp = resourceState.ActiveSessions.Count > 0 || pendingSession is not null ? null : stopTimeStamp, 390ExitCode = resourceState.ActiveSessions.Count > 0 || pendingSession is not null ? null : exitCode, 399var reports = new List<HealthReportSnapshot>(resourceState.ActiveSessions.Count + (pendingSession is null ? 0 : 1)); 441yield return new ResourcePropertySnapshot(BrowserLogsBuilderExtensions.ActiveSessionCountPropertyName, resourceState.ActiveSessions.Count); 515if (resourceState.ActiveSessions.Count > 0)
Aspire.Hosting.CodeGeneration.Java (1)
AtsJavaCodeGenerator.cs (1)
1033if (_optionsClassesToGenerate.Count == 0)
Aspire.Hosting.CodeGeneration.Python (5)
PythonModuleBuilder.cs (5)
103if (MethodParameters.Count > 0) 138if (TypeClasses.Count > 0) 152if (InterfaceClasses.Count > 0) 166if (ResourceClasses.Count > 0) 201if (HandleRegistrations.Count > 0)
Aspire.Hosting.CodeGeneration.TypeScript (1)
AtsTypeScriptCodeGenerator.cs (1)
713if (_projector.OptionsInterfacesToGenerate.Count == 0)
Aspire.Hosting.Docker (4)
DockerComposeEnvironmentResource.cs (1)
522if (CapturedEnvironmentVariables.Count == 0)
DockerComposePublishingContext.cs (1)
151if (environment.CapturedEnvironmentVariables.Count > 0)
DockerComposeServiceResource.cs (2)
228if (env.Count > 0) 273if (EndpointMappings.Count == 0)
Aspire.Hosting.Dotnet (1)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
125if (launchSettings == null || launchSettings.Profiles.Count == 0)
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
211if (synchronousDelegateParameters.Count == 0)
Aspire.Hosting.Kafka.Tests (4)
AddKafkaTests.cs (4)
195Assert.Equal(config1.Count, config2.Count); 226Assert.Equal(config1.Count, config2.Count);
Aspire.Hosting.Kubernetes (9)
Deployment\HelmDeploymentEngine.cs (1)
353if (overrideValues.Count > 0)
Extensions\ResourceExtensions.cs (6)
65if (context.Secrets.Count == 0) 99if (context.EnvironmentVariables.Count == 0) 131if (context.EndpointMappings.Count == 0) 340if (context.EndpointMappings.Count == 0) 402if (context.EnvironmentVariables.Count > 0) 419if (context.Secrets.Count > 0)
KubernetesPublishingContext.cs (2)
260if (contextItems.Count <= 0 || _helmValues[helmKey] is not Dictionary<string, object> helmSection) 360if (paramValues.Count > 0)
Aspire.Hosting.Kubernetes.Tests (1)
KubernetesHelmChartTests.cs (1)
40Assert.Equal(2, chart.Resource.Values.Count);
Aspire.Hosting.Maui (2)
MauiiOSExtensions.cs (1)
420msBuildProperties: msBuildProperties.Count > 0 ? msBuildProperties : null);
Utilities\MauiEnvironmentHelper.cs (1)
57if (environmentVariables.Count == 0)
Aspire.Hosting.MongoDB.Tests (2)
AddMongoDBTests.cs (2)
324Assert.Equal(config1.Count, config2.Count);
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
393Assert.Equal(config1.Count, config2.Count);
Aspire.Hosting.PostgreSQL.Tests (2)
AddPostgresTests.cs (2)
725Assert.Equal(config1.Count, config2.Count);
Aspire.Hosting.Radius (9)
Publishing\RadiusInfrastructureBuilder.cs (9)
391if (deployParameters.Count > 0) 524if (targets.Count == 0 || 1035if (connectionTargets.Count > 0) 1470if (snapshot.Count == 0) 1685return effective.Count == 0 ? null : effective; 2022if (bicepAuth.Count > 0) 2027if (gitPat.Count > 0) 2038if (envSecrets.Count > 0) 2043if (recipeConfig.Count > 0)
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
774Assert.Equal(config1.Count, config2.Count);
Aspire.Hosting.RemoteHost (6)
AtsCapabilityScanner.cs (1)
567if (enumTypes.Count == 0)
AtsContextFilter.cs (1)
116if (supportingHandleTypes.Count == 0)
CodeGeneration\CodeGenerationService.cs (2)
259activity.SetFileCount(files.Count); 261_logger.LogDebug("<< generateCode({Language}) completed in {ElapsedMs}ms, generated {FileCount} files", language, sw.ElapsedMilliseconds, files.Count);
Language\LanguageService.cs (2)
68activity.SetFileCount(files.Count); 70_logger.LogDebug("<< scaffoldAppHost({Language}) completed in {ElapsedMs}ms, generated {FileCount} files", language, sw.ElapsedMilliseconds, files.Count);
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
299if (launchProfile?.EnvironmentVariables is { Count: > 0 } envVars)
Aspire.Hosting.Tests (17)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (2)
48Assert.Equal(2, annotation.BuildArguments.Count); 64Assert.Equal(2, annotation.BuildSecrets.Count);
Backchannel\BackchannelContractTests.cs (3)
396return expectedDictionary.Count == actualDictionary.Count && 414BackchannelTraceContext context => $"{nameof(BackchannelTraceContext)}({context.Baggage.Count} baggage items)",
ConnectionPropertiesExtensionsTests.cs (1)
33Assert.Equal(3, dict.Count);
DistributedApplicationTests.cs (2)
804if (pids.Count == replicaCount) 815Assert.Equal(3, pids.Count);
ExecutionConfigurationGathererTests.cs (3)
134Assert.Equal(2, context.EnvironmentVariables.Count); 157Assert.Equal(2, context.EnvironmentVariables.Count); 533Assert.Equal(2, metadata.CustomBundlesFactories.Count);
Publishing\ResourceContainerImageManagerTests.cs (4)
764Assert.Equal(2, fakeContainerRuntime.CapturedBuildArguments.Count); 828Assert.Equal(10, fakeContainerRuntime.CapturedBuildArguments.Count); 924Assert.Equal(2, fakeContainerRuntime.CapturedBuildSecrets.Count); 977Assert.Equal(2, fakeContainerRuntime.CapturedBuildSecrets.Count);
WithEnvironmentTests.cs (2)
247Assert.Equal(4, config.Count); 253Assert.Equal(4, manifestConfig.Count);
Aspire.Playground.Tests (1)
AppHostTests.cs (1)
329public override string? ToString() => $"{AppHostType} ({ResourceEndpoints?.Count ?? 0} resources)";
Aspire.Templates.Tests (2)
TemplateTestsBase.cs (2)
189while (foundNames.Count < expectedRowsTable.Count && !cts.IsCancellationRequested) 255if (foundNames.Count != expectedRowsTable.Count)
Aspire.TerminalHost (3)
TerminalReplica.cs (3)
136get { lock (_gate) { return _peers.Count; } } 146if (_peers.Count == 0) 150var snap = new TerminalHostPeerInfo[_peers.Count];
Client.ClientBase.IntegrationTests (2)
ClientBaseTests.4.0.0.cs (2)
42Assert.True(property.Headers.Count > 0, "TestHttpRequestMessageProperty.Headers should not have empty headers"); 89Assert.True(property.Headers.Count > 0, "TestHttpRequestMessageProperty.Headers should not have empty headers");
crossgen2 (3)
Program.cs (2)
228if (inputFilePathsArg.Count > 0) 246if (_inputBubble && inputBubbleReferenceFilePaths.Count == 0)
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (1)
337string reproFileDir = prefix + originalToReproPackageFileName.Count.ToString() + Path.DirectorySeparatorChar;
csc (1)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
472if (environmentVariables.Count == 0)
dotnet (13)
Commands\Run\FileBasedAppRunPlan.cs (4)
471if (previousCacheEntry.GlobalProperties.Count != cacheEntry.GlobalProperties.Count) 473Reporter.Verbose.WriteLine($"Building because previous global properties count ({previousCacheEntry.GlobalProperties.Count}) does not match current count ({cacheEntry.GlobalProperties.Count}): {successCacheFile.FullName}");
Commands\Test\MTP\IPC\Serializers\HandshakeMessageSerializer.cs (1)
35WriteUShort(stream, (ushort)(handshakeMessage.Properties?.Count ?? 0));
Commands\Test\MTP\Terminal\TestProgressState.cs (2)
359return count <= 0 || _testUidToDuration.Count == 0 376if (_uidWithEarlierFailure.Count == 0)
Commands\Workload\InstallingWorkloadCommand.cs (2)
347(currentInstallState.Manifests.Count != oldInstallState.Manifests.Count ||
Commands\Workload\List\InstalledWorkloadsCollection.cs (1)
17public int Count => _workloads.Count;
Commands\Workload\WorkloadHistoryRecord.cs (2)
40if (ManifestVersions.Count != other.ManifestVersions.Count)
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26425.101\contentFiles\cs\net11.0\BuildServerConnection.cs (1)
472if (environmentVariables.Count == 0)
dotnet-aot (5)
src\sdk\src\Cli\dotnet\Commands\Run\FileBasedAppRunPlan.cs (4)
471if (previousCacheEntry.GlobalProperties.Count != cacheEntry.GlobalProperties.Count) 473Reporter.Verbose.WriteLine($"Building because previous global properties count ({previousCacheEntry.GlobalProperties.Count}) does not match current count ({cacheEntry.GlobalProperties.Count}): {successCacheFile.FullName}");
src\sdk\src\Cli\dotnet\Commands\Workload\List\InstalledWorkloadsCollection.cs (1)
17public int Count => _workloads.Count;
dotnet-svcutil-lib (28)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriter.cs (3)
2249Debug.Assert(_attrHashTable.Count == 0); 2275int count = _attrHashTable.Count; 2277if (count != _attrHashTable.Count)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaObjectTable.cs (5)
100Debug.Assert(_table.Count == _entries.Count); 101return _table.Count; 130return new NamesCollection(_entries, _table.Count); 139return new ValuesCollection(_entries, _table.Count); 146return new XSODictionaryEnumerator(_entries, _table.Count, EnumeratorType.DictionaryEntry);
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (2)
92ArgBuilder arg = new ArgBuilder(argNames[i], _argList.Count, argTypes[i]); 161localTmp = DeclareLocal(type, "_tmp" + _tmpLocals.Count);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (2)
980if (knownContracts == null || knownContracts.Count == 0) 996if (knownContractDictionary == null || knownContractDictionary.Count == 0)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExtensionDataReader.cs (1)
524prefix = (ns == null || ns.Length == 0) ? String.Empty : "p" + s_nsToPrefixTable.Count;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\MruCache.cs (2)
55return _items.Count; 68if (_items.Count == _highWatermark)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeaderCollection.cs (2)
125if (myHeaders.Count != otherHeaders.Count)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SecurityBindingElement.cs (2)
1425if (_operationSupportingTokenParameters.Count == 0) 1437if (_optionalOperationSupportingTokenParameters.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ImportedPolicyConversionContext.cs (2)
242Dictionary<K, V> counterValue = new Dictionary<K, V>(sets.Count); 255KeyValuePair<K, IEnumerator<V>>[] digits = new KeyValuePair<K, IEnumerator<V>>[sets.Count];
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (1)
485get { return _usedRetrievers.Count == _maxResolvedReferences; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (1)
1870if (_warnings.Count >= 1024)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\XmlSerializerOperationGenerator.cs (1)
121if (_partInfoTable != null && _partInfoTable.Count > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
128messageInfo.AnyHeaders = messageInfo.UnknownHeaderDescription != null || messageInfo.HeaderDescriptionTable.Count > 0;
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs (1)
62object[] headerValues = new object[headerDescriptionTable.Count];
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityProtocolFactory.cs (2)
764if (_mergedSupportingTokenAuthenticatorsMap != null && _mergedSupportingTokenAuthenticatorsMap.Count > 0) 792if (_scopedSupportingTokenAuthenticatorSpecification.Count == 0)
dotnet-svcutil.xmlserializer (1)
Microsoft\Tools\ServiceModel\SvcUtil\CommandLineParser.cs (1)
146get { return _contents.Count; }
dotnet-user-jwts (1)
Helpers\JwtIssuer.cs (1)
44if (options.Claims is { Count: > 0 } claimsToAdd)
dotnet-watch (1)
Watch\StaticFileHandler.cs (1)
54if (refreshRequests.Count == 0)
GenerateDocumentationAndConfigFiles (28)
src\b310f676f7308b7f\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
123other._reachingWrites.Count != _reachingWrites.Count) 173private bool IsEmpty => _reachingWrites.Count == 0;
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
448if (SymbolsWriteBuilder.Count == 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
132if (namesBuilder.Count == 0 && symbolsBuilder.Count == 0 && wildcardNamesBuilder.Count == 0)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
28if (Count == 0) 61Debug.Assert(instance.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
409var spans = new List<TextSpan>(nodesToReplace.Count + tokensToReplace.Count + triviaToReplace.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
230if (first == null || last == null || importToSyntax.Count == 0)
ILAssembler (1)
GrammarVisitor.cs (1)
212if (_vtableFixups.Count > 0 || exports.Count > 0 || _mappedFieldDataReferenceFixups.Count > 0)
ilc (1)
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (1)
337string reproFileDir = prefix + originalToReproPackageFileName.Count.ToString() + Path.DirectorySeparatorChar;
ILCompiler.Compiler (13)
Compiler\Dataflow\ArrayValue.cs (2)
72equals &= IndexValues.Count == otherArr.IndexValues.Count;
Compiler\Dataflow\MethodBodyScanner.cs (1)
277else if (maxTrackedValues == null || valueCollection.Count < maxTrackedValues)
Compiler\DependencyAnalysis\InterfaceGenericVirtualMethodTableNode.cs (1)
192vertex = nativeFormatWriter.GetTuple(vertex, nativeFormatWriter.GetUnsignedConstant((uint)ifaceImpls.Count));
Compiler\ObjectWriter\Dwarf\DwarfInfoWriter.cs (1)
63abbreviationCode = _usedAbbrevs.Count + 1;
Compiler\RuntimeConfigurationRootProvider.cs (1)
98builder.EmitNaturalInt(settings.Count);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectDataInterner.cs (3)
49symbolRemapping = new Dictionary<ISymbolNode, ISymbolNode>((int)(1.05 * (previousSymbolRemapping?.Count ?? 0))); 65if (a.Count != b.Count)
src\runtime\src\coreclr\tools\Common\Pgo\PgoFormat.cs (1)
569PgoSchemaElem[] result = new PgoSchemaElem[dataMerger.Count];
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\DefaultValueDictionary.cs (3)
58if (Dictionary.Count != other.Dictionary.Count) 72public int Count => Dictionary?.Count ?? 0;
ILCompiler.DependencyAnalysisFramework (1)
DependencyAnalyzer.cs (1)
343} while ((_markStack.Count != 0) || (_deferredStaticDependencies.Count != 0));
ILCompiler.ReadyToRun (9)
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (2)
173int oldModuleToIndexCount = _assemblyRefToModuleIdMap.Count; 177Debug.Assert(oldModuleToIndexCount == _assemblyRefToModuleIdMap.Count);
Compiler\PettisHansenSort\PettisHansen.cs (1)
27var dict = new Dictionary<int, long>(node.OutgoingEdges.Count);
Compiler\ReadyToRunStandaloneMethodMetadata.cs (1)
205alternateToken = (_alternateNonTokenStrings.Count + 1) | flag;
src\runtime\src\coreclr\tools\aot\ILCompiler.Reflection.ReadyToRun\PEReaderExtensions.cs (1)
115Console.Error.WriteLine($"_namedExportRva: {_namedExportRva.Count} item(s)");
src\runtime\src\coreclr\tools\Common\Compiler\ObjectDataInterner.cs (3)
49symbolRemapping = new Dictionary<ISymbolNode, ISymbolNode>((int)(1.05 * (previousSymbolRemapping?.Count ?? 0))); 65if (a.Count != b.Count)
src\runtime\src\coreclr\tools\Common\Pgo\PgoFormat.cs (1)
569PgoSchemaElem[] result = new PgoSchemaElem[dataMerger.Count];
ILCompiler.RyuJit (1)
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\PettisHansen.cs (1)
27var dict = new Dictionary<int, long>(node.OutgoingEdges.Count);
illink (8)
ILLink.RoslynAnalyzer (7)
DataFlowAnalyzerContext.cs (1)
28public readonly bool AnyAnalyzersEnabled => TrimAnalyzer is not null || _enabledAnalyzers.Count > 0;
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\DefaultValueDictionary.cs (3)
58if (Dictionary.Count != other.Dictionary.Count) 72public int Count => Dictionary?.Count ?? 0;
TrimAnalysis\ArrayValue.cs (2)
53equals &= IndexValues.Count == otherArr.IndexValues.Count;
TrimAnalysis\TrimAnalysisVisitor.cs (1)
336else if (arr.IndexValues.TryGetValue(index.Value, out _) || arr.IndexValues.Count < MaxTrackedArrayValues)
ILLink.Tasks (2)
CreateRuntimeRootDescriptorFile.cs (2)
349if (featureSwitchMembers.Count > 0) 353if (members.Count == 0)
Infrastructure.Tests (1)
PowerShellScripts\BuildTestMatrixTests.cs (1)
563Assert.Equal(2, entry.Runners.Count);
Microsoft.AspNetCore.Components (1)
src\aspnetcore\src\Http\Routing\src\Tree\TreeEnumerator.cs (1)
92if (next.Literals.Count > 0)
Microsoft.AspNetCore.Components.AI (2)
Engine\UIAgent.cs (1)
166if (_options.UIActions.Count == 0)
Pipeline\BlockMappingPipeline.cs (1)
32if (options.UIActions.Count > 0)
Microsoft.AspNetCore.Components.Analyzers (1)
StateHasChangedAnalyzer.cs (1)
140if (callLocations.Count == 0)
Microsoft.AspNetCore.Components.Endpoints (7)
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (4)
92var saveServerTask = server.Saved.Count > 0 96var saveWebAssemblyTask = webAssembly.Saved.Count > 0 106server.Saved.Count > 0 ? serverStore : null, 107webAssembly.Saved.Count > 0 ? webAssemblyStore : null);
SessionCascadingValueSupplier.cs (1)
89if (_valueCallbacks.Count == 0)
TempData\TempData.cs (1)
119int ICollection<KeyValuePair<string, object?>>.Count => Data.Count;
TempData\TempDataCascadingValueSupplier.cs (1)
69if (_valueCallbacks.Count == 0)
Microsoft.AspNetCore.Components.Media (1)
FileDownload.cs (1)
79var copy = new Dictionary<string, object>(AdditionalAttributes.Count);
Microsoft.AspNetCore.Components.Server (1)
src\aspnetcore\src\Components\Shared\src\WebRootComponentManager.cs (1)
43if (_webRootComponents.Count + 1 > renderer._options.RootComponents.MaxJSRootComponents)
Microsoft.AspNetCore.Components.Web (1)
JSComponents\JSComponentConfigurationStore.cs (1)
31var parameters = new JSComponentParameter[parameterTypes.Count];
Microsoft.AspNetCore.Components.WebView (3)
src\aspnetcore\src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (2)
347internal bool HasChildren() => Children != null && Children.Count > 0; 422if (value.Children.Count > 0)
WebViewManager.cs (1)
232var pendingRenders = new List<Task>(_rootComponentsBySelector.Count);
Microsoft.AspNetCore.DataProtection (3)
XmlEncryption\XmlEncryptionExtensions.cs (2)
62Debug.Assert(placeholderReplacements.Count > 0); 143Debug.Assert(placeholderReplacements.Count > 0);
XmlEncryption\XmlKeyDecryptionOptions.cs (1)
18public int KeyDecryptionCertificateCount => _certs.Count;
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (1)
RedactionBenchmark.cs (1)
131var newDict = new Dictionary<string, string>(_routeValues.Count);
Microsoft.AspNetCore.Hosting (2)
src\aspnetcore\src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (2)
347internal bool HasChildren() => Children != null && Children.Count > 0; 422if (value.Children.Count > 0)
Microsoft.AspNetCore.Http (14)
FormCollection.cs (4)
88return Store?.Count ?? 0; 133if (Store == null || Store.Count == 0) 148if (Store == null || Store.Count == 0) 163if (Store == null || Store.Count == 0)
HeaderDictionary.cs (4)
152public int Count => Store?.Count ?? 0; 333if (Store == null || Store.Count == 0) 347if (Store == null || Store.Count == 0) 361if (Store == null || Store.Count == 0)
QueryCollection.cs (4)
97return Store.Count; 152if (Store == null || Store.Count == 0) 166if (Store == null || Store.Count == 0) 180if (Store == null || Store.Count == 0)
src\aspnetcore\src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionaryHolder.cs (1)
92return ReadDictionary.Count;
src\aspnetcore\src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
143public int Count => _dictionaryStorage != null ? _dictionaryStorage.Count : _count;
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\Validation\ValidationStateDictionary.cs (1)
55public int Count => _inner.Count;
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
126if (responseTypes.Count == 0 && declaredReturnType != null)
Microsoft.AspNetCore.Mvc.Core (2)
ApplicationModels\ApplicationModelFactory.cs (1)
95if (attributeRoutingConfigurationErrors.Count > 0)
src\aspnetcore\src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionaryHolder.cs (1)
92return ReadDictionary.Count;
Microsoft.AspNetCore.Mvc.Razor (1)
Compilation\DefaultViewCompiler.cs (1)
68if (compiledViews.Count == 0)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RuntimeViewCompiler.cs (1)
79if (_precompiledViews.Count == 0)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
TempDataDictionary.cs (1)
50return _data.Count;
Microsoft.AspNetCore.OpenApi (3)
Services\OpenApiDocumentService.cs (1)
263if (operations.Count > 0)
Services\OpenApiGenerator.cs (2)
191if (responseType != null && eligibileAnnotations.Count == 0) 295if (requestBodyContent.Count == 0)
Microsoft.AspNetCore.Razor.Runtime (1)
src\aspnetcore\src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionaryHolder.cs (1)
92return ReadDictionary.Count;
Microsoft.AspNetCore.Razor.Utilities.Shared (4)
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\DictionaryPool`2.Policy.cs (1)
45var count = map.Count;
Utilities\CleanableWeakCache`2.cs (1)
265using var deadKeys = new MemoryBuilder<TKey>(initialCapacity: _cacheMap.Count, clearArray: true);
Microsoft.AspNetCore.Rewrite (1)
IISUrlRewrite\IISRewriteMapCollection.cs (1)
20public int Count => _rewriteMaps.Count;
Microsoft.AspNetCore.Routing (13)
DecisionTree\DecisionTreeBuilder.cs (2)
151foreach (var criterion in criteria.OrderByDescending(c => c.Value.Count)) 177if (reducedBranches.Count > 0)
Internal\DfaGraphWriter.cs (1)
66label = visited.Count;
Matching\AcceptsMatcherPolicy.cs (1)
239var result = new PolicyNodeEdge[edges.Count];
Matching\DfaMatcherBuilder.cs (5)
598pathEntries = new (string text, int destination)[node.Literals.Count]; 634if (node.PolicyEdges != null && node.PolicyEdges.Count > 0) 636policyEntries = new PolicyJumpTableEdge[node.PolicyEdges.Count]; 749_assignments.Add(kvp.Key, _assignments.Count); 769slotIndex = _assignments.Count;
Matching\HostMatcherPolicy.cs (1)
271var result = new PolicyNodeEdge[edges.Count];
Matching\HttpMethodMatcherPolicy.cs (1)
289var policyNodeEdges = new PolicyNodeEdge[edges.Count];
Matching\NegotiationMatcherPolicy.cs (1)
311var result = new PolicyNodeEdge[edges.Count];
Tree\TreeEnumerator.cs (1)
92if (next.Literals.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Core (15)
Internal\CertificatePathWatcher.cs (1)
262internal int TestGetDirectoryWatchCountUnsynchronized() => _metadataForDirectory.Count;
Internal\ConfigSectionClone.cs (3)
33if (Value != other.Value || Children.Count != other.Children.Count) 54public override int GetHashCode() => HashCode.Combine(Value, Children.Count);
Internal\ConfigurationReader.cs (4)
228if (endpoint.Sni.Count > 0) 314Certificate, ClientCertificateMode ?? Https.ClientCertificateMode.NoCertificate, Sni.Count, _configSectionClone); 321if (lhs.Count != rhs.Count)
Internal\Http\HttpHeaders.Generated.cs (3)
2586return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0); 10872return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0); 17169return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0);
Internal\Http\HttpResponseHeaders.cs (1)
44if (extraHeaders != null && extraHeaders.Count > 0)
Internal\Http2\Http2Connection.cs (2)
1342if (_streams.Count > MaxTrackedStreams || SendEnhanceYourCalmOnStartStream) 1515while (_streams.Count >= maxStreams && _completedStreams.TryDequeue(out var stream))
TlsConfigurationLoader.cs (1)
102if (endpoint.Sni.Count == 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (3)
TlsEventPump.cs (3)
364int timeout = ComputePollTimeoutMs(_handshaking.Count); 422if (_handshakeTimeoutMs != long.MaxValue && _handshaking.Count > 0) 1099if (_handshaking.Count == 0)
Microsoft.AspNetCore.Session (1)
DefaultDistributedSessionStore.cs (1)
13public int Count => _store.Count;
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
1096var streamTasks = new Task[readers.Count];
Microsoft.AspNetCore.WebUtilities (1)
KeyValueAccumulator.cs (1)
82public int KeyCount => _accumulator?.Count ?? 0;
Microsoft.Build (81)
BackEnd\BuildManager\BuildManager.cs (8)
1139Assumed.Zero(_buildSubmissions.Count, "All submissions not yet complete."); 1150if (_projectStartedEvents.Count != 0) 1328submissionCount = _buildSubmissions?.Count; 1367var submissionDetailParts = new List<string>(_buildSubmissions.Count); 1383telemetry.PendingSubmissionCount = _buildSubmissions.Count; 1385telemetry.UnmatchedProjectStartedCount = _projectStartedEvents.Count; 2376while (blockedNodes.Count > 0 || buildingNodes.Count > 0) 3117if (_buildSubmissions.Count == 0)
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (4)
251if (_unresolvedConfigurations.Count == 0) 358if (result.CircularDependency || (_outstandingRequests.Count == 0 && (_unresolvedConfigurations == null || _unresolvedConfigurations.Count == 0))) 437_outstandingResults = new Dictionary<int, BuildResult>(_outstandingRequests.Count);
BackEnd\Components\Communications\NodeManager.cs (1)
294if (_nodeIdToProvider.Count == 0)
BackEnd\Components\Logging\ProjectTelemetry.cs (3)
133if (taskFactoryProperties.Count > 0) 139if (taskTotalProperties.Count > 0) 145if (msbuildTaskSubclassProperties.Count > 0)
BackEnd\Components\RequestBuilder\BatchingEngine.cs (5)
128if (consumedMetadataReferences?.Count > 0) 149if (itemListsToBeBatched.Count == 0) 304Assumed.Positive(itemListsToBeBatched.Count, "Need item types consumed by the batchable object."); 305Assumed.Positive(consumedMetadataReferences.Count, "Need item metadata consumed by the batchable object."); 399var itemMetadataValues = new Dictionary<string, string>(consumedMetadataReferences.Count, MSBuildNameIgnoreCaseComparer.Default);
BackEnd\Components\RequestBuilder\Lookup.cs (3)
508if (modifies.Count != 0) 510allModifies ??= new Dictionary<ProjectItemInstance, MetadataModifications>(modifies.Count); 1162get { return _modifications.Count > 0 || _keepOnlySpecified; }
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (4)
173else if (discreteItemsInTargetOutputs.Count == 0) 228if ((discreteItemsInTargetOutputs.Count > 0) || 610Assumed.Equal(inputItemVectors.Count, 1, "There should only be one item vector of a particular type in the target inputs that can be filtered."); 849Assumed.True((itemVectorTransforms == null) || (itemVectorCollection.Equals(itemVectorTransforms)) || (itemVectorPartition.Count == 1), "If transforms have been separated out, there should only be one item vector per partition.");
BackEnd\Components\Scheduler\SchedulableRequest.cs (5)
206return _requestsWeAreBlockedBy.Count; 420Assumed.Zero(_requestsWeAreBlockedBy.Count, "We can't be complete if we are still blocked on requests."); 438Assumed.Zero(_requestsWeAreBlockedBy.Count, "We are blocked by requests."); 610if (_requestsWeAreBlockedBy.Count != 0) 653if (_requestsWeAreBlockedBy.Count == 0)
BackEnd\Components\Scheduler\Scheduler.cs (11)
761HashSet<int> idleNodes = new HashSet<int>(_availableNodes.Count); 787if (_availableNodes.Count > 0) 843TraceScheduler($"Requests scheduled: {nodesFreeToDoWorkPriorToScheduling - idleNodes.Count} Unassigned Requests: {_schedulingData.UnscheduledRequestsCount} Blocked Requests: {_schedulingData.BlockedRequestsCount} Unblockable Requests: {_schedulingData.ReadyRequestsCount} Free Nodes: {idleNodes.Count}/{_availableNodes.Count} Responses: {responses.Count}"); 1358Dictionary<int, int> configurationCountsByNode = new Dictionary<int, int>(_availableNodes.Count); 1370configurationCountLimit = Math.Max(1, (int)Math.Ceiling(configurationCountLimit * _customSchedulerForSQLConfigurationLimitMultiplier / _availableNodes.Count)); 2407int[] currentWork = new int[_availableNodes.Count]; 2414TimeSpan[] nodeActiveTimes = new TimeSpan[_availableNodes.Count]; 2415DateTime[] nodeStartTimes = new DateTime[_availableNodes.Count]; 2418Dictionary<int, int> availableNodeIdsToIndex = new Dictionary<int, int>(_availableNodes.Count); 2419int[] indexToAvailableNodeId = new int[_availableNodes.Count]; 2533loggingService.LogComment(context, MessageImportance.Normal, "NodeUtilizationSummary", utilitzationPercentages.ToString(), (utilizationAverage / (double)_availableNodes.Count) * 100);
BackEnd\Components\Scheduler\SchedulingData.cs (4)
152get { return _executingRequests.Count; } 168get { return _readyRequests.Count; } 192get { return _blockedRequests.Count; } 208get { return _yieldingRequests.Count; }
BackEnd\Components\Scheduler\SchedulingPlan.cs (1)
167if (_configIdToData.Count > 0)
BackEnd\Shared\BuildRequestConfiguration.cs (1)
301public bool IsActivelyBuilding => _activelyBuildingTargets?.Count > 0;
Collections\HashTableUtility.cs (2)
42int comparison = Math.Sign(h1.Count - h2.Count);
Collections\MultiDictionary.cs (1)
82internal int KeyCount => _backing.Count;
Collections\WeakValueDictionary.cs (4)
54public int Count => _dictionary.Count; 117if (_dictionary.Count == _capacity) 124if (_dictionary.Count == _capacity) 126_capacity = _dictionary.Count * 2;
Evaluation\Evaluator.cs (1)
2071escapedMetadata = new Dictionary<string, string>(item.Value.Metadata.Count, StringComparer.OrdinalIgnoreCase);
Evaluation\ExpressionShredder.cs (1)
91bool result = (pair.Metadata?.Count > 0);
Evaluation\LazyItemEvaluator.cs (2)
204var cacheCount = _cache?.Count ?? 0; 439if (itemsWithNoWildcards.Count > 0)
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
97CapturedItems = capturedItems == null || capturedItems.Count == 0
Evaluation\ParserIgnoreConfiguration.cs (2)
112if (_allowedAttributes.Count == 0) 128if (_allowedChildren.Count == 0)
Graph\GraphBuilder.cs (1)
148Dictionary<ProjectGraphNode, HashSet<ProjectGraphNode>> transitiveReferenceCache = new(allParsedProjects.Count);
Instance\ProjectItemInstance.cs (1)
622if (metadataList.Count != 0 && items.Count != 0)
Instance\TaskRegistry.cs (1)
548if (taskRecord == null && _taskRegistrations?.Count > 0)
Logging\ParallelLogger\ParallelConsoleLogger.cs (2)
254if (!showOnlyErrors && !showOnlyWarnings && _deferredMessages.Count > 0) 1775if (_internalPerformanceCounters?.Count > 0)
src\9f0d3f3da306d8cf\ImmutableArrayExtensions.cs (3)
863if (dictionary.Count == 0) 1220var capacity = map.Count > 3 ? map.Count : 0;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ArrayBuilder.cs (1)
578var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\PooledDictionary.cs (1)
58Debug.Assert(instance.Count == 0);
src\msbuild\src\Shared\TaskHostBuildResponse.cs (1)
64var dict = new Dictionary<string, ITaskItem[]>(projectOutputs.Count, StringComparer.OrdinalIgnoreCase);
src\msbuild\src\Shared\TaskParameter.cs (2)
707int count = (_customEscapedMetadata == null) ? 0 : _customEscapedMetadata.Count; 730public bool HasCustomMetadata => _customEscapedMetadata?.Count > 0;
src\msbuild\src\Shared\Tracing.cs (1)
145if (s_counts.Count > 0)
TelemetryInfra\InternalTelemetryConsumingLogger.cs (2)
51Console.WriteLine($"Targets ({_workerNodeTelemetryData.TargetsExecutionData.Count}):"); 58Console.WriteLine($"Tasks: ({_workerNodeTelemetryData.TasksExecutionData.Count})");
TelemetryInfra\TasksDetailsTelemetry.cs (1)
38if (telemetryData is null || telemetryData.TasksExecutionData.Count == 0)
Microsoft.Build.Framework (16)
BinaryTranslator.cs (4)
1456if ((dictionary is null) && ((additionalEntries is null) || (additionalEntries.Count == 0))) 1469(additionalEntries is null ? 0 : additionalEntries.Count) + 1584int count = dictionary.Count; 1652int count = dictionary.Count;
BinaryWriterExtensions.cs (2)
125writer.Write7BitEncodedInt(data.ExtendedMetadata.Count); 136writer.Write7BitEncodedInt(durations.Count);
BuildCheck\BuildCheckEventArgs.cs (1)
50writer.Write7BitEncodedInt(TracingData.TelemetryData.Count);
MutableTaskItem.cs (1)
24public int MetadataCount => _metadata.Count;
Sdk\SdkResultItem.cs (2)
43Metadata?.Count == item.Metadata.Count)
Telemetry\BuildCheckTelemetry.cs (1)
48int rulesCount = data.TelemetryData.Count;
Telemetry\TelemetryDataUtils.cs (1)
335int totalTargets = targetsExecutionData.Count;
Telemetry\WorkerNodeTelemetryData.cs (2)
82public bool IsEmpty => TasksExecutionData.Count == 0 && TargetsExecutionData.Count == 0;
Telemetry\WorkerNodeTelemetryEventArgs.cs (2)
20writer.Write7BitEncodedInt(WorkerNodeTelemetryData.TasksExecutionData.Count); 31writer.Write7BitEncodedInt(WorkerNodeTelemetryData.TargetsExecutionData.Count);
Microsoft.Build.Tasks.CodeAnalysis (3)
src\roslyn\src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (2)
152int index = topLevelMappedPaths.Count; 168if (topLevelMappedPaths.Count == 0)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
472if (environmentVariables.Count == 0)
Microsoft.Build.Tasks.Core (22)
AssemblyDependency\Reference.cs (1)
755get { return _preUnificationVersions.Count != 0; }
AssemblyDependency\ReferenceTable.cs (4)
1888if (baseNameToReferences.Count == 0) 1899var fullNameToReference = new Dictionary<string, AssemblyNameReference>(References.Count, StringComparer.OrdinalIgnoreCase); 2216var baseNameToReferences = new Dictionary<string, List<AssemblyNameReference>>(References.Count, StringComparer.OrdinalIgnoreCase); 2244List<string> toRemove = new(baseNameToReferences.Count);
AssemblyDependency\ResolveAssemblyReference.cs (3)
2256else if (_stateFile.Value is not null && (_cache.IsDirty || _cache.instanceLocalOutgoingFileStateCache.Count < _cache.instanceLocalFileStateCache.Count)) 3259AssemblyTableInfo[] extensions = new AssemblyTableInfo[tableMap.Count];
BootstrapperUtil\BootstrapperBuilder.cs (6)
237resourceUpdater.AddStringResource(44, "COUNT", eulas.Count.ToString(CultureInfo.InvariantCulture)); 742while (buildQueue.Count > 0) 768if (buildQueue.Count > 0 && productsToRemove.Count == 0) 778if (productsInLoop.Length > 0 && (buildQueue.Count == 0 || productsToRemove.Count == 0)) 1535string configFileKey = string.Format(CultureInfo.InvariantCulture, "EULA{0}", eulas.Count); 1757if (_cultures.Count == 0)
CreateItem.cs (1)
108(excludeItems.Count == 0) || // minor perf optimization
ResolveSDKReference.cs (2)
1292if (FrameworkIdentitiesFromManifest.Count > 0) 1342if (AppxLocationsFromManifest.Count > 0)
src\msbuild\src\Shared\TaskParameter.cs (2)
707int count = (_customEscapedMetadata == null) ? 0 : _customEscapedMetadata.Count; 730public bool HasCustomMetadata => _customEscapedMetadata?.Count > 0;
src\msbuild\src\Shared\Tracing.cs (1)
145if (s_counts.Count > 0)
system.design\stronglytypedresourcebuilder.cs (1)
753Capacity = resourceList.Count
SystemState.cs (1)
282internal override bool HasStateToSave => instanceLocalOutgoingFileStateCache.Count > 0;
Microsoft.Build.Utilities.Core (1)
src\msbuild\src\Shared\Tracing.cs (1)
145if (s_counts.Count > 0)
Microsoft.CodeAnalysis (25)
Binding\AbstractLookupSymbolsInfo.cs (1)
271public int Count => _nameMap.Count;
CodeGen\SwitchStringJumpTableEmitter.cs (1)
139int count = stringHashMap.Count;
Collections\TopologicalSort.cs (1)
85bool hadCycle = predecessorCounts.Count != resultBuilder.Count;
CommandLine\SarifV1ErrorLogger.cs (1)
243public int Count => _keys.Count;
CommandLine\SarifV2ErrorLogger.cs (1)
464public int Count => _distinctDescriptors.Count;
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (2)
482Debug.Assert(_lazyPendingMemberSymbolsMap == null || _lazyPendingMemberSymbolsMap.Count == 0); 483Debug.Assert(_lazyPendingSymbolEndActionsMap == null || _lazyPendingSymbolEndActionsMap.Count == 0);
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
1560get { return this.added.Count + _firstRowId; }
InternalUtilities\ConcurrentLruCache.cs (2)
68var copy = new KeyValuePair<K, V>[_cache.Count]; 135if (_cache.Count == _capacity)
InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
MetadataReader\MetadataHelpers.cs (1)
916if (names.Count != nestedNamespaces.Count) // nothing to merge otherwise
MetadataReader\PEModule.cs (2)
683var result = new ArrayBuilder<IGrouping<string, TypeDefinitionHandle>>(namespaces.Count); 3829if (_lazyForwardedTypesToAssemblyIndexMap.Count == 0)
Operations\OperationMapBuilder.cs (1)
21Debug.Assert(dictionary.Count == 0);
PEWriter\MetadataWriter.cs (2)
4305Debug.Assert(index.Count == 0); 4332Debug.Assert(index.Count == 0);
ReferenceManager\CommonReferenceManager.State.cs (1)
428Debug.Assert(referencedModules.Length == referencedModulesMap.Count);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
Microsoft.CodeAnalysis.Analyzers (34)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (2)
224if (_codeActionCreateInvocations.Count > 0 || _codeActionObjectCreations.Count > 0)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (1)
385if (entriesToUpdate?.Count > 0 &&
MetaAnalyzers\PreferIsKindAnalyzer.cs (1)
63if (containingTypeMap.Count > 0)
src\b310f676f7308b7f\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
123other._reachingWrites.Count != _reachingWrites.Count) 173private bool IsEmpty => _reachingWrites.Count == 0;
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
448if (SymbolsWriteBuilder.Count == 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (1)
55if (bannedApis == null || bannedApis.Count == 0)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
132if (namesBuilder.Count == 0 && symbolsBuilder.Count == 0 && wildcardNamesBuilder.Count == 0)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
28if (Count == 0) 61Debug.Assert(instance.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
409var spans = new List<TextSpan>(nodesToReplace.Count + tokensToReplace.Count + triviaToReplace.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
245if (dictionary.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
230if (first == null || last == null || importToSyntax.Count == 0)
Microsoft.CodeAnalysis.AnalyzerUtilities (32)
src\66dd3055a1c91c38\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (1)
68if (escapedLocationsBuilder.Count == 0)
src\b310f676f7308b7f\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
123other._reachingWrites.Count != _reachingWrites.Count) 173private bool IsEmpty => _reachingWrites.Count == 0;
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
448if (SymbolsWriteBuilder.Count == 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
132if (namesBuilder.Count == 0 && symbolsBuilder.Count == 0 && wildcardNamesBuilder.Count == 0)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
28if (Count == 0) 61Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2148if (interproceduralUnhandledThrowOperationsData.Count == 0) 3763if (AnalysisDataForUnhandledThrowOperations?.Count > 0)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DictionaryAnalysisData.cs (1)
72return _coreAnalysisData.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
409var spans = new List<TextSpan>(nodesToReplace.Count + tokensToReplace.Count + triviaToReplace.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
245if (dictionary.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
Microsoft.CodeAnalysis.CodeStyle (25)
src\b310f676f7308b7f\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
123other._reachingWrites.Count != _reachingWrites.Count) 173private bool IsEmpty => _reachingWrites.Count == 0;
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
448if (SymbolsWriteBuilder.Count == 0)
src\roslyn\src\Analyzers\Core\Analyzers\OrderModifiers\OrderModifiersHelpers.cs (1)
88if (result.Count == 0)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
837return idToSuppressMessageAttributesMap.Count > 0;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
409var spans = new List<TextSpan>(nodesToReplace.Count + tokensToReplace.Count + triviaToReplace.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
245if (dictionary.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
230if (first == null || last == null || importToSyntax.Count == 0)
Microsoft.CodeAnalysis.CSharp (45)
Binder\Binder_Constraints.cs (1)
50names.Add(name, names.Count);
Binder\PatternExplainer.cs (2)
714needsPropertyString = properties.Count != 0; 748needsPropertyString |= deconstruction == null && typeName == null || properties.Count != 0;
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (5)
65Debug.Assert(instance.Count == 0); 2370var result = dictionary.Count != interfaces.Length ? dictionary.Values.ToImmutableArray() : interfaces; 2919if (candidates.Count >= 2) 2925if (candidates.Count == 0) 3364builder.EnsureCapacity(builder.Count + candidates.Count);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1122else if (containingTypeMapOpt.Count == 1)
BoundTree\BoundNode_Source.cs (1)
536identifier = tempIdentifiers.Count + 1;
CodeGen\Optimizer.cs (2)
71if (locals.Count == 0) 113if (info.Count != 0)
Compilation\MemberSemanticModel.cs (3)
1206if (_guardedIOperationNodeMap.Count != 0) 1216if (_guardedIOperationNodeMap.Count != 0) 1995if (_guardedBoundNodeMap.Count > 0)
Compilation\MemberSemanticModel.NodeMapBuilder.cs (1)
55map.EnsureCapacity(map.Count + additionMap.Keys.Count);
Compiler\TypeCompilationState.cs (1)
165get { return _wrappers == null ? 0 : _wrappers.Count; }
FlowAnalysis\NullableWalker.cs (2)
490Debug.Assert(_targetTypedAnalysisCompletionOpt is null or { Count: 0 }); 584Debug.Assert(_resultForPlaceholdersOpt.Count == 0);
FlowAnalysis\NullableWalker.SnapshotManager.cs (3)
172Debug.Assert(_symbolToSlot.Count == _walkerStates.Count); 173Debug.Assert(_symbolToSlot.Count > 0); 195_currentWalkerSlot = _symbolToSlot.Count;
FlowAnalysis\NullableWalker.Variables.cs (4)
164Debug.Assert(_variableSlot.Count == 0); 165Debug.Assert(_variableTypes.Count == 0); 324return fromContainer + _variableSlot.Count; 432return $"Id={Id}, Symbol={symbol}, Count={_variableSlot.Count}";
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
76var fieldName = GeneratedNames.DelegateCacheContainerFieldName(_delegateFields.Count, targetMethod.Name);
Lowering\LocalRewriter\DelegateCacheRewriter.cs (1)
114container = new DelegateCacheContainer(_factory.CompilationState.Type, owner, _topLevelMethodOrdinal, ownerUniqueId: containers.Count, generation);
Lowering\LocalRewriter\LocalRewriter.cs (1)
531Debug.Assert(_placeholderReplacementMapDoNotUseDirectly.Count == 0);
Lowering\SpillSequenceSpiller.cs (1)
201if (tempSubstitution.Count == 0)
Lowering\SynthesizedSubmissionFields.cs (1)
44return _previousSubmissionFieldMap == null ? 0 : _previousSubmissionFieldMap.Count;
Symbols\Metadata\PE\PENamespaceSymbol.cs (2)
80if (lazyNamespaces.Count == 0) 83var builder = ArrayBuilder<Symbol>.GetInstance(memberTypes.Length + lazyNamespaces.Count);
Symbols\Source\ConstantEvaluationHelpers.cs (5)
63Debug.Assert(graph.Count >= 1); 159Debug.Assert(graph.Count > 0); 164while (graph.Count > 0) 269Debug.Assert(graph.Count > 0); 273fieldsInvolvedInCycles = ArrayBuilder<SourceFieldSymbolWithSyntaxReference>.GetInstance(graph.Count);
Symbols\Source\ExtensionGroupingInfo.cs (1)
56var builder = ArrayBuilder<ExtensionGroupingType>.GetInstance(groupingMap.Count);
Symbols\Source\SourceMemberContainerSymbol.cs (4)
1484Debug.Assert(s_emptyTypeMembers.Count == 0); 1773var dictionary = new Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>>(accumulator.Count, ReadOnlyMemoryOfCharComparer.Instance); 2611if (membersByNameToMerge.Count == 0) 3773Debug.Assert(partialMembersToMerge.Count != 0);
Symbols\Source\SourceNamespaceSymbol.cs (1)
282var result = new Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamespaceOrTypeSymbol>>(builder.Count, ReadOnlyMemoryOfCharComparer.Instance);
Symbols\SpecializedSymbolCollections.cs (1)
28Debug.Assert(instance.Count == 0);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
162public bool HasCandidateMembersToRemove => _candidateMembersToRemove.Count > 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
650if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Microsoft.CodeAnalysis.CSharp.Features (2)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
110if (map.Count > 0)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
162public bool HasCandidateMembersToRemove => _candidateMembersToRemove.Count > 0;
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
650if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Microsoft.CodeAnalysis.Extensions.Package (5)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
Microsoft.CodeAnalysis.Features (24)
CodeFixes\Service\CodeFixService.cs (2)
379return fixerMap.Count > 0; 489if (fixerToRangesAndDiagnostics.Count == 0)
CodeRefactorings\CodeRefactoringService.cs (1)
229providerToIndex.Add(provider, providerToIndex.Count);
Completion\CompletionService_GetCompletions.cs (1)
404public bool IsEmpty => _displayNameToItemsMap.Count == 0;
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
387documentIdToIndex.Add(documentId, documentIdToIndex.Count);
Completion\Providers\ImportCompletionProvider\ExtensionMemberImportCompletionHelper.cs (1)
179var itemsBuilder = new FixedSizeArrayBuilder<SerializableImportCompletionItem>(overloadMap.Count);
DocumentationComments\CopilotDocumentationCommentGenerator.cs (1)
140if (documentationCommentDictionary is null || documentationCommentDictionary.Count == 0)
EditAndContinue\AbstractEditAndContinueAnalyzer.ActiveMembersBuilder.cs (1)
88if (_declarations.Count == 0)
EditAndContinue\EmitSolutionUpdateResults.cs (1)
296if (!moduleUpdates.IsEmpty && projectsToRebuildBuilder.Count > 0)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncDocumentWorkItemQueue.cs (4)
20protected override int WorkItemCount_NoLock => _documentWorkQueue.Count; 30if (documentMap.Count == 0) 47if (_documentWorkQueue.Count == 0) 118if (_documentWorkQueue.Count == 1)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncProjectWorkItemQueue.cs (2)
20protected override int WorkItemCount_NoLock => _projectWorkQueue.Count; 48if (_projectWorkQueue.Count == 0)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (1)
166if (_cancellationMap.Count == 0)
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (2)
82_namedTypes.Add(symbol, (order: _namedTypes.Count, count: 1)); 96_namedTypes.Add(symbol, (order: _namedTypes.Count, count: 1));
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
443if (nodesToUpdate.Count > 0)
src\roslyn\src\Analyzers\Core\Analyzers\OrderModifiers\OrderModifiersHelpers.cs (1)
88if (result.Count == 0)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
837return idToSuppressMessageAttributesMap.Count > 0;
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (2)
35projectAssets.Targets.Count == 0) 41projectAssets.Libraries.Count == 0)
Wrapping\AbstractCodeActionComputer.cs (1)
197if (leftTokenToTrailingTrivia.Count == 0)
Microsoft.CodeAnalysis.NetAnalyzers (11)
src\ffd9070534249528\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (1)
65if (escapedLocationsBuilder.Count == 0)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
130if (namesBuilder.Count == 0 && symbolsBuilder.Count == 0 && wildcardNamesBuilder.Count == 0)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (1)
419var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
33if (Count == 0) 52if (Count == 0) 98Debug.Assert(instance.Count == 0);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2145if (interproceduralUnhandledThrowOperationsData.Count == 0) 3760if (AnalysisDataForUnhandledThrowOperations?.Count > 0)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DictionaryAnalysisData.cs (1)
71return _coreAnalysisData.Count;
Microsoft.CodeAnalysis.Razor.Compiler (6)
Language\Components\ComponentGenericTypePass.cs (1)
246if (bindings.Count > 0)
Language\DefaultRazorTagHelperContextDiscoveryPhase.cs (2)
515if (_namespaceToComponentsMap.Count == 0 && _componentsWithoutNamespace is null or { Count: 0 }) 530if (_namespaceToComponentsMap is { Count: > 0 } namespaceToComponentsMap)
Language\Intermediate\IntermediateNodeFormatter.cs (2)
150=> _content != null && (_properties.Count == 0 || Mode == FormatterMode.PreferContent); 153=> _properties.Count > 0 && (_content == null || Mode == FormatterMode.PreferContent);
Language\TagHelperBinder.cs (1)
102var map = new Dictionary<string, TagHelperSet>(capacity: tagNameToBuilderIndexMap.Count, StringComparer.OrdinalIgnoreCase);
Microsoft.CodeAnalysis.ResxSourceGenerator (28)
src\b310f676f7308b7f\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
123other._reachingWrites.Count != _reachingWrites.Count) 173private bool IsEmpty => _reachingWrites.Count == 0;
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
448if (SymbolsWriteBuilder.Count == 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
132if (namesBuilder.Count == 0 && symbolsBuilder.Count == 0 && wildcardNamesBuilder.Count == 0)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
28if (Count == 0) 61Debug.Assert(instance.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
409var spans = new List<TextSpan>(nodesToReplace.Count + tokensToReplace.Count + triviaToReplace.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
245if (dictionary.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
Microsoft.CodeAnalysis.Scripting (1)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (1)
631get { return _shadowCopies.Count; }
Microsoft.CodeAnalysis.VisualBasic (11)
Binding\Binder_XmlLiterals.vb (2)
129Debug.Assert((namespaces Is Nothing) OrElse (namespaces.Count > 0)) 1482Debug.Assert(namespaces.Count > 0)
Lowering\Diagnostics\DiagnosticsPass.vb (1)
199If _withExpressionPlaceholderMap IsNot Nothing AndAlso _withExpressionPlaceholderMap.Count > 0 Then
Lowering\SynthesizedSubmissionFields.vb (1)
38Return If(_previousSubmissionFieldMap Is Nothing, 0, _previousSubmissionFieldMap.Count)
Symbols\Source\SourceFieldSymbol.vb (5)
272Debug.Assert(graph.Count >= 1) 431Debug.Assert(graph.Count > 0) 436While graph.Count > 0 527Debug.Assert(graph.Count > 0) 530fieldsInvolvedInCycles = ArrayBuilder(Of SourceFieldSymbol).GetInstance(graph.Count)
Symbols\Source\SourceFile.vb (2)
273importAliasesOpt = If(data.Aliases.Count = 0, Nothing, data.Aliases) 274xmlNamespacesOpt = If(data.XmlNamespaces.Count > 0, data.XmlNamespaces, Nothing)
Microsoft.CodeAnalysis.Workspaces (35)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
65if (docIdToTextMerger.Count == 0)
FindSymbols\StreamingProgressCollector.cs (1)
40var result = new FixedSizeArrayBuilder<ReferencedSymbol>(_symbolToLocations.Count);
FindSymbols\SymbolFinder_Helpers.cs (2)
107if (equivalentTypesWithDifferingAssemblies.Count > 0) 125Contract.ThrowIfTrue(equivalentTypesWithDifferingAssemblies.Count == 0);
FindSymbols\SyntaxTree\SyntaxTreeIndex_Persistence.cs (1)
43writer.WriteInt32(_interceptsLocationInfo?.Count ?? 0);
Log\KeyValueLogMessage.cs (1)
157return _lazyMap.Count > 0;
src\b310f676f7308b7f\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
123other._reachingWrites.Count != _reachingWrites.Count) 173private bool IsEmpty => _reachingWrites.Count == 0;
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
448if (SymbolsWriteBuilder.Count == 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
409var spans = new List<TextSpan>(nodesToReplace.Count + tokensToReplace.Count + triviaToReplace.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
230if (first == null || last == null || importToSyntax.Count == 0)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
381if (_documentPathsToDocumentIds.Count != filePaths.Length)
Workspace\Solution\Solution.cs (1)
1597Contract.ThrowIfTrue(solution._documentIdToFrozenSolution.Count != 0);
Workspace\Solution\SolutionCompilationState.cs (1)
1466if (documentStates.Count == 0)
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (1)
180documentToIndex.Add(document, documentToIndex.Count);
Workspace\Workspace_Editor.cs (1)
195if (_projectToOpenDocumentsMap.Count == 0)
Workspace\Workspace.cs (1)
393if (relatedDocumentIdsAndStates.Count == 0)
Microsoft.CSharp (3)
Microsoft\CSharp\RuntimeBinder\ComInterop\ComTypeDesc.cs (1)
177if (Events != null && Events.Count > 0)
Microsoft\CSharp\RuntimeBinder\ComInterop\ComTypeLibDesc.cs (1)
131string[] retval = new string[_enums.Count + _classes.Count];
Microsoft\CSharp\RuntimeBinder\ComInterop\IDispatchComObject.cs (1)
402if (events.Count == 0)
Microsoft.Diagnostics.DataContractReader (4)
ContractDescriptorParser.cs (4)
77return $"Version: {Version}, Baseline: {Baseline}, Contracts: {Contracts?.Count}, Types: {Types?.Count}, Globals: {Globals?.Count}, SubDescriptors: {SubDescriptors?.Count}";
Microsoft.DotNet.ApiCompatibility (1)
Mapping\AssemblySetMapper.cs (1)
22public int AssemblyCount => _assemblies != null ? _assemblies.Count : 0;
Microsoft.DotNet.Arcade.Sdk (1)
src\InstallDotNetCore.cs (1)
81if (runtimeItems.Count > 0)
Microsoft.DotNet.Build.Tasks.Installers (1)
src\CreateWixBuildWixpack.cs (1)
351if (_defineConstantsDictionary != null && _defineConstantsDictionary.Count > 0)
Microsoft.DotNet.Build.Tasks.Packaging (2)
GetLayoutFiles.cs (1)
75if (frameworks.Count != 0)
SplitReferences.cs (1)
86if (packageReferences.Count == 0)
Microsoft.DotNet.Cli.Telemetry (1)
Implementation\AzureMonitorLogSerializer.cs (1)
126var propertyBag = properties.Count > 0 ? properties : null;
Microsoft.DotNet.HotReload.Watch (5)
FileWatcher\FileWatcher.cs (2)
55=> _directoryTreeWatchers.Count > 0 || _directoryWatchers.Count > 0;
FileWatcher\PollingDirectoryWatcher.cs (3)
89Debug.Assert(_currentSnapshot.Count == 0); 96Debug.Assert(_changesBuilder.Count == 0); 97Debug.Assert(_snapshotBuilder.Count == 0);
Microsoft.DotNet.NuGetRepack.Tasks (1)
src\ReplacePackageParts.cs (1)
210if (replacementMap.Count > 0)
Microsoft.DotNet.TemplateLocator (2)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadPack.cs (2)
19public bool IsAlias => AliasTo != null && AliasTo.Count > 0; 24if (AliasTo == null || AliasTo.Count == 0)
Microsoft.Extensions.AI.Abstractions (2)
AdditionalPropertiesDictionary{TValue}.cs (1)
74public int Count => _dictionary.Count;
Functions\AIFunctionArguments.cs (1)
111public int Count => _arguments.Count;
Microsoft.Extensions.AI.Evaluation.NLP (2)
Common\MatchCounter.cs (2)
62_counts.Count < other._counts.Count ? (_counts, other._counts) : (other._counts, _counts);
Microsoft.Extensions.Caching.Hybrid.Tests (3)
SerializerTests.cs (1)
197Assert.Equal(2, clone.Count);
StampedeTests.cs (1)
479Assert.Equal(8, counts.Count);
TestEventListener.cs (1)
186return _counters.Count;
Microsoft.Extensions.Compliance.Redaction (1)
RedactorProvider.cs (1)
46var dict = new Dictionary<DataClassificationSet, Redactor>(map.Count);
Microsoft.Extensions.Configuration (1)
ConfigurationManager.cs (1)
287public int Count => _properties.Count;
Microsoft.Extensions.DataIngestion.Abstractions (2)
IngestionChunk.cs (1)
65public bool HasMetadata => _metadata?.Count > 0;
IngestionDocumentElement.cs (1)
60public bool HasMetadata => _metadata?.Count > 0;
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\CallSiteChain.cs (1)
35_callSiteChain[serviceIdentifier] = new ChainItemInfo(_callSiteChain.Count, implementationType);
ServiceLookup\ServiceProviderEngineScope.cs (1)
293DependencyInjectionEventSource.Log.ScopeDisposed(RootProvider.GetHashCode(), ResolvedServices.Count, _disposables?.Count ?? 0);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Roslyn4.0.cs (1)
204if (allLogClasses.Count > 0)
Microsoft.Extensions.Options.SourceGeneration (4)
Emitter.cs (4)
628if (_optionsSourceGenContext.AttributesToGenerate.Count == 0) 1204if (attr.Properties.Count > 0) 1226var fieldNumber = staticValidationAttributesDict.Count + 1; 1343var fieldNumber = staticValidatorsDict.Count + 1;
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Resolver\DnsResolver.cs (1)
261if (i >= aliasMap.Count)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
SyntaxContextReceiverTests.cs (1)
33Assert.Equal(3, typeDeclarations!.Count);
Microsoft.Gen.Logging.Generated.Tests (3)
LogPropertiesTests.cs (3)
177Assert.Equal(11, ss.Count); 195Assert.Equal(4, ss.Count); 606Assert.Equal(4, state.Count);
Microsoft.Interop.SourceGeneration (1)
ManualTypeMarshallingHelper.cs (1)
232if (modes.Count == 0)
Microsoft.Maui.Controls (11)
DragAndDrop\DataPackagePropertySet.cs (1)
26 public int Count => _propertyBag.Count;
Element\Element.cs (1)
735 if (DynamicResources.Count == 0)
ListProxy.cs (1)
194 if (_items != null && _items.Count > 0)
OrderedDictionary.cs (1)
145 get { return _dict.Count; }
ResourceDictionary.cs (3)
180 get { return _innerDictionary.Count + (_mergedInstance?.Count ?? 0); } 248 if (_innerDictionary.Count == 0) 267 if (_innerDictionary.Count == 0)
Shell\ShellContent.cs (1)
347 if (query.Count == 0 && !this.IsSet(QueryAttributesProperty))
Shell\ShellNavigationQueryParameters.cs (1)
55 public int Count => _internal.Count;
Shell\ShellRouteParameters.cs (2)
43 : base(query.Count) 91 if (queryStringParameters == null || queryStringParameters.Count == 0)
Microsoft.Maui.Controls.Xaml (1)
RemoveDuplicateDesignNodes.cs (1)
24 if (node.Properties == null || node.Properties.Count == 0)
Microsoft.Maui.Graphics.Text.Markdig (1)
Renderer\HtmlInlineRenderer.cs (1)
57 if (attributes.Count > 0)
Microsoft.Maui.Resizetizer (1)
DetectInvalidResourceOutputFilenamesTask.cs (1)
45 if (tempInvalidItems.Count > 0)
Microsoft.ML.AutoML (4)
Sweepers\ISweeper.cs (3)
118get { return _parameterValues.Count; } 135if (other == null || other._hash != _hash || other._parameterValues.Count != _parameterValues.Count)
Tuner\CostFrugalTuner.cs (1)
88if (_searchThreadPool.Count == 0)
Microsoft.ML.Core (5)
CommandLine\CmdParser.cs (1)
1345Contracts.Assert(map.Count >= args.Length);
Data\RoleMappedSchema.cs (1)
313var copy = new Dictionary<string, IReadOnlyList<DataViewSchema.Column>>(map.Count);
Utilities\LruCache.cs (1)
67if (_cache.Count > _size)
Utilities\Tree.cs (1)
79public int Count { get { return _children.Count; } }
Utilities\Utils.cs (1)
111return x == null ? 0 : x.Count;
Microsoft.ML.Data (18)
DataLoadSave\Database\DatabaseLoader.cs (1)
489if (iinfo == nameToInfoIndex.Count && nameToInfoIndex.ContainsKey(name))
DataLoadSave\Text\TextLoader.cs (1)
765if (iinfo == nameToInfoIndex.Count && nameToInfoIndex.ContainsKey(name))
Evaluators\EvaluatorBase.cs (1)
404public override int Count => _dict.Count;
Evaluators\EvaluatorUtils.cs (11)
489slotNames[name] = slotNames.Count; 494var reconciledSlotNames = new VBuffer<ReadOnlyMemory<char>>(slotNames.Count, slotNames.Keys.Select(k => k.AsMemory()).ToArray()); 513var editor = VBufferEditor.Create(ref dst, slotNames.Count); 524var mappedIndices = new bool[slotNames.Count]; 537var editor = VBufferEditor.Create(ref dst, slotNames.Count); 547var typeDst = new VectorDataViewType(itemType, slotNames.Count); 589reconciledKeyNames[name] = reconciledKeyNames.Count; 614var keyType = new KeyDataViewType(typeof(uint), keyNames.Count); 615var keyNamesVBuffer = new VBuffer<ReadOnlyMemory<char>>(keyNames.Count, keyNames.Keys.ToArray()); 682var keyType = new KeyDataViewType(typeof(uint), keyNames.Count); 683var keyNamesVBuffer = new VBuffer<ReadOnlyMemory<char>>(keyNames.Count, keyNames.Keys.ToArray());
Model\Pfa\BoundPfaContext.cs (2)
84_host.Assert(_nameToVarName.Count == fields.Count); 85_host.Assert(_nameToVarName.Count == fieldNames.Count);
Transforms\ColumnBindingsBase.cs (1)
341Contracts.Assert(_nameToInfoIndex.Count == names.Length);
Transforms\InvertHashUtils.cs (1)
231int count = _slotToValueSet.Count;
Microsoft.ML.FastTree (10)
Dataset\DatasetUtils.cs (3)
51uvalToOrder[uintQid] = uvalToOrder.Count; 54skel.NumDocs, IntArrayType.Dense, IntArray.NumBitsNeeded(uvalToOrder.Count), 57uint[] valueMap = uvalToOrder.Keys.OrderBy(x => x).ToArray(uvalToOrder.Count);
FastTree.cs (1)
3240if (gainMap.Count == 0)
GamModelParameters.cs (1)
185ctx.Writer.Write(_inputFeatureToShapeFunctionMap.Count);
TreeEnsemble\InternalRegressionTree.cs (4)
1203sbInput.AppendFormat("\n[Input:{0}]\n", featureToId.Count + 1); 1207featureToId.Add(SplitFeatures[n], featureToId.Count + 1); 1283sbInput.AppendFormat("\n[Input:{0}]\n", featureToId.Count + 1); 1287featureToId.Add(categoricalSplitFeature, featureToId.Count + 1);
TreeEnsemble\InternalTreeEnsemble.cs (1)
136sb.AppendFormat("[TreeEnsemble]\nInputs={0}\nEvaluators={1}\n", featureToID.Count, evaluatorCounter + 1);
Microsoft.ML.GenAI.Core (1)
Extension\ModuleExtension.cs (1)
123if (deviceMap.Count == 0)
Microsoft.ML.LightGbm (1)
LightGbmTrainerBase.cs (1)
921cnt = ivPair.Count;
Microsoft.ML.SearchSpace (1)
Parameter.cs (1)
233public int Count => ParameterType == ParameterType.Object ? (_value as Dictionary<string, Parameter>).Count : 1;
Microsoft.ML.Sweeper (3)
ISweeper.cs (3)
147get { return _parameterValues.Count; } 164if (other == null || other._hash != _hash || other._parameterValues.Count != _parameterValues.Count)
Microsoft.ML.TimeSeries (18)
PolynomialUtils.cs (1)
332if (hash.Count > 0)
RootCauseAnalyzer.cs (15)
54if (anomalyTree.ParentNode == null || dimPointMapping.Count == 0) 136if (anomalyTree.ChildrenNodes.Count == 0) 235int pointSize = isLeaveslevel ? pointDistribution.Count : GetTotalNumber(pointDistribution); 310double entropy = GetEntropy(dimension.PointDis.Count, dimension.AnomalyDis.Count); 490if (dimension.Key.AnomalyDis.Count == 1 || (isLeavesLevel ? dimension.Value >= meanGain : dimension.Value <= meanGain)) 499if (dimension.Key.AnomalyDis.Count > 1) 501if (best.AnomalyDis.Count != 1 && !isRatioNan && (isLeavesLevel ? valueRatioMap[best].CompareTo(dimension.Value) <= 0 : valueRatioMap[best].CompareTo(dimension.Value) >= 0)) 506else if (dimension.Key.AnomalyDis.Count == 1) 509if (best.AnomalyDis.Count > 1) 513else if (best.AnomalyDis.Count == 1) 539if (dimension.Key.AnomalyDis.Count != dimension.Key.PointDis.Count) 816if (x.Count != y.Count)
RootCauseLocalizationType.cs (2)
154if (Dimension.Count == other.Dimension.Count)
Microsoft.ML.TimeSeries.Tests (5)
TimeSeriesDirectApi.cs (5)
965Assert.Equal(3, (int)rootCause.Items[0].Dimension.Count); 994Assert.Equal(3, (int)preparedCauses[0].Items[0].Dimension.Count); 1010Assert.Equal(3, (int)preparedCauses[1].Items[0].Dimension.Count); 1042Assert.Equal(3, rootCause.Items[0].Dimension.Count); 1192Assert.Equal(3, rootCause.Items[0].Dimension.Count);
Microsoft.ML.Tokenizers (5)
Model\BPETokenizer.cs (1)
159if (vocab.Count == 0)
Model\Cache.cs (1)
50if (_map.Count < _capacity)
Model\SentencePieceTokenizer.cs (1)
749mergedSpecialTokens.Count > 0 ? mergedSpecialTokens : null,
Utils\LruCache.cs (1)
109while (_cache.Count >= _cacheSize)
Utils\StringSpanOrdinalKey.cs (1)
120if (_map.Count < _capacity)
Microsoft.ML.TorchSharp (3)
AutoFormerV2\Attention.cs (2)
83attentionOffsets.Add(offset, attentionOffsets.Count); 91this.attention_biases = nn.Parameter(torch.zeros(numHeads, attentionOffsets.Count));
Utils\DefaultDictionary.cs (1)
80public int Count => _dictionary.Count;
Microsoft.ML.Transforms (2)
Dracula\CMCountTable.cs (1)
135ctx.Writer.Write(dict.Count);
Dracula\DictCountTable.cs (1)
106ctx.Writer.Write(table.Count);
Microsoft.NET.Build.Containers (1)
ImageConfig.cs (1)
100if (_environmentVariables.Count != 0)
Microsoft.NET.Build.Tasks (3)
ProcessFrameworkReferences.cs (1)
219Log.LogMessage(MessageImportance.Low, $"Found {frameworkReferenceMap.Count} known framework references for target framework {TargetFrameworkIdentifier}");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadPack.cs (2)
19public bool IsAlias => AliasTo != null && AliasTo.Count > 0; 24if (AliasTo == null || AliasTo.Count == 0)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (2)
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (2)
1851var result = new List<string>(_defaultPropertyNames.Length + _additionalCustomMetadata.Count); 1863int ITaskItem.MetadataCount => _defaultPropertyNames.Length + (_additionalCustomMetadata?.Count ?? 0);
Microsoft.NET.Sdk.StaticWebAssets.Tasks (28)
ComputeReferenceStaticWebAssetItems.cs (1)
54var resultAssets = new List<StaticWebAsset>(existingAssets.Count);
ComputeStaticWebAssetsForCurrentProject.cs (1)
33var resultAssets = new List<StaticWebAsset>(currentProjectAssets.Count);
Data\StaticWebAsset.cs (2)
1851var result = new List<string>(_defaultPropertyNames.Length + _additionalCustomMetadata.Count); 1863int ITaskItem.MetadataCount => _defaultPropertyNames.Length + (_additionalCustomMetadata?.Count ?? 0);
Data\StaticWebAssetEndpoint.cs (2)
466var result = new List<string>(_defaultPropertyNames.Length + _additionalCustomMetadata.Count); 478int ITaskItem.MetadataCount => _defaultPropertyNames.Length + (_additionalCustomMetadata?.Count ?? 0);
DefineStaticWebAssetEndpoints.cs (3)
213var properties = new StaticWebAssetEndpointProperty[values.Count + (values.Count > 0 ? 2 : 1)]; 220if (values.Count > 0)
DefineStaticWebAssets.Cache.cs (1)
214var newHashes = new HashSet<string>(inputHashes.Count);
DefineStaticWebAssets.cs (1)
99Log.LogMessage(MessageImportance.Low, "Parsed {0} group definition source(s).", groupDefinitions.Count);
FilterStaticWebAssetEndpoints.cs (1)
48if (assetFiles.Count > 0 && !assetFiles.TryGetValue(endpoint.AssetFile, out asset))
FilterStaticWebAssetGroups.cs (1)
50if (groups.Count == 0)
GenerateStaticWebAssetsDevelopmentManifest.cs (6)
190index = contentRootIndex.Count; 191contentRootIndex.Add(asset.ContentRoot, contentRootIndex.Count); 235index = contentRootIndex.Count; 236contentRootIndex.Add(pattern.ContentRoot, contentRootIndex.Count); 259index = contentRootIndex.Count; 260contentRootIndex.Add(pattern.ContentRoot, contentRootIndex.Count);
ReadPackageAssetsManifest.cs (2)
64if (manifest.Assets == null || manifest.Assets.Count == 0) 71var assets = new StaticWebAsset[manifest.Assets.Count];
UpdateExternallyDefinedStaticWebAssets.cs (2)
114if (assetMapping.Count > 0) 129if (assetMapping.Count > 0)
UpdatePackageStaticWebAssets.cs (1)
75if (Endpoints != null && assetMapping.Count > 0)
Utils\Globbing\GlobNode.cs (4)
38return LiteralsDictionary?.Count > 0 || ExtensionsDictionary?.Count > 0 || ComplexGlobSegments?.Count > 0 || WildCard != null || RecursiveWildCard != null; 66return LiteralsDictionary?.Count > 0; 75return ExtensionsDictionary?.Count > 0;
Microsoft.NET.Sdk.WorkloadManifestReader (2)
WorkloadPack.cs (2)
19public bool IsAlias => AliasTo != null && AliasTo.Count > 0; 24if (AliasTo == null || AliasTo.Count == 0)
Microsoft.Private.Windows.Core (1)
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (1)
100Debug.Assert(s_knownTypes.Count == 60);
Microsoft.TemplateEngine.Cli (2)
Alias\AliasRegistry.cs (1)
147if (_aliases is AliasModel { CommandAliases: { Count: > 0 } })
ChoiceTemplateParameter.cs (1)
78Arity = new ArgumentArity(DefaultIfOptionWithoutValue == null ? 1 : 0, AllowMultipleValues ? _choices.Count : 1),
Microsoft.TemplateEngine.Edge (1)
Template\ParameterSetBuilder.cs (1)
243if (parametersDependencies.Count == 0)
Microsoft.TemplateEngine.Utils (3)
DirectedGraph.cs (1)
27private bool IsEmpty => _dependenciesMap.Count == 0;
InMemoryFileSystem.cs (2)
126if (!recursive && (currentDir.Directories.Count > 0 || currentDir.Files.Count > 0))
Microsoft.TemplateSearch.Common (2)
TemplateDiscoveryMetadata\LegacySearchCacheReader.cs (2)
196logger.LogDebug($"Successfully read {workingPackToTemplateMap.Count} packages."); 249logger.LogDebug($"Successfully read {workingAdditionalData.Count} additional information entries.");
Microsoft.TestPlatform.CrossPlatEngine (3)
Discovery\DiscovererEnumerator.cs (1)
136if (discovererToSourcesMap == null || discovererToSourcesMap.Count == 0)
Execution\RunTestsWithSources.cs (2)
64if (!exceptionsHitDuringRunTests && _executorUriVsSourceList?.Count > 0 && !IsCancellationRequested 165if (discovererToSourcesMap == null || discovererToSourcesMap.Count == 0)
Microsoft.TestPlatform.TestHostRuntimeProvider (1)
Hosting\DefaultTestHostManager.cs (1)
478if (conflictingExtensions.Count != 0)
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (1)
1595ElseIf _dict.Count = _maxSize Then
Microsoft.VisualStudio.TestPlatform.Common (17)
DataCollection\DataCollectionManager.cs (3)
299if (!_isDataCollectionEnabled || RunDataCollectors.Count == 0) 410EqtTrace.Verbose("DataCollectionManager.CleanupPlugins: Cleaning up {0} plugins", RunDataCollectors.Count); 776if (RunDataCollectors.Count == 0)
ExtensionFramework\TestPluginCache.cs (1)
327if (extensions?.Count > 0)
ExtensionFramework\Utilities\TestExtensions.cs (9)
106var isFirstNullOrEmpty = first == null || first.Count == 0; 107var isSecondNullOrEmpty = second == null || second.Count == 0; 237if (testExtensions.TestDiscoverers.Count != 0 238|| testExtensions.TestExecutors.Count != 0 239|| testExtensions.TestExecutors2.Count != 0 240|| testExtensions.TestSettingsProviders.Count != 0 241|| testExtensions.TestLoggers.Count != 0 242|| testExtensions.TestHosts.Count != 0 243|| testExtensions.DataCollectors.Count != 0)
Utilities\SimpleJSON.cs (4)
873return aIndex < 0 || aIndex >= _dict.Count ? null : _dict.ElementAt(aIndex).Value; 879if (aIndex < 0 || aIndex >= _dict.Count) 888get { return _dict.Count; } 914if (aIndex < 0 || aIndex >= _dict.Count)
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (1)
HtmlLogger.cs (1)
143if (parameters.Count == 0)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
TrxLogger.cs (1)
143if (parameters.Count == 0)
Microsoft.VisualStudio.TestPlatform.ObjectModel (1)
Navigation\PortableSymbolReader.cs (1)
125if (methodsNavigationData.Count != 0)
Microsoft.Web.XmlTransform (2)
XmlAttributePreservationDict.cs (1)
216if (leadingSpaces.Count > 1) {
XmlTransforms.cs (1)
580int count = paramDictionary.Count;
Mono.Cecil (3)
Mono.Cecil.Metadata\Buffers.cs (2)
321 index = (uint) guids.Count + 1; 353 index = (uint) strings.Count + 1;
Mono.Cecil\AssemblyReader.cs (1)
806 var type_count = mtypes.Length - metadata.NestedTypes.Count;
Mono.Cecil.Mdb (1)
Mono.CompilerServices.SymbolWriter\MonoSymbolFile.cs (1)
284 ot.AnonymousScopeCount = anonymous_scopes != null ? anonymous_scopes.Count : 0;
MSBuild (4)
src\msbuild\src\Shared\TaskHostBuildResponse.cs (1)
64var dict = new Dictionary<string, ITaskItem[]>(projectOutputs.Count, StringComparer.OrdinalIgnoreCase);
src\msbuild\src\Shared\TaskParameter.cs (2)
707int count = (_customEscapedMetadata == null) ? 0 : _customEscapedMetadata.Count; 730public bool HasCustomMetadata => _customEscapedMetadata?.Count > 0;
XMake.cs (1)
1909result = ExecuteRestore(projectFile, toolsVersion, buildManager, restoreProperties.Count > 0 ? restoreProperties : globalProperties, saveProjectResult: saveProjectResult);
NuGet.Build.Tasks (1)
StaticGraphRestoreTaskBase.cs (1)
383writer.Write(globalProperties.Count);
NuGet.CommandLine.XPlat (5)
Commands\Package\Update\PackageUpdateCommandRunner.cs (2)
403if (projectPackageUpdates.Count == 0) 726List<(PackageWithVersionRange package, List<string> tfms)> result = new(allPackages.Count);
Commands\PackageSearch\PackageSearchRunner.cs (1)
91while (searchRequests.Count > 0)
Commands\Why\DependencyGraphPrinter.cs (1)
145var dependencyGraphHashes = new Dictionary<int, List<string>>(dependencyGraphPerFramework.Count);
Utility\TableParser.cs (1)
93while (columnQueues.Count > 0)
NuGet.Commands (18)
RestoreCommand\ContentFiles\ContentFileUtils.cs (4)
111Dictionary<string, List<ContentFilesEntry>> relativePathToEntries = new(entryMappings.Count, StringComparer.OrdinalIgnoreCase); 126if (relativePathToEntries.Count > 0) 128var absolutePaths = new List<string>(relativePathToEntries.Count); 163var results = new List<LockFileContentFile>(entryMappings.Count);
RestoreCommand\DependencyGraphResolver.cs (3)
649if (versionConflicts.Count > 0) 666if (downgrades.Count > 0) 1403CommandsEventSource.Instance.DependencyGraphResolver_ResolveDependencyGraphItemsStop(_request.Project.FilePath, pair.ToString(), resolvedDependencyGraphItems.Count, restartCount, totalQueuedItemCount);
RestoreCommand\LockFileBuilder.cs (4)
360if (lockFile.Libraries.Count != libraryReferences.Count) 362lockFile.Libraries = new List<LockFileLibrary>(libraryReferences.Count); 393if (lockFileTarget.Libraries.Count == libraryReferences.Count) 398lockFileTarget.Libraries = new List<LockFileTargetLibrary>(libraryReferences.Count);
RestoreCommand\Logging\TransitiveNoWarnUtils.cs (4)
388if (first.Count == 0) 393if (second.Count == 0) 795if (packages.Count == 0) 902if (PackageSpecific?.Count > 0 &&
RestoreCommand\RestoreCommand.cs (2)
965telemetry.TelemetryEvent[AuditSuppressedAdvisoriesDefinedCount] = audit.SuppressedAdvisories?.Count ?? 0; 1142telemetryEvent[PackagePruningDirectCount] = prunedDirectPackages?.Count ?? 0;
RestoreCommand\Utility\AuditUtility.cs (1)
270TransitivePackagesWithAdvisory = new(capacity: packagesWithKnownVulnerabilities.Count - directPackageCount);
NuGet.Configuration (2)
PackageSource\PackageSourceProvider.cs (2)
106List<PackageSource> defaultSources = new(packageSourceLookup.Count); 147packageSources = new(capacity: packageSourceLookup.Count);
NuGet.DependencyResolver.Core (1)
GraphModel\GraphOperations.cs (1)
82var requiredCapacity = downgrades.Count + workingDowngrades.Count;
NuGet.PackageManagement (5)
Audit\AuditChecker.cs (3)
53bool anyProjectsEnabledForAudit = restoreAuditProperties.Count == 0; 54var auditSettings = new Dictionary<string, ProjectAuditSettings>(restoreAuditProperties.Count); 96List<PackageIdentity> packagesWithReportedAdvisories = new(packagesWithKnownVulnerabilities?.Count ?? 0);
IDE\PackageRestoreManager.cs (1)
254if (packageReferencesDictionary.Count == 0)
NuGetPackageManager.cs (1)
2906if (nugetProjectActionsLookup.Count == 0 && packageIdentity == null)
NuGet.Packaging (5)
ContentModel\ContentItemCollection.cs (3)
122list.Capacity = Math.Max(list.Capacity, contentItemGroupList.Count + groupAssets.Count); 452if (x._properties?.Count != y._properties?.Count)
RuntimeModel\RuntimeDescription.cs (1)
117newSets.Count == 0 ? null : newSets);
Signing\Content\SignatureContent.cs (1)
138if (properties.Count == 0)
NuGet.ProjectModel (3)
LockFile\LockFileItem.cs (2)
59bool thisEmpty = _properties == null || _properties.Count == 0; 60bool otherEmpty = other._properties == null || other._properties.Count == 0;
ProjectLockFile\PackagesLockFileUtilities.cs (1)
407if (actualDependencies.Count != 0)
NuGet.Versioning (2)
NuGetVersionFactory.cs (1)
106if (ParsedNuGetVersionsMapping.Count >= ParsedNuGetVersionsMappingMaxEntries)
VersionRangeFactory.cs (1)
301if (ParsedVersionRangeMapping.Count >= ParsedVersionRangeMappingMaxEntries)
PresentationBuildTasks (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\ParserContext.cs (1)
891return cache.Count == 0 ? null : cache;
PresentationCore (14)
MS\Internal\Automation\EventMap.cs (3)
171if (_eventsTable.Count == 0) 187if (_eventsTable != null && _eventsTable.Count != 0) 199if (_eventsTable != null && _eventsTable.Count != 0)
MS\Internal\DeferredElementTreeState.cs (2)
118return _oldCoreParents.Count == 0 && _oldLogicalParents.Count == 0;
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
736get { return CMap.Count; }
MS\Internal\FontFace\CompositeFontInfo.cs (1)
146Dictionary<XmlLanguage, ushort[]> table = new Dictionary<XmlLanguage, ushort[]>(_familyMapRangesByLanguage.Count);
MS\Internal\Ink\Renderer.cs (1)
559i = Math.Min(_visuals.Count, _strokes.Count); //not -1, we're about to decrement
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\MimeTypeMapper.cs (1)
37if (_fileExtensionToMimeType.Count == 0)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SizeLimitedCache.cs (1)
237return (_nodeLookup.Count - _permanentCount) >= _maximumItems;
System\Windows\Input\ManipulationLogic.cs (1)
670get { return (_currentManipulators.Count > 0) ? _currentManipulators.Values : null; }
System\Windows\Input\Stylus\Wisp\WispLogic.cs (1)
3165if (__penContextsMap.Count == 1)
System\Windows\Media\UniqueEventHelper.cs (2)
128if (_delegates is { Count: > 0 } delegates) 130var handlers = new TEventHandler[delegates.Count];
PresentationFramework (18)
MS\Internal\Annotations\AnnotationMap.cs (1)
58return _annotationIdToAttachedAnnotations.Count == 0;
MS\Internal\Annotations\ObservableDictionary.cs (2)
75int count = _nameValues.Count; 222return _nameValues.Count;
MS\Internal\Data\AccessorTable.cs (3)
106int originalCount = _table.Count; 122Console.WriteLine($"After generation {_generation}, removed {originalCount - _table.Count} of {originalCount} entries from AccessorTable, new count is {_table.Count}");
MS\Internal\Data\CommitManager.cs (6)
20get { return _bindings.Count == 0 && _bindingGroups.Count == 0; } 98int count = _bindings.Count; 108foundDirt = foundDirt || (_bindings.Count < count); 110count = _bindingGroups.Count; 120foundDirt = foundDirt || (_bindingGroups.Count < count);
System\Windows\Markup\Localizer\BamlLocalizationDictionary.cs (1)
286get => _dictionary.Count;
System\Windows\Markup\ParserContext.cs (1)
891return cache.Count == 0 ? null : cache;
System\Windows\SystemResources.cs (4)
1024_hwndNotify.Count == 0 || 1132if (_hwndNotify != null && _hwndNotify.Count != 0) 1285&& _hwndNotify.Count != 0) 1645if (_hwndNotify != null && _hwndNotify.Count != 0)
Roslyn.Diagnostics.Analyzers (29)
src\b310f676f7308b7f\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
123other._reachingWrites.Count != _reachingWrites.Count) 173private bool IsEmpty => _reachingWrites.Count == 0;
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
448if (SymbolsWriteBuilder.Count == 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
704if (dictionary.Count == 0) 870var capacity = map.Count > 3 ? map.Count : 0;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
645var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
132if (namesBuilder.Count == 0 && symbolsBuilder.Count == 0 && wildcardNamesBuilder.Count == 0)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
28if (Count == 0) 61Debug.Assert(instance.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
409var spans = new List<TextSpan>(nodesToReplace.Count + tokensToReplace.Count + triviaToReplace.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
245if (dictionary.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
230if (first == null || last == null || importToSyntax.Count == 0)
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
650if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
rzc (2)
ConcurrentLruCache.cs (2)
61return _cache.Count; 182if (_cache.Count == _capacity)
SelectTests (7)
Program.cs (3)
824.OrderByDescending(g => g.Value.Count) 830if (orderedGroups.Count > 0 && tests.Count >= 10 && orderedGroups[0].Value.Count >= 5) 834$"⚠️ {top.Value.Count} of the {tests.Count} selected test projects come from a single change — {CauseGroupDescriptor(top.Key)}.");
TestSelector.cs (4)
393var beforeTests = testCauses.Count; 394var beforeJobs = jobCauses.Count; 410changed = testCauses.Count != beforeTests || jobCauses.Count != beforeJobs;
System.Collections.Immutable (13)
System\Collections\Frozen\FrozenDictionary.cs (5)
132if (newDictionary is null || (newDictionary.Count != 0 && !newDictionary.Comparer.Equals(comparer))) 145if (newDictionary.Count == 0) 161Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller"); 177if (source.Count <= Constants.MaxItemsInSmallValueTypeFrozenCollection) 285if (source.Count <= Constants.MaxItemsInSmallFrozenCollection)
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (2)
24Debug.Assert(source.Count != 0); 26KeyValuePair<int, TValue>[] entries = new KeyValuePair<int, TValue>[source.Count];
System\Collections\Frozen\Integer\DenseIntegralFrozenDictionary.cs (1)
48int count = source.Count;
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (2)
20Debug.Assert(source.Count != 0); 22KeyValuePair<TKey, TValue>[] entries = new KeyValuePair<TKey, TValue>[source.Count];
System\Collections\Frozen\SmallFrozenDictionary.cs (1)
26Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (1)
30Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenDictionary.cs (1)
23Debug.Assert(source.Count != 0);
System.ComponentModel.Composition (2)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
247if (dictionary.Count == 0)
System\ComponentModel\Composition\Hosting\ImportEngine.PartManager.cs (1)
162if (_importedDisposableExports.Count == 0)
System.ComponentModel.TypeConverter (3)
System\ComponentModel\CultureInfoConverter.cs (1)
551Debug.Assert(result.Count == Count);
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (2)
459eventArray = new EventDescriptor[eventList.Count]; 494propertyArray = new PropertyDescriptor[propertyList.Count];
System.Composition.TypedParts (4)
System\Composition\Hosting\SinglePartExportDescriptorProvider.cs (1)
32subsetOfConstraints.Count == 0 ? null : subsetOfConstraints);
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (1)
71if (propertyDependencies.Count == 0)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (1)
219return partMetadata.Count == 0 ? s_noMetadata : partMetadata;
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (1)
90if (subsettedConstraints.Count != 0)
System.Console (1)
System\TerminalFormatStrings.cs (1)
161if (KeyFormatToConsoleKey.Count > 0)
System.Data.Common (7)
System\Data\Common\DbConnectionStringBuilder.cs (3)
199get { return CurrentValues.Count; } 319if ((GetType() != connectionStringBuilder.GetType()) || (CurrentValues.Count != connectionStringBuilder.CurrentValues.Count))
System\Data\Common\ObjectStorage.cs (1)
6111 + cache.Count, TempAssemblyComparer.s_default);
System\Data\DataView.cs (3)
275Debug.Assert(_rowViewCache.Count == CountFromIndex, "DataView.Count mismatch"); 276return _rowViewCache.Count; 1474Debug.Assert(rvc.Count == CountFromIndex, "didn't add expected count");
System.Data.Odbc (2)
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (2)
221Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup> newConnectionPoolGroups = new Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup>(1 + connectionPoolGroups.Count); 303Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup> newConnectionPoolGroups = new Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup>(connectionPoolGroups.Count);
System.Data.OleDb (4)
OleDbConnectionStringBuilder.cs (2)
213if (0 < dynamic.Count) 215knownKeywords = new string[s_validKeywords.Length + dynamic.Count];
System\Data\ProviderBase\DbConnectionFactory.cs (2)
383Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup> newConnectionPoolGroups = new Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup>(1 + connectionPoolGroups.Count); 489Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup> newConnectionPoolGroups = new Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup>(connectionPoolGroups.Count);
System.Diagnostics.EventLog (1)
System\Diagnostics\Reader\ProviderMetadataCachedInformation.cs (1)
75return _cache.Count == _maximumCacheSize;
System.Diagnostics.PerformanceCounter (4)
System\Diagnostics\PerformanceData\CounterSet.cs (3)
199if (_idToCounter.Count == 0) 209+ (uint)_idToCounter.Count * (uint)sizeof(Interop.PerfCounter.PerfCounterInfoStruct)); 226CounterSetInfo->NumCounters = (uint)_idToCounter.Count;
System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs (1)
125_dataBlock = (byte*)Marshal.AllocHGlobal(_instance._counterSet._idToCounter.Count * sizeof(long));
System.Diagnostics.Process (1)
System\Collections\Specialized\DictionaryWrapper.cs (1)
41public int Count => _contents.Count;
System.Formats.Nrbf (7)
System\Formats\Nrbf\ClassWithMembersAndTypesRecord.cs (1)
27MemberTypeInfo memberTypeInfo = MemberTypeInfo.Decode(reader, classInfo.MemberNames.Count, options, recordMap);
System\Formats\Nrbf\RecordMap.cs (1)
20public int Count => _map.Count;
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (5)
28MemberTypeInfo memberTypeInfo = MemberTypeInfo.Decode(reader, classInfo.MemberNames.Count, options, recordMap); 43if (!classInfo.TypeName.IsSimple || classInfo.MemberNames.Count == 0 || memberTypeInfo.Infos[0].BinaryType != BinaryType.Primitive) 47else if (classInfo.MemberNames.Count == 1) 75else if (classInfo.MemberNames.Count == 2 && typeName.FullName == "System.DateTime" 81else if (classInfo.MemberNames.Count == 4 && typeName.FullName == "System.Decimal"
System.Formats.Tar (4)
System\Formats\Tar\TarHeader.Read.cs (1)
157if (_ea == null || _ea.Count == 0)
System\Formats\Tar\TarHeader.Write.cs (3)
464Debug.Assert(_dataStream is null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); 472Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 832if (extendedAttributes.Count > 0)
System.IO.Packaging (4)
System\IO\Packaging\ContentType.cs (2)
186if (_parameterDictionary.Count > 0) 222if (_parameterDictionary != null && _parameterDictionary.Count > 0)
System\IO\Packaging\OrderedDictionary.cs (1)
69public int Count => _dictionary.Count;
System\IO\Packaging\Package.cs (1)
1208_partList = new SortedList<PackUriHelper.ValidatedPartUri, PackagePart>(partDictionary.Count);
System.Linq.Expressions (5)
System\Linq\Expressions\DebugViewWriter.cs (1)
90id = ids.Count + 1;
System\Linq\Expressions\ExpressionStringBuilder.cs (1)
43id = _ids.Count;
System\Linq\Expressions\Interpreter\Interpreter.cs (1)
42internal int ClosureSize => ClosureVariables?.Count ?? 0;
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
2802_instructions.Emit(new QuoteInstruction(unary.Operand, mapping.Count > 0 ? mapping : null));
System\Linq\Expressions\Interpreter\LocalVariables.cs (1)
161LocalVariable result = new LocalVariable(_closureVariables.Count, true);
System.Linq.Parallel (1)
System\Linq\Parallel\Utils\Lookup.cs (1)
53int count = _dict.Count;
System.Net.Http (16)
src\runtime\src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (3)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 27return _forward.Count;
src\runtime\src\libraries\Common\src\System\Net\CredentialCacheKey.cs (1)
118if (cache.Count == 0)
System\Net\Http\Headers\HttpHeaders.cs (2)
1470var entries = new HeaderEntry[dictionary.Count]; 1579Debug.Assert(dictionary.Count == _count - 1);
System\Net\Http\HttpRequestOptions.cs (3)
35int ICollection<KeyValuePair<string, object?>>.Count => Options.Count; 50int IReadOnlyCollection<KeyValuePair<string, object?>>.Count => Options.Count; 87private string DebuggerToString() => $"Count = {Options.Count}";
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
841if (added && altSvcBlocklist.Count >= MaxAltSvcIgnoreListSize && _altSvcEnabled)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (3)
339Debug.Assert(_streamsInUse >= _httpStreams.Count); 1673if (_httpStreams.Count == 0) 2199if (_httpStreams.Count == 0)
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (3)
136if (_activeRequests.Count != 0) 293if (_activeRequests.Count == 0) 464if (_activeRequests.Count == 0)
System.Net.HttpListener (2)
System\Net\Managed\HttpEndPointListener.cs (1)
292if (_prefixes.Count > 0)
System\Net\Managed\HttpEndPointManager.cs (1)
176if (p.Count == 0)
System.Net.Mail (4)
System\Net\Mime\MediaTypeMap.cs (4)
734Debug.Assert(ExtensionToMediaTypeCount == s_extensionToMediaType.Dictionary.Count, 735$"Expected {ExtensionToMediaTypeCount} entries in {nameof(s_extensionToMediaType)}, but found {s_extensionToMediaType.Dictionary.Count}."); 745Debug.Assert(MediaTypeToExtensionCount == s_mediaTypeToExtension.Dictionary.Count, 746$"Expected {MediaTypeToExtensionCount} entries in {nameof(s_mediaTypeToExtension)}, but found {s_mediaTypeToExtension.Dictionary.Count}.");
System.Net.NetworkInformation (10)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (10)
73if (s_addressChangedSubscribers.Count == 0 && s_availabilityChangedSubscribers.Count == 0) 81if (s_addressChangedSubscribers.Count == 0 && s_availabilityChangedSubscribers.Count == 0) 125if (s_addressChangedSubscribers.Count == 0 && s_availabilityChangedSubscribers.Count == 0) 133if (s_availabilityChangedSubscribers.Count == 0) 142if (s_addressChangedSubscribers.Count == 0) 270if (s_addressChangedSubscribers.Count > 0) 305if (s_availabilityChangedSubscribers.Count > 0)
System.Net.Primitives (1)
src\runtime\src\libraries\Common\src\System\Net\CredentialCacheKey.cs (1)
118if (cache.Count == 0)
System.Private.CoreLib (30)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (14)
121if (source.Count == 0) 131Debug.Assert(_entries.Length >= source.Count); 354if (array.Length - index < Count) 373Count == 0 ? GenericEmptyEnumerator<KeyValuePair<TKey, TValue>>.Instance : 391var array = new KeyValuePair<TKey, TValue>[Count]; 1593if (array.Length - index < Count) 1682public void TrimExcess() => TrimExcess(Count); 1694if (capacity < Count) 2022if (array.Length - index < _dictionary.Count) 2035public int Count => _dictionary.Count; 2082if (array.Length - index < _dictionary.Count) 2217if (array.Length - index < _dictionary.Count) 2230public int Count => _dictionary.Count; 2276if (array.Length - index < _dictionary.Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\DiagnosticCounter.cs (1)
127Debug.Assert(_metadata.Count > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
74if (m_subscriptions.Count <= 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
2915Dictionary<int, bool> eventEnabled = new Dictionary<int, bool>(m_eventData.Count); 3589enabledDict = new Dictionary<int, bool>(m_eventData.Count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ManifestBuilder.cs (1)
316if (channelTab.Count == MaxCountChannels)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (2)
675Debug.Assert(s_lookupTable.Count == 253, $"There should be 253 HTML entities, but {nameof(s_lookupTable)} has {s_lookupTable.Count} of them.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceSet.cs (1)
217caseTable = new Dictionary<string, object?>(copyOfTable.Count, StringComparer.OrdinalIgnoreCase);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
286alcSnapshot = new WeakReference<AssemblyLoadContext>[allContexts.Count];
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (2)
139Debug.Assert(children.Count > 0); 149int dictionarySize = DictionaryMemoryFootprintBytesEstimate(children.Count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (1)
160var result = new EncodingInfo[encodingInfoList.Count];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (2)
486int count = Count; 535Debug.Assert(map.Count == count - 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (1)
640_freeIds.EnsureCapacity(_usedIdToTracksAllValuesMap.Count + 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (1)
788TimeZoneInfo[] array = new TimeZoneInfo[filteredTimeZones.Count];
System.Private.CoreLib.Generators (1)
NativeRuntimeEventSourceGenerator.cs (1)
114if (inclusionList == null || inclusionList.Count == 0)
System.Private.DataContractSerialization (7)
System\Runtime\Serialization\DataContractSet.cs (1)
204if (knownDataContracts?.Count > 0)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (1)
267if (dataContract.KnownDataContracts?.Count > 0)
System\Runtime\Serialization\XmlObjectSerializerContext.cs (1)
211if (knownDataContracts?.Count > 0)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (2)
145if (dataContract.KnownDataContracts?.Count > 0) 204if (knownDataContracts?.Count > 0)
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
129if (dataContract.KnownDataContracts?.Count > 0) 234if (dataContract.KnownDataContracts?.Count > 0)
System.Private.Windows.Core (1)
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (1)
100Debug.Assert(s_knownTypes.Count == 60);
System.Private.Xml (26)
System\Xml\Core\XmlWellFormedWriter.cs (3)
2120Debug.Assert(_attrHashTable.Count == 0); 2147int count = _attrHashTable.Count; 2149if (count != _attrHashTable.Count)
System\Xml\Schema\ContentValidator.cs (4)
1494int newState = stateTable.Count - 1; 2127int i = _elements.Count; 2149Debug.Assert(_elements.Count > 0); 2150context.AllElementsSet = new BitSet(_elements.Count);
System\Xml\Schema\XmlSchemaObjectTable.cs (5)
94Debug.Assert(_table.Count == _entries.Count); 95return _table.Count; 121return new NamesCollection(_entries, _table.Count); 129return new ValuesCollection(_entries, _table.Count); 135return new XSODictionaryEnumerator(_entries, _table.Count, EnumeratorType.DictionaryEntry);
System\Xml\Serialization\CodeGenerator.cs (2)
100ArgBuilder arg = new ArgBuilder(argNames[i], _argList.Count, argTypes[i]); 155localTmp = DeclareLocal(type, $"_tmp{_tmpLocals.Count}");
System\Xml\Serialization\NameTable.cs (1)
100Array a = Array.CreateInstance(type, _table.Count);
System\Xml\Serialization\XmlSerializer.cs (2)
729if (pendingKeys.Count > 0) 731XmlMapping[] pendingMappings = new XmlMapping[pendingKeys.Count];
System\Xml\Serialization\XmlSerializerNamespaces.cs (6)
85if (_namespaces == null || _namespaces.Count == 0) 88XmlQualifiedName[] array = new XmlQualifiedName[_namespaces.Count]; 98get { return (_namespaces == null) ? 0 : _namespaces.Count; } 109if (_namespaces == null || _namespaces.Count == 0) 120if (_namespaces == null || _namespaces.Count == 0 || string.IsNullOrEmpty(ns)) 138if (_namespaces == null || _namespaces.Count == 0 || string.IsNullOrEmpty(prefix))
System\Xml\Xsl\Xslt\Compiler.cs (1)
99_moduleOrder.TryAdd(baseUri, _moduleOrder.Count);
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
2143Debug.Assert(sheet.TemplateMatches.Count == 0);
System\Xml\Xsl\Xslt\Scripts.cs (1)
66public int Count => _backingDictionary.Count;
System.Reflection.Emit (2)
System\Reflection\Emit\ModuleBuilderImpl.cs (2)
416if (il.DocumentToSequencePoints.Count == 0) 424if (il.DocumentToSequencePoints.Count > 1)
System.Reflection.Metadata (2)
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
104public int Count => _dictionary.Count;
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (1)
454handle = StringHandle.FromWriterVirtualIndex(_strings.Count + 1); // idx 0 is reserved for empty string
System.Resources.Extensions (1)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
289numResources += _preserializedData.Count;
System.Resources.Writer (1)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
289numResources += _preserializedData.Count;
System.Runtime.Caching (1)
System\Runtime\Caching\MemoryCacheEntry.cs (1)
248if (_fields != null && _fields._dependents != null && _fields._dependents.Count > 0)
System.Runtime.Serialization.Schema (2)
System\Runtime\Serialization\Schema\CodeExporter.cs (2)
982if (knownContracts == null || knownContracts.Count == 0) 1002if (knownContractDictionary == null || knownContractDictionary.Count == 0)
System.Security.Claims (2)
System\Security\Claims\Claim.cs (2)
455if (_properties != null && _properties.Count > 0) 493writer.Write(_properties!.Count);
System.Security.Cryptography (9)
System\Security\Cryptography\CryptoConfig.cs (2)
102Debug.Assert(ht.Count <= capacity); // if more entries are added in the future, increase initial capacity. 279Debug.Assert(ht.Count <= capacity); // // if more entries are added in the future, increase initial capacity.
System\Security\Cryptography\OidLookup.cs (6)
109Debug.Assert(s_friendlyNameToOid.Count == FriendlyNameToOidCount, 110$"Expected {nameof(s_friendlyNameToOid)}.{nameof(s_friendlyNameToOid.Count)} == {FriendlyNameToOidCount}, got {s_friendlyNameToOid.Count}"); 111Debug.Assert(s_oidToFriendlyName.Count == OidToFriendlyNameCount, 112$"Expected {nameof(s_oidToFriendlyName)}.{nameof(s_oidToFriendlyName.Count)} == {OidToFriendlyNameCount}, got {s_oidToFriendlyName.Count}");
System\Security\Cryptography\X509Certificates\FindPal.cs (1)
32Debug.Assert(s_keyUsages.Count == NamedKeyUsageFlagsCount);
System.Security.Cryptography.Cose (4)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (4)
55public int Count => _headerParameters.Count; 337if (map._headerParameters.Count == 0 && isProtected && !shouldSlipAlgHeader) 342int mapLength = map._headerParameters.Count; 388int mapLength = map._headerParameters.Count;
System.ServiceModel.Primitives (16)
Internals\System\Runtime\GeneratedXmlSerializers.cs (1)
23return s_generatedSerializers.Count != 0;
Internals\System\Runtime\MruCache.cs (2)
74return _items.Count; 90if (_items.Count == _highWatermark)
Internals\System\Xml\XmlMtomReader.cs (1)
456if (_mimeParts.Count > maxMimeParts)
System\ServiceModel\Channels\AddressHeaderCollection.cs (2)
145if (myHeaders.Count != otherHeaders.Count)
System\ServiceModel\Channels\DeliveryStrategy.cs (1)
69return Channel.InternalPendingItems + items.Count;
System\ServiceModel\Channels\ReliableMessagingHelpers.cs (3)
500if ((tempFaultList == null) || (tempFaultList.Count == 0)) 564if ((_faultList == null) || (_faultList.Count == 0)) 596if ((_closeHandle == null) || (_faultList.Count > 0))
System\ServiceModel\Channels\SecurityBindingElement.cs (2)
618if (_operationSupportingTokenParameters.Count == 0) 631if (_optionalOperationSupportingTokenParameters.Count == 0)
System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
150messageInfo.AnyHeaders = messageInfo.UnknownHeaderDescription != null || messageInfo.HeaderDescriptionTable.Count > 0;
System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs (1)
65object[] headerValues = new object[headerDescriptionTable.Count];
System\ServiceModel\Security\SecurityProtocol.cs (2)
102if (_mergedSupportingTokenProvidersMap != null && _mergedSupportingTokenProvidersMap.Count > 0) 252if (ScopedSupportingTokenProviderSpecification.Count == 0)
System.ServiceProcess.ServiceController (1)
System\ServiceProcess\ServiceController.cs (1)
364_servicesDependedOn = new ServiceController[dependencyHash.Count];
System.Speech (10)
Internal\SrgsCompiler\BackEnd.cs (3)
337if (_nameOffsetRules.Count > 0) 517System.Diagnostics.Debug.Assert(tags.Count == 0); 623System.Diagnostics.Debug.Assert(tags.Count == 0);
Internal\StringBlob.cs (1)
60System.Diagnostics.Debug.Assert(_strings.Count == _refStrings.Count);
Recognition\RecognizerBase.cs (3)
2728if (_bookmarkTable.Count > 0) 2730int[] keysArray = new int[_bookmarkTable.Count]; 2741if (_bookmarkTable.Count == 0)
Result\SemanticValue.cs (3)
106get { return _dictionary.Count; } 224return _dictionary.Count; 248SemanticValue[] keys = new SemanticValue[_dictionary.Count];
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (1)
96Debug.Assert(converters.Count <= NumberOfSimpleConverters);
System.Text.Json.SourceGeneration (4)
JsonSourceGenerator.Emitter.cs (2)
102Debug.Assert(_typeIndex.Count == 0); 103Debug.Assert(_propertyNames.Count == 0);
JsonSourceGenerator.Parser.cs (2)
101Debug.Assert(_generatedTypes.Count == 0); 172Debug.Assert(_generatedTypes.Count > 0);
System.Text.RegularExpressions (11)
System\Text\RegularExpressions\RegexCharClass.cs (2)
198s_definedCategories.Count == DefinedCategoriesCapacity, 199$"Expected (s_definedCategories.Count): {s_definedCategories.Count}, Actual (DefinedCategoriesCapacity): {DefinedCategoriesCapacity}");
System\Text\RegularExpressions\RegexWriter.cs (2)
115var strings = new string[_stringTable.Count]; 184i = _stringTable.Count - 1;
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (3)
258state.Id = _stateCache.Count; 315nfaStateId = _nfaIdByCoreId.Count; 368(checkThreshold && _builder._nodeCache.Count >= SymbolicRegexThresholds.NfaNodeCountThreshold)) // if # of nodes exceeds the NFA threshold
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (3)
29writer.WriteLine(" <Node Id=\"dfa\" Label=\" \" Group=\"Collapsed\" Category=\"DFA\" DFAInfo=\"{0}\" />", FormatInfo(this, transitions.Count)); 30writer.WriteLine(" <Node Id=\"dfainfo\" Category=\"DFAInfo\" Label=\"{0}\"/>", FormatInfo(this, transitions.Count)); 185sb.Append($"States = {matcher._stateCache.Count}&#13;");
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
67BDD[] catBDDs = new BDD[catMap.Count];
System.Text.RegularExpressions.Generator (4)
RegexGenerator.cs (1)
284if (requiredHelpers.Count != 0)
RegexGenerator.Emitter.cs (1)
1696if (additionalLocalFunctions.Count != 0)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (2)
198s_definedCategories.Count == DefinedCategoriesCapacity, 199$"Expected (s_definedCategories.Count): {s_definedCategories.Count}, Actual (DefinedCategoriesCapacity): {DefinedCategoriesCapacity}");
System.Threading.Tasks.Dataflow (3)
Internal\QueuedMap.cs (1)
228internal int Count { get { return _mapKeyToIndex.Count; } }
Internal\ReorderingBuffer.cs (1)
176private int CountForDebugging { get { return _reorderingBuffer.Count; } }
Internal\TargetRegistry.cs (1)
277private int Count { get { return _targetInformation.Count; } }
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (1)
243int elementCount = ribbon.TabDisplayIndexToIndexMap.Count;
System.Windows.Forms (8)
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (1)
430int propertyCount = propertyInfo.Count;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
1906if (_viewTabProperties?.Count > 0)
System\Windows\Forms\Controls\WebBrowser\HtmlShim.cs (1)
63EventHandler[] events = new EventHandler[_attachedEventList.Count];
System\Windows\Forms\Controls\WebBrowser\HtmlShimManager.cs (2)
173HtmlDocument.HtmlDocumentShim[] shims = new HtmlDocument.HtmlDocumentShim[_htmlDocumentShims.Count]; 191HtmlElement.HtmlElementShim[] shims = new HtmlElement.HtmlElementShim[_htmlElementShims.Count];
System\Windows\Forms\DataBinding\BindingContext.cs (1)
35return _listManagers.Count;
System\Windows\Forms\NativeWindow.cs (1)
607if (s_windowHandles.Count > 0)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.TableLayoutSettingsStub.cs (1)
88List<ControlInformation> listOfControlInfo = new(_controlsInfo.Count);
System.Windows.Forms.Design (13)
System\ComponentModel\Design\DesignerActionPanel.cs (2)
836if (categoryIndex < category.Count) 844if (categoriesIndex < categories.Count)
System\ComponentModel\Design\DesignerActionService.cs (1)
94if (_designerActionLists.Count == 0)
System\ComponentModel\Design\MenuCommandService.cs (1)
291DesignerVerb[] result = new DesignerVerb[buildVerbs.Count];
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (3)
136Dictionary<string, CodeDomComponentSerializationState> state = new(_objects.Count); 172Dictionary<Assembly, AssemblyName> assemblies = new(_objects.Count); 183AssemblyNames = new AssemblyName[assemblies.Count];
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (1)
176OrderedCodeStatementCollection[] statementArray = new OrderedCodeStatementCollection[_statementTable.Count];
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (1)
472List<IComponent> list = new(_lastSelection.Count);
System\Drawing\Design\ToolboxItem.cs (1)
573AssemblyName[] parentAssemblies = new AssemblyName[parents.Count];
System\Resources\Tools\StronglyTypedResourceBuilder.cs (1)
866SortedList<string, ResourceData> cleanedResourceList = new(resourceList.Count, StringComparer.InvariantCultureIgnoreCase);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1283propArray = new PropertyDescriptor[hash.Count + 1];
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
122if (t_customToolStripItemCount > 0 && (t_customToolStripItemCount * 2 < t_cachedToolboxItems.Count))
System.Windows.Forms.Primitives (4)
System\Windows\Forms\Animation\HighPrecisionTimer.cs (4)
148if (s_registrations.Count == 0) 261if (restart && s_registrations.Count > 0) 638return s_registrations.Count; 682Registration[] registrations = new Registration[s_registrations.Count];
System.Windows.Input.Manipulations (9)
System\Windows\Input\Manipulations\ManipulationSequence.cs (9)
301removedManipulatorIds = ((this.manipulatorStates != null) && (this.manipulatorStates.Count > 0)) 440if (this.manipulatorStates != null && this.manipulatorStates.Count > 0) 682if (this.manipulatorStates.Count > 1 && // rotate and scale require more than one manipulator 688else if ((this.manipulatorStates.Count == 1) // try single-manipulator rotation 801if ((this.manipulatorStates.Count < 2) 1010Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1020PointF result = new PointF(x / this.manipulatorStates.Count, y / this.manipulatorStates.Count); 1031Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0);
System.Xaml (10)
System\Xaml\AttachablePropertyServices.cs (1)
147return instanceProperties.Count;
System\Xaml\Context\NameFixupGraph.cs (1)
394while (_dependenciesByParentObject.Count > 0)
System\Xaml\Context\XamlParserContext.cs (1)
157if (_prescopeNamespaces.Count > 0)
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
458_subsumeCount = new Dictionary<string, int>(nsInfo.OldToNewNs.Count);
System\Xaml\Schema\TypeReflector.cs (4)
531if (result.Count == 0) 536List<PropertyInfo> filteredResult = new List<PropertyInfo>(result.Count); 585if (result.Count == 0) 590List<EventInfo> filteredResult = new List<EventInfo>(result.Count);
System\Xaml\XamlSchemaContext.cs (1)
610return map.Count > 0 ? map : null;
System\Xaml\XamlXmlWriter.cs (1)
758return (namespaceMap.Count == 0);
vbc (1)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
472if (environmentVariables.Count == 0)
VBCSCompiler (1)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
472if (environmentVariables.Count == 0)
vstest.console (3)
Internal\ConsoleLogger.cs (1)
211if (parameters.Count == 0)
Processors\EnableBlameArgumentProcessor.cs (1)
345if (parameters != null && parameters.Count > 0)
Processors\Utilities\LoggerUtilities.cs (1)
57if (loggerParameters != null && loggerParameters.Count > 0)
vstest.console.arm64 (3)
src\vstest\src\vstest.console\Internal\ConsoleLogger.cs (1)
211if (parameters.Count == 0)
src\vstest\src\vstest.console\Processors\EnableBlameArgumentProcessor.cs (1)
345if (parameters != null && parameters.Count > 0)
src\vstest\src\vstest.console\Processors\Utilities\LoggerUtilities.cs (1)
57if (loggerParameters != null && loggerParameters.Count > 0)