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
8362 references to Count
AnalyzerRunner (1)
Program.cs (1)
178Console.WriteLine("Number of projects:\t\t" + projects.Count);
aspire (15)
Commands\ExecCommand.cs (2)
293while (i < allTokens.Count) 311if (!isFlag && i + 1 < allTokens.Count)
Configuration\ConfigurationService.cs (1)
208for (int i = objectPath.Count - 1; i >= 0; i--)
Projects\ProjectLocator.cs (4)
148logger.LogDebug("Found {ProjectFileCount} project files.", appHostProjects.Count); 152if (appHostProjects.Count == 0) 156else if (appHostProjects.Count == 1) 160else if (appHostProjects.Count > 1)
src\Shared\CircularBuffer.cs (8)
48public int Count => _buffer.Count; 108if (shiftLength > 0 || internalIndex == _buffer.Count - 1) 114else if (internalIndex < _end && _end < _buffer.Count - 1) 135if (internalIndex > _buffer.Count) 137internalIndex = internalIndex % _buffer.Count; 144if (_end != _buffer.Count) 209if (_end != _buffer.Count) 266return (_start + index) % _buffer.Count;
Aspire.Azure.Messaging.EventHubs (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Azure.Messaging.ServiceBus (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Azure.Messaging.WebPubSub (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Cli.Tests (7)
Commands\PublishCommandPromptingIntegrationTests.cs (2)
304Assert.Equal(3, promptBackchannel.ReceivedPrompts.Count); 322Assert.Equal(3, promptBackchannel.CompletedPrompts.Count);
E2E\ExecTests.cs (5)
39Assert.True(logs.Count > 0, "No logs were produced during the exec operation."); 60Assert.True(logs.Count > 0, "No logs were produced during the exec operation."); 88Assert.True(logs.Count > 0, "No logs were produced during the exec operation."); 108Assert.True(logs.Count > 0, "No logs were produced during the exec operation."); 136Assert.True(logs.Count > 0, "No logs were produced during the exec operation.");
Aspire.Components.Common.TestUtilities (2)
ActivityNotifier.cs (1)
25if (activityList.Count == count)
ConformanceTests.cs (1)
143Assert.Equal(2, registeredNames.Count);
Aspire.Confluent.Kafka.Tests (16)
Aspire8MetricsTests.cs (16)
64collectorNetworkTx.WaitForMeasurementsAsync(statistics.Count), 65collectorNetworkTransmitted.WaitForMeasurementsAsync(statistics.Count), 66collectorNetworkRx.WaitForMeasurementsAsync(statistics.Count), 67collectorNetworkReceived.WaitForMeasurementsAsync(statistics.Count), 68collectorMessageTx.WaitForMeasurementsAsync(statistics.Count), 69collectorMessageTransmitted.WaitForMeasurementsAsync(statistics.Count), 70collectorMessageRx.WaitForMeasurementsAsync(statistics.Count), 71collectorMessageReceived.WaitForMeasurementsAsync(statistics.Count) 179collectorNetworkTx.WaitForMeasurementsAsync(statistics.Count), 180collectorNetworkTransmitted.WaitForMeasurementsAsync(statistics.Count), 181collectorNetworkRx.WaitForMeasurementsAsync(statistics.Count), 182collectorNetworkReceived.WaitForMeasurementsAsync(statistics.Count), 183collectorMessageTx.WaitForMeasurementsAsync(statistics.Count), 184collectorMessageTransmitted.WaitForMeasurementsAsync(statistics.Count), 185collectorMessageRx.WaitForMeasurementsAsync(statistics.Count), 186collectorMessageReceived.WaitForMeasurementsAsync(statistics.Count)
Aspire.Dashboard (90)
Components\Controls\Chart\ChartBase.cs (2)
175for (var i = 0; i < currentTrace.Values.Count; i++) 420for (var i = 0; i < xValues.Count; i++)
Components\Controls\Chart\ChartContainer.razor.cs (2)
102if (_instrument.Dimensions.Count > _renderedDimensionsCount) 105_renderedDimensionsCount = _instrument.Dimensions.Count;
Components\Controls\Chart\MetricTable.razor.cs (7)
75for (var i = 0; i < metricView.Count; i++) 120for (var i = 0; i < xValues.Count; i++) 157for (var traceIndex = 0; traceIndex < traces.Count; traceIndex++) 213Debug.Assert(exemplars.Count == newMetrics.Sum(m => m.Value.Exemplars.Count), $"Expected {exemplars.Count} exemplars but got {newMetrics.Sum(m => m.Value.Exemplars.Count)} exemplars.");
Components\Controls\Chart\PlotlyChart.razor.cs (4)
118for (var i = 0; i <= xValues.Count; i++) 121var end = i < xValues.Count ? xValues[i] : (DateTimeOffset?)null; 127if (groupExemplars.Count > MaxExemplarsPerTick) 129var step = (double)groupExemplars.Count / MaxExemplarsPerTick;
Components\Controls\ResourceDetails.razor.cs (2)
130_isUrlsExpanded = GetUrls().Count > 0; 255if (valueMaskedValues.Count == 1)
Components\Controls\StructuredLogDetails.razor.cs (2)
115var insertStart = destination.Count; 116for (var i = source.Count - 1; i >= 0; i--)
Components\Dialogs\FilterDialog.razor.cs (1)
57if (customFields.Count > 0)
Components\Dialogs\InteractionsInputDialog.razor.cs (2)
69if (_inputDialogInputViewModels.Count > 0 && _elementRefs.TryGetValue(_inputDialogInputViewModels[0], out var firstInputElement)) 91for (var i = 0; i < Content.Inputs.Count; i++)
Components\Pages\ConsoleLogs.razor.cs (1)
781return actualResources.Count == 1 ? actualResources[0] : null;
Components\Pages\Metrics.razor.cs (4)
171return apps.Count == 1 ? apps[0] : null; 325if (PageViewModel.Instruments is null || instruments.Count != PageViewModel.Instruments.Count) 349new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsInstrumentsCount, new AspireTelemetryProperty((PageViewModel.Instruments?.Count ?? -1).ToString(CultureInfo.InvariantCulture), AspireTelemetryPropertyType.Metric)),
Components\Pages\Resources.razor.cs (6)
423return ValueTask.FromResult(GridItemsProviderResult.From(query, orderedResources.Count)); 687if (displayedUrls.Count == 0) 692if (displayedUrls.Count == 1) 700if (displayedUrls.Count > maxShownUrls) 702tooltipBuilder.Append(CultureInfo.CurrentCulture, $" + {displayedUrls.Count - maxShownUrls}"); 852return escapedFilters.Count == 0 ? null : string.Join(" ", escapedFilters);
Components\Pages\StructuredLogs.razor.cs (1)
459if (filters.Count > 0)
Components\Pages\Traces.razor.cs (1)
271if (filters.Count > 0)
Configuration\ValidateDashboardOptions.cs (2)
79for (var i = 0; i < options.Otlp.AllowedCertificates.Count; i++) 152return errorMessages.Count > 0
ConsoleLogs\AnsiParser.cs (4)
497if (classes.Count == 0 && styles.Count == 0) 504if (classes.Count > 0) 509if (styles.Count > 0)
DashboardWebApplication.cs (5)
61if (_frontendEndPointAccessor.Count == 0) 74if (_frontendEndPointAccessor.Count == 0) 78else if (_frontendEndPointAccessor.Count > 1) 304if (_frontendEndPointAccessor.Count > 0) 685if (options.Otlp.AllowedCertificates is { Count: > 0 } allowList)
Model\ConsoleLogsManager.cs (1)
91if (_subscriptions.Count == 0)
Model\KnownPropertyLookup.cs (1)
78for (var i = 0; i < knownProperties.Count; i++)
Model\Otlp\ApplicationsSelectHelpers.cs (5)
21if (instanceIdMatches.Count == 1) 25else if (instanceIdMatches.Count == 0) 30if (replicaSetMatches.Count == 1) 34else if (replicaSetMatches.Count == 0) 74if (replicas.Count == 1)
Model\ResourceMenuItems.cs (2)
112if (menuCommands.Count > 0) 137if (urls.Count > 0)
Model\ResourceOutgoingPeerResolver.cs (1)
191if (_subscriptions.Count == 0 || _watchContainersTokenSource.IsCancellationRequested)
Model\ResourceViewModel.cs (1)
148if (resourcesWithDisplayName.Count == 1)
Model\ThemeManager.cs (1)
141if (_subscriptions.Count == 0)
Otlp\Model\ColorGenerator.cs (1)
74_currentIndex = ++_currentIndex % _colors.Count;
Otlp\Model\DurationFormatter.cs (3)
60for (var i = 0; i < s_unitSteps.Count; i++) 63var result = i < s_unitSteps.Count - 1 && step.Ticks > ticks; 67return (step, i < s_unitSteps.Count - 1 ? s_unitSteps[i + 1] : step);
Otlp\Model\MetricValues\MetricValueBase.cs (1)
14public bool HasExemplars => _exemplars != null && _exemplars.Count > 0;
Otlp\Model\OtlpHelpers.cs (2)
238if (values.Count < readLimit) 249for (var i = 0; i < values.Count; i++)
Otlp\Storage\TelemetryRepository.cs (17)
408if (applications.Count == 0) 419if (applications?.Count > 0) 450if (applications?.Count > 0) 477if (applications?.Count > 0) 498if (applications.Count == 0) 513if (applications?.Count > 0) 527if (filters.Count > 0) 587for (var i = 0; i < applications.Count; i++) 622if (applications is null || applications.Count == 0) 660if (applications is null || applications.Count == 0) 1155if (currentSpanLinks.Count > 0) 1158sb.AppendLine(CultureInfo.InvariantCulture, $"There are {currentSpanLinks.Count} orphaned span links."); 1219if (events.Count >= context.Options.MaxSpanEventCount) 1230if (applications.Count == 0) 1234else if (applications.Count == 1) 1258if (instruments.Count == 0) 1262else if (instruments.Count == 1)
src\Shared\CircularBuffer.cs (8)
48public int Count => _buffer.Count; 108if (shiftLength > 0 || internalIndex == _buffer.Count - 1) 114else if (internalIndex < _end && _end < _buffer.Count - 1) 135if (internalIndex > _buffer.Count) 137internalIndex = internalIndex % _buffer.Count; 144if (_end != _buffer.Count) 209if (_end != _buffer.Count) 266return (_start + index) % _buffer.Count;
Aspire.Dashboard.Components.Tests (2)
Pages\MetricsTests.cs (2)
221cut.WaitForState(() => cut.Instance.PageViewModel.Instruments?.Count == 1); 266cut.WaitForState(() => cut.Instance.PageViewModel.Instruments?.Count == 3);
Aspire.Dashboard.Tests (4)
Integration\ServerRetryHelper.cs (1)
83logger.LogInformation("Found {count} unavailable endpoints.", unavailableEndpoints.Count);
TelemetryRepositoryTests\MetricsTests.cs (1)
392Assert.Equal(5, instrumentData.Dimensions.Count);
TelemetryRepositoryTests\TraceTests.cs (2)
853Assert.Equal(5, trace.FirstSpan.Events.Count); 957Assert.Equal(MaxTraceCount * 2, repository.SpanLinks.Count);
Aspire.Hosting (40)
ApplicationModel\ReferenceExpression.cs (3)
133var index = _valueProviders.Count; 148var index = _valueProviders.Count; 247var index = _valueProviders.Count;
ApplicationModel\ResourceCollection.cs (1)
20public int Count => _resources.Count;
ApplicationModel\ResourceCommandService.cs (2)
76if (failures.Count == 0) 83var errorMessage = $"{failures.Count} command executions failed.";
ApplicationModel\ResourceLoggerService.cs (2)
84if (scopes.Count == 0) 88else if (scopes.Count == 1)
Dashboard\ResourceServiceOptions.cs (1)
56return errorMessages is { Count: > 0 }
Dcp\DcpExecutor.cs (8)
646if (needAddressAllocated.Count == 0) 676if (needAddressAllocated.Count == 0) 1053if (er.DcpResource.TryGetAnnotationAsObjectList<string>(CustomResource.ResourceProjectArgsAnnotation, out var projectArgs) && projectArgs.Count > 0) 1065if (executableArgs.Count > 0) 1098if (spec.ExecutionType == ExecutionType.Process || (spec.ExecutionType == ExecutionType.IDE && appHostArgs.Count == 0)) 1105if (launchProfileArgs.Count > 0 && appHostArgs.Count > 0) 1291if (cr.ServicesProduced.Count > 0)
Dcp\DcpKubernetesClient.cs (1)
172if (_parameters.Count > 0)
Dcp\ResourceSnapshotBuilder.cs (2)
245if (effectiveSource is null or { Count: 0 }) 250var environment = ImmutableArray.CreateBuilder<EnvironmentVariableSnapshot>(effectiveSource.Count);
Eventing\DistributedApplicationEventing.cs (1)
30var pendingSubscriptionCallbacks = new List<Task>(subscriptions.Count);
Orchestrator\ParameterProcessor.cs (2)
41if (_unresolvedParameters.Count > 0) 178for (var i = resourceInputs.Count - 1; i >= 0; i--)
Publishing\ManifestPublishingContext.cs (3)
550if (args.Count > 0) 570if (bindMounts.Count > 0) 596if (volumes.Count > 0)
Publishing\Publisher.cs (4)
63taskInfo = deployingResources.Count switch 66_ => ($"Found {deployingResources.Count} resources that support deployment. ({string.Join(", ", deployingResources.Select(r => r.GetType().Name))})", CompletionState.Completed) 71taskInfo = publishingResources.Count switch 74_ => ($"Found {publishingResources.Count} resources that support publishing. ({string.Join(", ", publishingResources.Select(r => r.GetType().Name))})", CompletionState.Completed)
src\Shared\CircularBuffer.cs (8)
48public int Count => _buffer.Count; 108if (shiftLength > 0 || internalIndex == _buffer.Count - 1) 114else if (internalIndex < _end && _end < _buffer.Count - 1) 135if (internalIndex > _buffer.Count) 137internalIndex = internalIndex % _buffer.Count; 144if (_end != _buffer.Count) 209if (_end != _buffer.Count) 266return (_start + index) % _buffer.Count;
src\Shared\CommandLineArgsParser.cs (1)
16var args = result.Count > 1 ? result.Skip(1).ToArray() : Array.Empty<string>();
src\Shared\CustomResourceSnapshotExtensions.cs (1)
42for (var i = 0; i < existingProperties.Count; i++)
Aspire.Hosting.Analyzers (1)
Infrastructure\BoundedCacheWithFactory.cs (1)
32for (var i = 0; i < _weakReferencedEntries.Count; i++)
Aspire.Hosting.Azure (6)
AzurePublishingContext.cs (2)
265var (message, state) = computeEnvironments.Count switch 268_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.", CompletionState.Completed)
AzureResourcePreparer.cs (1)
26if (azureResources.Count == 0)
Provisioning\Provisioners\AzureProvisioner.cs (2)
40if (azureResources.Count == 0) 66for (var i = 0; i < childResources.Count; i++)
src\Shared\CustomResourceSnapshotExtensions.cs (1)
42for (var i = 0; i < existingProperties.Count; i++)
Aspire.Hosting.Azure.AppContainers (4)
ContainerAppContext.cs (4)
399if (endpointsByTargetPort.Count > 5) 661if (_httpIngress is null && _additionalPorts.Count == 0) 677else if (_additionalPorts.Count > 0) 779if (Args.Count > 0)
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceWebsiteContext.cs (1)
263if (Args.Count > 0)
Aspire.Hosting.Azure.CosmosDB (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubResource.cs (1)
100if (hub.ConsumerGroups.Count >= 0)
Aspire.Hosting.Azure.Functions (4)
AzureFunctionsProjectResourceExtensions.cs (3)
157if (commandLineArgs is { Count: > 0 } && 160indexOfPort + 1 < commandLineArgs.Count && 166useHttps = commandLineArgs is { Count: > 0 } &&
src\Shared\CommandLineArgsParser.cs (1)
16var args = result.Count > 1 ? result.Skip(1).ToArray() : Array.Empty<string>();
Aspire.Hosting.Azure.Tests (1)
AzureEventHubsExtensionsTests.cs (1)
244Assert.Equal(2, endpoints.Count);
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubExtensions.cs (1)
100for (var i = 0; i < hubResource.EventHandlers.Count; i++)
Aspire.Hosting.Docker (3)
DockerComposePublishingContext.cs (1)
124if (containerImagesToBuild.Count > 0)
DockerComposeServiceResource.cs (2)
194if (args.Count > 0) 258if (Volumes.Count == 0)
Aspire.Hosting.Kubernetes (3)
Extensions\ResourceExtensions.cs (3)
173if (context.Volumes.Count == 0) 238if (context.Volumes.Count == 0) 296if (context.Commands.Count == 0)
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
157if (containerAnnotations.Count == 1
Aspire.Hosting.Testing.Tests (3)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
113return table.Count == 0;
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (2)
22if (logs.Count >= targetLogCount) 39if (logs.Count >= targetLogCount)
Aspire.Hosting.Tests (21)
Dcp\DcpExecutorTests.cs (5)
86Assert.Equal(2, executables.Count); 214Assert.Equal(2, executables.Count); 550Assert.Equal(replicaCount, executables.Count); 789Assert.Equal(3, exes.Count); 834Assert.Equal(3, exes.Count);
InteractionServiceTests.cs (1)
137Assert.Equal(2, interactionService.GetCurrentInteractions().Count);
PublishingTests.cs (2)
139Assert.Equal(2, callOrder.Count); 171Assert.Equal(2, deployingCallbacks.Count);
ResourceLoggerServiceTests.cs (1)
298Assert.Equal(6, sortedLogs.Count);
ResourceNotificationTests.cs (2)
59if (values.Count == 2) 112if (values.Count == 3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
StableConnectionStringBuilderTests.cs (1)
298Assert.Equal(3, keys.Count);
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (2)
22if (logs.Count >= targetLogCount) 39if (logs.Count >= targetLogCount)
Utils\LoggerNotificationExtensions.cs (1)
113return table.Count == 0;
Utils\StringComparersTests.cs (2)
56if (extraComparers.Count + extraComparisons.Count != 0)
WithHttpCommandTests.cs (1)
161Assert.True(commands.Count >= 5);
Aspire.Hosting.Yarp (3)
ConfigurationBuilder\YarpConfigurationBuilder.cs (1)
16var routeId = $"route{_parent.Resource.Routes.Count}";
YarpJsonConfigGeneratorBuilder.cs (2)
52if (_clusterConfigs.Count > 0 || _routeConfigs.Count > 0)
Aspire.Microsoft.Azure.Cosmos (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Playground.Tests (4)
AppHostTests.cs (3)
55for (int i = 0; i < testEndpoints.WaitForTexts.Count; i++) 72if (testEndpoints.WaitForResources?.Count > 0) 88if (endpoints.Count == 0)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
113return table.Count == 0;
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
DistributedCacheConformanceTests.cs (1)
68Assert.Equal(3, activityList.Count);
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
OutputCacheConformanceTests.cs (1)
68Assert.Equal(3, activityList.Count);
BasicWebSite (1)
ContactsRepository.cs (1)
19contact.ContactId = _contacts.Count + 1;
BasketService (1)
BasketService.cs (1)
61_logger.LogInformation("Checking out {Count} item(s) for BuyerId: {BuyerId}.", order.Items.Count, buyerId);
BicepSample.ApiService (3)
Program.cs (3)
42totalEntries = entries.Count, 61totalEntries = entries.Count, 92totalEntries = entries.Count,
BuildActionTelemetryTable (1)
Program.cs (1)
159if (missingDescriptions.Count == 0)
BuildBoss (2)
Program.cs (2)
68(solutionFiles.Count > 0) ? Path.GetDirectoryName(solutionFiles[0]) : AppContext.BaseDirectory); 77if (solutionFiles.Count == 0)
CatalogDb (3)
CatalogDbInitializer.cs (3)
89logger.LogInformation("Seeding {CatalogBrandCount} catalog brands", brands.Count); 99logger.LogInformation("Seeding {CatalogTypeCount} catalog item types", types.Count); 109logger.LogInformation("Seeding {CatalogItemCount} catalog items", items.Count);
CatalogService (1)
CatalogApi.cs (1)
27itemsOnPage.Count < pageSize,
Client.ClientBase.IntegrationTests (4)
ChannelBaseTests.4.0.0.cs (2)
195Assert.True(eventsCalled.Count == 0, 199Assert.True(proxyEventsCalled.Count == 0,
ClientBaseTests.4.0.0.cs (2)
668Assert.True(eventsCalled.Count == 0, 672Assert.True(proxyEventsCalled.Count == 0,
CodeGenerator (8)
HttpUtilities\HttpUtilities.cs (8)
104for (var index = 0; index < methodsInfo.Count; index++) 111if (index < methodsInfo.Count - 1) 128for (var index = 0; index < distinctLengths.Count; index++) 138if (index < distinctLengths.Count - 1) 155for (var index = 0; index < methodsInfo.Count; index++) 163if (index < methodsInfo.Count - 1) 180for (var index = 0; index < methodsInfo.Count; index++) 186if (index < methodsInfo.Count - 1)
ConfigurationSchemaGenerator (9)
ConfigSchemaEmitter.cs (7)
60for (var i = 0; i < categories.Count; i++) 78if (spec.ConfigurationTypes.Count > 0) 80if (spec.ConfigurationTypes.Count != spec.ConfigurationPaths?.Count) 85for (var i = 0; i < spec.ConfigurationPaths.Count; i++) 710var result = new string[exclusionPaths.Count]; 711for (var i = 0; i < exclusionPaths.Count; i++)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (2)
720if (invalidParameters?.Count > 0) 724else if (missingParameters?.Count > 0)
CosmosEndToEnd.ApiService (1)
Program.cs (1)
45totalEntries = entries.Count,
CSharpSyntaxGenerator (52)
AbstractFileWriter.cs (1)
377while ((field.Kinds is null || field.Kinds.Count == 0) && IsOverride(field))
Grammar\GrammarGenerator.cs (10)
30if (type is Node && type.Children.Count > 0) 42if (type.Children.First() is Field firstField && firstField.Kinds.Count > 0) 45if (type.Children.Count >= 2 && type.Children.Last() is Field lastField && lastField.Kinds.Count == firstField.Kinds.Count) 48for (int i = 0; i < originalFirstFieldKinds.Count; i++) 57for (int i = 0; i < originalFirstFieldKinds.Count; i++) 76.Where(r => !rules.TryGetValue(r, out var productions) || productions.Count == 0).ToArray(); 349=> field.Kinds.Count == 0 351: Choice(field.Kinds.Select(k => HandleTokenName(k.Name)), parenthesize: field.Kinds.Count >= 2);
SignatureWriter.cs (5)
52for (int i = 0, n = nodes.Count; i < n; i++) 67for (int i = 0, n = nd.Fields.Count; i < n; i++) 88for (int i = 0, n = nodeFields.Count; i < n; i++) 94for (int i = 0, n = valueFields.Count; i < n; i++) 106if (kinds.Count > 1)
SourceWriter.cs (35)
240if (nodeFields.Count == 0) 244else if (nodeFields.Count == 1) 257for (int i = 0, n = nodeFields.Count; i < n; i++) 300WriteLine($"this.SlotCount = {nodeFields.Count};"); 414node.Kinds.Count > 1 ? "this.Kind" : "", 450if (nodeFields.Count == 0) 522if (nd.Kinds.Count >= 2) 545if (field.Type == "SyntaxToken" && field.Kinds != null && field.Kinds.Count > 0) 553if (field.Kinds.Count == 1 && !IsOptional(field)) 590valueFields.Count + nodeFields.Count <= 3) 654nd.Kinds.Count > 1 ? "SyntaxKind kind" : "", 671nd.Kinds.Count == 1 ? $"SyntaxKind.{nd.Kinds[0].Name}" : "kind", 766if (baseNodeFields.Count > 0) 853for (int i = 0, n = nodeFields.Count; i < n; i++) 1105node.Kinds.Count > 1 ? "this.Kind()" : "", 1300if (node.Fields.Count == 0) 1360&& ((field.Kinds.Count == 1 && field.Kinds[0].Name != "IdentifierToken" && !field.Kinds[0].Name.EndsWith("LiteralToken", StringComparison.Ordinal)) || (field.Kinds.Count > 1 && field.Kinds.Count == node.Kinds.Count)); 1384if (nd.Kinds.Count > 1 && includeKind) 1431if (nd.Kinds.Count >= 2) 1452if (fieldKinds != null && fieldKinds.Count > 0) 1460if (kinds.Count == 1) 1485nd.Kinds.Count > 1 ? "kind" : "", 1519nd.Kinds.Count > 1 ? "SyntaxKind kind" : "", 1544if (field.Kinds.Count == 1) 1565if (field.Type == "SyntaxToken" && CanBeAutoCreated(nd, field) && field.Kinds.Count > 1) 1573for (int k = 0; k < field.Kinds.Count; k++) 1611nd.Kinds.Count > 1 ? "SyntaxKind kind" : "", 1618nd.Kinds.Count > 1 ? "kind" : "", 1700nd.Kinds.Count > 1 ? "SyntaxKind kind" : "", 1725nd.Kinds.Count > 1 ? "kind" : "", 1764return field.Type == "SyntaxToken" && field.Kinds != null && field.Kinds.Count == 1 && field.Kinds[0].Name == "IdentifierToken";
TestWriter.cs (1)
113if (node.Kinds.Count > 1)
DatabaseMigration.ApiService (1)
Program.cs (1)
44totalEntries = entries.Count,
dotnet-dev-certs (6)
Program.cs (1)
330if (trustedCertificates.Count == 0)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
886var certificatesDescription = list.Count switch 890_ => $"{list.Count} certificates",
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
118if (nssDbs.Count > 0) 285if (nssDbs.Count > 0) 421if (nssDbs.Count > 0)
dotnet-svcutil.xmlserializer (5)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (1)
47if (options.InputParameters.Count == 0)
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (1)
150for (int i = 0; i < s_existingFileNames.Count; i++)
Microsoft\Tools\ServiceModel\SvcUtil\XmlSerializerGenerator.cs (3)
33if (!string.IsNullOrEmpty(_outFile) && assemblies.Count > 1) 51if (types.Count == 0) 56if (mappings.Count == 0)
dotnet-svcutil-lib (221)
CmdCredentialsProvider.cs (1)
169while (!int.TryParse(idxString, out idx) || idx < 1 || idx > candidateCerts.Count);
CodeDomFixup\ConfigToCode.cs (2)
57if (endpointNames.Count > 0) 64bool shouldRemoveDefault = (endpointNames.Count != 1);
CodeDomFixup\EndpointSelector.cs (1)
116return s_bindingValidationErrors.Count == 0;
CodeDomFixup\MethodCreationHelper.cs (2)
86if (endpointNames.Count == 1) 2172System.Diagnostics.Debug.Assert(endpointNames.Count == 1, "have and only have on endpoint has to exist for a given client type");
CommandProcessorOptions.cs (1)
254if (userOptions.Count == 0)
FrameworkFork\Microsoft.Xml\Xml\Core\QueryOutputWriter.cs (1)
55if (settings.CDataSectionElements.Count > 0)
FrameworkFork\Microsoft.Xml\Xml\Core\QueryOutputWriterV1.cs (1)
76if (settings.CDataSectionElements != null && settings.CDataSectionElements.Count > 0)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEventCache.cs (4)
117for (idxPage = 0; idxPage < _pages.Count; idxPage++) 128Debug.Assert(idxPage + 1 == _pages.Count); 275for (idxPage = 0; idxPage < _pages.Count; idxPage++) 286Debug.Assert(idxPage + 1 == _pages.Count);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWriterSettings.cs (1)
450return _cdataSections.Count != 0 || _docTypePublic != null ||
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentXmlWriter.cs (8)
378for (int i = _fragment.Count - 1; i >= 0; i--) 389for (int i = 0; i < _fragment.Count; i++) 395for (int i = _fragment.Count - 1; i >= 0; i--) 401for (int i = 0; i < _fragment.Count; i++) 410if (_fragment.Count == 0) 429for (int i = 0; i < _fragment.Count; i++) 440for (int i = 0; i < _fragment.Count; i++) 469for (int i = _fragment.Count - 1; i >= 1; i--)
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentXPathNavigator.cs (1)
1842for (int i = elements.Count - 1; i >= 0; i--)
FrameworkFork\Microsoft.Xml\Xml\Dom\XPathNodeList.cs (4)
35return _list.Count; 49int count = _list.Count; 72if (_list.Count <= index) 76if (index < 0 || _list.Count <= index)
FrameworkFork\Microsoft.Xml\Xml\schema\ContentValidator.cs (1)
2095if (matchCount + 2 >= runningPositions.Count)
FrameworkFork\Microsoft.Xml\Xml\schema\GenerateConverter.cs (1)
950for (int i = 0; i < _rules.Count; i++)
FrameworkFork\Microsoft.Xml\Xml\schema\Preprocessor.cs (1)
811for (int i = 0; i < removeItemsList.Count; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaAttDef.cs (2)
198(values.Count <= 2)) 202if (values.Count == 2)
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaCollectionPreprocessor.cs (1)
587for (int i = 0; i < removeItemsList.Count; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaObjectTable.cs (2)
86for (index = 0; index < _entries.Count; index++) 100Debug.Assert(_table.Count == _entries.Count);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaSet.cs (2)
1166for (int i = 0; i < newMembers.Count; ++i) 1481for (int i = 0; i < reprocessList.Count; ++i)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlMapping.cs (1)
127if (list.Count > 0) root = list[0];
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (1)
519if (attrs.Count > 0)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (2)
661for (int i = 0; i < caseLabels.Count; i++) 711for (int i = 0; i < caseLabels.Count; i++)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheAxisQuery.cs (4)
43Debug.Assert(0 <= count && count <= outputBuffer.Count); 44if (count < outputBuffer.Count) 55Debug.Assert(0 <= count && count <= outputBuffer.Count); 65public override int Count { get { return outputBuffer.Count; } }
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheChildrenQuery.cs (1)
66if (_elementStk.Count == 0)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheOutputQuery.cs (4)
53Debug.Assert(0 <= count && count <= outputBuffer.Count); 54if (count < outputBuffer.Count) 65Debug.Assert(0 <= count && count <= outputBuffer.Count); 76public override int Count { get { return outputBuffer.Count; } }
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\ClonableStack.cs (2)
26int last = base.Count - 1; 34return base[base.Count - 1];
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\followingsibling.cs (2)
44for (int i = 0; i < _parentStk.Count; i++) 79if (_elementStk.Count == 0)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\precedingquery.cs (1)
85if (_ancestorStk.Count == 0)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\precedingsibling.cs (1)
35for (int i = 0; i < parentStk.Count; i++)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\Query.cs (3)
114int r = buffer.Count; 189Debug.Assert(0 <= pos && pos <= buffer.Count, "Algorithm error: Insert()"); 196if (pos < buffer.Count)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\ReversePositionQuery.cs (1)
18public override int CurrentPosition { get { return outputBuffer.Count - count + 1; } }
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\SortQuery.cs (5)
60SortKey key = new SortKey(numSorts, /*originalPosition:*/_results.Count, eNext.Clone()); 83Debug.Assert(0 <= count && count <= _results.Count); 84if (count < _results.Count) 95Debug.Assert(0 <= count && count <= _results.Count); 113public override int Count { get { return _results.Count; } }
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathAncestorQuery.cs (1)
65public override int CurrentPosition { get { return outputBuffer.Count - count + 1; } }
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (17)
505XmlDictionaryString[] childElementNamespaces = new XmlDictionaryString[Members.Count + baseChildElementNamespaceCount]; 510for (int i = 0; i < this.Members.Count; i++) 619for (int i = 0; i < this.Members.Count; i++) 707for (int i = 0; i < this.Members.Count; i++) 819XmlDictionary dictionary = new XmlDictionary(2 + Members.Count); 827MemberNames = new XmlDictionaryString[Members.Count]; 828MemberNamespaces = new XmlDictionaryString[Members.Count]; 834MemberNames = new XmlDictionaryString[Members.Count + baseMemberCount]; 836MemberNamespaces = new XmlDictionaryString[Members.Count + baseMemberCount]; 843for (int i = 0; i < Members.Count; i++) 858XmlDictionary dictionary = new XmlDictionary(1 + Members.Count); 862MemberNames = new XmlDictionaryString[Members.Count]; 863MemberNamespaces = new XmlDictionaryString[Members.Count]; 864for (int i = 0; i < Members.Count; i++) 1076if (tempMembers.Count > 1) 1127for (int i = 0; i < membersInHierarchy.Count - 1; i++) 1132while (endIndex < membersInHierarchy.Count - 1
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (2)
860for (int i = 0; i < classDataContract.Members.Count; i++) 1082for (int i = 0; i < enumDataContract.Members.Count; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (6)
2446if (level >= _nestedParamCounts.Count) 2450_nestedParamCounts.Add((level == _nestedParamCounts.Count) ? count : 0); 2451} while (level >= _nestedParamCounts.Count); 2481return _paramGenericInfos.Count; 2497for (int j = 0; j < _paramGenericInfos.Count; j++) 2512for (int j = 0; j < _paramGenericInfos.Count; j++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (2)
167for (int i = 0; i < classDataContract.Members.Count; i++) 463for (int i = 0; i < types.Count; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\EnumDataContract.cs (6)
199XmlDictionary dictionary = new XmlDictionary(2 + Members.Count); 202_childElementNames = new XmlDictionaryString[Members.Count]; 203for (int i = 0; i < Members.Count; i++) 336for (int i = 0; i < Values.Count; i++) 348for (int i = 0; i < Values.Count; i++) 428for (int i = 0; i < Members.Count; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (6)
168XmlDictionary dictionary = new XmlDictionary(2 + Members.Count); 175_memberNames = new XmlDictionaryString[Members.Count]; 176_memberNamespaces = new XmlDictionaryString[Members.Count]; 181_memberNames = new XmlDictionaryString[Members.Count]; 182_memberNamespaces = new XmlDictionaryString[Members.Count]; 188for (int i = 0; i < Members.Count; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaImporter.cs (5)
1007int prevMemberIndex = dataContract.Members.Count - 1; 1012memberOrder = dataContract.Members.Count; 1018memberOrder = dataContract.Members.Count; 1109if (keyValueContract == null || keyValueContract.Members == null || keyValueContract.Members.Count != 2 1215dataContract.Values.Add(SchemaExporter.GetDefaultEnumValue(isFlags, dataContract.Members.Count));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (2)
305for (int i = 0; i < classContract.Members.Count; i++, memberCount++) 371for (int i = 0; i < members.Count; i++, memberCount++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (4)
237_ilg.Call(_contextArg, XmlFormatGeneratorStatics.IncrementItemCountMethod, classContract.Members.Count); 239for (int i = 0; i < classContract.Members.Count; i++, memberCount++) 281_childElementIndex += classContract.Members.Count; 707for (int j = 0; j < members.Count; j++)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Fx.cs (1)
253if (types.Count != 0)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InputQueue.cs (2)
665if (_readerQueue.Count == 0 && _waiterList.Count == 0) 685if (_waiterList.Count > 0)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\KeyInfoSerializer.cs (10)
90for (int i = 0; i < _serializerEntries.Count; ++i) 150for (int i = 0; i < _keyIdentifierEntries.Count; i++) 187for (int i = 0; i < _keyIdentifierEntries.Count; ++i) 200for (int i = 0; i < _keyIdentifierEntries.Count; ++i) 237for (int i = 0; i < _keyIdentifierClauseEntries.Count; i++) 249for (int i = 0; i < _keyIdentifierClauseEntries.Count; i++) 277for (int i = 0; i < _keyIdentifierClauseEntries.Count; ++i) 290for (int i = 0; i < _keyIdentifierClauseEntries.Count; ++i) 340for (int i = 0; i < _tokenEntries.Count; i++) 357for (int i = 0; i < _tokenEntries.Count; i++)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SecurityKeyIdentifier.cs (2)
59get { return _clauses.Count; } 131for (int i = 0; i < _clauses.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncoder.cs (1)
954get { return _bytes.Count; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionPool.cs (9)
110for (int i = 0; i < endpointKeysToRemove.Count; i++) 135if (itemsToClose != null && itemsToClose.Count > 0) 139for (int i = 0; i < itemsToClose.Count; i++) 274if (_busyConnections.Count > 0) 340for (int i = 0; i < itemsToClose.Count; i++) 355for (int i = 0; i < idleItemsToClose.Count; i++) 360for (int i = 0; i < _busyConnections.Count; i++) 454for (int i = 0; i < itemsToClose.Count; i++) 464WcfEventSource.Instance.ConnectionPoolMiss(_key != null ? _key.ToString() : string.Empty, _busyConnections.Count);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionPoolRegistry.cs (3)
35for (int i = 0; i < registryEntry.Count; i++) 69for (int i = 0; i < registryEntry.Count; i++) 78if (registryEntry.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IdlingCommunicationPool.cs (1)
237for (int i = 0; i < itemsToClose.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ReliableSessionBindingElementImporter.cs (1)
220if (wsrmAlternatives.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\RequestChannel.cs (3)
134if (_outstandingRequests.Count > 0) 136requests = new IRequestBase[_outstandingRequests.Count]; 198if (_outstandingRequests.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelFactory.cs (6)
236channel = (_channelsList.Count > 0) ? _channelsList[_channelsList.Count - 1] : null; 246channel = (_channelsList.Count > 0) ? _channelsList[_channelsList.Count - 1] : null; 260count = _channelsList.Count; 275for (int index = 0; index < _channelsList.Count; index++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (1)
601if (types.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (3)
715for (int i = 0; i < types.Count; i++) 767for (int i = 0; i < types.Count; i++) 1354for (int i = 0; i < contractMembers.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\XmlSerializerOperationBehavior.cs (7)
649int[] uniqueIndexes = new int[_mappings.Count]; 650for (int srcIndex = 0; srcIndex < _mappings.Count; srcIndex++) 657uniqueIndex = uniqueMappings.Count - 1; 662if (uniqueMappings.Count == _mappings.Count) 664XmlSerializer[] serializers = new XmlSerializer[_mappings.Count]; 665for (int i = 0; i < _mappings.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (2)
573if (_timedOutRequests != null && _timedOutRequests.Count > 0) 577if (_timedOutRequests != null && _timedOutRequests.Count > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\EndpointAddressProcessor.cs (2)
78if (attrSet.Count > 0) 81for (int i = 0; i < attrSet.Count; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\EndpointDispatcherTable.cs (1)
37if (_cachedEndpoints.Count < optimizationThreshold)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\SynchronizedChannelCollection.cs (1)
51for (int i = 0; i < items.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\ExtensionCollection.cs (1)
78for (int i = 0; i < items.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\MessagePartSpecification.cs (9)
41get { return _headerTypes != null && _headerTypes.Count > 0; } 101if (headerTypes != null && headerTypes.Count > 0) 105_headerTypes = new List<XmlQualifiedName>(headerTypes.Count); 108for (int i = 0; i < headerTypes.Count; i++) 123List<XmlQualifiedName> noDuplicates = new List<XmlQualifiedName>(_headerTypes.Count); 124for (int i = 0; i < _headerTypes.Count; i++) 130for (int j = 0; j < noDuplicates.Count; j++) 198for (int i = 0; i < _headerTypes.Count; i++) 224if (_headerTypes != null && _headerTypes.Count > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\ReferenceList.cs (1)
29get { return _referredIds.Count; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (1)
581for (int i = 0; i < identities.Count; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityPolicy.cs (2)
3097for (int i = 0; i < _drivers.Count; ++i) 3111for (int i = 0; i < _drivers.Count; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityTokenSerializer.cs (10)
147for (int i = 0; i < _serializerEntries.Count; ++i) 212for (int i = 0; i < _tokenEntries.Count; i++) 224for (int i = 0; i < _tokenEntries.Count; i++) 249for (int i = 0; i < _tokenEntries.Count; i++) 363for (int i = 0; i < _tokenEntries.Count; i++) 380for (int i = 0; i < _tokenEntries.Count; i++) 417for (int i = 0; i < _tokenEntries.Count; i++) 546for (int i = 0; i < _dictionaryStrings.Count; ++i) 560for (int i = 0; i < _dictionaryStrings.Count; ++i) 577for (int i = 0; i < _dictionaryStrings.Count; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSTrust.cs (1)
247if (rstrCollection.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedCollection.cs (9)
58get { lock (_sync) { return _items.Count; } } 84if (index < 0 || index >= _items.Count) 86string.Format(SRServiceModel.ValueMustBeInRange, 0, _items.Count - 1))); 97int index = _items.Count; 146if (index < 0 || index > _items.Count) 148string.Format(SRServiceModel.ValueMustBeInRange, 0, _items.Count))); 156int count = _items.Count; 185if (index < 0 || index >= _items.Count) 187string.Format(SRServiceModel.ValueMustBeInRange, 0, _items.Count - 1)));
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedKeyedCollection.cs (3)
73for (int i = 0; i < this.Items.Count; i++) 147for (int i = 0; i < Items.Count; i++) 212for (int i = 0; i < Items.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\XmlBuffer.cs (1)
80get { return _sections.Count; }
Metadata\MetadataDocumentLoader.cs (1)
704if (this.metadataSourceFiles.Count == 1)
Metadata\MetadataDocumentSaver.cs (1)
127for (int idx = UnresolvedReferences.Count - 1; idx >= 0; idx--)
Shared\MSBuildProj.cs (4)
208if (msbuildProj._targetFrameworks.Count == 0) 763if (_targetFrameworks.Count >= 1 && TargetFrameworkHelper.IsSupportedFramework(this.TargetFramework, out var frameworkInfo) && frameworkInfo.IsDnx) 855await safeLogger.WriteMessageAsync($"Package reference count: {packageDependencies.Count}", logToUI: false).ConfigureAwait(false); 943await safeLogger.WriteMessageAsync($"Assembly reference count: {assemblyDependencies.Count}", logToUI: false).ConfigureAwait(false);
Shared\Options\ApplicationOptions.cs (1)
152if (options._errors.Count > 0 && throwOnError)
Shared\Options\ListValue.cs (3)
67public int Count { get { return this.InnerList.Count; } } 125for (int idx = this.InnerList.Count - 1; idx >= 0; idx--) 215var value = this.InnerList.Count > 0 ? this.InnerList.Select(i => $"\"{i}\"").Aggregate((str, s) => $"{str}, {s}") : string.Empty;
TypeLoader.cs (1)
69if (listType.Count == 0)
dotnet-svcutil-lib.Tests (7)
TestInit.cs (7)
480if (isLogFile && fileLines1.Count != fileLines2.Count) 486if (fileLines1.Count != fileLines2.Count) 488diffLines = new KeyValuePair<string, string>($"Line count file1: {fileLines1.Count}", $"Line count file2: {fileLines2.Count}"); 496for (int i = 0; i < fileLines1.Count; i++)
dotnet-user-jwts (11)
Commands\CreateCommand.cs (1)
143if (audience is null || audience.Count == 0)
Helpers\ConsoleTable.cs (7)
37if (_columns.Count != values.Length) 40$"The number of columns in the table '{_columns.Count}' does not match the number of columns in the row '{values.Length}'."); 61var equalColumnLengths = Math.Max((Console.WindowWidth / _columns.Count) - EXCESS_LENGTH_CREATED_BY_BORDERS, 5); 67for (var i = 0; i < maxColumnLengths.Count; i++) 81for (var i = 0; i < maxColumnLengths.Count; i++) 89var formatRow = Enumerable.Range(0, _columns.Count) 105for (var i = 0; i < rows.Count; i++)
Helpers\JwtIssuer.cs (1)
53if (options.Audiences is { Count: > 0} audiences)
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (2)
34if (projects.Count > 1) 39if (projects.Count == 0)
dotnet-user-secrets (2)
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (2)
34if (projects.Count > 1) 39if (projects.Count == 0)
Extensibility.WebSockets.IntegrationTests (5)
WebSocketTests.4.1.0.cs (5)
99Assert.True(clientReceiver.ServerLog.Count > 0, 167Assert.True(clientReceiver.ServerLog.Count > 0, 235Assert.True(clientReceiver.ServerLog.Count > 0, 332Assert.True(clientReceiver.ServerLog.Count > 0, 404Assert.True(clientReceiver.ServerLog.Count > 0,
GenerateAnalyzerNuspec (1)
Program.cs (1)
120if (allTargets.Count == 0)
GenerateDocumentationAndConfigFiles (47)
Program.cs (1)
382if (fileNamesWithValidationFailures.Count > 0)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
87for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 100if (result == 0 && usedFieldsAndValues.Count > 0) 104for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 155for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (4)
27addBlankLine = newImports.Count > 0; 49for (var i = 0; i < newImports.Count; i++) 78if (originalLastUsingCurrentIndex != newImports.Count - 1) 86for (var i = 0; i < newImports.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
HeaderPropagationSample (1)
Startup.cs (1)
119if (values.Count == 0)
http2cat (2)
src\Shared\Http2cat\Http2Utilities.cs (2)
416var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; 450var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
IdeCoreBenchmarks (3)
FindReferencesBenchmarks.cs (2)
111Console.WriteLine($"References count: {refList.Count}"); 113Console.WriteLine($"Locations count: {locations.Count}");
NavigateToBenchmarks.cs (1)
239return results.Count;
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (1)
149result.Logger.LogInformation($"Number of freb files available {xmlFiles.Count}.");
src\Shared\Http2cat\Http2Utilities.cs (2)
416var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; 450var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
IIS.LongTests (2)
src\Shared\Http2cat\Http2Utilities.cs (2)
416var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; 450var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
IIS.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
IIS.NewHandler.FunctionalTests (2)
src\Shared\Http2cat\Http2Utilities.cs (2)
416var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; 450var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
IIS.NewShim.FunctionalTests (2)
src\Shared\Http2cat\Http2Utilities.cs (2)
416var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; 450var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (1)
149result.Logger.LogInformation($"Number of freb files available {xmlFiles.Count}.");
src\Shared\Http2cat\Http2Utilities.cs (2)
416var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; 450var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
illink (48)
Infrastructure.Common (3)
xunit\ConditionAttribute.cs (1)
96if (falseConditions.Count == 0)
xunit\WcfTestDiscoverer.cs (2)
46if (issueSkipList.Count > 0) 75if (skipReasons.Count > 0)
InMemory.FunctionalTests (16)
EventSourceTests.cs (4)
134Assert.Equal(eventIndex, events.Count); 261Assert.Equal(eventIndex, events.Count); 351Assert.Equal(eventIndex, events.Count); 416Assert.Equal(eventIndex, events.Count);
Http2\Http2TestBase.cs (2)
246await context.Response.Body.WriteAsync(data.ToArray(), 0, data.Count); 818var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
Http3\Http3StreamTests.cs (1)
739while (receivedData.Count < data.Length)
HttpsTests.cs (2)
192Assert.True(loggerProvider.ErrorLogger.ErrorMessages.Count == 0, 221Assert.True(loggerProvider.ErrorLogger.ErrorMessages.Count == 0,
RequestTests.cs (1)
98Assert.Equal(2, bufferLengths.Count);
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (1)
423if (_revocationList?.Count > 0)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
24var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
68logger.LogInformation("Found {count} unavailable endpoints.", unavailableEndpoints.Count);
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
76for (var i = 0; i < MaybeExtra.Count; i++) 95for (var i = 0; i < MaybeExtra.Count; i++) 110for (var i = 0; i < MaybeExtra.Count; i++)
Interop.FunctionalTests (7)
H2SpecCommands.cs (1)
289if (failures.Count > 0)
Http2\Http2RequestTests.cs (2)
312logger.LogInformation($"Received {readCount} bytes. Total {data.Count} bytes."); 317logger.LogInformation($"Error reading response. Total {data.Count} bytes.");
Http3\Http3RequestTests.cs (1)
810return requestTasks.Count;
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
68logger.LogInformation("Found {count} unavailable endpoints.", unavailableEndpoints.Count);
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
InteropClient (1)
InteropClient.cs (1)
399Assert.AreEqual(0, responseList.Count);
IOperationGenerator (16)
IOperationClassWriter.cs (12)
326(n.OperationKind?.Entries is null || n.OperationKind?.Entries.Count == 0) && 335int numKinds = elementsToKind.Count + explicitKinds.Count + unusedKinds.Count; 553if (propsToInitialize.Count == 0 && !hasType) 656if (node.OperationKind?.Entries.Count > 0) 667if (publicIOperationProps.Count == 0) 704if (publicIOperationProps.Count > 0) 708if (publicIOperationProps.Count == 1) 742for (int i = 0; i < orderedProperties.Count; i++) 778for (; slot < orderedProperties.Count; slot++) 853int slot = orderedProperties.Count - 1; 874var previousSlot = slot == (orderedProperties.Count - 1) ? "int.MaxValue" : (slot + 1).ToString();
IOperationClassWriter.Verifier.cs (4)
88if (properties.Count < 2) 94if (splitOrder.Count != properties.Count || (properties.Count == 1 && properties[0] != splitOrder[0]))
Keycloak.Web (1)
WeatherApiClient.cs (1)
11if (forecasts?.Count >= maxItems)
Metrics (36)
Program.cs (1)
160if (projectsOrSolutions.Count == 0)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
Metrics.Legacy (36)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Tools\Metrics\Program.cs (1)
160if (projectsOrSolutions.Count == 0)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
Microsoft.Analyzers.Extra (2)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
180var matchParams = invocationArgList.Count == methodSymbol.Parameters.Length; 183for (int i = 0; i < invocationArgList.Count; i++)
Microsoft.Analyzers.Extra.Tests (3)
Resources\RoslynTestUtils.cs (3)
355if (actions.Count == 0 || numberOfActionsInPreviousIteration == actions.Count) 369numberOfActionsInPreviousIteration = actions.Count;
Microsoft.Analyzers.Local (4)
ApiLifecycle\ApiLifecycleAnalyzer.cs (2)
125if (missingContraintsForSymbol.Count > 0) 133if (missingBaseForSymbol.Count > 0)
ApiLifecycle\Json\JsonArray.cs (2)
40public int Count => _items.Count; 51get => index >= 0 && index < _items.Count
Microsoft.Analyzers.Local.Tests (5)
InternalReferencedInPublicDocAnalyzerTests.cs (2)
464Assert.Equal(expectedNumberOfWarnings, detected.Count); 466for (int i = 0; i < detected.Count; i++)
Resources\RoslynTestUtils.cs (3)
356if (actions.Count == 0 || numberOfActionsInPreviousIteration == actions.Count) 370numberOfActionsInPreviousIteration = actions.Count;
Microsoft.AspNetCore.Analyzer.Testing (1)
DiagnosticVerifier.cs (1)
208return assemblies.Count > 0;
Microsoft.AspNetCore.Analyzers (1)
CompilationFeatureDetector.cs (1)
31for (var i = 0; i < configureMethods.Count; i++)
Microsoft.AspNetCore.Antiforgery (6)
Internal\DefaultAntiforgeryTokenGenerator.cs (1)
205for (var i = 0; i < identitiesList.Count; i++)
Internal\DefaultClaimUidExtractor.cs (5)
47for (var i = 0; i < identitiesList.Count; i++) 94for (var i = 0; i < identitiesList.Count; i++) 102if (allClaims.Count == 0) 110var identifierParameters = new List<string>(allClaims.Count * 3); 111for (var i = 0; i < allClaims.Count; i++)
Microsoft.AspNetCore.App.Analyzers (15)
Infrastructure\AmbiguousRoutePatternComparer.cs (3)
106if (xParameterPolicies.Count != yParameterPolicies.Count) 111for (var i = 0; i < xParameterPolicies.Count; i++)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (2)
316for (var i = 0; i < charResults.Count;) 329if (i + 1 < charResults.Count)
Mvc\DetectAmbiguousActionRoutes.cs (1)
32if (actionRoutes.Count > 0)
Mvc\DetectOverriddenAuthorizeAttribute.cs (3)
29Debug.Assert(authorizeAttributes.Count is 0); 59Debug.Assert(authorizeAttributes.Count is 0); 82if (currentMethod is null && (authorizeAttributes.Count is 0 || !isCheckingBaseType))
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (2)
248if (routePatternCompletionContext.Items == null || routePatternCompletionContext.Items.Count == 0) 270var sortText = routePatternCompletionContext.Items.Count.ToString("0000", CultureInfo.InvariantCulture);
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (3)
127if (routePatternCompletionContext.Items.Count == 0) 149var sortText = routePatternCompletionContext.Items.Count.ToString("0000", CultureInfo.InvariantCulture); 191if (context.Items.Count > 0)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
35for (var i = 0; i < _weakReferencedEntries.Count; i++)
Microsoft.AspNetCore.App.Analyzers.Test (3)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (2)
82if (matches.Count == 0) 89if (orderedMatches.Count >= 2 &&
RouteEmbeddedLanguage\RoutePatternHighlighterTests.cs (1)
467if (tempSpans.Count > 0)
Microsoft.AspNetCore.Authentication.Abstractions (1)
TokenExtensions.cs (1)
47if (tokenNames.Count > 0)
Microsoft.AspNetCore.Authentication.Cookies (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
330if (keyValuePairs.Count > 0)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerHandler.cs (1)
184Exception = (validationFailures.Count == 1) ? validationFailures[0] : new AggregateException(validationFailures)
Microsoft.AspNetCore.Authentication.Test (2)
ClaimActionTests.cs (2)
37Assert.Equal(2, roleClaims.Count); 69Assert.Equal(2, roleClaims.Count);
Microsoft.AspNetCore.Authentication.WsFederation (2)
WsFederationHandler.cs (2)
303if (validationFailures == null || validationFailures.Count == 0) 307else if (validationFailures.Count == 1)
Microsoft.AspNetCore.Components (35)
CascadingValueSource.cs (2)
101var subscribersCount = subscribers.Count; 181if (subscribersForDispatcher.Count == 0)
NavigationManager.cs (3)
361var handlerCount = _locationChangingHandlers.Count; 522var isFirstHandler = _locationChangingHandlers.Count == 0; 538if (_locationChangingHandlers.Remove(locationChangingHandler) && _locationChangingHandlers.Count == 0)
PersistentState\ComponentStatePersistenceManager.cs (2)
148for (var i = 0; i < _registeredCallbacks.Count; i++) 189for (var i = _registeredCallbacks.Count - 1; i >= 0; i--)
PersistentState\PersistentServicesRegistry.cs (1)
43if (_subscriptions.Count != 0)
Reflection\MemberAssignment.cs (1)
58var count = list.Count;
RenderTree\Renderer.cs (7)
360Debug.Assert(_pendingTasks is null || _pendingTasks.Count == 0); 369while (_pendingTasks?.Count > 0) 1055if (exceptions?.Count > 1) 1059else if (exceptions?.Count == 1) 1278if (asyncDisposables?.Count >= 1) 1304if (exceptions?.Count > 1) 1308else if (exceptions?.Count == 1)
Sections\SectionRegistry.cs (3)
45if (index == providers.Count) 85if (providers.Count != 0 && providers[^1] == provider) 92=> providers.Count != 0
src\Http\Routing\src\ParameterPolicyActivator.cs (3)
121if (matchingConstructors.Count == 0) 129if (matchingConstructors.Count == 1) 161Debug.Assert(constructors.Count > 0);
src\Http\Routing\src\Patterns\RoutePatternFactory.cs (2)
504for (var i = 0; i < parameters.Count; i++) 628&& (parameterConstraints?.Count ?? 0) == 0)
src\Http\Routing\src\Patterns\RoutePatternParser.cs (8)
319for (var i = 0; i < segments.Count; i++) 327(i != segments.Count - 1 || j != segment.Parts.Count - 1)) 341for (var i = 0; i < parts.Count; i++) 344if (part is RoutePatternParameterPart parameter && parameter.IsCatchAll && parts.Count > 1) 353for (var i = 0; i < parts.Count; i++) 357if (part is RoutePatternParameterPart parameter && parameter.IsOptional && parts.Count > 1) 360if (i == parts.Count - 1) 411for (var i = 0; i < parts.Count; i++)
src\Http\Routing\src\RouteConstraintBuilder.cs (1)
58if (kvp.Value.Count == 1)
src\Http\Routing\src\Tree\TreeEnumerator.cs (2)
48if (next.IsCatchAll && next.Matches.Count > 0) 58if (next.Matches.Count > 0)
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentParameterAnalyzer.cs (2)
64if (properties.Count == 0) 124if (captureUnmatchedValuesParameters.Count > 1)
Microsoft.AspNetCore.Components.Authorization.Tests (7)
AuthorizeRouteViewTest.cs (1)
351Assert.Equal(2, _renderer.Batches.Count);
AuthorizeViewTest.cs (4)
211Assert.Equal(2, renderer.Batches.Count); 278Assert.Equal(2, renderer.Batches.Count); 327Assert.Equal(2, renderer.Batches.Count); 385Assert.Equal(2, renderer.Batches.Count);
CascadingAuthenticationStateTest.cs (2)
105Assert.Equal(2, renderer.Batches.Count); 141Assert.Equal(2, renderer.Batches.Count);
Microsoft.AspNetCore.Components.Endpoints (7)
Assets\LinkPreload.cs (1)
50for (var i = 0; i < assets.Count; i ++)
Builder\RazorComponentEndpointDataSource.cs (1)
132var resourceCollection = endpoints.Count > 0 ? endpoints[^1].Metadata.GetMetadata<ResourceAssetCollection>() : null;
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (2)
232for (var i = 0; i < constructorParameters.Count; i++) 257for (var i = 0; i < properties.Count; i++)
FormMapping\Metadata\FormDataMetadataFactory.cs (1)
280for (var i = 0; i < _context.CurrentTypes.Count; i++)
Rendering\EndpointHtmlRenderer.Prerendering.cs (2)
169else if (_nonStreamingPendingTasks.Count > 0) 224while (_nonStreamingPendingTasks.Count > 0)
Microsoft.AspNetCore.Components.Endpoints.Tests (13)
Binding\FormDataMapperTests.cs (12)
446Assert.Equal(size, result.Count); 491Assert.Equal(rented.Count, returned.Count); 551Assert.Equal(rented.Count, returned.Count); 590Assert.True(result.Count == maxCollectionSize || result.Count == maxCollectionSize - 1); 637Assert.Equal(2, errors.Count); 1146Assert.Equal(2, errors.Count); 1205Assert.Equal(2, errors.Count); 1890Assert.Equal(2, errors.Count); 2420public int Count => _inner.Count;
HotReloadServiceTests.cs (1)
68Assert.Equal(2, pageEndpoints.Count);
Microsoft.AspNetCore.Components.Performance (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
200return (_columns.Count > 0 && mustRefreshData) ? RefreshDataCoreAsync() : Task.CompletedTask;
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentParameterAnalyzer.cs (2)
58if (properties.Count == 0) 111if (captureUnmatchedValuesParameters.Count > 1)
Microsoft.AspNetCore.Components.Server (6)
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.Components.Server.Tests (6)
Circuits\RevalidatingServerAuthenticationStateProviderTest.cs (1)
49Assert.Equal(10, provider.RevalidationCallLog.Count);
Circuits\ServerComponentDeserializerTest.cs (4)
87Assert.Equal(2, descriptors.Count); 109Assert.Equal(2, descriptors.Count); 139Assert.Equal(2, descriptors.Count); 253Assert.Equal(2, descriptors.Count);
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
88Assert.Equal(4, buildersAffected.Count);
Microsoft.AspNetCore.Components.Tests (54)
CascadingParameterTest.cs (9)
83Assert.Equal(2, renderer.Batches.Count); 129Assert.Equal(2, renderer.Batches.Count); 174Assert.Equal(2, renderer.Batches.Count); 226Assert.Equal(2, renderer.Batches.Count); 293Assert.Equal(2, renderer.Batches.Count); 381Assert.Equal(2, renderer.Batches.Count); 600Assert.Equal(2, renderer.Batches.Count); 616Assert.Equal(3, renderer.Batches.Count); 764Assert.Equal(2, renderer.Batches.Count);
ComponentBaseTest.cs (8)
175Assert.Equal(2, renderer.Batches.Count); 217Assert.Equal(2, renderer.Batches.Count); 228Assert.Equal(3, renderer.Batches.Count); 256Assert.Equal(2, renderer.Batches.Count); 290Assert.Equal(2, renderer.Batches.Count); 298Assert.Equal(2, renderer.Batches.Count); 337Assert.Equal(2, renderer.Batches.Count); 348Assert.Equal(2, renderer.Batches.Count);
ComponentsMetricsTest.cs (2)
31Assert.Equal(2, _meterFactory.Meters.Count); 400Assert.Equal(2, _meterFactory.Meters.Count);
LayoutViewTest.cs (2)
179Assert.Equal(2, _renderer.Batches.Count); 221Assert.Equal(2, _renderer.Batches.Count);
PersistentState\ComponentStatePersistenceManagerTest.cs (1)
351Assert.Equal(4, executionSequence.Count);
PersistentState\PersistentServicesRegistryTest.cs (3)
384Assert.Equal(customer.Addresses.Count, restoredCustomerService.Customer.Addresses.Count); 385for (var i = 0; i < customer.Addresses.Count; i++)
RendererTest.cs (28)
191Assert.Equal(5, renderer.Batches.Count); 2255Assert.Equal(2, renderer.Batches.Count); 2262Assert.Equal(2, renderer.Batches.Count); 2296Assert.Equal(2, renderer.Batches.Count); 2332Assert.Equal(2, renderer.Batches.Count); 2366Assert.Equal(2, renderer.Batches.Count); 2406Assert.Equal(2, renderer.Batches.Count); 2450Assert.Equal(2, renderer.Batches.Count); 2490Assert.Equal(2, renderer.Batches.Count); 2528Assert.Equal(2, renderer.Batches.Count); 2591Assert.Equal(2, renderer.Batches.Count); 2609Assert.Equal(2, renderer.HandledExceptions.Count); 2876Assert.Equal(2, renderer.Batches.Count); 3103Assert.Equal(2, renderer.Batches.Count); 3791Assert.Equal(2, renderer.HandledExceptions.Count); 3845Assert.Equal(2, renderer.HandledExceptions.Count); 4353Assert.Equal(2, renderer.Batches.Count); 4405Assert.Equal(i + 2, renderer.Batches.Count); 4599Assert.Equal(2, renderer.Batches.Count); 4634Assert.Equal(2, renderer.Batches.Count); 4639Assert.Equal(3, renderer.Batches.Count); 4677Assert.Equal(2, renderer.Batches.Count); 4721Assert.Equal(2, renderer.Batches.Count); 4770Assert.Equal(2, renderer.Batches.Count); 4776Assert.Equal(2, renderer.Batches.Count); // Didn't re-render as the error boundary was already gone 4800Assert.Equal(2, renderer.Batches.Count); 4812Assert.Equal(3, renderer.Batches.Count); 4934Assert.Equal(2, renderer.HandledExceptions.Count);
Routing\RouteTableFactoryTests.cs (1)
75Assert.Equal(routes.GroupBy(x => x.Handler).Count(), routes.Count);
Microsoft.AspNetCore.Components.Web (1)
Forms\Mapping\FormMappingContext.cs (1)
134for (var i = 0; i < _pendingErrors.Count; i++)
Microsoft.AspNetCore.Components.WebAssembly (2)
Hosting\WebAssemblyHostConfiguration.cs (2)
50for (var i = _providers.Count - 1; i >= 0; i--) 64if (_providers.Count == 0)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
TargetPickerUi.cs (2)
307if (matchingTabs.Count == 1) 313else if (matchingTabs.Count == 0)
Microsoft.AspNetCore.Components.WebView (1)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
207for (var i = 0; i < patterns.Count; i++)
Microsoft.AspNetCore.Components.WebView.Test (5)
Infrastructure\ContainerNode.cs (3)
18while (container.Children.Count > 0) 34if (child is LogicalContainerNode comment && comment.Children.Count > 0) 53if (childIndex < Children.Count)
Infrastructure\TestDocument.cs (1)
475if (e.Children.Count > 0)
WebViewManagerTests.cs (1)
76Assert.Equal(2, singleton.Services.Count);
Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.CookiePolicy.Test (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
330if (keyValuePairs.Count > 0)
Microsoft.AspNetCore.DataProtection (3)
KeyManagement\KeyEscrowServiceProviderExtensions.cs (1)
21return (escrowSinks != null && escrowSinks.Count > 0) ? new AggregateKeyEscrowSink(escrowSinks) : null;
RegistryPolicyResolver.cs (2)
103var keyEscrowSinks = escrowSinks.Count is 0 ? 105new IKeyEscrowSink[escrowSinks.Count];
Microsoft.AspNetCore.DeveloperCertificates.XPlat (5)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
886var certificatesDescription = list.Count switch 890_ => $"{list.Count} certificates",
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
118if (nssDbs.Count > 0) 285if (nssDbs.Count > 0) 421if (nssDbs.Count > 0)
Microsoft.AspNetCore.Diagnostics (1)
src\Shared\Metrics\MetricsExtensions.cs (1)
39for (var i = 0; i < list.Count; i++)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckOptions.cs (1)
53if (missingHealthStatus.Count > 0)
Microsoft.AspNetCore.Grpc.JsonTranscoding (13)
Internal\JsonTranscodingRouteAdapter.cs (6)
62while (i < tempSegments.Count) 107routeValueFormatTemplateParts.Add($"{{{variableParts.Count}}}"); 125routeValueFormatTemplateParts.Add($"{{{variableParts.Count}}}"); 130while (i < tempSegments.Count - 1) 132tempSegments.RemoveAt(tempSegments.Count - 1); 146var values = new object?[variableParts.Count];
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (4)
88if (_segments.Count > 0) 335CurrentVariable.StartSegment = _segments.Count; 341CurrentVariable.EndSegment = _segments.Count; 345Debug.Assert(CurrentVariable.EndSegment <= _segments.Count);
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (3)
226for (var i = 0; i < pathDescriptors.Count; i++) 228var isLast = i == pathDescriptors.Count - 1; 563path.RemoveAt(path.Count - 1);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
ConverterTests\JsonElementComparer.cs (2)
72if (xPropertiesUnsorted.Count != yPropertiesUnsorted.Count)
JsonTranscodingServiceMethodProviderTests.cs (1)
58Assert.Equal(2, matchedEndpoints.Count);
Microsoft.AspNetCore.Grpc.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Grpc.Swagger (8)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
172for (var i = 0; i < httpRoutePattern.Segments.Count; i++)
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (4)
88if (_segments.Count > 0) 335CurrentVariable.StartSegment = _segments.Count; 341CurrentVariable.EndSegment = _segments.Count; 345Debug.Assert(CurrentVariable.EndSegment <= _segments.Count);
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (3)
226for (var i = 0; i < pathDescriptors.Count; i++) 228var isLast = i == pathDescriptors.Count - 1; 563path.RemoveAt(path.Count - 1);
Microsoft.AspNetCore.Hosting (8)
GenericHost\GenericWebHostBuilder.cs (1)
160if (exceptions.Count > 0)
Internal\HostingMetrics.cs (1)
77for (var i = 0; i < customTags.Count; i++)
Internal\StartupLoader.cs (3)
325if (selectedMethods.Count > 1) 329if (selectedMethods.Count == 0) 332if (selectedMethods.Count > 1)
src\Shared\Metrics\MetricsExtensions.cs (1)
39for (var i = 0; i < list.Count; i++)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
207for (var i = 0; i < patterns.Count; i++)
WebHostBuilder.cs (1)
253if (exceptions.Count > 0)
Microsoft.AspNetCore.Hosting.Tests (3)
WebHostBuilderTests.cs (2)
991Assert.Equal(2, containerFactory.ServiceProviders.Count); 992Assert.Equal(2, disposables.Count);
WebHostTests.AsyncDisposable.cs (1)
24Assert.Equal(2, providerFactory.Providers.Count);
Microsoft.AspNetCore.Http (2)
Builder\ApplicationBuilder.cs (2)
35private int MiddlewareCount => _components.Count; 195for (var c = _components.Count - 1; c >= 0; c--)
Microsoft.AspNetCore.Http.Abstractions (1)
CookieBuilder.cs (1)
121if (_extensions?.Count > 0)
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
HttpMethodslTests.cs (1)
26for (int i = 0; i < testCases.Count; i++)
Microsoft.AspNetCore.Http.Connections (6)
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.Http.Connections.Client (1)
HttpConnection.cs (1)
434if (transportExceptions.Count > 0)
Microsoft.AspNetCore.Http.Extensions (15)
RequestDelegateFactory.cs (12)
377var responseWritingMethodCall = factoryContext.ParamCheckExpressions.Count > 0 ? 973var localVariables = new ParameterExpression[factoryContext.ExtraLocals.Count + 1]; 974var checkParamAndCallMethod = new Expression[factoryContext.ParamCheckExpressions.Count + 1]; 976for (var i = 0; i < factoryContext.ExtraLocals.Count; i++) 981for (var i = 0; i < factoryContext.ParamCheckExpressions.Count; i++) 986localVariables[factoryContext.ExtraLocals.Count] = WasParamCheckFailureExpr; 1004checkParamAndCallMethod[factoryContext.ParamCheckExpressions.Count] = checkWasParamCheckFailureWithFilters; 1020checkParamAndCallMethod[factoryContext.ParamCheckExpressions.Count] = checkWasParamCheckFailure; 1256if (factoryContext.ParameterBinders.Count > 0) 1304if (factoryContext.ParameterBinders.Count > 0) 1439if (factoryContext.ParameterBinders.Count > 0) 1996var boundValueExpr = Expression.ArrayIndex(BoundValuesArrayExpr, Expression.Constant(factoryContext.ParameterBinders.Count - 1));
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (2)
232for (var i = 0; i < constructorParameters.Count; i++) 257for (var i = 0; i < properties.Count; i++)
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (1)
280for (var i = 0; i < _context.CurrentTypes.Count; i++)
Microsoft.AspNetCore.Http.Extensions.Tests (3)
HeaderDictionaryTypeExtensionsTest.cs (1)
311if (results.Count > 0)
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (2)
217Assert.Equal(3, elements.Count); 254Assert.Equal(3, elements.Count);
Microsoft.AspNetCore.Http.Features (2)
CookieOptions.cs (2)
46if (options._extensions?.Count > 0) 124if (_extensions?.Count > 0)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
RequestDelegateGenerator.cs (1)
51.Where(endpoint => endpoint.Diagnostics.Count == 0)
RequestDelegateGeneratorSuppressor.cs (1)
76if (endpoint.Diagnostics.Count == 0)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
35for (var i = 0; i < _weakReferencedEntries.Count; i++)
StaticRouteHandlerModel\Endpoint.cs (1)
59if (Diagnostics.Count > 0)
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (1)
322else if (potentialImplicitBodyParameters.Count > 0)
Microsoft.AspNetCore.Http.Tests (1)
Features\RequestBodyPipeFeatureTests.cs (1)
60Assert.Equal(2, bufferLengths.Count);
Microsoft.AspNetCore.HttpLogging (10)
FileLoggerProcessor.cs (1)
127if (_currentBatch.Count > 0)
HttpLog.cs (3)
25public int Count => _keyValues.Count; 29var count = _keyValues.Count; 42var count = _keyValues.Count;
HttpLoggingMiddleware.cs (3)
143if (logContext.InternalParameters.Count > 0 && !options.CombineLogs) 236if (logContext.InternalParameters.Count > 0) 343if (logContext.InternalParameters.Count > 0 && !options.CombineLogs)
MediaTypeHelpers.cs (2)
25if (mediaTypeList == null || mediaTypeList.Count == 0 || string.IsNullOrEmpty(contentType)) 49for (var i = 0; i < SupportedEncodings.Count; i++)
W3CLoggingMiddleware.cs (1)
182for (var i = 0; i < additionalRequestHeaders.Count; i++)
Microsoft.AspNetCore.HttpLogging.Tests (3)
HttpLoggingOptionsTests.cs (3)
13Assert.Equal(5, defaultMediaTypes.Count); 29Assert.Equal(6, defaultMediaTypes.Count); 41Assert.Equal(6, defaultMediaTypes.Count);
Microsoft.AspNetCore.HttpsPolicy.Tests (2)
HttpsRedirectionMiddlewareTests.cs (2)
272Assert.Equal(2, logMessages.Count); 360Assert.Equal(2, logMessages.Count);
Microsoft.AspNetCore.Identity.FunctionalTests (5)
MapIdentityApiTests.cs (5)
556Assert.Equal(2, emailSender.Emails.Count); 972Assert.Equal(2, emailSender.Emails.Count); 980Assert.Equal(3, emailSender.Emails.Count); 1075Assert.Equal(2, emailSender.Emails.Count); 1160Assert.Equal(2, emailSender.Emails.Count);
Microsoft.AspNetCore.Identity.Specification.Tests (3)
IdentitySpecificationTestBase.cs (2)
331Assert.Equal(roles.Count, manager.Roles.Count(func)); 409Assert.Equal(roles.Count, rs.Count);
UserManagerSpecificationTests.cs (1)
941Assert.Equal(users.Count, mgr.Users.Count(UserNameStartsWithPredicate("CanFindUsersViaUserQueryable")));
Microsoft.AspNetCore.Identity.Test (1)
PasswordValidatorTest.cs (1)
169if (errors.Count == 0)
Microsoft.AspNetCore.JsonPatch (3)
JsonPatchDocument.cs (1)
202var allOps = new List<Operation>(Operations?.Count ?? 0);
JsonPatchDocumentOfT.cs (2)
638var allOps = new List<Operation>(Operations?.Count ?? 0); 667if (segments.Count == 0)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (3)
JsonPatchDocument.cs (1)
202var allOps = new List<Operation>(Operations?.Count ?? 0);
JsonPatchDocumentOfT.cs (2)
639var allOps = new List<Operation>(Operations?.Count ?? 0); 668if (segments.Count == 0)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (6)
Internal\ListAdapterTest.cs (6)
55var position = targetObject.Count.ToString(CultureInfo.InvariantCulture); 63Assert.Equal(3, targetObject.Count); 136Assert.Equal(expected.Count, targetObject.Count); 154Assert.Equal(3, targetObject.Count); 174Assert.Equal(2, targetObject.Count);
Microsoft.AspNetCore.JsonPatch.Tests (6)
Internal\ListAdapterTest.cs (6)
55var position = targetObject.Count.ToString(CultureInfo.InvariantCulture); 63Assert.Equal(3, targetObject.Count); 136Assert.Equal(expected.Count, targetObject.Count); 154Assert.Equal(3, targetObject.Count); 174Assert.Equal(2, targetObject.Count);
Microsoft.AspNetCore.Localization (1)
AcceptLanguageHeaderRequestCultureProvider.cs (1)
46if (orderedLanguages.Count > 0)
Microsoft.AspNetCore.Mvc.Abstractions (6)
ModelBinding\ModelStateDictionary.cs (6)
648for (var i = 0; i < node.ChildNodes.Count; i++) 933var high = ChildNodes.Count - 1; 1051if (_rootNode.ChildNodes?.Count > 0) 1068while (_nodes.Count > 0) 1071if (_index == node.ChildNodes!.Count - 1) 1084if (currentChild.ChildNodes?.Count > 0)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (2)
2850if (SupportedTypes.Count == 0) 2876if (SupportedTypes.Count == 0)
Microsoft.AspNetCore.Mvc.Core (54)
ActionConstraints\ActionConstraintCache.cs (5)
70for (var i = 0; i < items.Count; i++) 102var items = new List<ActionConstraintItem>(entry.Items!.Count); 103for (var i = 0; i < entry.Items.Count; i++) 139for (var i = 0; i < items.Count; i++) 154for (var i = 0; i < items.Count; i++)
ApplicationModels\ActionAttributeRouteModel.cs (3)
78else if (controllerSelectors.Count > 0) 80for (var i = 0; i < controllerSelectors.Count; i++) 165else if (controllerAttributeRoutes.Count > 0)
ApplicationModels\ApplicationModelFactory.cs (6)
103if (namedRoutedErrors.Count > 0) 109if (routeTemplateErrors.Count > 0) 234for (var i = 1; i < actions.Count; i++) 263for (var i = 0; i < actions.Count; i++) 297var actionDescriptions = new List<string>(actions.Count); 298for (var i = 0; i < actions.Count; i++)
ApplicationModels\DefaultApplicationModelProvider.cs (1)
577if (routeProviders.Count == 0 && !createSelectorForSilentRouteProviders)
ApplicationModels\InferParameterBindingInfoConvention.cs (2)
93if (fromBodyParameters.Count > 1) 105else if (fromBodyParameters.Count == 1 &&
Filters\FilterFactory.cs (3)
27for (var i = 0; i < orderedFilters.Count; i++) 111for (var i = 0; i < filterItems.Count; i++) 127for (int i = 0; i < filterItems.Count; i++)
Filters\MiddlewareFilterConfigurationProvider.cs (1)
45if (selectedMethods.Count > 1)
Infrastructure\ActionSelectionTable.cs (1)
179Debug.Assert(matches.Count >= 0);
Infrastructure\ActionSelector.cs (2)
230if (actionsWithConstraint.Count > 0) 240if (actionsWithoutConstraint.Count == 0)
Infrastructure\DefaultOutputFormatterSelector.cs (2)
77if (acceptableMediaTypes.Count == 0) 153for (var i = 0; i < result.Count; i++)
ModelBinding\Binders\CollectionModelBinder.cs (1)
379if (boundCollection.Count > _maxModelBindingCollectionSize)
ModelBinding\CompositeValueProvider.cs (2)
196if (filteredValueProviders.Count == 0) 248if (filteredValueProviders.Count == 0)
ModelBinding\Validation\ClientValidatorCache.cs (5)
52for (var i = 0; i < items.Count; i++) 85var items = new List<ClientValidatorItem>(entry.Items.Count); 86for (var i = 0; i < entry.Items.Count; i++) 114for (var i = 0; i < items.Count; i++) 129for (var i = 0; i < items.Count; i++)
ModelBinding\Validation\ValidationStack.cs (5)
14public int Count => HashSet?.Count ?? List.Count; 38if (HashSet == null && List.Count > CutOff) 56Debug.Assert(ReferenceEquals(List[List.Count - 1], model)); 57List.RemoveAt(List.Count - 1); 64for (var i = 0; i < List.Count; i++)
ModelBinding\Validation\ValidationVisitor.cs (1)
229var resultsCount = results.Count;
ModelBinding\Validation\ValidatorCache.cs (5)
42for (var i = 0; i < items.Count; i++) 75var items = new List<ValidatorItem>(entry.Items.Count); 76for (var i = 0; i < entry.Items.Count; i++) 103for (var i = 0; i < items.Count; i++) 119for (int i = 0; i < items.Count; i++)
Routing\ActionConstraintMatcherPolicy.cs (2)
255if (endpointsWithConstraint.Count > 0) 265if (endpointsWithoutConstraint.Count == 0)
Routing\AttributeRoute.cs (1)
161if (errors.Count > 0)
Routing\ControllerActionEndpointDataSource.cs (2)
102if (_routes.Count > 0) 116for (var i = 0; i < _routes.Count; i++)
Routing\ViewEnginePath.cs (3)
87if (pathSegments.Count == 0) 93pathSegments.RemoveAt(pathSegments.Count - 1); 107for (var i = 0; i < pathSegments.Count; i++)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
330if (keyValuePairs.Count > 0)
Microsoft.AspNetCore.Mvc.Core.Test (2)
DependencyInjection\MvcBuilderExtensionsTest.cs (2)
97Assert.Equal(3, services.Count); 128Assert.Equal(3, collection.Count);
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
DataAnnotationsModelValidator.cs (1)
120if (validationResults.Count == 0)
Microsoft.AspNetCore.Mvc.FunctionalTests (20)
ApiExplorerTest.cs (11)
431Assert.Equal(2, result.Count); 454Assert.Equal(2, result.Count); 628Assert.Equal(2, description.SupportedResponseTypes.Count); 660Assert.Equal(2, description.SupportedResponseTypes.Count); 692Assert.Equal(2, description.SupportedResponseTypes.Count); 724Assert.Equal(2, description.SupportedResponseTypes.Count); 981Assert.Equal(2, parameters.Count); 1006Assert.Equal(2, parameters.Count); 1030Assert.Equal(2, parameters.Count); 1054Assert.Equal(2, parameters.Count); 1078Assert.Equal(7, parameters.Count);
AsyncEnumerableTestBase.cs (1)
51Assert.Equal(10, projects.Count);
JsonPatchInputFormatterTest.cs (5)
49Assert.Equal(3, product.Reviews.Count); 69Assert.Equal(2, product.Reviews.Count); 89Assert.Equal(2, product.Reviews.Count); 110Assert.Equal(2, product.Reviews.Count); 131Assert.Equal(2, product.Reviews.Count);
TempDataInCookiesTest.cs (2)
38if (tempDataSerializers.Count == 1 && tempDataSerializers[0].ImplementationType.FullName == "Microsoft.AspNetCore.Mvc.NewtonsoftJson.BsonTempDataSerializer") 50throw new Exception($"Expected exactly one instance of TempDataSerializer based on NewtonsoftJson, but found {tempDataSerializers.Count} instance(s):" + Environment.NewLine + builder);
XmlDataContractSerializerInputFormatterTest.cs (1)
105Assert.Equal(expectedErrorMessages.Count(), modelBindingInfo.ModelStateErrorMessages.Count);
Microsoft.AspNetCore.Mvc.Localization.Test (2)
HtmlLocalizerTest.cs (1)
244Assert.Equal(2, allLocalizedStrings.Count);
ViewLocalizerTest.cs (1)
160Assert.Equal(2, allLocalizedStrings.Count);
Microsoft.AspNetCore.Mvc.Razor (1)
RazorView.cs (1)
221if (renderedLayouts.Count > 0 &&
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
TestInfrastructure\DirectoryNode.cs (1)
146for (var i = 0; i < parentDirectory.Directories.Count; i++)
Microsoft.AspNetCore.Mvc.Razor.Test (2)
DependencyInjection\MvcRazorMvcBuilderExtensionsTest.cs (1)
52Assert.Equal(3, collection.Count);
DependencyInjection\MvcRazorMvcCoreBuilderExtensionsTest.cs (1)
92Assert.Equal(3, collection.Count);
Microsoft.AspNetCore.Mvc.RazorPages (5)
Infrastructure\DefaultPageHandlerMethodSelector.cs (4)
17if (handlers == null || handlers.Count == 0) 26for (var i = 0; i < handlers.Count; i++) 100if (candidates.Count == 0) 118for (var i = candidates.Count - 1; i >= 0; i--)
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
157for (var j = 0; j < loadedEndpoints.Count; j++)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\PageActionInvokerProviderTest.cs (1)
460Assert.Equal(2, factories.Count);
Microsoft.AspNetCore.Mvc.TagHelpers (2)
CacheTagHelper.cs (1)
261for (var i = 0; i < Buffer.Pages.Count; i++)
TagHelperOutputExtensions.cs (1)
246if (listOfClasses.Count > 0)
Microsoft.AspNetCore.Mvc.ViewFeatures (13)
AttributeDictionary.cs (1)
57public int Count => _items == null ? 0 : _items.Count;
Buffers\MemoryPoolViewBufferScope.cs (4)
49if (_available != null && _available.Count > 0) 51segment = _available[_available.Count - 1]; 52_available.RemoveAt(_available.Count - 1); 105for (var i = 0; i < _leased.Count; i++)
Buffers\PagedBufferedTextWriter.cs (1)
53var count = pages.Count;
Buffers\PagedCharBuffer.cs (4)
29var fullPages = pages.Count - 1; 105for (var i = pages.Count - 1; i > 0; i--) 120CurrentPage = pages.Count > 0 ? pages[0] : null; 154var count = pages.Count;
Buffers\ViewBuffer.cs (1)
53return _multiplePages.Count;
Filters\SaveTempDataPropertyFilterBase.cs (1)
112if (errorMessages.Count > 0)
ValidationHelpers.cs (1)
64if (entries.Count < modelStateDictionary.Count)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensionsTest.cs (1)
143Assert.Equal(3, collection.Count);
Microsoft.AspNetCore.OpenApi (13)
Services\OpenApiDocumentService.cs (7)
63var schemaTransformers = _options.SchemaTransformers.Count > 0 64? new IOpenApiSchemaTransformer[_options.SchemaTransformers.Count] 66var operationTransformers = _options.OperationTransformers.Count > 0 ? 67new IOpenApiOperationTransformer[_options.OperationTransformers.Count] 111for (var i = 0; i < _options.DocumentTransformers.Count; i++) 120for (var i = 0; i < _options.SchemaTransformers.Count; i++) 133for (var i = 0; i < _options.OperationTransformers.Count; i++)
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.OpenApi.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.OpenApi.SourceGenerators (9)
XmlCommentGenerator.Emitter.cs (9)
587if (comment.Examples is null || comment.Examples.Count == 0) 594for (var i = 0; i < comment.Examples.Count; i++) 598if (i < comment.Examples.Count - 1) 606if (comment.Parameters is null || comment.Parameters.Count == 0) 613for (var i = 0; i < comment.Parameters.Count; i++) 625if (i < comment.Parameters.Count - 1) 633if (comment.Responses is null || comment.Responses.Count == 0) 640for (var i = 0; i < comment.Responses.Count; i++) 647if (i < comment.Responses.Count - 1)
Microsoft.AspNetCore.OutputCaching (2)
OutputCachePolicyBuilder.cs (2)
295if (_policies.Count != 1 || _policies[0] != DefaultPolicy.Instance) 322var policies = _policies.Count switch
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.OutputCaching.Tests (2)
TestUtils.cs (2)
260Assert.Equal(expectedMessages.Length, messageList.Count); 262for (var i = 0; i < messageList.Count; i++)
Microsoft.AspNetCore.Owin.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Owin.Tests (2)
OwinEnvironmentTests.cs (2)
194Assert.Equal(owinEnvironment1.ToList().Count + 1, owinEnvironment2.ToList().Count);
Microsoft.AspNetCore.RateLimiting (1)
DefaultCombinedLease.cs (1)
89if (exceptions.Count == 1)
Microsoft.AspNetCore.Razor (5)
TagHelpers\DefaultTagHelperContent.cs (5)
34Debug.Assert(_buffer.Count == 0); 65for (var i = 0; i < (_buffer?.Count ?? 0); i++) 111for (var i = 0; i < (_buffer?.Count ?? 0); i++) 134for (var i = 0; i < (_buffer?.Count ?? 0); i++) 195for (var i = 0; i < (_buffer?.Count ?? 0); i++)
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperScopeManager.cs (1)
128if (_nextIndex == _executionContexts.Count)
Microsoft.AspNetCore.Razor.Test (4)
TagHelpers\DefaultTagHelperContentTest.cs (4)
116Assert.Equal(3, items.Count); 142Assert.Equal(3, items.Count); 166Assert.Equal(3, items.Count); 194Assert.Equal(3, items.Count);
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.RequestDecompression.Tests (1)
RequestDecompressionMiddlewareTests.cs (1)
249Assert.Equal(2, logMessages.Count);
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.ResponseCaching.Tests (2)
TestUtils.cs (2)
246Assert.Equal(messageList.Count, expectedMessages.Length); 248for (var i = 0; i < messageList.Count; i++)
Microsoft.AspNetCore.ResponseCompression.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.ResponseCompression.Tests (9)
ResponseCompressionMiddlewareTest.cs (9)
109Assert.Equal(3, logMessages.Count); 193Assert.Equal(2, logMessages.Count); 281Assert.Equal(2, logMessages.Count); 358Assert.Equal(3, logMessages.Count); 383Assert.Equal(3, logMessages.Count); 395Assert.Equal(2, logMessages.Count); 409Assert.Equal(2, logMessages.Count); 427Assert.Equal(2, logMessages.Count); 1338Assert.Equal(3, logMessages.Count);
Microsoft.AspNetCore.Rewrite (5)
BackReferenceCollection.cs (2)
32if (index < _backReferences.Count) 38throw new ArgumentOutOfRangeException(null, $"Cannot access back reference at index {index}. Only {_backReferences.Count} back references were captured.");
IISUrlRewrite\ConditionCollection.cs (3)
26public int Count => _conditions.Count; 32if (index < _conditions.Count) 36throw new ArgumentOutOfRangeException(null, $"Cannot access condition at index {index}. Only {_conditions.Count} conditions were captured.");
Microsoft.AspNetCore.Routing (68)
CompositeEndpointDataSource.cs (1)
126if (_changeTokenRegistrations is { Count: > 0 })
DefaultLinkGenerator.cs (7)
81if (endpoints.Count == 0) 104if (endpoints.Count == 0) 133if (endpoints.Count == 0) 166if (endpoints.Count == 0) 187if (endpoints.Count == 0) 208for (var i = 0; i < endpoints.Count; i++) 244for (var i = 0; i < endpoints.Count; i++)
DefaultLinkParser.cs (5)
51if (endpoints.Count == 0) 56for (var i = 0; i < endpoints.Count; i++) 75if (endpoints.Count == 0) 105if (constraintsForParameter.Count > 0) 132for (var i = 0; i < kvp.Value.Count; i++)
Matching\DfaMatcherBuilder.cs (10)
72var work = new List<DfaBuilderWorkerWorkItem>(_endpoints.Count); 79for (var i = 0; i < _endpoints.Count; i++) 178_workCount = work.Count; 204for (var j = 0; j < parents.Count; j++) 213if (nextWorkCount < nextWork.Count) 239if (nextParents.Count > 0) 257for (var i = 0; i < parents.Count; i++) 650if (node.Matches?.Count > 0) 879if (node.Matches == null || node.Matches.Count == 0) 908for (var j = 0; j < work.Count; j++)
Matching\DfaNode.cs (1)
120builder.Append(Matches?.Count ?? 0);
Matching\HttpMethodMatcherPolicy.cs (2)
333if (destinations?.Count == 1) 343if (corsPreflightDestinations?.Count > 0)
Matching\NegotiationMatcherPolicy.cs (2)
298var result = new double[values.Count]; 299for (var i = 0; i < values.Count; i++)
ParameterPolicyActivator.cs (3)
121if (matchingConstructors.Count == 0) 129if (matchingConstructors.Count == 1) 161Debug.Assert(constructors.Count > 0);
Patterns\DefaultRoutePatternTransformer.cs (2)
220for (var i = 0; i < segments.Count; i++) 234for (var k = 0; k < parameters.Count; k++)
Patterns\RoutePatternFactory.cs (2)
504for (var i = 0; i < parameters.Count; i++) 628&& (parameterConstraints?.Count ?? 0) == 0)
Patterns\RoutePatternParser.cs (8)
319for (var i = 0; i < segments.Count; i++) 327(i != segments.Count - 1 || j != segment.Parts.Count - 1)) 341for (var i = 0; i < parts.Count; i++) 344if (part is RoutePatternParameterPart parameter && parameter.IsCatchAll && parts.Count > 1) 353for (var i = 0; i < parts.Count; i++) 357if (part is RoutePatternParameterPart parameter && parameter.IsOptional && parts.Count > 1) 360if (i == parts.Count - 1) 411for (var i = 0; i < parts.Count; i++)
RouteCollection.cs (2)
40get { return _routes.Count; } 129for (var i = 0; i < routes.Count; i++)
RouteConstraintBuilder.cs (1)
58if (kvp.Value.Count == 1)
RouteEndpointDataSource.cs (6)
97var endpoints = new RouteEndpoint[_routeEntries.Count]; 98for (int i = 0; i < _routeEntries.Count; i++) 108var endpoints = new RouteEndpoint[_routeEntries.Count]; 109for (var i = 0; i < _routeEntries.Count; i++) 121if (_routeEntries.Count is not 1) 123throw new InvalidOperationException($"There are {_routeEntries.Count} endpoints defined! This can only be called for a single endpoint.");
RouteGroupBuilder.cs (2)
63return _routeGroupBuilder._dataSources.Count switch 71public override IChangeToken GetChangeToken() => _routeGroupBuilder._dataSources.Count switch
Template\RoutePrecedence.cs (2)
151if (segment.Parts.Count > 1) 217if (segment.Parts.Count > 1)
Template\RouteTemplate.cs (3)
42for (var j = 0; j < segment.Parts.Count; j++) 68for (var i = 0; i < segments.Count; i++) 71for (var j = 0; j < segment.Parts.Count; j++)
Template\TemplateSegment.cs (1)
43public bool IsSimple => Parts.Count == 1;
Tree\LinkGenerationDecisionTree.cs (2)
70if (_root.Matches.Count > 0 || _root.Criteria.Count > 0 || _conventionalEntries.Count > 0) 164for (var i = 0; i < _conventionalEntries.Count; i++)
Tree\TreeEnumerator.cs (2)
48if (next.IsCatchAll && next.Matches.Count > 0) 58if (next.Matches.Count > 0)
Tree\UrlMatchingTree.cs (1)
98Debug.Assert(segment.Parts.Count == 1);
UriBuildingContext.cs (2)
88for (var i = 0; i < buffer.Count; i++) 178if (_path.Length != 0 || _buffer.Count != 0)
ValidationEndpointFilterFactory.cs (1)
55if (validatableParameters is null || validatableParameters.Count == 0)
Microsoft.AspNetCore.Routing.Abstractions (4)
RouteData.cs (4)
143var count = _routers?.Count; 259for (var i = routers.Count - 1; i >= 0; i--) 277for (; i < snapshotRouters.Count && i < routers.Count; i++) 288for (i = routers.Count - 1; i >= snapshotRouters.Count; i--)
Microsoft.AspNetCore.Routing.Microbenchmarks (3)
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcherBuilder.cs (2)
20var matchers = new InnerMatcher[_endpoints.Count]; 21for (var i = 0; i < _endpoints.Count; i++)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Routing.Tests (12)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (2)
210Assert.Equal(2, matcherEndpointDataSources.Count); 276Assert.Equal(2, matcherEndpointDataSources.Count);
Matching\BarebonesMatcherBuilder.cs (2)
20var matchers = new InnerMatcher[_endpoints.Count]; 21for (var i = 0; i < _endpoints.Count; i++)
RouteValuesAddressSchemeTest.cs (5)
24Assert.Equal(2, allMatches.Count); 44Assert.Equal(3, allMatches.Count); 46Assert.Equal(2, namedMatches.Count); 64Assert.Equal(3, allMatches.Count); 66Assert.Equal(2, namedMatches.Count);
Template\TemplateParserTests.cs (3)
835if (x.Segments[i].Parts.Count != y.Segments[i].Parts.Count) 840for (int j = 0; j < x.Segments[i].Parts.Count; j++)
Microsoft.AspNetCore.Security.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Server.HttpSys (4)
RequestProcessing\RequestContext.FeatureCollection.cs (2)
645for (var i = actions.Count - 1; i >= 0; i--) 736for (var i = actions.Count - 1; i >= 0; i--)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
src\Shared\Http2cat\Http2Utilities.cs (2)
416var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; 450var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Server.IIS (5)
Core\IISHttpContext.FeatureCollection.cs (3)
62for (var i = 0; i < MaybeExtra.Count; i++) 81for (var i = 0; i < MaybeExtra.Count; i++) 96for (var i = 0; i < MaybeExtra.Count; i++)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Core (39)
Internal\Http\Http1OutputProducer.cs (1)
542Debug.Assert(_completedSegments == null || _completedSegments.Count == 0);
Internal\Http\HttpProtocol.Generated.cs (3)
137for (var i = 0; i < MaybeExtra.Count; i++) 156for (var i = 0; i < MaybeExtra.Count; i++) 171for (var i = 0; i < MaybeExtra.Count; i++)
Internal\Http2\Http2FrameWriter.cs (1)
912var settingsSize = settings.Count * Http2FrameReader.SettingSize;
Internal\Infrastructure\KestrelEventSource.cs (2)
266for (var i = _options.Count - 1; i >= 0; i--) 363for (var i = _options.Count - 1; i >= 0; i--)
Internal\Infrastructure\KestrelMetrics.cs (1)
126for (var i = 0; i < customTags.Count; i++)
Internal\Infrastructure\TransportManager.cs (6)
37if (_transportFactories.Count == 0) 66if (_multiplexedTransportFactories.Count == 0) 126var tasks = new Task[transportsToStop.Count]; 128for (int i = 0; i < transportsToStop.Count; i++) 148for (int i = 0; i < transportsToStop.Count; i++) 155for (int i = 0; i < transportsToStop.Count; i++)
Internal\KestrelServerImpl.cs (9)
63if (_transportFactories.Count == 0 && _multiplexedTransportFactories.Count == 0) 176if (hasHttp3 && _multiplexedTransportFactories.Count == 0 && !(hasHttp1 || hasHttp2)) 183var addAltSvcHeader = !options.DisableAltSvcHeader && _multiplexedTransportFactories.Count > 0; 192if (_transportFactories.Count == 0) 206if (hasHttp3 && _multiplexedTransportFactories.Count > 0) 352if (endpointsToStop.Count > 0) 366var configsToStop = new List<EndpointConfig>(endpointsToStop.Count); 380if (endpointsToStart.Count > 0)
Internal\ServerAddressesCollection.cs (1)
33return _addresses.Count;
KestrelConfigurationLoader.cs (1)
404if (matchingBoundEndpoints.Count > 0)
KestrelServerOptions.cs (3)
79int resultCount = CodeBackedListenOptions.Count + ConfigurationBackedListenOptions.Count; 87ConfigurationBackedListenOptions.CopyTo(result, CodeBackedListenOptions.Count);
ListenOptions.cs (2)
197for (var i = _middleware.Count - 1; i >= 0; i--) 213for (int i = _multiplexedMiddleware.Count - 1; i >= 0; i--)
LocalhostListenOptions.cs (1)
61if (exceptions.Count == 2)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
886var certificatesDescription = list.Count switch 890_ => $"{list.Count} certificates",
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
118if (nssDbs.Count > 0) 285if (nssDbs.Count > 0) 421if (nssDbs.Count > 0)
src\Shared\Metrics\MetricsExtensions.cs (1)
39for (var i = 0; i < list.Count; i++)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (7)
KestrelServerTests.cs (3)
833Assert.Equal(2, mockTransports.Count); 854Assert.Equal(4, mockTransports.Count); 883Assert.Equal(5, mockTransports.Count);
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (1)
423if (_revocationList?.Count > 0)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
24var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
68logger.LogInformation("Found {count} unavailable endpoints.", unavailableEndpoints.Count);
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
190int expectedCount = Math.Min(finalMaxSize / 64, headers.Count);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (5)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
24var payload = new byte[settings.Count * Http2FrameReader.SettingSize];
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
76for (var i = 0; i < MaybeExtra.Count; i++) 95for (var i = 0; i < MaybeExtra.Count; i++) 110for (var i = 0; i < MaybeExtra.Count; i++)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.Server.Kestrel.Tests (5)
KestrelConfigurationLoaderTests.cs (5)
1503Assert.Equal(2, serverOptions.ConfigurationBackedListenOptions.Count); 1519Assert.Equal(2, endpointsToStart.Count); 1523Assert.Equal(3, serverOptions.ConfigurationBackedListenOptions.Count); 1763Assert.Equal(numEndpointsToAdd, serverOptions.CodeBackedListenOptions.Count); 1776Assert.Equal(numEndpointsToAdd, serverOptions.CodeBackedListenOptions.Count);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (5)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
76for (var i = 0; i < MaybeExtra.Count; i++) 95for (var i = 0; i < MaybeExtra.Count; i++) 110for (var i = 0; i < MaybeExtra.Count; i++)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (11)
Internal\QuicConnectionListener.cs (2)
48if (tlsConnectionCallbackOptions.ApplicationProtocols.Count == 0) 112if (serverAuthenticationOptions.ApplicationProtocols == null || serverAuthenticationOptions.ApplicationProtocols.Count == 0)
QuicTransportFactory.cs (1)
48if (tlsConnectionOptions.ApplicationProtocols == null || tlsConnectionOptions.ApplicationProtocols.Count == 0)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
76for (var i = 0; i < MaybeExtra.Count; i++) 95for (var i = 0; i < MaybeExtra.Count; i++) 110for (var i = 0; i < MaybeExtra.Count; i++)
src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (3)
63for (var i = 0; i < MaybeExtra.Count; i++) 82for (var i = 0; i < MaybeExtra.Count; i++) 97for (var i = 0; i < MaybeExtra.Count; i++)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (2)
QuicConnectionContextTests.cs (1)
268if (data.Count == TestData.Length)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
68logger.LogInformation("Found {count} unavailable endpoints.", unavailableEndpoints.Count);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (3)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
76for (var i = 0; i < MaybeExtra.Count; i++) 95for (var i = 0; i < MaybeExtra.Count; i++) 110for (var i = 0; i < MaybeExtra.Count; i++)
Microsoft.AspNetCore.Session.Tests (2)
SessionTests.cs (2)
368Assert.Equal(2, sessionLogMessages.Count); 434Assert.Equal(3, sessionLogMessages.Count);
Microsoft.AspNetCore.Shared.Tests (3)
runtime\Http2\DynamicTableTest.cs (1)
190int expectedCount = Math.Min(finalMaxSize / 64, headers.Count);
SegmentWriteStreamTests.cs (2)
56Assert.Equal((WriteData.Length + segmentSize - 1) / segmentSize, segments.Count); 89Assert.Equal((WriteData.Length + segmentSize - 1) / segmentSize, segments.Count);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (10)
HubConnectionTests.cs (8)
624Assert.True(results.Count > 0 && results.Count < 1000); 908Assert.True(results.Count > 0 && results.Count < 1000); 950Assert.True(results.Count > 0 && results.Count < 1000); 988Assert.True(results.Count > 0 && results.Count < 1000);
HubConnectionTests.Tracing.cs (2)
417Assert.True(results.Count > 0 && results.Count < 1000);
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (1)
HubClientProxyGenerator.Emitter.cs (1)
140var registrations = new System.IDisposable[{typeSpec.Methods.Count}];");
Microsoft.AspNetCore.SignalR.Client.Tests (15)
HttpConnectionTests.cs (1)
161Assert.Equal(2, writeList.Count);
HubConnectionTests.Reconnect.cs (7)
169Assert.Equal(2, retryContexts.Count); 267Assert.Equal(2, retryContexts.Count); 451Assert.Equal(2, retryContexts.Count); 752if (retryContexts.Count == 2) 810Assert.Equal(2, retryContexts.Count); 859if (retryContexts.Count == 2) 929Assert.Equal(2, retryContexts.Count);
LongPollingTransportTests.cs (1)
442Assert.Equal(3, sentRequests.Count);
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.SignalR.Common (6)
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Internal\Formatters\BinaryMessageParserTests.cs (1)
107Assert.Equal(2, messages.Count);
Internal\Protocol\Utf8BufferTextWriterTests.cs (1)
391if (CurrentSegment.IsEmpty && _completedSegments.Count == 0)
Microsoft.AspNetCore.SignalR.Core (3)
HubOptionsSetup.cs (1)
68options.SupportedProtocols = new List<string>(_defaultProtocols.Count);
Internal\DefaultHubDispatcher.cs (2)
52var count = hubFilters?.Count ?? 0; 349var serverStreamLength = descriptor.StreamingParameters?.Count ?? 0;
Microsoft.AspNetCore.SignalR.Microbenchmarks (2)
Shared\TestPipeReader.cs (1)
37if (ReadResults.Count == 0)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (6)
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (6)
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.SignalR.Specification.Tests (6)
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (7)
Internal\DefaultHubMessageSerializer.cs (1)
29var list = new List<SerializedMessage>(_hubProtocols.Count);
src\SignalR\common\Shared\MemoryBufferWriter.cs (6)
85for (var i = 0; i < _completedSegments.Count; i++) 128var count = _completedSegments.Count; 196var count = _completedSegments.Count; 232var count = _completedSegments.Count; 261var count = _completedSegments.Count; 375for (var i = 0; i < Segments.Count; i++)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
TestConnectionMultiplexer.cs (1)
257return handlers != null ? handlers.Count : 0;
Microsoft.AspNetCore.SignalR.Tests (1)
HubConnectionHandlerTests.cs (1)
5462if (result.Count == count)
Microsoft.AspNetCore.SignalR.Tests.Utils (6)
ChannelExtensions.cs (4)
46while (items.Count < minimumCount) 51if (items.Count >= minimumCount) 62throw new InvalidOperationException($"Channel ended after writing {items.Count} items."); 67throw new OperationCanceledException($"ReadAtLeastAsync canceled with {items.Count} of {minimumCount} items.");
src\Shared\SignalR\VerifyNoErrorScope.cs (2)
43if (results.Count > 0) 45string errorMessage = $"{results.Count} error(s) logged.";
Microsoft.AspNetCore.StaticAssets (2)
Development\StaticAssetDevelopmentRuntimeHandler.cs (2)
147for (var i = 0; i < descriptors.Count; i++) 294if (propertiesList.Count < descriptor.Properties.Count)
Microsoft.AspNetCore.Tests (3)
WebApplicationTests.cs (3)
208Assert.Equal(2, urls.Count); 247Assert.Equal(2, urls.Count); 299Assert.Equal(2, startOrder.Count);
Microsoft.AspNetCore.WebSockets.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.WebUtilities (7)
PagedByteBuffer.cs (7)
68for (var i = 0; i < Pages.Count; i++) 71var length = (i == Pages.Count - 1) ? 85for (var i = 0; i < Pages.Count; i++) 88var length = (i == Pages.Count - 1) ? 102for (var i = 0; i < Pages.Count; i++) 105var length = (i == Pages.Count - 1) ? 126for (var i = 0; i < Pages.Count; i++)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.WebUtilities.Tests (1)
PagedByteBufferTest.cs (1)
91Assert.Equal(2, buffer.Pages.Count);
Microsoft.Build (184)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (7)
218TraceEngine("CFB: Cleaning up build. Requests Count {0} Status {1}", _requests.Count, _status); 224var deactivateExceptions = new List<Exception>(_requests.Count); 231var requestsToWait = new List<BuildRequestEntry>(_requests.Count); 281if (deactivateExceptions.Count > 0) 572if (requestsToIssue.Count != 0) 781if (completedEntries.Count > 0) 1297ErrorUtilities.VerifyThrow((requestsToIssue == null) || (requestsToIssue.Count == 0), "Entry shouldn't be ready if we also issued requests.");
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (2)
312for (int i = 0; i < _requestsToIssue.Count; i++) 317if (_requestsToIssue.Count == 0)
BackEnd\Components\Caching\ResultsCache.cs (2)
195if (request.Targets.Count == 0) 211if (request.Targets.Count > 0)
BackEnd\Components\Communications\NodeManager.cs (3)
103if (nodes.Count < numberOfNodesToCreate && (nodeAffinity == NodeAffinity.Any || nodeAffinity == NodeAffinity.OutOfProc)) 105nodes.AddRange(AttemptCreateNode(_outOfProcNodeProvider!, configuration, numberOfNodesToCreate - nodes.Count)); 109if (nodes.Count > 0)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (2)
118Task[] waitForExitTasks = waitForExit && contextsToShutDown.Count > 0 ? new Task[contextsToShutDown.Count] : null;
BackEnd\Components\Logging\LoggingService.cs (1)
1062if (_loggers.Count > 0)
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
823if (projectCacheDescriptors.Count == 0) 856Task[] tasks = new Task[projectCacheDescriptors.Count];
BackEnd\Components\RequestBuilder\BatchingEngine.cs (5)
173if ((buckets == null) || (buckets.Count == 0)) 177var bucket = new ItemBucket(null, null, lookup, buckets.Count); 342matchingBucket = new ItemBucket(itemListsToBeBatched.Keys, itemMetadataValues, lookup, buckets.Count); 365var orderedBuckets = new List<ItemBucket>(buckets.Count); 366for (int i = 0; i < buckets.Count; ++i)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (5)
87if (keepMetadataEvaluated.Count > 0) 96if (removeMetadataEvaluated.Count > 0) 105if (matchOnMetadataEvaluated.Count > 0) 221if (LogTaskInputs && !LoggingContext.LoggingService.OnlyLogCriticalEvents && itemsToAdd?.Count > 0) 271if (LogTaskInputs && !LoggingContext.LoggingService.OnlyLogCriticalEvents && itemsToRemove.Count > 0)
BackEnd\Components\RequestBuilder\Lookup.cs (2)
565itemsCount += allAdds?.Count ?? 0; // Add all the additions 566itemsCount -= allRemoves?.Count ?? 0; // Remove the removals
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
764bool pushedTargets = (targetsToPush.Count > 0);
BackEnd\Components\RequestBuilder\TargetEntry.cs (2)
431int numberOfBuckets = buckets.Count; 646if (batchingBuckets.Count == 1)
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (14)
168if (targetOutputItemSpecs.Count == 0) 190if (itemVectorsReferencedOnlyInTargetOutputs.Count == 0) 205ErrorUtilities.VerifyThrow(itemVectorsReferencedInBothTargetInputsAndOutputs.Count > 0, "The target must have inputs."); 229((itemVectorsReferencedOnlyInTargetOutputs?.Count > 0))) 273if (result == DependencyAnalysisResult.FullBuild && _dependencyAnalysisDetail.Count > 0) 548if (discreteTargetInputItemSpecs.Count > 0) 553if (inputs.Count == 0) 558if (outputs.Count == 0) 634if (upToDateInputItems.Count == outputItems.Count) 636for (int i = 0; i < upToDateInputItems.Count; i++) 714ErrorUtilities.VerifyThrow(numberOfInputItemVectorsWithAllChangedItems <= itemVectorsReferencedInBothTargetInputsAndOutputs.Count, 718if (numberOfInputItemVectorsWithAllChangedItems == itemVectorsReferencedInBothTargetInputsAndOutputs.Count) 751if (inputs.Count == 0) 756if (outputs.Count == 0)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (3)
321if (buckets.Count > 1) 329for (int i = 0; i < buckets.Count; i++) 772if (undeclaredProjects?.Count > 0)
BackEnd\Components\Scheduler\Scheduler.cs (8)
747if (_schedulingData.UnscheduledRequestsCount > 0 || responses.Count == 0) 805ErrorUtilities.VerifyThrow(responses.Count > 0, "We failed to request a node to be created."); 808TraceScheduler("Requests scheduled: {0} Unassigned Requests: {1} Blocked Requests: {2} Unblockable Requests: {3} Free Nodes: {4}/{5} Responses: {6}", nodesFreeToDoWorkPriorToScheduling - idleNodes.Count, _schedulingData.UnscheduledRequestsCount, _schedulingData.BlockedRequestsCount, _schedulingData.ReadyRequestsCount, idleNodes.Count, _availableNodes.Count, responses.Count); 2026request.Targets.Count == 0 2307if (firstTargetsSet.Count != secondTargetsList.Count) 2584for (int i = 0; i < childRequests.Count; i++) 2587WriteRecursiveSummary(loggingService, context, submissionId, childRequest, level + 1, useConfigurations, i == childRequests.Count - 1); 2661if (scheduledRequestsByNode.Count == 0)
BackEnd\Components\Scheduler\SchedulingPlan.cs (3)
276projectsInOrderOfReference.Sort(delegate (int left, int right) { return -Comparer<int>.Default.Compare(_configIdToPaths[left].Count, _configIdToPaths[right].Count); }); 279Console.WriteLine("{0}: {1} {2}", configId, _configIdToPaths[configId].Count, _configIdToData[configId].ConfigFullPath);
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (2)
68MSBuildEventSource.Log.SdkResolverLoadAllResolversStop(resolvers.Count); 264MSBuildEventSource.Log.SdkResolverLoadResolversStop(manifest.DisplayName ?? string.Empty, resolvers.Count);
BackEnd\Components\SdkResolution\SdkResolverService.cs (2)
199if (matchingResolversManifests.Count != 0) 253if (resolvers.Count == 1) // Check if only one resolver was used
BackEnd\Shared\BuildRequestConfiguration.cs (4)
788bool hasInitialTargets = request.Targets.Count == 0 ? false : true; 791_projectInitialTargets.Count + 792(hasInitialTargets ? _projectDefaultTargets.Count : request.Targets.Count));
BuildCheck\Infrastructure\BuildCheckCentralContext.cs (6)
65internal bool HasEvaluatedPropertiesActions => _globalCallbacks.EvaluatedPropertiesActions.Count > 0; 67internal bool HasParsedItemsActions => _globalCallbacks.ParsedItemsActions.Count > 0; 69internal bool HasTaskInvocationActions => _globalCallbacks.TaskInvocationActions.Count > 0; 71internal bool HasPropertyReadActions => _globalCallbacks.PropertyReadActions.Count > 0; 73internal bool HasPropertyWriteActions => _globalCallbacks.PropertyWriteActions.Count > 0; 75internal bool HasBuildFinishedActions => _globalCallbacks.BuildFinishedActions.Count > 0;
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (1)
109if (checksFactories.Count != 0)
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (2)
120var imArray = ImmutableArray.CreateBuilder<(int, int)>(numberRangePairs is null ? 0 : numberRangePairs.Count); 121if (numberRangePairs?.Count > 0)
BuildCheck\Infrastructure\EditorConfig\EditorConfigParser.cs (1)
82for (int i = editorConfigFiles.Count - 1; i >= 0; i--)
BuildEnvironmentHelper.cs (2)
301if (instances.Count == 0) 306if (instances.Count > 1)
CollectionHelpers.cs (3)
24List<T> inputsWithoutNulls = new List<T>(inputs.Count); 35return (inputsWithoutNulls.Count == inputs.Count) ? inputs : inputsWithoutNulls;
Collections\LookasideStringInterner.cs (1)
87index = _strings.Count; // This will be the index of the string we are about to add.
Collections\MultiDictionary.cs (3)
200return list.Count; 281for (int i = 0; i < list.Count; i++) 285if (list.Count == 2)
Collections\WeakValueDictionary.cs (1)
224return remove.Count;
Construction\ProjectElementContainer.cs (1)
801public int Count => RealizedElements.Count;
Construction\Solution\SolutionFile.cs (1)
907HashSet<string> projectPaths = new HashSet<string>(_projectsInOrder.Count, _pathComparer);
Construction\Solution\SolutionProjectGenerator.cs (2)
747var projectInstances = new List<ProjectInstance>(projectsInOrder.Count + 1); 1486if (project.ProjectReferences.Count > 0)
Definition\Project.cs (7)
2262var imports = new List<ResolvedImport>(_data.ImportClosure.Count - 1 /* outer project */); 2285var imports = new List<ResolvedImport>(_data.ImportClosureWithDuplicates.Count - 1 /* outer project */); 2571if (projectItemElements.Count == 0) 2596var removeElementCache = new Dictionary<string, CumulativeRemoveElementData>(projectItemElements.Count); 2597var globResults = new List<GlobResult>(projectItemElements.Count); 2599for (var i = projectItemElements.Count - 1; i >= 0; i--) 3544if (items.Count != 1)
Definition\ProjectCollection.cs (1)
2592if (projectList.Count == 0)
Definition\ProjectItem.cs (2)
349for (int i = _inheritedItemDefinitions.Count - 1; i >= 0; i--) 1069int inheritedItemDefinitionsCount = (source._inheritedItemDefinitions == null) ? 0 : source._inheritedItemDefinitions.Count;
Definition\Toolset.cs (3)
519if (orderedSubToolsetList.Count > 0) 521_defaultSubToolsetVersion = orderedSubToolsetList[orderedSubToolsetList.Count - 1]; 932int count = _environmentProperties.Count + reservedProperties.Count + Properties.Values.Count + _globalProperties.Count + 1;
Evaluation\Conditionals\FunctionCallExpressionNode.cs (2)
190_arguments.Count == expected, 194_arguments.Count,
Evaluation\Evaluator.cs (10)
673List<string> initialTargets = new List<string>(_initialTargetsList.Count); 761var targetElementsCount = _targetElements.Count; 762if (_data.DefaultTargets.Count == 0 && targetElementsCount > 0) 972for (int i = 0; i < temp.Count; i++) 977_data.DefaultTargets ??= new List<string>(temp.Count); 1574var pathsToSearch = new string[fallbackSearchPathMatch.SearchPaths.Count + 1]; 1670if (allProjects.Count == 0 && 1850if (projects?.Count > 0) 1863if (additionalProjects?.Count > 0) 2356if (imports?.Count > 0)
Evaluation\Expander.cs (17)
976if (itemVectorExpressions?.Count == 1 && itemVectorExpressions[0].Value == expression && itemVectorExpressions[0].Separator == null) 986if (itemVectorExpressions != null && itemVectorExpressions.Count > 0) 991for (int n = 0; n < itemVectorExpressions.Count; n++) 1884for (int i = 0; i < captures.Count; i++) 1982if (i < captures.Count - 1) 2064ErrorUtilities.VerifyThrow(matches.Count == 1, "Expected just one item vector"); 2127if (itemsFromCapture == null || itemsFromCapture.Count == 0) 2132result = new List<T>(itemsFromCapture.Count); 2242ProjectErrorUtilities.VerifyThrowInvalidProject(captures.Count > 0, elementLocation, "InvalidFunctionPropertyExpression"); 2290for (int i = 0; i < matches.Count; i++) 2350for (int i = 0; i < itemsFromCapture.Count; i++) 2373if (i < itemsFromCapture.Count - 1) 2470transformedItems.Add(new KeyValuePair<string, S>(Convert.ToString(itemsOfType.Count, CultureInfo.InvariantCulture), null /* no base item */)); 2676Dictionary<string, string> directoryNameTable = new Dictionary<string, string>(itemsOfType.Count, StringComparer.OrdinalIgnoreCase); 2816HashSet<string> seenItems = new HashSet<string>(itemsOfType.Count, comparer); 2834for (int i = itemsOfType.Count - 1; i >= 0; i--) 3582for (int i = list.Count - 1; i >= 0; i--)
Evaluation\ItemDataCollectionValue.cs (1)
58public bool IsEmpty => _value == null || (_value is List<I> list && list.Count == 0);
Evaluation\ItemSpec.cs (3)
102if (ReferencedItems.Count == 1) 315var result = new List<ItemSpecFragment>(Fragments.Count); 379if (Fragments.Count == 1)
Evaluation\LazyItemEvaluator.cs (1)
377for (i = 0; i < op.Spec.Fragments.Count; i++)
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
306if (itemSpec.Fragments.Count != 1)
FileMatcher.cs (2)
919if (files?.Count > 0) 2571if (searchesToExclude?.Count == 0)
Graph\GraphBuilder.cs (4)
276if (Solution.SolutionParserWarnings.Count != 0 || Solution.SolutionParserErrorCodes.Count != 0) 365if (solutionDependenciesForProject.Count > 0) 610for (var i = projectsInCycle.Count - 1; i >= 0; i--)
Graph\ParallelWorkSet.cs (2)
61if (_exceptions.Count > 0) 155if (_exceptions.Count > 0)
Graph\ProjectGraph.cs (3)
587ErrorUtilities.VerifyThrow(toposort.Count == graphNodes.Count, "sorted node count must be equal to total node count"); 810i += defaultTargets.Count; 824i += expandedTargets.Count;
Instance\ProjectInstance.cs (6)
801_properties = new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 802_globalProperties = new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 804new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 806new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 2974if (sp.SolutionParserComments.Count > 0) 3417inheritedItemDefinitions = new List<ProjectItemDefinitionInstance>(item.InheritedItemDefinitions.Count);
Instance\TaskFactories\TaskHostTask.cs (1)
452if (taskHostTaskComplete.FileAccessData?.Count > 0)
Logging\BaseConsoleLogger.cs (1)
461if (properties.Count == 0)
Logging\BinaryLogger\BuildEventArgsReader.cs (4)
485if (id >= 0 && id < nameValueListRecords.Count) 510$"NameValueList record number {_recordNumber} is invalid: index {id} is not within {nameValueListRecords.Count}."); 1712if (index >= 0 && index < this.stringRecords.Count) 1721$"String record number {_recordNumber} is invalid: string index {index} is not within {stringRecords.Count}.");
Logging\BinaryLogger\BuildEventArgsWriter.cs (6)
904count = reusableItemsList.Count; 992if (reusableProjectItemList.Count > 0) 1110if (nameValueListBuffer.Count == 0) 1151Write(nameValueIndexListBuffer.Count); 1152for (int i = 0; i < nameValueListBuffer.Count; i++) 1176for (int i = 0; i < nameValueList.Count; i++)
Logging\ParallelLogger\ParallelConsoleLogger.cs (7)
348if (warningList.Count == 0 && errorList.Count == 0) 365if (warningList.Count > 0) 374if (errorList.Count > 0) 393if (warningList.Count == 0 && errorList.Count == 0) 744if (propertyList.Count == 0)
Logging\ParallelLogger\ParallelLoggerHelpers.cs (1)
153string[] stackTrace = new string[projectStackTrace.Count];
LogMessagePacketBase.cs (3)
1055BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count); 1087BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count); 1126BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count);
PropertyParser.cs (2)
146if (finalPropertiesList.Count > 0) 151finalPropertiesList[finalPropertiesList.Count - 1].Value.Add(propertyValue);
Microsoft.Build.BuildCheck.UnitTests (11)
DoubleWritesAnalyzer_Tests.cs (2)
52_registrationContext.Results.Count.ShouldBe(1); 73_registrationContext.Results.Count.ShouldBe(4);
EditorConfigParser_Tests.cs (2)
86listOfEditorConfigFile.Count.ShouldBe(1); 115listOfEditorConfigFile.Count.ShouldBe(2);
ExecCliBuildCheck_Tests.cs (2)
76_registrationContext.Results.Count.ShouldBe(1); 89_registrationContext.Results.Count.ShouldBe(0);
SharedOutputPathCheck_Tests.cs (3)
61_registrationContext.Results.Count.ShouldBe(0); 88_registrationContext.Results.Count.ShouldBe(2); 131_registrationContext.Results.Count.ShouldBe(4); // 4 reports for two pairs of project: (1, 2) and (1, 3).
TaskInvocationAnalysisDataTests.cs (2)
117s_testCheck!.CheckData.Count.ShouldBe(1); 139s_testCheck!.CheckData.Count.ShouldBe(1);
Microsoft.Build.CommandLine.UnitTests (55)
XMake_Tests.cs (55)
170sa.Count.ShouldBe(1); 175sa.Count.ShouldBe(2); 181sa.Count.ShouldBe(2); 187sa.Count.ShouldBe(3); 195sa.Count.ShouldBe(2); 202sa.Count.ShouldBe(2); 209sa.Count.ShouldBe(4); 217sa.Count.ShouldBe(1); 222sa.Count.ShouldBe(1); 227sa.Count.ShouldBe(1); 232sa.Count.ShouldBe(1); 238sa.Count.ShouldBe(2); 244sa.Count.ShouldBe(1); 250sa.Count.ShouldBe(2); 256sa.Count.ShouldBe(1); 262sa.Count.ShouldBe(2); 268sa.Count.ShouldBe(1); 273sa.Count.ShouldBe(1); 278sa.Count.ShouldBe(2); 284sa.Count.ShouldBe(1); 289sa.Count.ShouldBe(1); 295sa.Count.ShouldBe(2); 301sa.Count.ShouldBe(1); 306sa.Count.ShouldBe(1); 311sa.Count.ShouldBe(1); 316sa.Count.ShouldBe(2); 322sa.Count.ShouldBe(3); 329sa.Count.ShouldBe(1); 335sa.Count.ShouldBe(2); 341sa.Count.ShouldBe(3); 348sa.Count.ShouldBe(4); 2048distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2049loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2067distributedLoggerRecords.Count.ShouldBe(1); // "Expected one distributed loggers to be attached" 2068loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2086distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2087loggers.Count.ShouldBe(0); // "Expected a central loggers to be attached" 2098distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2099loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2109distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2110loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2128loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2129distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2141loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2142distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2154loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2155distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2167loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2168distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2180loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2181distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2191loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2192distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2220distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2221loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached"
Microsoft.Build.Engine.OM.UnitTests (72)
BuildEnvironmentHelper.cs (2)
301if (instances.Count == 0) 306if (instances.Count > 1)
Construction\ConstructionEditing_Tests.cs (3)
93Assert.Equal(2, targets.Count); 453Assert.Equal(2, children.Count); 530Assert.Equal(3, children.Count);
Construction\ProjectChooseElement_Tests.cs (1)
225Assert.Equal(2, whens.Count);
Construction\ProjectImportElement_Tests.cs (1)
103Assert.Equal(2, imports.Count);
Construction\ProjectImportGroupElement_Tests.cs (3)
272Assert.Equal(2, imports.Count); 302Assert.Equal(2, importGroups.Count); 307Assert.Equal(3, imports.Count);
Construction\ProjectItemDefinitionElement_Tests.cs (1)
114Assert.Equal(3, metadata.Count);
Construction\ProjectItemDefinitionGroupElement_Tests.cs (1)
88Assert.Equal(2, itemDefinitionGroups.Count);
Construction\ProjectItemElement_Tests.cs (1)
416Assert.Equal(3, metadata.Count);
Construction\ProjectItemGroupElement_tests.cs (1)
67Assert.Equal(2, items.Count);
Construction\ProjectPropertyGroupElement_Tests.cs (1)
66Assert.Equal(2, properties.Count);
Construction\ProjectRootElement_Tests.cs (7)
539Console.WriteLine(@"Targets: {0}", Helpers.MakeList(project.Targets).Count); 540Console.WriteLine(@"Root ItemGroups: {0}", Helpers.MakeList(project.ItemGroups).Count); 541Console.WriteLine(@"Root PropertyGroups: {0}", Helpers.MakeList(project.PropertyGroups).Count); 542Console.WriteLine(@"UsingTasks: {0}", Helpers.MakeList(project.UsingTasks).Count); 543Console.WriteLine(@"ItemDefinitionGroups: {0}", Helpers.MakeList(project.ItemDefinitionGroups).Count); 828Assert.Equal(6, properties.Count); 886Assert.Equal(6, items.Count);
Construction\ProjectTargetElement_Tests.cs (1)
203Assert.Equal(2, tasks.Count);
Definition\DefinitionEditing_Tests.cs (7)
291Assert.Equal(2, items.Count); 1237Assert.Equal(2, Helpers.MakeList(itemElement.Metadata).Count); 1281Assert.Equal(2, Helpers.MakeList(itemGroupElement.Items).Count); 1471int environmentPropertyCount = Helpers.MakeList(project.Properties).Count; 1496int environmentPropertyCount = Helpers.MakeList(project.Properties).Count; 1817int environmentPropertyCount = Helpers.MakeList(project.Properties).Count; 2215Assert.Equal(2, items.Count);
Definition\Project_Tests.cs (13)
604items.Count.ShouldBe(4); 621logicalElements.Count.ShouldBe(18); 1671items.Count.ShouldBe(3); 1694items.Count.ShouldBe(2); 1801items.Count.ShouldBe(2); 2575logicalProject.Count.ShouldBe(8); // 4 properties + 4 property groups 2621logicalProject.Count.ShouldBe(6); // 3 properties + 3 property groups 4310globs.Count.ShouldBe(expected.Count); 4312for (var i = 0; i < expected.Count; i++) 4357actual.Count.ShouldBe(expected.Count); 4359for (var i = 0; i < expected.Count; i++)
Definition\ProjectCollection_Tests.cs (4)
430Assert.Equal(2, projects.Count); 984Assert.Equal(2, toolsets.Count); 1034int initial = Helpers.MakeList(collection.Toolsets).Count; 1042Assert.Equal(1, Helpers.MakeList(collection.Toolsets).Count - initial);
Definition\ProjectItem_Tests.cs (3)
126Assert.Equal(2, itemMetadata.Count); 1530Assert.Equal(2, itemMetadata.Count); 3406Assert.Equal(4, items.Count);
Instance\ProjectInstance_Tests.cs (4)
141Assert.Equal(3, metadataOut.Count); 308Assert.Equal(2, Helpers.MakeList(projectInstance.GetItems("i")).Count); 333Assert.Equal(4, Helpers.MakeList(first.GetItems("i")).Count); 334Assert.Equal(3, Helpers.MakeList(second.GetItems("i")).Count);
Instance\ProjectItemInstance_Tests.cs (5)
449Assert.Equal(0 + BuiltInMetadataCount, Helpers.MakeList(item.MetadataNames).Count); 476Assert.Equal(2, itemMetadata.Count); 551Assert.Equal(3, Helpers.MakeList(item.Metadata).Count); 552Assert.Equal(3 + BuiltInMetadataCount, Helpers.MakeList(item.MetadataNames).Count); 631Assert.Equal(2, itemMetadata.Count);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (4)
176for (int i = 0; i < viewResult.Count; i++) 684Assert.Equal(realPLocList.Count, viewPLocList.Count); 685for (int li = 0; li < realPLocList.Count; li++)
ObjectModelRemoting\Helpers\ViewValidation.cs (6)
308Assert.Equal(realXmlList.Count, viewXmlList.Count); 309for (int i = 0; i < realXmlList.Count; i++) 338Assert.Equal(realXmlList.Count, viewXmlList.Count); 339for (int i = 0; i < realXmlList.Count; i++)
ObjectModelRemoting\Helpers\ViewValidation.evaluation.cs (3)
302Assert.Equal(realProps.Count, viewProps.Count); 304for (int i = 0; i < realProps.Count; i++)
Microsoft.Build.Engine.UnitTests (138)
BackEnd\BatchingEngine_Tests.cs (2)
62Assert.Equal(5, buckets.Count); 150Assert.Equal(2, buckets.Count);
BackEnd\BuildManager_Tests.cs (16)
254_logger.ProjectStartedEvents.Count.ShouldBe(1); 346int numberProcsOriginally = (new List<Process>(Process.GetProcessesByName("MSBuild"))).Count; 377int numberProcsAfterBuild = (new List<Process>(Process.GetProcessesByName("MSBuild"))).Count; 388int numberProcsAfterShutdown = (new List<Process>(Process.GetProcessesByName("MSBuild"))).Count; 787Assert.Equal(3, _logger.ProjectStartedEvents.Count); 1014logger.BuildStartedEvents.Count.ShouldBe(1); 1015logger.BuildFinishedEvents.Count.ShouldBe(1); 1016logger.ProjectStartedEvents.Count.ShouldBe(1); 1017logger.ProjectFinishedEvents.Count.ShouldBe(1); 1018logger.TargetStartedEvents.Count.ShouldBe(1); 1019logger.TargetFinishedEvents.Count.ShouldBe(1); 1020logger.TaskStartedEvents.Count.ShouldBe(2); 1021logger.TaskFinishedEvents.Count.ShouldBe(2); 1088Assert.Equal(3, _logger.TaskStartedEvents.Count); 1089Assert.Equal(3, _logger.TaskFinishedEvents.Count); 4365logger.EvaluationStartedEvents.Count.ShouldBe(3);
BackEnd\BuildRequest_Tests.cs (3)
132Assert.Equal(request.Targets.Count, deserializedRequest.Targets.Count); 133for (int i = 0; i < request.Targets.Count; i++)
BackEnd\BuildRequestConfiguration_Tests.cs (1)
176Assert.Equal(props.Count, Helpers.MakeList((IEnumerable<ProjectPropertyInstance>)(config1.GlobalProperties)).Count);
BackEnd\BuildRequestEngine_Tests.cs (1)
119for (int i = 0; i < NewRequests.Count; ++i)
BackEnd\LoggingService_Tests.cs (1)
998while (logger.ProjectFinishedEvents.Count == 0)
BackEnd\RequestedProjectState_Tests.cs (4)
38clone.PropertyFilters.Count.Should().NotBe(properties.Count); 82clone.ItemFilters["item2"].Count.Should().NotBe(items["item2"].Count);
BackEnd\Scheduler_Tests.cs (16)
135Assert.Equal(2, response.Count); 159Assert.Equal(2, response.Count); 189Assert.Equal(2, response.Count); 233Assert.Equal(2, response.Count); 256Assert.Equal(3, response.Count); 361Assert.Equal(2, response.Count); 411Assert.Equal(2, moreResponses.Count); 469Assert.Equal(2, response.Count); 499Assert.Equal(2, response.Count); 634Assert.Equal(2, response.Count); 653Assert.Equal(2, response.Count); 673Assert.Equal(2, response.Count); 692Assert.Equal(2, response.Count); 885results.Count.ShouldBe(2); 917results.Count.ShouldBe(2); 959if (nodeInfos.Count > 0)
BackEnd\SdkResolverService_Tests.cs (1)
96_logger.Errors.Count.ShouldBe(1);
BackEnd\TargetBuilder_Tests.cs (1)
1546Assert.Equal(tasks.Length, mockBuilder.ExecutedTasks.Count);
BackEnd\TargetEntry_Tests.cs (10)
224Assert.Equal(2, taskBuilder.ExecutedTasks.Count); 234Assert.Equal(3, taskBuilder.ExecutedTasks.Count); 262Assert.Equal(3, taskBuilder.ExecutedTasks.Count); 275Assert.Equal(2, taskBuilder.ExecutedTasks.Count); 279Assert.Equal(2, entry.GetErrorTargets(GetProjectLoggingContext(entry.RequestEntry)).Count); 288Assert.Equal(3, taskBuilder.ExecutedTasks.Count); 293Assert.Equal(2, entry.GetErrorTargets(GetProjectLoggingContext(entry.RequestEntry)).Count); 301Assert.Equal(3, taskBuilder.ExecutedTasks.Count); 699Assert.Equal(3, log.TargetFinishedEvents.Count); 796Assert.Equal(3, log.TargetFinishedEvents.Count);
BackEnd\TaskExecutionHost_Tests.cs (1)
1115ml.TaskParameterEvents.Count.ShouldBe(3);
BackEnd\TaskRegistry_Tests.cs (2)
212Assert.Equal(2, duplicateBucket.Count); // "Expected two Records registered under this TaskName!" 2174return registryRecords?.Values.Sum(recordList => recordList.Count) ?? 0;
BackEnd\TaskThatReturnsDictionaryTaskItem.cs (2)
106public int Count => _keys.Count; 204return ++_index < _keys.Count;
BuildEventArgsDataEnumeration.cs (7)
39results.Count.ShouldBe(3); 68results.Count.ShouldBe(2); 76metadata.Count.ShouldBe(2); 110results.Count.ShouldBe(2); 118metadata.Count.ShouldBe(2); 126results.Count.ShouldBe(2); 131metadata.Count.ShouldBe(2);
BuildEventArgsSerialization_Tests.cs (5)
1021readerErrors.Count.ShouldBe(1); 1029readerErrors.Count.ShouldBe(1); 1081readerErrors.Count.ShouldBe(1); 1132readerErrors.Count.ShouldBe(1); 1188readerErrors.Count.ShouldBe(1);
Collections\CopyOnReadEnumerable_Tests.cs (1)
43int expectedCount = values.Count;
Collections\MultiDictionary_Tests.cs (1)
108Assert.Equal(2, values.Count);
ConsoleLogger_Tests.cs (2)
161projectStartedEvents.Count.ShouldBe(1); 166targetStartedEvents.Count.ShouldBe(1);
Construction\SolutionFile_NewParser_Tests.cs (1)
120aspNetProjectReferences.Count.ShouldBe(2);
Construction\SolutionFile_OldParser_Tests.cs (1)
1580aspNetProjectReferences.Count.ShouldBe(2);
Definition\ProjectEvaluationContext_Tests.cs (1)
173directoryCacheFactory.DirectoryCaches.Count.ShouldBe(1);
Definition\ToolsetConfigurationReader_Tests.cs (2)
586Assert.Equal(paths.SearchPaths.Count, expectedPaths.Length); 588for (int i = 0; i < paths.SearchPaths.Count; i++)
Definition\ToolsVersion_Tests.cs (2)
276Assert.Equal(sortedTasksExpectedPaths.Count, foundFiles.Length); 282Assert.Equal(sortedOverrideExpectedPaths.Count, foundoverrideFiles.Length);
EscapingInProjects_Tests.cs (1)
1831for (int i = 0; i < matchingItems.Count; i++)
Evaluation\EvaluationLogging_Tests.cs (1)
131allBuildEvents.Count.ShouldBe(2);
Evaluation\Evaluator_Tests.cs (2)
2375Assert.Equal(2, instance.DefaultTargets.Count); 2399Assert.Equal(2, instance.InitialTargets.Count);
Evaluation\Expander_Tests.cs (3)
4297for (int i = 0; i < validTests.Count; i++) 4313for (int i = 0; i < errorTests.Count; i++) 5207logger.AllBuildEvents.Count.ShouldBe(1);
Evaluation\ExpressionShredder_Tests.cs (22)
500if (messages.Count > 0) 549if (messages.Count > 0) 603Assert.Equal(matches.Count, expressions.Count); 766Assert.Equal(2, capture.Captures.Count); 788Assert.Equal(2, capture.Captures.Count); 810Assert.Equal(2, capture.Captures.Count); 832Assert.Equal(2, capture.Captures.Count); 873Assert.Equal(2, capture.Captures.Count); 895Assert.Equal(2, capture.Captures.Count); 917Assert.Equal(2, capture.Captures.Count); 939Assert.Equal(2, capture.Captures.Count); 961Assert.Equal(2, capture.Captures.Count); 983Assert.Equal(2, capture.Captures.Count); 1004Assert.Equal(2, expressions.Count); 1007Assert.Equal(2, capture.Captures.Count); 1028Assert.Equal(2, expressions.Count); 1031Assert.Equal(2, capture.Captures.Count); 1052Assert.Equal(2, expressions.Count); 1055Assert.Equal(2, capture.Captures.Count); 1076Assert.Equal(2, expressions.Count); 1079Assert.Equal(2, capture.Captures.Count); 1098Assert.Equal(5, expressions.Count);
EvaluationProfiler_Tests.cs (1)
255Assert.Equal(allIds.Count, allUniqueIds.Count);
ExpressionTree_Tests.cs (8)
354Assert.Equal(2, properties.Count); 359Assert.Equal(2, properties.Count); 370Assert.Equal(2, properties.Count); 372Assert.Equal(2, properties.Count); 381Assert.Equal(2, properties.Count); 383Assert.Equal(3, properties.Count); 385Assert.Equal(2, properties.Count); 387Assert.Equal(2, properties.Count);
Graph\ResultCacheBasedBuilds_Tests.cs (2)
72_logger.AllBuildEvents.Count.ShouldBe(6); 568_logger.AllBuildEvents.Count.ShouldBe(6);
Instance\ProjectInstance_Internal_Tests.cs (3)
178properties.Count.ShouldBe(2); 216items.Count.ShouldBe(3); 237metadata1.Count.ShouldBe(2);
PrintLineDebugger_Tests.cs (3)
123writer.Logs.Count.ShouldBe(1); 152writer.Logs.Count.ShouldBe(1); 180writer.Logs.Count.ShouldBe(3);
ProjectCache\ProjectCacheTests.cs (2)
901logger.ProjectStartedEvents.Count.ShouldBe(2); 1635logger.ProjectStartedEvents.Count.ShouldBe(2 * projectPaths.Length);
TerminalLogger_Tests.cs (6)
784mockLogFromPlaybackWithoutTL.Errors.Count.ShouldBe(mockLogFromPlaybackWithTL.Errors.Count); 785mockLogFromPlaybackWithoutTL.Warnings.Count.ShouldBe(mockLogFromPlaybackWithTL.Warnings.Count); 786mockLogFromPlaybackWithoutTL.AllBuildEvents.Count.ShouldBe(mockLogFromPlaybackWithTL.AllBuildEvents.Count);
Microsoft.Build.Framework (8)
BinaryTranslator.cs (2)
1096int count = list.Count; 1135int count = list.Count;
InterningReadTranslator.cs (1)
80_pathIdsToString = new(_strings.Count);
InterningWriteTranslator.cs (1)
110index = _strings.Count;
TaskParameterEventArgs.cs (2)
250writer.Write7BitEncodedInt(reusableMetadataList.Count); 251if (reusableMetadataList.Count == 0)
XamlTypes\ContentType.cs (1)
159var metadata = new Dictionary<string, string>(this.Metadata.Count, StringComparer.OrdinalIgnoreCase);
XamlTypes\Rule.cs (1)
497var map = new Dictionary<string, BaseProperty>(this.Properties.Count, StringComparer.OrdinalIgnoreCase);
Microsoft.Build.Framework.UnitTests (2)
CustomEventArgSerialization_Tests.cs (2)
625entryList.Count.ShouldBe(propertyList.Count);
Microsoft.Build.Tasks.CodeAnalysis (4)
src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (2)
174var items = new ITaskItem[commandLineArgs.Count]; 175for (var i = 0; i < commandLineArgs.Count; i++)
src\Compilers\Core\MSBuildTask\Vbc.cs (2)
578if (links.Count > 0) 583if (references.Count > 0)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (4)
src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (2)
174var items = new ITaskItem[commandLineArgs.Count]; 175for (var i = 0; i < commandLineArgs.Count; i++)
src\Compilers\Core\MSBuildTask\Vbc.cs (2)
578if (links.Count > 0) 583if (references.Count > 0)
Microsoft.Build.Tasks.Core (93)
AssemblyDependency\AssemblyInformation.cs (1)
509if (arguments.Count == 1)
AssemblyDependency\AssemblyResolution.cs (2)
224var resolvers = new Resolver[parentReferenceDirectories.Count]; 225for (int i = 0; i < parentReferenceDirectories.Count; i++)
AssemblyDependency\Reference.cs (1)
799return !IsResolved && _errors.Count > 0;
AssemblyDependency\ReferenceTable.cs (8)
1310if (parentReferenceFolders.Count > 0 && (assemblyName == null || !_externallyResolvedPrimaryReferences.Contains(assemblyName.Name))) 1765if (newEntries.Count > 0) 1828while (comparisonIndex < assemblyReferences.Count) 1928var idealRemappingsList = new List<DependentAssembly>(assemblyNamesList.Count); 2219if (kvp.Value.Count == 1) 2740if (relatedFileExtensions.Count > 0 || satellites.Count > 0 || serializationAssemblyFiles.Count > 0 || scatterFiles.Length > 0)
AssemblyDependency\ResolveAssemblyReference.cs (10)
1142bool logWarning = idealAssemblyRemappingsIdentities.Any(i => i.assemblyName.FullName.Equals(fusionName) && i.reference.GetConflictVictims().Count == 0); 1196for (int i = 0; i < idealAssemblyRemappings.Count; i++) 1204for (int j = 0; j < idealRemapping.BindingRedirects.Count; j++) 1267if (idealAssemblyRemappings.Count > 0 && foundAtLeastOneValidBindingRedirect) 1462bool hadProblems = reference.GetErrors().Count > 0; 2337for (int i = 0; i < inclusionListErrors.Count; ++i) 2511bool shouldRerunClosure = autoUnifiedRemappedAssemblies?.Count > 0 || excludedReferencesExist; 3030for (int i = 0; i < idealAssemblyRemappings.Count; i++) 3039if (conflictVictims == null || 0 == conflictVictims.Count) 3044for (int j = 0; j < idealRemapping.BindingRedirects.Count; j++)
BootstrapperUtil\BootstrapperBuilder.cs (9)
242string[] componentFiles = new string[componentFilesCopied.Count]; 315if (productDependency.Count == 1) 337if (missingDependecies.Count == 1) 683if (foundDependencies.Count > 0) 690else if (allDependencies.Count > 0) 745if (p.Dependencies.Count == 0) 766if (buildQueue.Count > 0 && productsToRemove.Count == 0) 776if (productsInLoop.Length > 0 && (buildQueue.Count == 0 || productsToRemove.Count == 0)) 793p.Dependencies.RemoveAll(m => m.Count == 0);
BootstrapperUtil\BuildResults.cs (2)
45if (_componentFiles.Count == 0) 61if (_messages.Count == 0)
BootstrapperUtil\PackageCollection.cs (1)
28public int Count => _list.Count;
BootstrapperUtil\ProductBuilderCollection.cs (1)
44internal int Count => _list.Count;
BootstrapperUtil\ProductCollection.cs (1)
65public int Count => _list.Count;
BootstrapperUtil\ResourceUpdater.cs (4)
42if (_stringResources.Count == 0 && _fileResources.Count == 0) 83if (_fileResources.Count > 0) 86byte[] countArray = StringToByteArray(_fileResources.Count.ToString("G", CultureInfo.InvariantCulture));
BootstrapperUtil\xmlvalidationresults.cs (2)
58public bool ValidationPassed => _validationErrors.Count == 0 && _validationWarnings.Count == 0;
BuildEnvironmentHelper.cs (2)
301if (instances.Count == 0) 306if (instances.Count > 1)
Copy.cs (1)
641for (int partitionIndex = 0; partitionIndex < partition.Count && !_cancellationTokenSource.IsCancellationRequested; partitionIndex++)
FileMatcher.cs (2)
919if (files?.Count > 0) 2571if (searchesToExclude?.Count == 0)
GenerateResource.cs (15)
577for (int i = 0; i < inputFiles.Count; ++i) 717if (inputsToProcess.Count == 0) 721if (cachedOutputFiles.Count > 0) 736int maxCount = Math.Min(inputsToProcess.Count, outputsToProcess.Count); 865if (cachedOutputFiles.Count > 0) 867OutputResources = new ITaskItem[outputResources.Length + cachedOutputFiles.Count]; 878for (int i = 0; i < portableLibraryCacheInfo.Count; i++) 1680if (inputsToProcess.Count == 0) 2436for (int i = 0; i < _inFiles.Count; ++i) 2718ErrorUtilities.VerifyThrow(_readers.Count == 1, 2720_readers.Count); 2728ErrorUtilities.VerifyThrow(_readers.Count == 1, 2730_readers.Count); 3043_logger.LogMessageFromResources(MessageImportance.Low, "GenerateResource.ReadResourceMessage", reader.resources.Count, filename);
ManifestUtil\AssemblyReferenceCollection.cs (1)
69public int Count => _list.Count;
ManifestUtil\ComImporter.cs (1)
112if (comClassList.Count > 0)
ManifestUtil\CompatibleFrameworkCollection.cs (1)
38public int Count => _list.Count;
ManifestUtil\DeployManifest.cs (1)
636get => _compatibleFrameworks.Count > 0 ? _compatibleFrameworks.ToArray() : null;
ManifestUtil\FileAssociationCollection.cs (1)
38public int Count => _list.Count;
ManifestUtil\FileReferenceCollection.cs (1)
69public int Count => _list.Count;
MSBuild.cs (7)
382if (projectsToBuildInParallel.Count > 0) 492var projectDirectory = new string[projects.Count]; 493var projectNames = new string[projects.Count]; 494var toolsVersions = new string[projects.Count]; 495var projectProperties = new Dictionary<string, string>[projects.Count]; 496var undefinePropertiesPerProject = new IList<string>[projects.Count]; 615for (int i = 0; i < projects.Count; i++)
PropertyParser.cs (2)
146if (finalPropertiesList.Count > 0) 151finalPropertiesList[finalPropertiesList.Count - 1].Value.Add(propertyValue);
RedistList.cs (3)
117for (int i = 0; i < assemblyList.Count; ++i) 559int errorsBeforeReadCall = allowListErrors.Count; 580if (allowListErrors.Count == errorsBeforeReadCall)
ResolveManifestFiles.cs (1)
677for (int i = 0; i < manifestEntryPointList.Count; i++)
ResolveProjectBase.cs (1)
196_projectReferences = new ITaskItem[updatedProjectReferenceList.Count];
ResolveSDKReference.cs (6)
422if (listOfIncompatibleReferences.Count > 0) 451if (listOfIncompatibleReferences.Count > 0) 504if (dependentSDKs.Count > 0) 617else if (reference.ResolutionErrors == null || reference.ResolutionErrors.Count == 0) 932if (!treatErrorsAsWarnings && ResolutionErrors.Count > 0) 1414if (appxLocationComponents.Count > 0)
WriteCodeFragment.cs (4)
225if (index > orderedParameters.Count || index < 1) 242for (int i = 0; i < orderedParameters.Count; i++) 493if (candidates.Count == 1) 497else if (candidates.Count > 1)
XmlPeek.cs (1)
149Result = new ITaskItem[peekValues.Count];
Microsoft.Build.Tasks.UnitTests (22)
Copy_Tests.cs (4)
2016Assert.Equal(2, filesActuallyCopied.Count); 2083Assert.Equal(4, filesActuallyCopied.Count); 2089Assert.Equal(3, xaCopies.Count); 3067if (FilesCopiedSuccessfully.Count > 0 || _countOfSuccess == _tries)
GetSDKReference_Tests.cs (1)
283readInfo.DirectoryToFileList["fourth"].Count.ShouldBe(3);
MockUnmanagedMemoryHelper.cs (1)
76while (_dependentAllocations[handle].Count > 0)
PrintLineDebugger_Tests.cs (3)
123writer.Logs.Count.ShouldBe(1); 152writer.Logs.Count.ShouldBe(1); 180writer.Logs.Count.ShouldBe(3);
RemoveDir_Tests.cs (1)
74t2.RemovedDirectories.Length.ShouldBe(list.Count);
ResolveSDKReference_Tests.cs (1)
84Assert.Equal(2, parsedDependencies.Count);
XmlPoke_Tests.cs (7)
61nodes.Count.ShouldBe(3, $"There should be 3 <variable /> elements with a Name attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 78nodes.Count.ShouldBe(3, $"There should be 3 <variable /> elements with a Name attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 95nodes.Count.ShouldBe(1, $"There should be 1 <class /> element with an AccessModifier attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 112nodes.Count.ShouldBe(1, $"There should be 1 <class /> element {Environment.NewLine}{xmlDocument.OuterXml}"); 118testNodes.Count.ShouldBe(1, $"There should be 1 <class /> element with one child Test element {Environment.NewLine}{xmlDocument.OuterXml}"); 136nodes.Count.ShouldBe(1, $"There should be 1 <class /> element with an AccessModifier attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 306nodes.Count.ShouldBe(3, $"There should be 3 <variable/> elements {Environment.NewLine}{xmlDocument.OuterXml}");
XslTransformation_Tests.cs (4)
108for (int xmi = 0; xmi < xmlInputs.Count; xmi++) 110for (int xsi = 0; xsi < xslInputs.Count; xsi++) 173for (int xmi = 0; xmi < xmlInputs.Count; xmi++) 219for (int xsi = 0; xsi < xslInputs.Count; xsi++)
Microsoft.Build.UnitTests.Shared (5)
BuildEventArgsExtension.cs (3)
369if (argItemIncludes.Count != otherItemIncludes.Count) 375for (int i = 0; i < argItemIncludes.Count; i++)
ObjectModelHelpers.cs (1)
388for (expectedItemIndex = 0; expectedItemIndex < expectedItems.Count; expectedItemIndex++)
TestEnvironment.cs (1)
92for (int i = _variants.Count - 1; i >= 0; i--)
Microsoft.Build.Utilities.Core (15)
BuildEnvironmentHelper.cs (2)
301if (instances.Count == 0) 306if (instances.Count > 1)
FileMatcher.cs (2)
919if (files?.Count > 0) 2571if (searchesToExclude?.Count == 0)
ToolLocationHelper.cs (3)
1392if (availablePlatformVersions?.Count > 0) 2949if (sdkDiskRoots.Count == 0) 2976if (sdkDiskRoots.Count == 0 && diskRoots?.Length > 0)
TrackedDependencies\FlatTrackingData.cs (8)
741else if (inputs.MissingFiles.Count > 0 || outputs.MissingFiles.Count > 0) 746if (inputs.MissingFiles.Count > 0) 751if (inputs.MissingFiles.Count > MaxLogCount) 753FileTracker.LogMessageFromResources(Log, MessageImportance.Low, "Tracking_InputsNotShown", inputs.MissingFiles.Count); 765if (outputs.MissingFiles.Count > 0) 770if (outputs.MissingFiles.Count > MaxLogCount) 772FileTracker.LogMessageFromResources(Log, MessageImportance.Low, "Tracking_OutputsNotShown", outputs.MissingFiles.Count);
Microsoft.Build.Utilities.UnitTests (6)
MuxLogger_Tests.cs (3)
123mockLogger2.BuildFinishedEvents.Count.ShouldBeGreaterThan(0); 124mockLogger.BuildFinishedEvents.Count.ShouldBe(mockLogger2.BuildFinishedEvents.Count);
PrintLineDebugger_Tests.cs (3)
123writer.Logs.Count.ShouldBe(1); 152writer.Logs.Count.ShouldBe(1); 180writer.Logs.Count.ShouldBe(3);
Microsoft.Cci.Extensions (5)
HostEnvironment.cs (1)
598if (assemblySet.Count == 0)
Writers\CSharp\CSDeclarationWriter.Enums.cs (3)
64for (int i = 0; i < candidateFlagFields.Count; i++) 100if (value == satisfiedValue && candidateFlagFields.Count > 0) 102for (int i = 0; i < candidateFlagFields.Count; i++)
Writers\CSharp\CSDeclarationWriter.Properties.cs (1)
182parameters.RemoveAt(parameters.Count - 1);
Microsoft.CodeAnalysis (103)
CommandLine\AnalyzerConfigSet.cs (9)
75if (x.Count != y.Count) 80for (int i = 0; i < x.Count; i++) 200int globalConfigOptionsCount = sectionKey.Count; 214sectionKey.RemoveRange(globalConfigOptionsCount, sectionKey.Count - globalConfigOptionsCount); 252if (sectionKey.Count > 0 && configSection == sectionKey[sectionKeyIndex]) 262if (sectionKeyIndex == sectionKey.Count) 270analyzerConfigIndex < _analyzerConfigs.Length && sectionKeyIndex < sectionKey.Count; 287if (sectionKeyIndex == sectionKey.Count)
CommandLine\CommonCompiler.cs (2)
1155var analyzerOptionsBuilder = hasAnalyzerConfigs ? ArrayBuilder<AnalyzerConfigOptionsResult>.GetInstance(generatedSyntaxTrees.Count) : null; 1156var embeddedTextBuilder = ArrayBuilder<EmbeddedText>.GetInstance(generatedSyntaxTrees.Count);
CommandLine\SarifV1ErrorLogger.cs (2)
292Debug.Assert(list.Capacity > list.Count); 296Debug.Assert(list.Capacity == list.Count);
CommandLine\SarifV2ErrorLogger.cs (2)
504Debug.Assert(list.Capacity > list.Count); 508Debug.Assert(list.Capacity == list.Count);
Desktop\DesktopAssemblyIdentityComparer.Fx.cs (1)
158for (int i = 0; i < values.Count; i++)
DiaSymReader\Utilities\ComMemoryStream.cs (4)
54if (chunkIndex < _chunks.Count) 84if (chunkIndex < _chunks.Count) 127if (chunkIndex < _chunks.Count) 221while (chunkIndex >= _chunks.Count)
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (4)
142if (value > _documentWriters.Count) 158int index = _documentWriters.Count; 213if (documentIndex < 0 || documentIndex >= _documentWriters.Count) 675if (documentIndex < 0 || documentIndex >= _documentWriters.Count)
DocumentationCommentId.cs (25)
165return results.Count == 0 ? null : results[0]; 253return results.Count == 0 ? null : results[0]; 716return results.Count > 0; 730return results.Count > 0; 818if (results.Count == 0) 870if (results.Count == 0) 897if (contexts.Count == 0) 941for (int i = 0; i < results.Count; i++) 1035arity = typeArguments.Count; 1047if (arity != 0 && typeArguments != null && typeArguments.Count != 0) 1050for (int i = 0; i < results.Count; i++) 1157for (int i = 0, n = containers.Count; i < n; i++) 1182for (int i = 0, n = containers.Count; i < n; i++) 1203for (int i = 0, n = containers.Count; i < n; i++) 1230for (int i = 0, n = containers.Count; i < n; i++) 1297for (int i = 0, n = containers.Count; i < n; i++) 1349for (int i = 0, n = containers.Count; i < n; i++) 1365for (int i = 0, n = containers.Count; i < n; i++) 1381if (symbolParameters.Length != expectedParameters.Count) 1386for (int i = 0; i < expectedParameters.Count; i++) 1569if (destination.Count + source.Count > destination.Capacity) 1571destination.Capacity = destination.Count + source.Count; 1574for (int i = 0, n = source.Count; i < n; i++)
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
948if (_deferredCustomAttributes.Count == 0)
MetadataReader\MetadataHelpers.cs (6)
864Debug.Assert(typesInLastChildNamespace.Count != 0); 882Debug.Assert(typesInLastChildNamespace.Count != 0); 899var names = new Dictionary<string, int>(nestedNamespaces.Count, nameComparer); 901for (int i = nestedNamespaces.Count - 1; i >= 0; i--) 906if (names.Count != nestedNamespaces.Count) // nothing to merge otherwise 908for (int i = 1; i < nestedNamespaces.Count; i++)
MetadataReader\PEModule.cs (6)
1671if (attrInfos is null || attrInfos.Count == 0) 1676var result = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1711if (attrInfos is null || attrInfos.Count == 0) 1716var whenTrue = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1717var whenFalse = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1756var result = ArrayBuilder<string>.GetInstance(attrInfos.Count);
PEWriter\MetadataWriter.cs (6)
568index = (ushort)result.Count; 685_fileRefIndex.Add(key, _fileRefList.Count); 848_fileRefIndex.Add(key, index = _fileRefList.Count); 2447metadata.SetCapacity(TableIndex.File, _fileRefList.Count); 2601metadata.SetCapacity(TableIndex.MethodImpl, methodImplList.Count); 4245int index = _firstRowId + _rows.Count;
PEWriter\MetadataWriter.DynamicAnalysis.cs (3)
210documentRowId = _documentTable.Count + 1; 333writer.WriteInt32(_documentTable.Count); 334writer.WriteInt32(_methodTable.Count);
PEWriter\NativeResourceWriter.cs (5)
247uint n = (uint)directory.Entries.Count; 266k += 16 + 8 * (uint)subDir.Entries.Count; 332k += 16 + 8 * (uint)subDir.Entries.Count; 340uint n = (uint)directory.Entries.Count; 347size += 16 + 8 * (uint)subDir.Entries.Count;
ReferenceManager\CommonReferenceManager.Binding.cs (2)
823Debug.Assert(candidateReferenceBinding.Length == candidateReferencedSymbols.Count); 824int referencesCount = candidateReferencedSymbols.Count;
ReferenceManager\CommonReferenceManager.State.cs (1)
523for (int i = 1; i < assemblyReference.Value.Count; i++)
RuleSet\RuleSetProcessor.cs (1)
82Debug.Assert(nodeList.Count == 1, "Multiple top-level nodes!");
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
Syntax\GreenNode.cs (2)
914switch (list.Count) 926var array = new ArrayElement<GreenNode>[list.Count];
Syntax\SeparatedSyntaxList.cs (3)
430if (nodesToInsertWithSeparators.Count > 0 || (insertionIndex > 0 && nodesWithSeps[insertionIndex - 1].IsNode)) 546if (newNodeList.Count == 0) 553if (newNodeList.Count > 1)
Syntax\SyntaxDiffer.cs (7)
575if (_changes.Count > 0) 577var last = _changes[_changes.Count - 1]; 581_changes[_changes.Count - 1] = new ChangeRecord( 596if (_changes.Count > 0) 598var last = _changes[_changes.Count - 1]; 604_changes[_changes.Count - 1] = new ChangeRecord( 741var textChanges = new List<ChangeRangeWithText>(changeRecords.Count);
Syntax\SyntaxList`1.cs (2)
270if (list.Count == 0) 346if (items.Count == 0)
Syntax\SyntaxNodeOrTokenList.cs (1)
348if (items.Count == 0)
Syntax\SyntaxTokenList.cs (2)
362if (items.Count == 0) 370if (list.Count == 0)
Text\SourceText.cs (1)
904var textChanges = new List<TextChange>(ranges.Count);
TreeDumper.cs (3)
94for (int i = 0; i < children.Count; ++i) 99_sb.Append(i == children.Count - 1 ? '\u2514' : '\u251C'); 104DoDumpCompact(child, indent + (i == children.Count - 1 ? " " : "\u2502 "));
Microsoft.CodeAnalysis.Analyzers (53)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (2)
187return invalidFileDiagnostics.Count == 0; 403if (invalidReleaseTrackingDiagnostics?.Count > 0)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (4)
232if (conditionalAccessMembers.Count == 0) 236else if (conditionalAccessMembers.Count == 1) 242var currentExpression = conditionalAccessMembers.Count > 2 246for (int i = 2; i < conditionalAccessMembers.Count - 1; i++)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (1)
132using var _1 = ArrayBuilder<TextChange>.GetInstance(fixInfos.Count, out var textChanges);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
87for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 100if (result == 0 && usedFieldsAndValues.Count > 0) 104for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 155for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (4)
27addBlankLine = newImports.Count > 0; 49for (var i = 0; i < newImports.Count; i++) 78if (originalLastUsingCurrentIndex != newImports.Count - 1) 86for (var i = 0; i < newImports.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
Microsoft.CodeAnalysis.AnalyzerUtilities (39)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\RoslynAnalyzers\Utilities\FlowAnalysis\Extensions\ListExtensions.cs (2)
27for (int i = 0; i < list.Count; i++) 46list.RemoveRange(list.Count - builder.Count, builder.Count);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (1)
198if (taintedValues.Count == 1)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
431Debug.Assert(_pendingArgumentsToPostProcess.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
Microsoft.CodeAnalysis.BannedApiAnalyzers (49)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
87for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 100if (result == 0 && usedFieldsAndValues.Count > 0) 104for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 155for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (4)
27addBlankLine = newImports.Count > 0; 49for (var i = 0; i < newImports.Count; i++) 78if (originalLastUsingCurrentIndex != newImports.Count - 1) 86for (var i = 0; i < newImports.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
SymbolIsBannedAnalyzer.cs (3)
78if (entries.Count == 0) 91for (int i = 1; i < groupList.Count; i++) 102if (errors.Count != 0)
Microsoft.CodeAnalysis.CodeStyle (34)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
Microsoft.CodeAnalysis.CodeStyle.Fixes (17)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
145.Where(nameAttributes => nameAttributes.Count == 1) 158if (paramNameAttributesForNode.Count != 1)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
95if (paramNodeIndex + 1 < paramNodeSiblings.Count)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
161for (var i = removalList.Count - 1; i >= 0; i--)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
84for (var i = classTypes.Count - 1; i >= 0; i--) 89for (var j = 0; j < classTypes.Count; j++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
87for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 100if (result == 0 && usedFieldsAndValues.Count > 0) 104for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 155for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (4)
27addBlankLine = newImports.Count > 0; 49for (var i = 0; i < newImports.Count; i++) 78if (originalLastUsingCurrentIndex != newImports.Count - 1) 86for (var i = 0; i < newImports.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
src\Features\DiagnosticsTestUtilities\CodeActions\SharedVerifierState.cs (1)
55_analyzerConfigIndex = _test.TestState.AnalyzerConfigFiles.Count;
Microsoft.CodeAnalysis.Collections.Package (2)
Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
Microsoft.CodeAnalysis.CSharp (17)
CommandLine\CSharpCommandLineParser.cs (6)
181if (sourceFiles.Count > 0) 653int before = sourceFiles.Count; 655if (sourceFiles.Count > before) 1458if (embeddedFiles.Count > 0 && !emitPdb) 1546InteractiveMode = interactiveMode || IsScriptCommandLineParser && sourceFiles.Count == 0, 1964commandLineReferences.RemoveRange(commandLineReferences.Count - pathCount, pathCount);
CommandLine\CSharpCompiler.cs (1)
196Debug.Assert(fileDiagnostics.Count == 0);
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (5)
261for (int cnt = proxiedLabels.Count; i <= cnt; i++) 311for (int cnt = proxiedLabels.Count; i <= cnt; i++) 488var handlers = ArrayBuilder<SyntheticBoundNodeFactory.SyntheticSwitchSection>.GetInstance(handlersList.Count); 489for (int i = 0, l = handlersList.Count; i < l; i++) 564_F.Literal(currentAwaitCatchFrame.handlers.Count + 1));
Parser\AbstractLexer.cs (2)
46var array = new SyntaxDiagnosticInfo[_errors.Count]; 47for (int i = 0; i < _errors.Count; i++)
Symbols\ReferenceManager.cs (3)
132for (int i = 0; i < referencedAssemblySymbols.Count; i++) 472if (newSymbols.Count > 0) 543Debug.Assert(newSymbols.Count > 0);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
900finalTrivia.RemoveAt(finalTrivia.Count - 1);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
105var insertionIndex = finalLeadingTrivia.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
227if (members.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
30if (members.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
324if (types.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
180for (var i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (6)
CommandLineTests.cs (6)
922Assert.Equal(0, diags.Count); 927Assert.Equal(0, diags.Count); 932Assert.Equal(0, diags.Count); 937Assert.Equal(0, diags.Count); 944Assert.Equal(0, diags.Count); 951Assert.Equal(0, diags.Count);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (17)
Classification\SyntacticTaggerTests.cs (4)
67Assert.Equal(1, callstacks.Count); 83Assert.Equal(2, callstacks.Count); 121Assert.Equal(1, callstacks.Count); 142Assert.Equal(2, callstacks.Count);
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
64if (expectedFolders?.Count > 0)
Completion\CompletionProviders\TypeImportCompletionProviderTests.cs (2)
1424Assert.Equal(expectedTypesInRelativeOrder.Count, actualTypesInRelativeOrder.Length); 1425for (var i = 0; i < expectedTypesInRelativeOrder.Count; ++i)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
777if (nugetAnalyzerReferences.Count > 0)
Intents\IntentTestsBase.cs (2)
86Assert.Equal(expectedTexts.Length, actualDocumentTexts.Count); 87for (var i = 0; i < actualDocumentTexts.Count; i++)
Interactive\NavigateTo\InteractiveNavigateToTests.cs (1)
644Assert.Equal(expecteditems.Count, items.Count());
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (2)
67Assert.Equal(5, originalSymbols.Count); 154Assert.Equal(8, originalSymbols.Count);
SymbolKey\SymbolKeyTestBase.cs (3)
46Assert.Equal(origlist.Count, newlist.Count); 48for (var i = 0; i < newlist.Count; i++)
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
1435Assert.Equal(2, eventArgs.Count);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (10)
CodeGen\CodeGenCapturing.cs (10)
45if (VariablesByScope.Count <= depth || 80if (variablesByScope.Count <= varDepth) 112return varNames.Count == 0 ? "0" : string.Join(" + ", varNames); 208Assert.Equal(expectedCtx.Count, ctx.VariablesByScope.Count); 323if (depth >= copy.LocalFuncs.Count) 325copy.LocalFuncs.AddRange(Enumerable.Repeat<List<string>>(null, depth - copy.LocalFuncs.Count)); 368for (int depth = 0; depth < localFuncs.Count; depth++) 377if (captureVars.Count > (depth + 1) && 406for (int depth = localFuncs.Count - 1; depth > 0; depth--) 444Parallel.ForEach(Partitioner.Create(0, methods.Count, PartitionSize), (range, state) =>
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (9)
Diagnostics\GetDiagnosticsTests.cs (9)
1756Assert.Equal(expectedSymbolCallbacks.Count, analyzer.AnalyzedSymbols.Count); 1760Assert.Equal(expectedSyntaxNodeCallbacks.Count, analyzer.AnalyzedSyntaxNodes.Count); 1764Assert.Equal(expectedSyntaxNodeInsideBlockCallbacks.Count, analyzer.AnalyzedSyntaxNodesInsideCodeBlock.Count); 1769Assert.Equal(expectedOperationCallbacks.Count, analyzer.AnalyzedOperations.Count); 1773Assert.Equal(expectedOperationInsideBlockCallbacks.Count, analyzer.AnalyzedOperationsInsideOperationBlock.Count); 1786Assert.Equal(expectedBlockSymbolCallbacks.Count, actualBlockSymbolCallbacks.Count); 1791Assert.Equal(expectedSymbolStartSymbolCallbacks.Count, analyzer.AnalyzedSymbolStartSymbols.Count); 1793Assert.Equal(expectedSymbolStartSymbolCallbacks.Count, analyzer.AnalyzedSymbolEndSymbols.Count); 1797Assert.Equal(expectedSemanticModelTreeCallbacks.Count, analyzer.AnalyzedSemanticModels.Count);
Microsoft.CodeAnalysis.CSharp.Features (17)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
356Debug.Assert(annotatedNodesOrTokens.Count == 1, "Only a single variable declarator should have been annotated.");
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
50return result.Count == 0 ? null : result;
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (4)
75if (triviaList.Count > 0) 85if (list.Count == 0) 88if (triviaList.Count == 0) 103if (list.Count == node.Declaration.Variables.Count)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
133Contract.ThrowIfFalse(keyValuePair.Value.Count > 0);
Formatting\CSharpNamespaceDeclarationNewDocumentFormattingProvider.cs (1)
38if (namespaces.Count != 1)
GenerateType\CSharpGenerateTypeService.cs (5)
593if (namespaceContainers.Count + indexDone > containers.Count || 599indexDone += namespaceContainers.Count; 600if (indexDone == containers.Count) 608for (var i = 0; i < namespaceContainers.Count; ++i)
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
104if (spans.Count > 0)
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
105var insertionIndex = finalLeadingTrivia.Count;
Structure\Providers\IfDirectiveTriviaStructureProvider.cs (1)
29for (int i = 0, n = allRelatedDirectives.Count - 1; i < n; i++)
Structure\Providers\NamespaceDeclarationStructureProvider.cs (1)
43if (externsAndUsings.Count > 0)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Testing\CSharpTestMethodFinderTests.cs (1)
586Assert.True(unmatchedTestNames.Count == 0, $"Unable to match the following test names: {string.Join(", ", unmatchedTestNames)}");
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (3)
InteractiveSessionTests.cs (3)
947Assert.Equal(3, result.Count); 973Assert.Equal(4, result.Count); 992Assert.Equal(2, result.Count);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (19)
Semantics\FunctionPointerTests.cs (8)
352Assert.Equal(3, conversions.Count); 403Assert.Equal(2, conversions.Count); 455Assert.Equal(2, conversions.Count); 503Assert.Equal(5, conversions.Count); 601Assert.Equal(2, decls.Count); 840Assert.Equal(4, decls.Count); 3179Assert.Equal(3, invocations.Count); 3298Assert.Equal(2, invocations.Count);
Semantics\LocalFunctionTests.cs (1)
1023Assert.Equal(4, attributeSyntaxes.Count);
Semantics\LookupTests.cs (1)
529Assert.Equal(2, actual_lookupSymbols.Count);
SourceGeneration\GeneratorDriverFuzzTests.cs (1)
302editedInputs.Insert(random.Next(editedInputs.Count), new InMemoryAdditionalText(hintNameProvider.GetNextHintName(), getRandomLetter()));
SourceGeneration\GeneratorDriverTests.cs (3)
2010Assert.Equal(1, compilationsCalledFor.Count); 2016Assert.Equal(1, compilationsCalledFor.Count); 2313Assert.Equal(1, compilationsCalledFor.Count);
SourceGeneration\SyntaxAwareGeneratorTests.cs (5)
253Assert.Equal(21, testReceiver.VisitedNodes.Count); 292Assert.Equal(21, testReceiver.VisitedNodes.Count); 335Assert.Equal(21, testReceiver.VisitedNodes.Count); 350Assert.Equal(21, testReceiver.VisitedNodes.Count); 529Assert.Equal(21, testReceiver.VisitedNodes.Count);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (19)
Compilation\GetSemanticInfoTests.cs (2)
1048Assert.Equal(6, exprSyntaxList.Count); // Note the omitted array size expression in "string[]" 1055var exprSyntaxToBind = exprSyntaxList[exprSyntaxList.Count - 2];
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (7)
1216Assert.Equal(5, namesInC.Count); // A, B, C, System, Microsoft 1225Assert.Equal(16, namesInM.Count); 1251Assert.Equal(13, namesInA.Count); 1285Assert.Equal(13, namesInC.Count); // everything with exception of protected members in System.Object is included, with an uncertain count 1336Assert.Equal(7, names.Count); 1348Assert.Equal(5, names.Count); 5141int counter = collector.Incompletes.Count;
Symbols\AnonymousTypesSemanticsTests.cs (4)
2042Assert.Equal(expectedIntervals, intervals.Count); 2071Assert.Equal(expectedIntervals, nodes.Count); 2101while (all.Count > 0) 2105while (i < all.Count)
Symbols\AnonymousTypesSymbolTests.cs (1)
254Assert.Equal(1, attrs.Count);
Symbols\ExtensionMethodTests.cs (1)
3140Assert.Equal(2, nodes.Count);
Symbols\Source\EnumTests.cs (1)
1015Assert.Equal(expectedEnumValues.Length, fields.Count);
Symbols\Source\NullablePublicAPITests.cs (2)
2917Assert.Equal(2, memberAccess.Count); 4728Assert.Equal(3, suppressions.Count);
Symbols\TypeTests.cs (1)
674Assert.Equal(3, fields.Count);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (126)
Diagnostics\LocationsTests.cs (2)
566Assert.Equal(1, diagnostics.Count); 594Assert.Equal(1, diagnostics.Count);
LexicalAndXml\LexicalTests.cs (1)
3446Assert.Equal(6, results.Count);
LexicalAndXml\XmlDocCommentTests.cs (2)
3307Assert.Equal(actual.Count(), expected.Count); 3316for (int i = 0; i < expected.Count; i++)
Parsing\ParsingErrorRecoveryTests.cs (1)
7383Assert.Equal(3, foreachNode.ChildNodes().ToList().Count);
Parsing\RoundTrippingTests.cs (2)
60if (nodes.Count > 0) 63for (int i = 1; i < nodes.Count; i++)
Syntax\SyntaxAnnotationTests.cs (8)
354Assert.Equal(actualNodesOrTokens.Count, annotatedNodesOrTokens.Count); 477var count = GetAllNodesAndTokens(currentRoot).Count; 508var numberOfCandidates = candidatePool.Count; 581for (int i = 0; i < allNodesAndTokens.Count; i++) 777var annotation = _annotations[_random.Next(0, _annotations.Count - 1)]; 788var annotation = _annotations[_random.Next(0, _annotations.Count - 1)]; 805var annotation = _annotations[_random.Next(0, _annotations.Count - 1)];
Syntax\SyntaxFactoryTests.cs (2)
421Assert.Equal(2, tokens.Count); // { "1l", "EOF" } 435Assert.Equal(2, tokens.Count); // { "1L", "EOF" }
Syntax\SyntaxNodeTests.cs (105)
75Assert.Equal(2, nodes.Count); 88Assert.Equal(7, nodes.Count); 106Assert.Equal(8, nodes.Count); 136Assert.Equal(1, nodes.Count); 140Assert.Equal(3, nodes.Count); 146Assert.Equal(1, nodes.Count); 150Assert.Equal(2, nodes.Count); 156Assert.Equal(1, nodes.Count); 160Assert.Equal(3, nodes.Count); 166Assert.Equal(1, nodes.Count); 170Assert.Equal(2, nodes.Count); 182Assert.Equal(2, nodes.Count); 187Assert.Equal(4, nodes.Count); 194Assert.Equal(2, nodes.Count); 199Assert.Equal(3, nodes.Count); 206Assert.Equal(2, nodes.Count); 211Assert.Equal(4, nodes.Count); 218Assert.Equal(2, nodes.Count); 223Assert.Equal(3, nodes.Count); 236Assert.Equal(4, nodesAndTokens.Count); 243Assert.Equal(10, nodesAndTokens.Count); 257Assert.Equal(4, nodesAndTokens.Count); 271Assert.Equal(5, nodesAndTokens.Count); 279Assert.Equal(11, nodesAndTokens.Count); 294Assert.Equal(5, nodesAndTokens.Count); 308Assert.Equal(2, nodesAndTokens.Count); 320Assert.Equal(7, nodesAndTokens.Count); 339Assert.Equal(directives.Count, descendantDirectives.Count); 521Assert.Equal(identifierNodes.Count, nodesWithMyAnnotations.Count); 523for (int i = 0; i < identifierNodes.Count; i++) 536Assert.Equal(4, tokens.Count); 549Assert.Equal(4, tokens.Count); 562Assert.Equal(8, tokens.Count); 579Assert.Equal(3, tokens.Count); 591Assert.Equal(3, tokens.Count); 603Assert.Equal(4, tokens.Count); 616Assert.Equal(4, tokens.Count); 630Assert.Equal(4, list.Count); 647Assert.Equal(7, list.Count); 993Assert.Equal(list1.Count, list2.Count); 994for (int i = 0; i < list1.Count; i++) 1016Assert.Equal(tokens.Count - 1, list.Count); 1017for (int i = 0; i < list.Count; i++) 1034Assert.Equal(6, tokens.Count); 1037var list = new List<SyntaxToken>(tokens.Count); 1045Assert.Equal(tokens.Count, list.Count); 1046for (int i = 0; i < tokens.Count; i++) 1060Assert.Equal(6, tokens.Count); 1062var list = new List<SyntaxToken>(tokens.Count); 1071Assert.Equal(tokens.Count - 1, list.Count); 1072for (int i = 0; i < list.Count; i++) 1093Assert.Equal(tokens.Count - 1, list.Count); 1094for (int i = 0; i < list.Count; i++) 1116Assert.Equal(tokens.Count - 1, list.Count); 1117for (int i = 0; i < list.Count; i++) 1134Assert.Equal(6, tokens.Count); 1137var list = new List<SyntaxToken>(tokens.Count); 1146Assert.Equal(tokens.Count, list.Count); 1147for (int i = 0; i < tokens.Count; i++) 1164Assert.Equal(6, tokens.Count); 1166var list = new List<SyntaxToken>(tokens.Count); 1176Assert.Equal(tokens.Count, list.Count + 1); 1177for (int i = 0; i < list.Count; i++) 1200Assert.Equal(tokens.Count - 1, list.Count); 1201for (int i = 0; i < list.Count; i++) 1221Assert.Equal(tokens.Count, list.Count); 1222for (int i = 0; i < tokens.Count; i++) 1242Assert.Equal(tokens.Count, list.Count); 1243for (int i = 0; i < tokens.Count; i++) 1266Assert.Equal(tokens.Count - 1, list.Count); 1267for (int i = 0; i < list.Count; i++) 1289Assert.Equal(tokens.Count - 1, list.Count); 1290for (int i = 0; i < list.Count; i++) 1307Assert.Equal(children.Count, list.Count); 1308for (int i = 0; i < children.Count; i++) 1321for (var child = children[children.Count - 1]; child.Kind() != SyntaxKind.None; child = child.GetPreviousSibling()) 1326Assert.Equal(children.Count, list.Count); 1327for (int i = 0; i < reversed.Count; i++) 1525Assert.Equal(5, related.Count); 1556Assert.Equal(5, related.Count); 1592Assert.Equal(5, related.Count); 1626Assert.Equal(5, related.Count); 1660Assert.Equal(5, related.Count); 1691Assert.Equal(5, related.Count); 1721Assert.Equal(5, related.Count); 1744Assert.Equal(2, related.Count); 1765Assert.Equal(2, related.Count); 3395Assert.Equal(1, diag.Count); 3445Assert.Equal(3, diag.Count);
Syntax\TrackNodeTests.cs (3)
140Assert.Equal(2, nodes.Count); 152Assert.Equal(3, ids.Count); 171Assert.Equal(3, ids.Count);
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
776var baseTypeList = itypes?.Count > 0 ? SyntaxFactory.BaseList([.. itypes]) : null; 792if (itypes?.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
900finalTrivia.RemoveAt(finalTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
227if (members.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
30if (members.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
324if (types.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
180for (var i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.EditorFeatures (9)
ExtractMethod\ExtractMethodCommandHandler.cs (1)
96if (spans.Count != 1)
Peek\DefinitionPeekableItem.cs (2)
85if (sourceLocations.Count == 0) 103callback.ReportProgress(100 * ++processedSourceLocations / sourceLocations.Count);
Preview\AbstractPreviewFactoryService.cs (2)
773if (lineSpans.Count > 0) 782lineSpans.RemoveAt(lineSpans.Count - 1);
Preview\SolutionPreviewResult.cs (1)
78return result.Count == 0 ? null : result;
Shared\Extensions\IProjectionBufferFactoryServiceExtensions.cs (1)
296if (spans.Count >= 0)
Shared\Utilities\LinkedEditsTracker.cs (2)
69if (trackingSpansAfterEdit.Count != normalizedTrackingSpansAfterEdit.Count) 93if (trackingSpansThatIntersect.Count != 1)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (9)
Classification\ClassificationTestHelper.cs (4)
39var max = Math.Max(expectedClassificationList.Count, actualClassificationList.Count); 42if (i >= expectedClassificationList.Count) 46else if (i >= actualClassificationList.Count)
Completion\AbstractCompletionProviderTests.cs (1)
308Assert.Equal(matchingFilters.Count, matchingFilters.Distinct().Count());
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (2)
70for (var j = 0; j < Math.Max(highlightSpans.Count, expectedHighlightSpans.Count); j++) 78else if (j >= highlightSpans.Count)
NavigateTo\AbstractNavigateToTests.cs (2)
168Assert.Equal(expecteditems.Count, items.Count()); 170for (var i = 0; i < expecteditems.Count; i++)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CommentSelection\CommentUncommentSelectionCommandHandlerTests.cs (1)
799if (spans.Count == 1)
Diagnostics\IDEDiagnosticIDUniquenessTest.cs (1)
21Assert.Equal(listOfIDEDiagnosticIds.Count, listOfIDEDiagnosticIds.Distinct().Count());
Utilities\BloomFilterTests.cs (2)
240for (var i = 0; i < allHashSets.Count; i++) 279for (var i = 0; i < ints.Count; i += 2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (4)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\ArrayBuilder.cs (4)
41get { return _items.Count; } 64return _items[_items.Count - 1]; 74var position = _items.Count - 1; 105return (_items.Count > 0) ? new ReadOnlyCollection<T>(_items.ToArray()) : s_empty;
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (4)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\ArrayBuilder.cs (4)
41get { return _items.Count; } 64return _items[_items.Count - 1]; 74var position = _items.Count - 1; 105return (_items.Count > 0) ? new ReadOnlyCollection<T>(_items.ToArray()) : s_empty;
Microsoft.CodeAnalysis.Extensions.Package (2)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
LanguageServices\FSharpVisualStudioWorkspaceExtensions.cs (1)
26if (projects.Count == 1)
SignatureHelp\FSharpSignatureHelpItems.cs (1)
83if (selectedItem.HasValue && items.Count != distinctItems.Count)
Microsoft.CodeAnalysis.Features (50)
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (1)
54if (otherProjects.Count > projectsToShow)
BraceMatching\AbstractBraceMatcher.cs (1)
38if (braceTokens.Count == 2 &&
ChangeSignature\ParameterConfiguration.cs (2)
32if (parametersList.Count > 0 && isExtensionMethod) 43parametersList.RemoveAt(parametersList.Count - 1);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
132if (attributeRemoveFixes.Count > 0)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
477if (refLocationsInSolution.Length != refLocationsInOtherDocuments.Count)
Completion\CompletionService_GetCompletions.cs (1)
412for (var i = 0; i < sameNamedItems.Count; i++)
Completion\Providers\SymbolCompletionItem.cs (2)
143if (idList.Count > 0) 165for (var i = 0; i < ids.Count;)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (4)
135if (_listStack.Count == 0) 154if (_listStack.Count == 0) 164_listStack.RemoveAt(_listStack.Count - 1); 240for (var i = 0; i < _listStack.Count; i++)
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (3)
186Debug.Assert(lines.Count > 2); 253for (var i = 1; i < lines.Count; i++) 344Debug.Assert(lines.Count > 2);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (15)
1437if (oldAncestors.Count > 0 || newAncestors.Count > 0) 1445Debug.Assert(oldAncestors.Count == newAncestors.Count); 1644if (exceptionHandlingAncestors.Count == 0) 1652for (var i = exceptionHandlingAncestors.Count - 1; i >= 0; i--) 1909if (areSimilar != null && matchCount < Math.Min(oldNodes.Count, newNodes.Count)) 1919if (matchCount < newNodes.Count) 1927var oldNodeCount = (oldNodes != null) ? oldNodes.Count : 0; 1929for (var i = 0; i < newNodes.Count; i++) 1965for (var newIndex = 0; newIndex < newNodes.Count; newIndex++) 1974while (oldIndex < oldNodes.Count) 1987if (oldIndex == oldNodes.Count) 2051for (var i = startIndex; i < oldNodes.Count; i++)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (2)
87if (embeddedContext.Items.Count == 0) 134if (context.Items.Count > 0)
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (3)
83LeadingTrivia = CreateTriviaListFromTo(list, index + 1, list.Count - 1) 89for (var i = 0; i < list.Count; i++) 97return list.Count - 1;
ExtractMethod\MethodExtractor.Analyzer.cs (2)
82if (failedVariables.Count > 0) 90Contract.ThrowIfFalse(unused.Count == 0);
GenerateType\AbstractGenerateTypeService.cs (2)
186var arity = arguments.Count; 195var argument = i < arguments.Count ? arguments[i] : null;
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
89if (listOfParametersOrdinals.Count < 2)
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
103var isEmpty = filteredList.Count == 0;
SignatureHelp\SignatureHelpItems.cs (1)
78if (selectedItem.HasValue && items.Count != distinctItems.Count)
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
131var nodeWithTrivia = node.ReplaceTokens(allTokens.Skip(1).Take(allTokens.Count - 2),
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
145.Where(nameAttributes => nameAttributes.Count == 1) 158if (paramNameAttributesForNode.Count != 1)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
95if (paramNodeIndex + 1 < paramNodeSiblings.Count)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
161for (var i = removalList.Count - 1; i >= 0; i--)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
84for (var i = classTypes.Count - 1; i >= 0; i--) 89for (var j = 0; j < classTypes.Count; j++)
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\SourceMarkers.cs (1)
206while (i >= list.Count)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
45Assert.True(results.Distinct().Count() == results.Count);
Microsoft.CodeAnalysis.InteractiveHost (3)
Interactive\Core\InteractiveHost.Service.cs (1)
642if (attempts.Count > 0)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\DecompiledSource\AssemblyResolver.cs (2)
87if (assemblies.Count == 1) 99Log(FeaturesResources.Found_0_assemblies_for_1, assemblies.Count, name.Name);
Handler\ResolveCache.cs (1)
66if (_resultIdToCachedItem.Count >= _maxCacheSize)
Protocol\Converters\SumConverter.cs (1)
90if ((objectUnionTypeInfosSet?.Count ?? 0) > 1)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (3)
164Assert.Equal(supportedOptions.Sum(option => option is IPerLanguageValuedOption ? 2 : 1), expectedValues.Count); 169for (var i = 0; i < expectedValues.Count; i++) 214Assert.Equal(expectConfigurationItemsNumber, MockClientSideValues.Count);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (46)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
87for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 100if (result == 0 && usedFieldsAndValues.Count > 0) 104for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 155for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (4)
27addBlankLine = newImports.Count > 0; 49for (var i = 0; i < newImports.Count; i++) 78if (originalLastUsingCurrentIndex != newImports.Count - 1) 86for (var i = 0; i < newImports.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
Microsoft.CodeAnalysis.PublicApiAnalyzers (37)
DeclarePublicApiAnalyzer.cs (2)
130Debug.Assert(errors.Count == 0); 406return errors.Count == 0;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (2)
AnnotatePublicApiFix.cs (1)
89for (int i = 0; i < lines.Count; i++)
DeclarePublicApiFix.cs (1)
151for (int i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Host\TestUtils.cs (1)
87if (items.Count == 0)
Services\DiagnosticAnalyzer\PerformanceQueue.cs (1)
120var squareLength = Math.Sqrt(data.Count);
Microsoft.CodeAnalysis.ResxSourceGenerator (35)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
Microsoft.CodeAnalysis.Scripting (2)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (1)
296for (int i = 0; i < members.Count; i++)
Hosting\SynchronizedList.cs (1)
42return _list.Count;
Microsoft.CodeAnalysis.Test.Utilities (16)
Assert\AssertEx.cs (3)
874if (list.Count != 0) 876Fail($"Expected 0 items but found {list.Count}: {message}\r\nItems:\r\n {string.Join("\r\n ", list)}"); 990.AppendLine($"{exceptions.Count} out of {assertions.Length} assertions failed.")
Diagnostics\DiagnosticExtensions.cs (1)
96if (unmatchedActualDescription.Count > 0 || unmatchedExpected.Count > 0)
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
176Assert.True(missingElements.Count == 0,
MarkedSource\MarkupTestFile.cs (1)
84if (matches.Count == 0)
Metadata\ILBuilderVisualizer.cs (1)
89int n = spans.Count;
Metadata\ILValidation.cs (2)
349for (var i = 0; i < rvasAndNames.Count; i++) 352var endRva = i + 1 < rvasAndNames.Count ? rvasAndNames[i + 1].rva : il.Length;
Platform\Custom\MetadataSignatureHelper.cs (3)
178return list.Count > 0; 197return list.Count > 0; 210return list.Count > 0;
Platform\Desktop\DesktopRuntimeEnvironment.cs (2)
115while (i < s_runtimeDataCache.Count) 237if (Data != null && s_runtimeDataCache.Count < MaxCachedRuntimeData)
Platform\Desktop\RuntimeAssemblyManager.cs (1)
138return _mainMvids.Count == 0
SourceGeneration\TestGenerators.cs (1)
33hintName ??= "generatedFile" + (_sources.Any() ? (_sources.Count + 1).ToString() : "");
Microsoft.CodeAnalysis.Threading.Package (2)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
Microsoft.CodeAnalysis.UnitTests (25)
Analyzers\AnalyzerFileReferenceTests.cs (8)
155Assert.Equal(2, errors.Count); 174Assert.Equal(1, errors.Count); 191Assert.Equal(0, errors.Count); 251Assert.Equal(1, errors.Count); 269Assert.Equal(1, errors.Count); 291Assert.Equal(1, errors.Count); 460Assert.Equal(2, errors.Count); 501if (errors.Count > 0)
CachingLookupTests.cs (2)
91Assert.Equal(l1.Count, l2.Count);
Collections\ImmutableListTestBase.cs (2)
459for (int index = 0; index < basis.Count - 1; index++) 461for (int count = 0; count <= basis.Count - index; count++)
Collections\ImmutableSegmentedListTest.cs (7)
67int position = random.Next(expected.Count + 1); 76position = random.Next(expected.Count + 1); 82if (expected.Count > 0) 84position = random.Next(expected.Count); 92position = random.Next(expected.Count); 93inputLength = random.Next(expected.Count - position); 227int startPosition = random.Next(list.Count + 1);
Collections\List\TestBase.Generic.cs (2)
203while (list.Count < count) 214Debug.Assert(list.Count == count);
Diagnostics\DiagnosticLocalizationTests.cs (2)
298Assert.Equal(3, exceptions.Count); 325Assert.Equal(3, exceptionDiagnostics.Count);
InternalUtilities\WeakListTests.cs (1)
94Assert.Equal(1, nonWeakList.Count);
Text\TextChangeTests.cs (1)
268Assert.Equal(changes.Length, result.Count);
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\VisualBasicCommandLineArguments.vb (1)
74If Me.DefaultCoreLibraryReference IsNot Nothing AndAlso resolved.Count > 0 Then
Microsoft.CodeAnalysis.Workspaces (73)
CodeCleanup\AbstractCodeCleanerService.cs (1)
433if (annotations.Count != 1)
Differencing\Match.cs (2)
168var count1 = s1.Count; 169var count2 = s2.Count;
Editing\SymbolEditor.cs (2)
156if (symbols.Count == 1) 160else if (symbols.Count > 1)
FindSymbols\SymbolTree\SymbolTreeInfo.cs (1)
445for (var i = 0; i < orderedKeys1.Count; i++)
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (1)
562if (baseTypeNameParts.Count > 0 &&
Log\StatisticResult.cs (4)
16if (values.Count == 0) 25for (var i = 0; i < values.Count; i++) 34var mean = (double)total / values.Count; 39return new StatisticResult(max, min, mean, range, mode, values.Count);
Rename\ConflictEngine\ConflictingIdentifierTracker.cs (1)
76if (currentIdentifiers.Count == 0)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
225for (var i = 0; i < conflictResolution.RelatedLocations.Count; i++)
Shared\Extensions\INamespaceSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 54return names1.Count - names2.Count;
Shared\TestHooks\AsynchronousOperationListener.cs (1)
141while (i < _diagnosticTokenList.Count)
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (1)
145if (tasks.Count == 0)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
87for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 100if (result == 0 && usedFieldsAndValues.Count > 0) 104for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 155for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (4)
27addBlankLine = newImports.Count > 0; 49for (var i = 0; i < newImports.Count; i++) 78if (originalLastUsingCurrentIndex != newImports.Count - 1) 86for (var i = 0; i < newImports.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
Workspace\ProjectSystem\ProjectSystemProject.cs (7)
595var hasAnalyzerChanges = _analyzersAddedInBatch.Count > 0 || _analyzersRemovedInBatch.Count > 0; 722if (metadataReferencesAddedInBatch.Count > 0) 780if (analyzersRemovedInBatch.Count == 0 && analyzersAddedInBatch.Count == 0) 800Contract.ThrowIfTrue(analyzersRemoved.Count == 0 && analyzersAdded.Count == 0, "Should only be called when there is work to do");
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
513else if (distinctProjectsForOutputPath.Count == 1)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
30if (referencedProjectIds.Count == 0)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
257var addDiscriminator = idsAndFileInfos.Count > 1;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (8)
MSBuild\Logging\DiagnosticLog.cs (2)
15public int Count => _items.Count; 17public bool IsEmpty => _items.Count == 0;
MSBuild\ProjectFile\ProjectFile.cs (1)
464if (items.Count == 1)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (9)
RpcTests.cs (1)
271while (_completionSources.Count <= index)
VisualStudioMSBuildWorkspaceTests.cs (8)
85Assert.Equal(4, references.Count); 95Assert.Equal(5, compReferences.Count); 770Assert.Equal(6, documents.Count); 850Assert.Equal(2, documents.Count); 2004Assert.Equal(4, documents.Count); 2023Assert.Equal(4, documentsB.Count); 2047Assert.Equal(3, documents.Count); 2977Assert.Equal(3, docs.Count);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestHelpers.cs (1)
164var id = namingRules.Count;
Microsoft.CodeAnalysis.Workspaces.UnitTests (24)
FindReferencesTests.cs (9)
107Assert.Equal(1, result.Count); // 1 symbol found 132Assert.Equal(9, result.Count); 330Assert.Equal(2, result.Count); // 2 symbols found 341Assert.Equal(2, result.Count); // 2 symbols found 352Assert.Equal(2, result.Count); // 2 symbols found 394Assert.Equal(2, references.Count); 545Assert.Equal(2, result.Count); 578Assert.Equal(2, result.Count); 620Assert.Equal(2, result.Count);
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (3)
24for (var i = 0; i < updatedTexts.Count; i++) 40for (var i = 0; i < updatedTexts.Count; i++) 51for (var i = 0; i < updatedTexts.Count; i++)
SolutionTests\SolutionTests.cs (2)
2904Assert.Equal(docs.Count, trees.Count);
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
172Assert.Equal(2, generatedDocuments.Count);
SymbolKeyTests.cs (8)
333Assert.Equal(5, symbols.Count); 543Assert.Equal(7, symbols.Count); 565Assert.Equal(3, symbols.Count); 592Assert.Equal(2, symbols.Count); 621Assert.True(symbols.Count > 0); 680Assert.Equal(2, symbols.Count); 686Assert.Equal(2, refSymbols.Count); 705Assert.Equal(2, symbols.Count);
SyntaxNodeTests.cs (1)
76Assert.Equal(computations, nodes.Count);
Microsoft.CSharp (44)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (1)
369Debug.Assert(argNames.Count <= argCount - discard);
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (1)
913Debug.Assert(expressions.Count == arrinit.DimensionSizes[0]);
Microsoft\CSharp\RuntimeBinder\Semantics\Binding\Better.cs (3)
494Debug.Assert(list.Count != 0); 517for (int i = 1; i < list.Count; i++) 540if (i < list.Count)
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (15)
839iuciBestSrc = prguci.Count - 1; 846iuciBestSrc = prguci.Count - 1; 850Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count - 1); 855iuciBestSrc = prguci.Count - 1; 866iuciBestDst = prguci.Count - 1; 873iuciBestDst = prguci.Count - 1; 877Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count - 1); 882iuciBestDst = prguci.Count - 1; 897Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 898Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 905for (int iuci = 0; iuci < prguci.Count; iuci++) 1085Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 1086Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 1531return list == null || list.Count == 0; 1539T[] array = new T[list.Count];
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (4)
304for (int i = 0; i < src.prgexpr.Count; i++) 318if (_methList.Count == 1) 470if (i < pArguments.prgexpr.Count) 1011if (_pArguments.prgexpr == null || _pArguments.prgexpr.Count == 0)
Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs (1)
113if (paramNames[i] != named.Name || i == paramNames.Count - 1 && i != args.carg - 1)
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (1)
1601if (_pExactBounds[iParam].Count >= 2)
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (14)
413if (binopSignatures.Count == 1) 421for (index = 1; index < binopSignatures.Count; index++) 449for (index = 0; index < binopSignatures.Count; index++) 541Debug.Assert(binopSignatures.Count > 0); 542bestBinopSignature = binopSignatures.Count - 1; 544else if (binopSignatures.Count == 0) 567Debug.Assert(bestBinopSignature < binopSignatures.Count); 1213int nBestSignature = pSignatures.Count - 1; 1229if (pSignatures.Count == 0) 1236if (pSignatures.Count != 1) 1239for (int iuofs = 1; iuofs < pSignatures.Count; iuofs++) 1265for (int iuofs = 0; iuofs < pSignatures.Count; iuofs++) 1280nBestSignature = pSignatures.Count - 1; 1284Debug.Assert(nBestSignature < pSignatures.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (1)
48if (iv >= prgptvs.Count)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (3)
159for (int i = inheritance.Count - 1; i >= 0; --i) 601for (int i = 0; i < declarationChain.Count; i++) 641Debug.Assert(i + 1 < declarationChain.Count);
Microsoft.Data.Analysis (37)
DataFrame.IO.cs (1)
413if (linesForGuessType.Count < guessRows || (header && rowline == 0))
DataFrameColumn.cs (3)
488if (tuplesOfSortAndBufferIndex.Count == 1) 495sortAndBufferIndex = tuplesOfSortAndBufferIndex[tuplesOfSortAndBufferIndex.Count - 1]; 496tuplesOfSortAndBufferIndex.RemoveAt(tuplesOfSortAndBufferIndex.Count - 1);
DataFrameColumns\ArrowStringDataFrameColumn.cs (2)
270while (ret.Count < length) 303while (ret.Count < length)
DataFrameColumns\StringDataFrameColumn.cs (17)
30long bufferLen = length - _stringBuffers.Count * MaxCapacity; 44if (_stringBuffers.Count == 0) 70List<string> lastBuffer = _stringBuffers[_stringBuffers.Count - 1]; 71if (lastBuffer.Count == MaxCapacity) 123while (ret.Count < length && bufferIndex < _stringBuffers.Count) 125for (int i = bufferOffset; ret.Count < length && i < _stringBuffers[bufferIndex].Count; i++) 170while (ret.Count < length && bufferIndex < _stringBuffers.Count) 172for (int i = bufferOffset; ret.Count < length && i < _stringBuffers[bufferIndex].Count; i++) 209List<int[]> bufferSortIndices = new List<int[]>(_stringBuffers.Count); 214var sortIndices = new int[buffer.Count]; 215for (int i = 0; i < buffer.Count; i++) 220columnNullIndices[nullIndicesSlot] = i + bufferSortIndices.Count * MaxCapacity; 242for (int i = 0; i < buffers.Count; i++)
DataFrameColumns\VBufferDataFrameColumn.cs (8)
34int bufferLen = (int)Math.Min(MaxCapacity, length - _vBuffers.Count * MaxCapacity); 47if (_vBuffers.Count == 0) 72List<VBuffer<T>> lastBuffer = _vBuffers[_vBuffers.Count - 1]; 73if (lastBuffer.Count == MaxCapacity) 108while (ret.Count < length && bufferIndex < _vBuffers.Count) 110for (int i = bufferOffset; ret.Count < length && i < _vBuffers[bufferIndex].Count; i++)
IDataView.Extension.cs (1)
131Delegate[] activeColumnDelegates = new Delegate[activeDataViewColumns.Count];
PrimitiveDataFrameColumn.Sort.cs (3)
86if (bufferSortIndices[i].Count == 0) 103GetBufferSortIndex getBufferSortIndex = new GetBufferSortIndex((int bufferIndex, int sortIndex) => (bufferSortIndices[bufferIndex][sortIndex]) + bufferIndex * bufferSortIndices[0].Count); 105GetBufferLengthAtIndex getBufferLengthAtIndex = new GetBufferLengthAtIndex((int bufferIndex) => bufferSortIndices[bufferIndex].Count);
StringDataFrameColumn.BinaryOperations.cs (2)
43for (int i = 0; i < ret._stringBuffers.Count; i++) 58for (int i = 0; i < ret._stringBuffers.Count; i++)
Microsoft.DotNet.ArcadeAzureIntegration (1)
DefaultIdentityTokenCredential.cs (1)
105if (tokenCredentials.Count == 0)
Microsoft.DotNet.Build.Manifest (4)
BuildModelFactory.cs (4)
251if (models == null || models.Count == 0) 258if (models.Count == 1) 268for (int i = 0; i < models.Count; i++) 334if (differences.Count > 0)
Microsoft.DotNet.Build.Manifest.Tests (3)
BuildModelFactoryTests.cs (3)
843result.Artifacts.Blobs.Count.Should().Be(2); 844result.Artifacts.Packages.Count.Should().Be(2); 845result.Artifacts.Pdbs.Count.Should().Be(2);
Microsoft.DotNet.Build.Tasks.Feed (1)
src\PushToBuildStorage.cs (1)
321if (string.IsNullOrEmpty(PdbArtifactsLocalStorageDir) && buildModel.Artifacts.Pdbs.Count > 0)
Microsoft.DotNet.Build.Tasks.Feed.Tests (10)
PushToBuildStorageTests.cs (10)
203model.Artifacts.Packages.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Package")); 204model.Artifacts.Blobs.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Blob")); 205model.Artifacts.Pdbs.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Pdb")); 267model.Artifacts.Packages.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Package")); 268model.Artifacts.Blobs.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Blob")); 269model.Artifacts.Pdbs.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Pdb")); 324model.Artifacts.Pdbs.Count.Should().Be(2); 733model.Artifacts.Packages.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Package")); 734model.Artifacts.Blobs.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Blob")); 735model.Artifacts.Pdbs.Count.Should().Be(DefaultTaskItems.Count(i => i.GetMetadata("Kind") == "Pdb"));
Microsoft.DotNet.Build.Tasks.Installers (8)
src\RpmBuilder.cs (6)
188if (_provides.Count != 0) 194if (_conflicts.Count != 0) 200if (_requires.Count != 0) 206if (_changelogLines.Count != 0) 295directoryIndex = directories.Count; 303fileClassIndex = fileClassDictionary.Count;
src\RpmHeader.cs (2)
240BinaryPrimitives.WriteInt32BigEndian(numIndexEntries, Entries.Count + 1); 356Offset = -(Entries.Count + 1) * Unsafe.SizeOf<IndexEntry>(),
Microsoft.DotNet.Build.Tasks.Packaging (1)
GetPackageDestination.cs (1)
124if (_packageDestinations.Count == 0)
Microsoft.DotNet.Build.Tasks.Workloads (1)
Msi\WorkloadPackGroupMsi.wix.cs (1)
95componentGroupRefElement.ReplaceWith(Enumerable.Range(1, _package.Packs.Count).Select(n => new XElement(ns + "ComponentGroupRef", new XAttribute("Id", "CG_PackageContents" + n))));
Microsoft.DotNet.Helix.Client (1)
generated-code\HelixApi.cs (1)
427for (int index = 0; index < Count; ++index)
Microsoft.DotNet.Helix.Sdk (1)
SendHelixJob.cs (1)
336if (commands.Count == 1)
Microsoft.DotNet.SignCheckLibrary (1)
Verification\Exclusions.cs (1)
30return _exclusions.Count;
Microsoft.DotNet.SignCheckTask (1)
src\SignCheck.cs (1)
282if (downloadFiles.Count > 0)
Microsoft.DotNet.SignTool (6)
src\BatchSignUtil.cs (6)
258_log.LogMessage(MessageImportance.High, $"Repacking {smallRepackList.Count} containers in parallel."); 266if (largeRepackList.Count == 0) 271_log.LogMessage(MessageImportance.High, $"Repacking {largeRepackList.Count} large containers in serial."); 314while (i < toProcessList.Count) 344while (toProcessList.Count > 0) 347if (trackList.Count == 0)
Microsoft.DotNet.StrongName (2)
Utils.cs (2)
286Debug.Assert(segment.Count > 0); 289int count = segment.Count;
Microsoft.DotNet.XliffTasks (1)
Model\UnstructuredDocument.cs (1)
54_nodes.Add(new UnstructuredTranslatableNode(_fragments, _fragments.Count, id, source));
Microsoft.DotNet.XUnitExtensions (2)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (1)
101if (falseConditions.Count > 0)
src\Microsoft.DotNet.XUnitExtensions.Shared\XunitParallelTheoryTestCaseRunner.cs (1)
135var runningTests = new List<Task<RunSummary>>(_testRunners.Count);
Microsoft.DotNet.XUnitV3Extensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (1)
101if (falseConditions.Count > 0)
Microsoft.Extensions.AI (9)
ChatCompletion\ChatClientBuilder.cs (1)
50for (var i = _clientFactories.Count - 1; i >= 0; i--)
ChatCompletion\FunctionInvokingChatClient.cs (6)
369if (functionCallContents is not { Count: > 0 } || 575Debug.Assert(functionCallContents.Count > 0, "Expected at least one function call."); 580if (functionCallContents.Count == 1) 604from callIndex in Enumerable.Range(0, functionCallContents.Count) 614for (int callIndex = 0; callIndex < functionCallContents.Count; callIndex++) 719FunctionCount = callContents.Count,
Embeddings\EmbeddingGeneratorBuilder.cs (1)
55for (var i = _generatorFactories.Count - 1; i >= 0; i--)
SpeechToText\SpeechToTextClientBuilder.cs (1)
49for (var i = _clientFactories.Count - 1; i >= 0; i--)
Microsoft.Extensions.AI.Abstractions (15)
ChatCompletion\ChatResponseExtensions.cs (2)
197while (start < contents.Count - 1) 218for (; i < contents.Count && contents[i] is TContent next; i++)
Embeddings\GeneratedEmbeddings.cs (1)
56public int Count => _embeddings.Count;
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (5)
142List<JsonSchema>? anyOf = new(derivedTypes.Count); 165state.PushSchemaNode(anyOf.Count.ToString(CultureInfo.InvariantCulture)); 178if (anyOf.Count == 0) 498public int CurrentDepth => _currentPath.Count; 512_currentPath.RemoveAt(_currentPath.Count - 1);
Utilities\AIJsonUtilities.Schema.Transform.cs (7)
76path?.RemoveAt(path.Count - 1); 79path?.RemoveAt(path.Count - 1); 86path?.RemoveAt(path.Count - 1); 94path?.RemoveAt(path.Count - 1); 101path?.RemoveAt(path.Count - 1); 120path?.RemoveAt(path.Count - 1); 123path?.RemoveAt(path.Count - 1);
Microsoft.Extensions.AI.Abstractions.Tests (7)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (3)
138Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), message.Contents.Count); 141Assert.Equal(expected.Count, contents.Length); 142for (int i = 0; i < expected.Count; i++)
SpeechToText\SpeechToTextClientTests.cs (1)
70Assert.Equal(3, updates.Count);
SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (3)
124Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), response.Contents.Count); 127Assert.Equal(expected.Count, contents.Length); 128for (int i = 0; i < expected.Count; i++)
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
479else if (GetContentParts(input.Contents) is { Count: > 0 } parts)
Microsoft.Extensions.AI.AzureAIInference.Tests (5)
AzureAIInferenceChatClientTests.cs (5)
234Assert.Equal(12, updates.Count); 235for (int i = 0; i < updates.Count; i++) 1347Assert.Equal(10, updates.Count); 1348for (int i = 0; i < updates.Count; i++) 1358FunctionCallContent fcc = Assert.IsType<FunctionCallContent>(Assert.Single(updates[updates.Count - 1].Contents));
Microsoft.Extensions.AI.Evaluation (1)
ChatMessageExtensions.cs (1)
74int lastMessageIndex = conversationHistory.Count - 1;
Microsoft.Extensions.AI.Evaluation.Safety (15)
ContentSafetyServicePayloadUtilities.cs (15)
448turns.RemoveRange(index: 0, count: turns.Count - 1); 535if (normalizedPerTurnContext.Count > turns.Count) 537var ignoredContextCount = normalizedPerTurnContext.Count - turns.Count; 542$"The supplied conversation contained {turns.Count} turns. " + 543$"However, context for {normalizedPerTurnContext.Count} turns were supplied as part of the context collection. " + 545$"Only the last {turns.Count} items from the context collection were used.")); 549else if (normalizedPerTurnContext.Count < turns.Count) 551int missingContextCount = turns.Count - normalizedPerTurnContext.Count; 556$"The supplied conversation contained {turns.Count} turns. " + 557$"However, context for only {normalizedPerTurnContext.Count} turns were supplied as part of the context collection. " + 559$"The supplied items in the context collection were applied to the last {normalizedPerTurnContext.Count} turns."));
Microsoft.Extensions.AI.Integration.Tests (8)
ChatClientIntegrationTests.cs (2)
148Assert.True(chunks.Count > 1); 167Assert.Equal(2, history.Count);
PromptBasedFunctionCallingChatClient.cs (1)
64for (var messageIndex = 0; messageIndex < chatMessagesList.Count; messageIndex++)
ReducingChatClientTests.cs (4)
56Assert.Equal(5, messages.Count); 137if (list.Count > 1) 139int totalCount = CountTokens(list[list.Count - 1]); 141for (int i = list.Count - 2; i >= 0; i--)
VerbatimMultiPartHttpHandler.cs (1)
132if (parameters[key] is List<JsonElement> list && list.Count == 1)
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
277if (message.Content?.Length > 0 || contents.Count == 0)
Microsoft.Extensions.AI.Ollama.Tests (7)
OllamaChatClientTests.cs (7)
185Assert.Equal(21, updates.Count); 189for (int i = 0; i < updates.Count; i++) 193Assert.Equal(i < updates.Count - 1 ? 1 : 2, updates[i].Contents.Count); 197Assert.Equal(i < updates.Count - 1 ? null : ChatFinishReason.Length, updates[i].FinishReason); 201Assert.Equal(2, updates[updates.Count - 1].Contents.Count); 202Assert.IsType<TextContent>(updates[updates.Count - 1].Contents[0]); 203UsageContent usage = Assert.IsType<UsageContent>(updates[updates.Count - 1].Contents[1]);
Microsoft.Extensions.AI.OpenAI (4)
OpenAIAssistantChatClient.cs (2)
427if (messageContents.Count > 0) 448if (toolResults?.Count > 0)
OpenAIChatClient.cs (1)
232if (parts.Count == 0)
OpenAIResponseChatClient.cs (1)
655if (parts.Count == 0)
Microsoft.Extensions.AI.OpenAI.Tests (9)
OpenAIChatClientTests.cs (5)
246Assert.Equal(12, updates.Count); 247for (int i = 0; i < updates.Count; i++) 1319Assert.Equal(10, updates.Count); 1320for (int i = 0; i < updates.Count; i++) 1330FunctionCallContent fcc = Assert.IsType<FunctionCallContent>(Assert.Single(updates[updates.Count - 1].Contents));
OpenAIResponseClientTests.cs (4)
262Assert.Equal(17, updates.Count); 264for (int i = 0; i < updates.Count; i++) 272Assert.Equal(i < updates.Count - 1 ? null : ChatFinishReason.Stop, updates[i].FinishReason); 275for (int i = 4; i < updates.Count; i++)
Microsoft.Extensions.AI.Tests (9)
ChatCompletion\FunctionInvokingChatClientTests.cs (9)
632for (int i = 0; i < activities.Count - 1; i++) 635Assert.Same(activities[activities.Count - 1], activities[i].Parent); 807Assert.Equal(messages.Count, context.Messages.Count); 1046Assert.Equal(expected.Count, chat.Count); 1047for (int i = 0; i < expected.Count; i++) 1140Assert.Equal(expected.Count, chat.Count); 1141for (int i = 0; i < expected.Count; i++)
Microsoft.Extensions.AsyncState (2)
AsyncState.cs (1)
99var difference = count - features.Count;
FeaturesPooledPolicy.cs (1)
20for (int i = 0; i < obj.Count; i++)
Microsoft.Extensions.AsyncState.Tests (3)
AsyncStateTests.cs (3)
220Assert.Equal(5, l.Count); 228Assert.Equal(5, l.Count); 236Assert.Equal(5, l.Count);
Microsoft.Extensions.Caching.Abstractions (1)
CacheEntryExtensions.cs (1)
178for (int i = 0; i < postEvictionCallbacks.Count; i++)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
LogCollector.cs (1)
39if (errorIds.Length == _items.Count)
Microsoft.Extensions.Caching.Memory (5)
CacheEntry.CacheEntryTokens.cs (4)
34for (int i = 0; i < expirationTokens.Count; i++) 53for (int i = 0; i < expirationTokens.Count; i++) 95for (int i = 0; i < registrations.Count; i++) 124for (int i = 0; i < callbackRegistrations.Count; i++)
MemoryCache.cs (1)
447for (int i = all.Count - 1; i >= 0; i--)
Microsoft.Extensions.Compliance.Testing (4)
FakeRedactionCollector.cs (4)
28if (_redactorRequestedLog.Count == 0) 33return _redactorRequestedLog[_redactorRequestedLog.Count - 1]; 62if (_dataRedactedLog.Count == 0) 67return _dataRedactedLog[_dataRedactedLog.Count - 1];
Microsoft.Extensions.Configuration (4)
ConfigurationManager.cs (2)
170return $"Sections = {ConfigurationSectionDebugView.FromConfiguration(this, this).Count}"; 206public int Count => _sources.Count;
ConfigurationRoot.cs (1)
144return $"Sections = {ConfigurationSectionDebugView.FromConfiguration(this, this).Count}";
ConfigurationSection.cs (1)
125var childCount = Configuration.ConfigurationSectionDebugView.FromConfiguration(this, _root).Count;
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
898Array result = Array.CreateInstance(elementType, list.Count);
Microsoft.Extensions.Configuration.KeyPerFile.Tests (4)
ConfigurationProviderTestBase.cs (4)
255Assert.Equal(3, sections.Count); 271Assert.Equal(2, sections.Count); 283Assert.Equal(2, sections.Count); 295Assert.Equal(3, sections.Count);
Microsoft.Extensions.Configuration.Xml (3)
XmlStreamConfigurationProvider.cs (3)
292for (var i = 0; i < element.Attributes.Count; i++) 334if (childrenWithSameSiblingName.Count == 1) 343for (int i = 0; i < childrenWithSameSiblingName.Count; i++)
Microsoft.Extensions.DependencyInjection (13)
DependencyInjectionEventSource.cs (3)
152int providersCount = _providers.Count; 157_survivingProvidersCount = _providers.Count; 171for (int i = _providers.Count - 1; i >= 0; i--)
ServiceLookup\CallSiteFactory.cs (5)
357callSites = new ServiceCallSite[callSitesByIndex.Count]; 825if (_items != null && _items.Count > 0) 827return _items[_items.Count - 1]; 845return 1 + (_items?.Count ?? 0); 879return _items.Count - (index + 1);
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (2)
254argument.Generator.Emit(OpCodes.Ldc_I4, argument.Factories.Count); 272argument.Generator.Emit(OpCodes.Ldc_I4, argument.Constants.Count);
ServiceLookup\ServiceProviderEngineScope.cs (3)
126for (int i = toDispose.Count - 1; i >= 0; i--) 148for (int i = toDispose.Count - 1; i >= 0; i--) 209DependencyInjectionEventSource.Log.ScopeDisposed(RootProvider.GetHashCode(), ResolvedServices.Count, _disposables?.Count ?? 0);
Microsoft.Extensions.DependencyInjection.Abstractions (2)
ServiceCollection.cs (2)
22public int Count => _descriptors.Count; 128string debugText = $"Count = {_descriptors.Count}";
Microsoft.Extensions.DependencyModel (3)
DependencyContextJsonReader.cs (3)
218if (targets == null || targets.Count == 0) 813if (targetLibrary.Runtimes != null && targetLibrary.Runtimes.Count > 0) 818if (targetLibrary.Natives != null && targetLibrary.Natives.Count > 0)
Microsoft.Extensions.Diagnostics (1)
Metrics\MetricsSubscriptionManager.cs (1)
21_listeners = new ListenerSubscription[list.Count];
Microsoft.Extensions.Diagnostics.ExceptionSummarization (2)
HttpExceptionSummaryProvider.cs (2)
48socketErrors[socketError] = descriptions.Count; 63webStatuses[status] = descriptions.Count;
Microsoft.Extensions.Diagnostics.HealthChecks (2)
DefaultHealthCheckService.cs (2)
301public int Count => _values.Count; 321for (var i = 0; i < values.Count; i++)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (7)
CircularBufferTests.cs (1)
34var expectedBufferElements = elementsToAdd.Skip(Math.Max(0, elementsToAdd.Count - BufferSize)).ToList();
Linux\Disk\FakeDiskStatsReader.cs (1)
16if (_index >= stats.Values.First().Count)
Linux\LinuxCountersTests.cs (1)
111samples.Count.Should().Be(22);
Linux\LinuxUtilizationProviderTests.cs (3)
78Assert.Equal(5, samples.Count); 147Assert.Equal(5, samples.Count); 262Assert.Equal(4, samples.Count);
Windows\WindowsCountersTests.cs (1)
58samples.Count.Should().Be(24);
Microsoft.Extensions.Diagnostics.Testing (9)
Logging\FakeLogCollector.cs (3)
94if (_records.Count == 0) 99return _records[_records.Count - 1]; 107public int Count => _records.Count;
Metrics\MetricCollector.cs (6)
35internal int WaitersCount => _waiters.Count; // Internal for testing 198return _measurements.Count > 0 ? _measurements[_measurements.Count - 1] : null; 218if (_measurements.Count >= minCount) 309for (int i = _waiters.Count - 1; i >= 0; i--) 311if (_measurements.Count >= _waiters[i].MinCount)
Microsoft.Extensions.Diagnostics.Testing.Tests (4)
Metrics\MeasurementExtensionsTests.cs (4)
28Assert.Equal(2, filtered.Count); 53Assert.Equal(2, filtered.Count); 78Assert.Equal(2, filtered.Count); 106Assert.Equal(2, filtered.Count);
Microsoft.Extensions.FileProviders.Composite (2)
CompositeDirectoryContents.cs (1)
64for (int i = 0; i < _directories.Count; i++)
CompositeFileProvider.cs (1)
89return changeTokens.Count switch
Microsoft.Extensions.FileProviders.Embedded (2)
Manifest\ManifestParser.cs (2)
66for (int i = 0; i < entriesList.Count - 1; i++) 68for (int j = i + 1; j < entriesList.Count; j++)
Microsoft.Extensions.FileSystemGlobbing (3)
Internal\MatcherContext.cs (1)
65return new PatternMatchingResult(_files, _files.Count > 0);
Internal\PathSegments\WildcardPathSegment.cs (1)
63for (int containsIndex = 0; containsIndex != wildcard.Contains.Count; ++containsIndex)
Internal\Patterns\PatternBuilder.cs (1)
179else if (segmentsPatternEndsWith!.Count != 0)
Microsoft.Extensions.Hosting (6)
HostApplicationBuilder.cs (2)
276if (_configureHostConfigActions.Count > 0) 317if (_configureContainerActions.Count > 0)
Internal\Host.cs (4)
152if (exceptions.Count > 0) 154if (exceptions.Count == 1) 286if (exceptions.Count > 0) 288if (exceptions.Count == 1)
Microsoft.Extensions.Http (2)
Logging\HttpHeadersLogValue.cs (2)
74public int Count => Values.Count; 93for (int i = 0; i < Values.Count; i++)
Microsoft.Extensions.Http.Diagnostics (4)
Logging\Internal\Log.cs (2)
97var requestHeadersCount = record.RequestHeaders?.Count ?? 0; 98var responseHeadersCount = record.ResponseHeaders?.Count ?? 0;
Logging\Internal\LoggerMessageStateExtensions.cs (2)
26for (var i = 0; i < items.Count; i++) 45for (var i = 0; i < items.Count; i++)
Microsoft.Extensions.Http.Polly.Tests (1)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (1)
582var func = Responses[CallCount++ % Responses.Count];
Microsoft.Extensions.Http.Resilience (1)
Routing\Internal\WeightedGroups\WeightedGroupsRoutingStrategy.cs (1)
67if (_groups.Count == 0)
Microsoft.Extensions.Http.Resilience.Tests (4)
Hedging\HedgingTests.cs (4)
177Assert.Equal(2, Requests.Count); 201Assert.Equal(DefaultHedgingAttempts + 1, Requests.Count); 278Assert.Equal(2, Requests.Count); 301Assert.Equal(3, Requests.Count);
Microsoft.Extensions.Identity.Core (5)
PasswordValidator.cs (1)
77Task.FromResult(errors?.Count > 0
RoleManager.cs (1)
409if (errors?.Count > 0)
RoleValidator.cs (1)
39if (errors?.Count > 0)
UserManager.cs (1)
2421if (errors?.Count > 0)
UserValidator.cs (1)
49return errors?.Count > 0 ? IdentityResult.Failed(errors) : IdentityResult.Success;
Microsoft.Extensions.Logging (6)
Logger.cs (3)
47if (exceptions != null && exceptions.Count > 0) 90if (exceptions != null && exceptions.Count > 0) 147if (exceptions != null && exceptions.Count > 0)
LoggerFactory.cs (3)
214var loggers = new LoggerInformation[_providerRegistrations.Count]; 215for (int i = 0; i < _providerRegistrations.Count; i++) 324return $"Providers = {_providerRegistrations.Count}, {_filterOptions.DebuggerToString()}";
Microsoft.Extensions.Logging.Abstractions (6)
FormattedLogValues.cs (1)
90return _formatter.ValueNames.Count + 1;
LoggerMessage.cs (1)
456int actualCount = logValuesFormatter.ValueNames.Count;
LogValuesFormatter.cs (4)
69vsb.Append(_valueNames.Count.ToString(CultureInfo.InvariantCulture)); 223if (index < 0 || index > _valueNames.Count) 228if (_valueNames.Count > index) 239for (int index = 0; index != _valueNames.Count; ++index)
Microsoft.Extensions.Logging.AzureAppServices (1)
BatchingLoggerProvider.cs (1)
106if (_currentBatch.Count > 0)
Microsoft.Extensions.Logging.Generators (12)
LoggerMessageGenerator.Emitter.cs (10)
63(lm.TemplateParameters.Count <= MaxLoggerMessageDefineArguments) && // more args than LoggerMessage.Define can handle 65(lm.TemplateList.Count == lm.TemplateParameters.Count); // mismatch in template to args, which LoggerMessage.Define can't handle 70for (int i = 0; i < lm.TemplateList.Count; i++) 106for (int i = parentClasses.Count - 1; i >= 0; i--) 157if (lm.TemplateParameters.Count > 0) 190{nestedIndentation}public int Count => {lm.TemplateParameters.Count + 1}; 205{nestedIndentation}for (int i = 0; i < {lm.TemplateParameters.Count + 1}; i++) 250if (index < lm.TemplateParameters.Count) 296if (lm.TemplateParameters.Count == 0)
LoggerMessageGenerator.Parser.cs (2)
575var methods = new Dictionary<string, int>(lc.Methods.Count); 594if (results.Count > 0 && _compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 })
Microsoft.Extensions.ObjectPool.Microbenchmark (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.Count - 1)
Microsoft.Extensions.Options (5)
OptionsFactory.cs (1)
85if (failures.Count > 0)
ValidateOnStart.cs (2)
40if (exceptions.Count == 1) 46if (exceptions.Count > 1)
ValidateOptionsResultBuilder.cs (2)
103if (_errors?.Count > 0) 116private int ErrorsCount => _errors is null ? 0 : _errors.Count;
Microsoft.Extensions.Options.Contextual (1)
Internal\ContextualOptionsFactory.cs (1)
144if (failures.Count > 0)
Microsoft.Extensions.Options.DataAnnotations (1)
DataAnnotationValidateOptions.cs (1)
67Debug.Assert(errors is not null && errors.Count > 0);
Microsoft.Extensions.Options.SourceGeneration (14)
Emitter.cs (6)
702int capacity = modelToValidate.MembersToValidate.Count == 0 ? 0 : modelToValidate.MembersToValidate.Max(static vm => vm.ValidationAttributes.Count); 713if (vm.ValidationAttributes.Count > 0) 765if (attr.ConstructorArguments.Count > 0) 769for (var i = 0; i < attr.ConstructorArguments.Count; i++) 771if (i != attr.ConstructorArguments.Count - 1)
Parser.cs (8)
71if (modelTypes.Count == 0) 78var modelsValidatorTypeValidates = new List<ValidatedModel>(modelTypes.Count); 107if (membersToValidate.Count == 0 && !selfValidate) 151if (results.Count > 0 && _compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 }) 535bool validationAttributeIsApplied = validationAttrs.Count > 0 || transValidatorTypeName is not null || enumerationValidatorTypeName is not null; 555if (membersToValidate.Count > 0) 571if (membersToValidate.Count > 0) 700if (membersToValidate.Count == 0 && !selfValidate)
Microsoft.Extensions.Primitives (1)
CompositeChangeToken.cs (1)
150for (int i = 0; i < disposables.Count; i++)
Microsoft.Extensions.ServiceDiscovery (3)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
139resolvedEndpointCount = resolved.Count;
ServiceEndpointWatcherFactory.cs (1)
48if (providers is not { Count: > 0 })
ServiceEndpointWatcherFactory.Log.cs (1)
19ServiceEndpointProviderListCore(logger, serviceName, providers.Count, string.Join(", ", providers.Select(static r => r.ToString())));
Microsoft.Extensions.ServiceDiscovery.Dns (12)
DnsServiceEndpointProvider.cs (1)
44if (endpoints.Count == 0)
DnsServiceEndpointProviderBase.cs (2)
88if (_lastEndpointCollection is { Count: > 0 } eps) 109if (endpoints is { Count: > 0 })
Resolver\DnsResolver.cs (7)
72var results = new List<ServiceResult>(response.Answers.Count); 178List<AddressResult> results = new List<AddressResult>(response.Answers.Count); 384Debug.Assert(response.Answers.Count > 0); 571(answers.Count + authorities.Count + additionals.Count) > 0 ? queryStartedTime.AddSeconds(ttl) : queryStartedTime; 639if (answers.Count > 0)
Resolver\ResolvConf.cs (2)
32if (serverList.Count == 3) 40if (serverList.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
Resolver\LoopbackDnsServer.cs (4)
156QueryCount = (ushort)Questions.Count, 157AnswerCount = (ushort)Answers.Count, 158AuthorityCount = (ushort)Authorities.Count, 159AdditionalRecordCount = (ushort)Additionals.Count
Microsoft.Extensions.Telemetry (6)
Logging\ExtendedLogger.LegacyTagJoiner.cs (2)
54int extraTagsCount = _extraTags.Count; 80public int Count => _incomingTagCount + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLogger.ModernTagJoiner.cs (2)
60int extraTagsCount = _extraTags.Count; 84public int Count => _incomingTagsCount + _redactedTagsCount + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLoggerFactory.cs (2)
226var loggers = new LoggerInformation[_providerRegistrations.Count]; 227for (int i = 0; i < _providerRegistrations.Count; i++)
Microsoft.Extensions.Telemetry.Tests (2)
Logging\ExtendedLoggerFactoryTests.cs (2)
231Assert.Equal(7, loggerProvider.LogText.Count); // Ensure that Baggage and Tags aren't added. 427Assert.Equal(2, loggerProvider.LogText.Count); // Ensure that the additional scopes for tags and baggage aren't added.
Microsoft.Extensions.Validation.ValidationsGenerator (1)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
35for (var i = 0; i < _weakReferencedEntries.Count; i++)
Microsoft.Gen.ComplianceReports (2)
Emitter.cs (2)
55if (member.Classifications.Count > 0) 99if (p.Classifications.Count > 0)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.ContextualOptions (1)
ContextualOptionsGenerator.cs (1)
58if (list.Count > 0)
Microsoft.Gen.ContextualOptions.Generated.Tests (1)
ContextualOptionsTests.cs (1)
36Assert.Equal(2, receiver.Received.Count);
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
ContextualOptionsTests.cs (1)
36Assert.Equal(2, receiver.Received.Count);
SyntaxContextReceiverTests.cs (1)
74Assert.Equal(2, declaration.Value.Count);
test\Generators\Shared\RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.Logging (9)
Emission\Emitter.cs (1)
52for (int i = parentTypes.Count - 1; i >= 0; i--)
Model\LoggingMethodParameter.cs (1)
50public bool HasProperties => Properties.Count > 0;
Model\LoggingMethodParameterExtensions.cs (1)
40if (propertyToLog.Properties.Count > 0)
Model\LoggingProperty.cs (1)
29public bool HasProperties => Properties.Count > 0;
Parsing\Parser.LogProperties.cs (2)
61if (props.Count > 0) 115if (maybeDataClasses.Count > 0)
Parsing\Parser.Records.cs (3)
42if (recordDataClassAttributes.Count > 0) 83if (parameterDataClassAttributes.Count > 0) 140if (propertyDataClassAttributes.Count > 0)
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.MetadataExtractor (3)
src\Generators\Microsoft.Gen.ComplianceReports\Emitter.cs (2)
55if (member.Classifications.Count > 0) 99if (p.Classifications.Count > 0)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
559if (metricMethod.AllParameters.Count < 1 ||
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.Metrics (5)
Emitter.cs (3)
114for (int i = parentTypes.Count - 1; i >= 0; i--) 183metricMethod.StrongTypeConfigs.Count != 0; 210metricMethod.StrongTypeConfigs.Count > MaxTagsWithoutEnabledCheck)
MetricFactoryEmitter.cs (1)
104var count = metricType.Methods.Count;
Parser.cs (1)
559if (metricMethod.AllParameters.Count < 1 ||
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
559if (metricMethod.AllParameters.Count < 1 ||
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Interop.ComInterfaceGenerator (1)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (1)
48if (marshalType is null || sourceGeneratedComRecognizers.Count == 0)
Microsoft.Interop.LibraryImportGenerator (6)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
34if (fixedDiagnostics.Count > 0)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (4)
790if (missingCollectionMethods.Count > 0) 848if (missingCollectionMethods.Count > 0) 1098if (missingCollectionMethods.Count > 0) 1167if (missingCollectionMethods.Count > 0)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
119if (missingMembersDiagnostics.Count > 0)
Microsoft.Interop.SourceGeneration (8)
ManagedToNativeStubGenerator.cs (1)
172if (finallyStatements.Count > 0)
Marshalling\ElementsMarshalling.cs (2)
507if (elementStatements.Count == 0) 566if (elementStatements.Count != 0)
Marshalling\MarshallerHelpers.cs (4)
156for (int node = 0; node < nodeIdToElement.Count; node++) 164while (S.Count != 0) 167T element = S[S.Count - 1]; 168S.RemoveAt(S.Count - 1);
Marshalling\MarshallingGeneratorExtensions.cs (1)
125if (rehydratedAttributes.Count > 0)
Microsoft.Maui (21)
Animations\Animation.cs (1)
197 if (childrenAnimations.Count > 0)
Animations\AnimationManager.cs (2)
54 if (_animations.Count == 0) 90 if (_animations.Count == 0)
Core\Extensions\IPickerExtension.cs (1)
20 for (int i = 0; i < returnValue.Count; i++)
Hosting\Internal\FontCollection.cs (1)
10 public int Count => _descriptors.Count;
Hosting\Internal\MauiServiceCollection.cs (1)
14 public int Count => _descriptors.Count;
Layouts\Flex.cs (6)
454 if (item == null || item.Count == 0) 463 for (int i = 0; i < item.Count; i++) 581 layout_items(item, last_layout_child, item.Count, relative_children_count, ref layout, inMeasureMode); 991 if (item.ShouldOrderChildren && item.Count > 0) 993 var indices = new int[item.Count]; 999 for (int i = 0; i < item.Count; i++)
LifecycleEvents\LifecycleEventService.cs (1)
41 _mapper.TryGetValue(eventName, out var delegates) && delegates?.Count > 0;
PropertyMapper.cs (2)
180 var updatePropertiesMappers = new List<Action<IElementHandler, IElement>>(updatePropertiesKeys.Count); 184 var cacheSize = updatePropertiesKeys.Count;
WeakEventManager.cs (4)
47 for (int i = 0; i < target.Count; i++) 67 for (int i = 0; i < toRemove.Count; i++) 74 for (int i = 0; i < toRaise.Count; i++) 128 for (int n = subscriptions.Count - 1; n >= 0; n--)
WeakList.cs (2)
17 public int Count => _list.Count; 32 for (int i = _list.Count - 1; i >= 0; i--)
Microsoft.Maui.Controls (266)
BindingExpression.cs (10)
101 for (var i = 0; i < _parts.Count - 1; i++) 133 for (var i = 0; i < _parts.Count; i++) 144 if (i < _parts.Count - 1) 458 for (int i = 0; i < chain.Count; i++) 461 if (i != chain.Count - 1 || !rootIsSource) 472 if (_ancestryChain == null || _ancestryChain.Count == 0) 474 int count = _ancestryChain.Count; 485 _ancestryChain.RemoveAt(_ancestryChain.Count - 1); 493 for (int i = 0; i < _ancestryChain.Count; i++) 549 if (index + 1 < _ancestryChain.Count)
DefinitionCollection.cs (2)
44 get { return _internalList.Count; } 88 if (index < _internalList.Count && index >= 0 && _internalList[index] != null)
Element\Element_StyleSheets.cs (1)
64 for (var i = (sheets?.Count ?? 0) - 1; i >= 0; i--)
Internals\ProfilePage.cs (1)
49 while (i < Data.Count)
Label\Label.cs (2)
405 if (!point.IsEmpty && spans.Count > 1) // More than 2 elements overlapping, deflate to see which one is actually hit. 406 for (var i = spans.Count - 1; i >= 0; i--)
Layout\Layout.cs (3)
50 public int Count => _children.Count; 158 var index = _children.Count; 174 for (int i = _children.Count - 1; i >= 0; i--)
LegacyLayouts\Grid.cs (2)
192 for (int i = row; i < row + rowSpan && i < rowDefinitions.Count; i++) 219 for (int i = col; i < col + colSpan && i < columnDefinitions.Count; i++)
LegacyLayouts\GridCalc.cs (48)
64 for (var index = 0; index < structure.Columns.Count; index++) 73 for (var index = 0; index < structure.Rows.Count; index++) 81 var request = new Size(columnWidthSum + (structure.Columns.Count - 1) * ColumnSpacing, rowHeightSum + (structure.Rows.Count - 1) * RowSpacing); 82 var minimum = new Size(nonStarColumnWidthSum + (structure.Columns.Count - 1) * ColumnSpacing, nonStarRowHeightSum + (structure.Rows.Count - 1) * RowSpacing); 124 for (var index = 0; index < _rows.Count; index++) 132 for (var index = 0; index < _columns.Count; index++) 157 for (var index = 0; index < _rows.Count; index++) 164 for (var index = 0; index < _columns.Count; index++) 178 for (var rowspan = 1; rowspan <= _rows.Count; rowspan++) 180 for (var i = 0; i < _rows.Count; i++) 211 for (var colspan = 1; colspan <= _columns.Count; colspan++) 213 for (var i = 0; i < _columns.Count; i++) 251 for (var index = 0; index < _columns.Count; index++) 258 for (var index = 0; index < _rows.Count; index++) 269 for (var index = 0; index < _columns.Count; index++) 281 for (var index = 0; index < _rows.Count; index++) 295 return new Size(columnWidthSum + (_columns.Count - 1) * columnSpacing, rowHeightSum + (_rows.Count - 1) * rowSpacing); 308 for (var index = 0; index < _columns.Count; index++) 320 for (var index = 0; index < _columns.Count; index++) 343 for (var index = 0; index < _rows.Count; index++) 354 for (var index = 0; index < _rows.Count; index++) 379 for (int n = 0; n < _columns.Count; n++) 417 for (var index = 0; index < _columns.Count; index++) 442 for (int n = 0; n < _rows.Count; n++) 479 for (var index = 0; index < _rows.Count; index++) 512 while (_columns.Count <= lastCol) 514 while (_rows.Count <= lastRow) 517 for (var index = 0; index < _columns.Count; index++) 522 for (var index = 0; index < _rows.Count; index++) 598 for (var index = 0; index < _columns.Count; index++) 608 for (var index = 0; index < _columns.Count; index++) 628 for (var index = 0; index < _rows.Count; index++) 638 for (var index = 0; index < _rows.Count; index++) 652 for (var colspan = 1; colspan <= _columns.Count; colspan++) 654 for (var i = 0; i < _columns.Count; i++) 691 for (var index = 0; index < _columns.Count; index++) 713 for (var rowspan = 1; rowspan <= _rows.Count; rowspan++) 715 for (var i = 0; i < _rows.Count; i++) 752 for (var index = 0; index < _rows.Count; index++) 772 for (var index = 0; index < _columns.Count; index++) 778 for (var index = 0; index < _rows.Count; index++) 868 double assigned = (_rows.Count - 1) * rowSpacing; 869 for (var i = 0; i < _rows.Count; i++) 880 double assigned = (_columns.Count - 1) * columnSpacing; 881 for (var i = 0; i < _columns.Count; i++)
LegacyLayouts\RelativeLayout.cs (1)
258 for (var i = 0; i < parents.Count; i++)
ListView\ListView.cs (1)
561 if (itemSource?.Count > groupIndex)
Menu\MenuBarItem.cs (3)
57 public int Count => _menus.Count; 63 var index = _menus.Count; 70 for (int i = _menus.Count - 1; i >= 0; i--)
Menu\MenuFlyout.cs (3)
33 public int Count => _menus.Count; 39 var index = _menus.Count; 52 for (int i = _menus.Count - 1; i >= 0; i--)
Menu\MenuFlyoutSubItem.cs (3)
25 public int Count => _menus.Count; 31 var index = _menus.Count; 39 for (int i = _menus.Count - 1; i >= 0; i--)
MergedStyle.cs (1)
172 for (var i = 0; i < _implicitStyles.Count; i++)
NavigationModel.cs (16)
18 if (_navTree.Count > 0) 28 if (_navTree.Count == 0) 87 if (stack.Count <= 1) 101 if (_navTree.Count <= 1) 112 if (_navTree.Count > 0 && 113 _navTree[0].Count > 0 && 128 if (_navTree.Count == 1) 130 if (_navTree[0].Count > 1) 140 if (_navTree.Last().Count == 0) 142 _navTree.RemoveAt(_navTree.Count - 1); 155 if (stack.Count <= 1) 157 stack.RemoveRange(1, stack.Count - 1); 170 if (_navTree.Count > 0) 200 if (_navTree.Count > 0 && 201 _navTree[0].Count > 0 && 216 while (!(found = currentStack.Remove(page)) && i < _navTree.Count - 1)
NavigationPage\NavigationPage.cs (1)
584 var topLevelPage = parentPages[parentPages.Count - 1];
NavigationProxy.cs (4)
203 if (_pushStack.Value.Count == 0) 252 if (list.Count == 0) 254 Page result = list[list.Count - 1]; 255 list.RemoveAt(list.Count - 1);
NavigationStepRequest.cs (2)
28 public int Count => _pages.Count; 120 for (var i = 0; i < _innerList.Count; i++)
ObservableList.cs (2)
61 index -= items.Count - 1; 63 for (var i = 0; i < items.Count; i++)
OrderedDictionary.cs (2)
133 for (var i = 0; i < _keyOrder.Count; ++i) 426 for (var i = 0; i < _odict._keyOrder.Count; ++i)
Page\Page.cs (2)
384 if (_pendingActions.Count > 0) 604 if (startingLayout.Count <= i || c.Bounds != startingLayout[i])
Platform\ModalNavigationManager\ModalNavigationManager.cs (9)
22 _platformModalPages.Count > 0 ? _platformModalPages[_platformModalPages.Count - 1] : (_window.Page ?? throw new InvalidOperationException("Current Window isn't loaded")); 25 _platformModalPages.Count > 0 ? _platformModalPages[_platformModalPages.Count - 1] : throw new InvalidOperationException("Modal Stack is Empty"); 132 for (popTo = 0; popTo < _platformModalPages.Count && popTo < _modalPages.Count; popTo++) 141 if (_platformModalPages.Count == _modalPages.Count && popTo == _platformModalPages.Count) 150 if (_platformModalPages.Count > popTo && IsModalReady) 167 var i = _platformModalPages.Count;
Profiler.cs (1)
150 _slot = Data.Count;
Shapes\GeometryHelper.cs (9)
136 for (int i = 1; i < points.Count; i++) 139 ptLast = points[points.Count - 1]; 158 for (int i = 1; i < points.Count; i++) 161 ptLast = points[points.Count - 1]; 174 for (int i = 1; i < points.Count; i++) 177 ptLast = points[points.Count - 1]; 195 for (int i = 1; i < points.Count; i++) 198 ptLast = points[points.Count - 1]; 219 for (int i = 1; i < points.Count; i++)
Shapes\PathGeometry.cs (1)
112 for (int i = 0; i < points.Count; i++)
Shell\RouteRequestBuilder.cs (10)
172 for (var i = 0; i < _matchedSegments.Count; i++) 175 if (segmentsToMatch.Count <= i || segmentsToMatch[i] != seg) 205 if (nextMatch >= _allSegments.Count) 221 var nextMatch = _matchedSegments.Count; 222 if (nextMatch >= _allSegments.Count) 233 var nextMatch = _matchedSegments.Count; 234 if (nextMatch >= _allSegments.Count) 253 int count = GlobalRouteMatches.Count; 269 public bool IsFullMatch => _matchedSegments.Count == _allSegments.Count;
Shell\Shell.cs (2)
913 for (int i = 0; i < _appearanceObservers.Count; i++) 1871 for (int i = 0; i < _flyoutBehaviorObservers.Count; i++)
Shell\ShellFlyoutItemsManager.cs (11)
30 for (var i = flyoutItems.Count; i < _lastGeneratedFlyoutItems.Count; i++) 33 for (var i = _lastGeneratedFlyoutItems.Count; i < flyoutItems.Count; i++) 36 for (var i = 0; i < _lastGeneratedFlyoutItems.Count; i++) 48 for (var j = 0; j < source.Count; j++) 176 if (_lastGeneratedFlyoutItems?.Count == result.Count) 179 for (var i = 0; i < result.Count && !hasChanged; i++) 184 if (topLevelNew.Count != topLevelPrevious.Count) 190 for (var j = 0; j > topLevelNew.Count; j++) 227 if (currentGroup.Count > 0)
Shell\ShellNavigationManager.cs (7)
111 if (navigationRequest.Request.GlobalRoutes.Count > 0 && 128 ApplyQueryAttributes(shellContent, parameters, navigationRequest.Request.GlobalRoutes.Count == 0, isRelativePopping); 161 if (navigatedToNewShellElement || navigationRequest.Request.GlobalRoutes.Count == 0) 165 if (navigationRequest.Request.GlobalRoutes.Count == 0) 175 if (navigationRequest.Request.GlobalRoutes.Count > 0 && navigationRequest.StackRequest != ShellNavigationRequest.WhatToDoWithTheStack.ReplaceIt) 183 else if (navigationRequest.Request.GlobalRoutes.Count == 0 && 569 if (routeStack.Count > 0)
Shell\ShellNavigationState.cs (1)
88 if (toKeep.Count == 0)
Shell\ShellSection.cs (48)
66 if (_navStack.Count > 1) 67 return _navStack[_navStack.Count - 1]; 116 if (_navStack.Count <= 1) 119 var page = _navStack[_navStack.Count - 1]; 133 if (_navStack.Count <= 1) 139 for (int i = 1; i < oldStack.Count; i++) 145 for (int i = 1; i < oldStack.Count; i++) 156 if (_navStack.Count <= 1) 159 var last = _navStack[_navStack.Count - 1]; 172 if (_navStack.Count <= 1) 333 for (int i = 1; i < navStackCopy.Count; i++) 336 if (i > globalRoutes.Count || routeToRemove != globalRoutes[i - 1]) 354 for (int i = 0; i < globalRoutes.Count; i++) 356 bool isLast = i == globalRoutes.Count - 1; 359 if (navIndex < _navStack.Count && Routing.GetRoute(_navStack[navIndex]) == globalRoutes[i]) 364 var page = GetOrCreateFromRoute(globalRoutes[i], queryData, services, i == globalRoutes.Count - 1, false); 370 else if (!isLast && navIndex < _navStack.Count) 384 for (int i = 0; i < globalRoutes.Count; i++) 386 bool isLast = i == globalRoutes.Count - 1; 392 if (navStack.Count == 1) 395 Page navPage = navStack.Count > i + 1 ? navStack[i + 1] : null; 419 while (navStack.Count > popCount && Navigation.ModalStack.Count > 0) 421 bool isAnimated = animate ?? IsNavigationAnimated(navStack[navStack.Count - 1]); 423 var nextModalPageToPopIndex = navStack.Count - 2; 436 if (Navigation.ModalStack.Contains(navStack[navStack.Count - 1])) 448 while (_navStack.Count > popCount) 452 if ((_navStack.Count - popCount) == 1) 454 bool isAnimated = animate ?? IsNavigationAnimated(_navStack[_navStack.Count - 1]); 459 OnRemovePage(_navStack[_navStack.Count - 2]); 477 for (int i = 0; i < globalRoutes.Count; i++) 480 for (int j = 1; j < _navStack.Count; j++) 513 if (globalRoutes == null || globalRoutes.Count == 0) 515 if (_navStack.Count == 2) 532 bool weveGoneTotalModal = currentNavStack.Count > _navStack.Count; 536 whereToStartNavigation = currentNavStack.Count - 1; 538 for (int i = whereToStartNavigation; i < globalRoutes.Count; i++) 540 bool isLast = i == globalRoutes.Count - 1; 570 for (int i = 0; i < modalPageStacks.Count; i++) 572 bool isLast = i == modalPageStacks.Count - 1; 612 for (int i = pages.Count - 1; i >= 0; i--) 614 bool isLast = i == pages.Count - 1; 773 if (_navStack.Count <= 1) 790 var page = _navStack[_navStack.Count - 1]; 814 if (_navStack.Count <= 1) 829 var page = _navStack[_navStack.Count - 1]; 845 for (int i = 1; i < oldStack.Count; i++) 970 if (_navStack.Count == 1)
Shell\ShellUriHandler.cs (33)
38 var lastPage = pages[pages.Count - 1]; 187 if (possibleRouteMatches.Count == 0) 194 else if (possibleRouteMatches.Count > 1) 196 string[] matches = new string[possibleRouteMatches.Count]; 263 if (result.Count > 0) 271 if (bestMatches.Count > 0) 295 if (globalRouteMatches.Count != 1) 314 if (possibleRoutePaths.Count == 0) 366 if (pureRoutesMatch.Count > 0) 375 if (currentLocation.Content != null && pureGlobalRoutesMatch.Count == 0) 382 if (pureGlobalRoutesMatch.Count > 0) 389 pureGlobalRoutesMatch[0].SegmentsMatched.Count - 390 pureGlobalRoutesMatch[0].GlobalRouteMatches.Count; 464 for (int i = existingGlobalRoutes.Count; i < additionalRouteMatches.Count; i++) 465 requestBuilderWithNewSegments.AddGlobalRoute(additionalRouteMatches[i], segments[i - existingGlobalRoutes.Count]); 492 for (var i = localRouteStack.Count - 1; i >= 0; i--) 507 if (paths.Count > 0) 510 while (paths.Count > 1 && walkBackCurrentStackIndex >= 0) 512 if (localRouteStack.Count <= walkBackCurrentStackIndex) 619 while (nodeLocation.Shell != null && pureGlobalRoutesMatch.Count == 0) 626 if (pureGlobalRoutesMatch.Count != 1 || pureGlobalRoutesMatch[0].GlobalRouteMatches.Count == 0) 631 for (var i = 0; i < pureGlobalRoutesMatch[0].GlobalRouteMatches.Count; i++) 655 bestMatch.GlobalRouteMatches.Count == match.GlobalRouteMatches.Count) 658 for (var i = 0; i < bestMatch.GlobalRouteMatches.Count; i++) 676 while (bestMatches.Count > 1) 679 for (int i = bestMatches.Count - 1; i >= 0; i--) 705 if (bestMatches.Count == betterMatches.Count) 1007 if (segments.Count == 0) 1035 if (segments.Count == 0)
SynchronizedList.cs (1)
46 get { return _list.Count; }
TemplatedItemsList.cs (12)
247 for (var i = 0; i < _templatedObjects.Count; i++) 558 for (int i = _templatedObjects.Count; i <= index; i++) 611 if (_templatedObjects.Count <= index || (content = _templatedObjects[index]) == null) 804 for (int i = e.NewStartingIndex; i < _templatedObjects.Count; i++) 824 for (int i = removeIndex + e.OldItems.Count; i < _templatedObjects.Count; i++) 904 for (var i = 0; i < oldItems.Count; i++) 1003 if (maxindex > _templatedObjects.Count) 1004 _templatedObjects.InsertRange(_templatedObjects.Count, Enumerable.Repeat<TItem>(null, maxindex - _templatedObjects.Count)); 1011 for (int i = e.NewStartingIndex; i < _templatedObjects.Count; i++) 1062 for (int i = removeIndex + e.OldItems.Count; i < _templatedObjects.Count; i++) 1202 for (var i = 0; i < _templatedObjects.Count; i++)
TypedBinding.cs (7)
353 for (int i = 0; i < chain.Count; i++) 356 if (i != chain.Count - 1 || !rootIsSource) 367 if (_ancestryChain == null || _ancestryChain.Count == 0) 369 int count = _ancestryChain.Count; 380 _ancestryChain.RemoveAt(_ancestryChain.Count - 1); 388 for (int i = 0; i < _ancestryChain.Count; i++) 442 if (index + 1 < _ancestryChain.Count)
VisualElement\VisualElement.cs (1)
1565 if (changedResources.Count != 0)
VisualStateManager.cs (2)
468 if (conflicts.Count > 1) 772 public int Count => _internalList.Count;
WebView\WebView.cs (1)
318 for (var i = 0; i < uniqueMatches.Count; i++)
Microsoft.Maui.Controls.BindingSourceGen (3)
BindingTransformer.cs (2)
22 var sourceIsReferenceType = newPath.Count == 0 && !BindingInvocationDescription.SourceType.IsValueType; 23 var previousPartIsReferenceType = newPath.Count > 0 && PreviousPartIsReferenceType(newPath.Last());
Setter.cs (1)
18 var tmpVariableName = $"p{patternMatchingExpressions.Count}";
Microsoft.Maui.Controls.Build.Tasks (19)
CompiledConverters\ListStringTypeConverter.cs (1)
25 yield return Create(Ldc_I4, parts.Count);
CompiledValueProviders\SetterValueProvider.cs (2)
17 ((IElementNode)node).CollectionItems.Count == 1) 53 if (items == null || items.Count <= 0)
CompiledValueProviders\StyleSheetProvider.cs (1)
24 ((IElementNode)node).CollectionItems.Count == 1)
CreateObjectVisitor.cs (3)
202 if (node.CollectionItems.Count == 1 && (vnode = node.CollectionItems.First() as ValueNode) != null && 211 else if (node.CollectionItems.Count == 1 && (vnode = node.CollectionItems.First() as ValueNode) != null && 395 var hasValue = node.CollectionItems.Count == 1 && node.CollectionItems[0] is ValueNode &&
MethodDefinitionExtensions.cs (1)
24 if (methodDef.Parameters.Count != arguments.Count)
NodeILExtensions.cs (8)
481 if (nodes.Count == 0 && context.ParentContextValues == null) 487 if (nodes.Count == 0) 510 yield return Instruction.Create(OpCodes.Ldc_I4, nodes.Count); 524 yield return Create(Ldc_I4, nodes.Count); //destinationIndex 540 if (nodes.Count > 0) 542 for (var i = 0; i < nodes.Count; i++) 591 yield return Instruction.Create(OpCodes.Ldc_I4, scopes.Count); 632 if (pushParentIl[pushParentIl.Count - 1].OpCode != Ldnull)
SetPropertiesVisitor.cs (3)
89 if (pList != null && pList.CollectionItems.Count == 1) 1154 yield return Create(Ldc_I4, handlers.Count); 1157 for (var i = 0; i < handlers.Count; i++)
Microsoft.Maui.Controls.SourceGen (2)
src\Controls\src\Xaml\XmlTypeXamlExtensions.cs (2)
56 if (lookupAssemblies.Count == 0) 69 for (var i = 0; i < lookupNames.Count; i++)
Microsoft.Maui.Controls.Xaml (13)
ApplyPropertiesVisitor.cs (1)
105 if (parentNode is ListNode pList && pList.CollectionItems.Count == 1)
CreateValuesVisitor.cs (3)
298 var array = new object[listnode.CollectionItems.Count]; 299 for (var i = 0; i < listnode.CollectionItems.Count; i++) 345 if (node.CollectionItems.Count == 1
PruneIgnoredNodesVisitor.cs (1)
31 for (var i = 0; i < prefixes.Count; i++)
RemoveDuplicateDesignNodes.cs (1)
27 for (var i = 0; i < props.Count; i++)
SimplifyOnPlatformVisitor.cs (1)
60 else if (node.CollectionItems.Count > 0) // syntax like {OnPlatform foo, iOS=bar}
SimplifyTypeExtensionVisitor.cs (1)
68 if (node.CollectionItems.Count == 1
XamlParser.cs (3)
124 if (node.CollectionItems.Count == 1 && node.CollectionItems[0] is ValueNode) 152 if (nodes.Count == 0) //Empty element 154 if (nodes.Count == 1)
XmlTypeXamlExtensions.cs (2)
56 if (lookupAssemblies.Count == 0) 69 for (var i = 0; i < lookupNames.Count; i++)
Microsoft.Maui.Essentials (6)
Email\Email.shared.cs (3)
68 if (message.To?.Count > 0) 71 if (message.Cc?.Count > 0) 74 if (message.Bcc?.Count > 0)
Share\Share.shared.cs (1)
140 if (!(request.Files?.Count > 0))
VersionTracking\VersionTracking.shared.cs (2)
337 return (trail.Count >= 2) ? trail[trail.Count - 2] : null;
Microsoft.Maui.Graphics (47)
PathF.cs (45)
85 if (_operations.Count > 0) 86 return _operations[_operations.Count - 1] == PathOperation.Close; 96 if (_points != null && _points.Count > 0) 107 for (var i = 0; i < _operations.Count; i++) 116 for (var i = 0; i < _points.Count; i++) 125 if (_points != null && _points.Count > 0) 126 return _points[_points.Count - 1]; 136 if (_points != null && _points.Count > 0) 137 return _points.Count - 1; 147 if (index < 0 || index >= _points.Count) 167 public int Count => _points.Count; 169 public int OperationCount => _operations.Count; 177 var operationsCount = _operations.Count; 185 if (_operations[_operations.Count - 1] == PathOperation.Close) 205 if (_arcAngles.Count > aIndex) 215 if (_arcAngles.Count > aIndex) 225 if (_arcClockwise.Count > aIndex) 235 if (_arcClockwise.Count > aIndex) 272 if (_operations[_operations.Count - 1] == PathOperation.Close) 276 _operations.RemoveAt(_operations.Count - 1); 289 if (_points.Count == 0) 433 for (var operationIndex = 0; operationIndex < _operations.Count; operationIndex++) 490 for (var s = 0; s < _operations.Count; s++) 539 if (pointIndex < _points.Count) 542 for (var segment = 0; segment < _operations.Count; segment++) 611 for (var segment = 0; segment < _operations.Count; segment++) 680 _points.RemoveRange(pointIndex, _points.Count - pointIndex); 681 _operations.RemoveRange(segmentIndex, _operations.Count - segmentIndex); 682 _arcAngles.RemoveRange(arcIndex, _arcAngles.Count - arcIndex); 683 _arcClockwise.RemoveRange(arcClockwiseIndex, _arcClockwise.Count - arcClockwiseIndex); 717 for (var segment = 0; segment < _operations.Count; segment++) 765 for (var segment = 0; segment < _operations.Count; segment++) 772 if (segmentIndex == _operations.Count - 1) 933 for (var i = 0; i < _points.Count; i++) 1004 for (var i = 0; i < operations.Count; i++) 1276 for (var i = 0; i < _points.Count; i++) 1297 for (var i = 0; i < _operations.Count; i++) 1304 for (var i = 0; i < _points.Count; i++) 1313 for (var i = 0; i < _arcAngles.Count; i++) 1323 for (var i = 0; i < _arcClockwise.Count; i++) 1354 for (var i = 0; i < _operations.Count; i++) 1361 for (var i = 0; i < _points.Count; i++) 1370 for (var i = 0; i < _arcAngles.Count; i++) 1380 for (var i = 0; i < _arcClockwise.Count; i++) 1463 for (var i = 0; i < _operations.Count && !foundClosed; i++)
Text\AttributedTextRunExtensions.cs (2)
159 for (int i = 0; i < runs.Count; i++) 180 for (int i = 0; i < runs.Count; i++)
Microsoft.Maui.Graphics.Skia (4)
SkiaTextLayout.cs (4)
107 var linesToDraw = lines.Count; 112 linesToDraw = (int)Math.Min(maxLines, lines.Count); 119 var startIndex = (lines.Count / 2); 162 for (int i = lines.Count - 1; i >= 0; i--)
Microsoft.ML.AutoML (6)
ColumnInference\ColumnTypeInference.cs (1)
308if (data.Count < 2)
ColumnInference\TextFileContents.cs (1)
111if (mostCommon.Count() < UniformColumnCountThreshold * columnCounts.Count)
TransformInference\TransformInference.cs (1)
456if (!concatColNames.Any() || (concatColNames.Count == 1 &&
Tuner\AutoZeroTuner.cs (2)
55if (_configs.Count == 0) 61aggregateTrainingStopManager.AddTrainingStopManager(new MaxModelStopManager(_configs.Count, null));
Tuner\SmacTuner.cs (1)
97var trialCount = _histories.Count + _candidates.Count;
Microsoft.ML.AutoML.SourceGenerator (15)
Template\EstimatorType.cs (3)
252if ((this.indentLengths.Count > 0)) 254int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 255this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Template\SearchSpace.cs (3)
269if ((this.indentLengths.Count > 0)) 271int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 272this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Template\SweepableEstimator.cs (3)
271if ((this.indentLengths.Count > 0)) 273int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 274this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Template\SweepableEstimator_T_.cs (3)
276if ((this.indentLengths.Count > 0)) 278int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 279this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Template\SweepableEstimatorFactory.cs (3)
247if ((this.indentLengths.Count > 0)) 249int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 250this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Microsoft.ML.AutoML.Tests (2)
AutoFitTests.cs (1)
571if (ignoredExceptions.Count > 0)
GetNextPipelineTests.cs (1)
72Assert.Equal(maxIterations, history.Count);
Microsoft.ML.CodeGenerator (33)
Templates\Azure\Console\AzureModelBuilder.cs (3)
346if ((this.indentLengths.Count > 0)) 348int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 349this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Azure\Model\AzureImageModelOutputClass.cs (3)
287if ((this.indentLengths.Count > 0)) 289int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 290this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Azure\Model\AzureObjectDetectionModelOutputClass.cs (3)
287if ((this.indentLengths.Count > 0)) 289int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 290this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Console\ConsumeModel.cs (3)
298if ((this.indentLengths.Count > 0)) 300int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 301this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Console\ModelBuilder.cs (3)
663if ((this.indentLengths.Count > 0)) 665int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 666this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Console\ModelInputClass.cs (3)
261if ((this.indentLengths.Count > 0)) 263int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 264this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Console\ModelOutputClass.cs (3)
304if ((this.indentLengths.Count > 0)) 306int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 307this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Console\ModelProject.cs (3)
293if ((this.indentLengths.Count > 0)) 295int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 296this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Console\PredictProgram.cs (3)
320if ((this.indentLengths.Count > 0)) 322int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 323this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Templates\Console\PredictProject.cs (3)
298if ((this.indentLengths.Count > 0)) 300int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 301this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Utils.cs (3)
325for (int i = 0; i < columnNames.Count; i++) 333if (columnNamesSet.Count != columnNames.Count) 335for (int i = 0; i < columnNames.Count; i++)
Microsoft.ML.CodeGenerator.Tests (3)
CodeGenTests.cs (3)
95Assert.Equal(CodeGenTestData.inputColumns.Count, CodeGenTestData.expectedLabels.Count); 96for (int i = 0; i < CodeGenTestData.inputColumns.Count; i++)
Microsoft.ML.Core (45)
CommandLine\CmdParser.cs (5)
510var arg = new Argument(isDefault ? -1 : args.Count, name, nicks, defaults, attr, field); 1575if (i < values.Count && IsCurlyGroup((string)values[i].Value) && string.IsNullOrEmpty(values[i].Key)) 1593var arr = Array.CreateInstance(ItemType, comList.Count); 1610if (i < values.Count && IsCurlyGroup((string)values[i].Value)) 1628var arr = Array.CreateInstance(ItemValueType, comList.Count);
Data\IEstimator.cs (1)
194var annotations = mCols.Count > 0 ? new SchemaShape(mCols) : _empty;
Data\Repository.cs (3)
183while (_open.Count > 0) 185var ent = _open[_open.Count - 1]; 197for (int i = _open.Count; --i >= 0;)
Environment\ConsoleEnvironment.cs (2)
183if (entries.Count == 0) 227bool needPrepend = entries.Count > 1;
Utilities\BinFinder.cs (6)
67_valuesSng[_counts.Count] = _valuesSng[i]; 78CountValues = _counts.Count; 145_valuesDbl[_counts.Count] = _valuesDbl[i]; 156CountValues = _counts.Count; 332Contracts.Assert(counts.Count == CountValues); 570Contracts.Assert(counts.Count == CountValues);
Utilities\Heap.cs (20)
61Contracts.Assert(_rgv.Count > 0); 83return _rgv.Count - 1; 114_rgv.RemoveRange(1, _rgv.Count - 1); 126if (_rgv.Count <= 1) 140int cv = _rgv.Count; 161int iv = _rgv.Count; 170Contracts.Assert(0 < iv && iv < _rgv.Count); 181Contracts.Assert(0 < iv && iv < _rgv.Count); 183int cv = _rgv.Count; 261Contracts.Assert(_rgv.Count > 0); 283return _rgv.Count - 1; 311Contracts.Assert(0 < index && index < _rgv.Count); 323int cv = _rgv.Count; 341if (_rgv.Count <= 1) 354int iv = _rgv.Count - 1; 383int iv = _rgv.Count; 403int ivSrc = _rgv.Count - 1; 421Contracts.Assert(0 < iv && iv < _rgv.Count); 432Contracts.Assert(0 < iv && iv < _rgv.Count); 434int cv = _rgv.Count;
Utilities\MathUtils.cs (1)
362for (int i = _logFactorialCache.Count; i <= n; i++)
Utilities\Utils.cs (7)
75return x == null ? 0 : x.Count; 190Contracts.Assert(!count.HasValue || (0 <= count && count <= src.Count)); 191Contracts.Assert(src.Count <= dst.Length); 193count = count ?? src.Count; 782invMap[c] = mapList.Count; 816invMap[c] = mapList.Count; 849invMap[col.Index] = mapList.Count;
Microsoft.ML.Core.Tests (10)
UnitTests\TestHosts.cs (1)
133Assert.True(messages.Count > 0);
UnitTests\TestVBuffer.cs (9)
475values[indices.Count] = func(iv.Key, iv.Value); 478dst = new VBuffer<TDst>(a.Length, indices.Count, values, indices.ToArray()); 877if (maxSlots.Count > 20 || len < 200 && rgen.Next(20) < 2 || dropAll) 884for (int i = 0; i < minSlots.Count; i++) 911if (dropSlotMinIndex >= minSlots.Count || logicalIndex < minSlots[dropSlotMinIndex]) 927Assert.Equal(expectedIndices.Count, expectedValues.Count); 928Assert.True(expectedIndices.Count <= a.GetValues().Length); 936expectedIndices.Count, expectedValues.ToArray(), a.IsDense ? null : expectedIndices.ToArray());
Microsoft.ML.Data (135)
Commands\SaveDataCommand.cs (2)
156Host.NotSensitive().Check(cols.Count > 0, "No valid columns to save"); 219ch.Check(cols.Count > 0, "No valid columns to save");
Commands\ScoreCommand.cs (1)
200ch.Check(cols.Count > 0, "No valid columns to save");
Data\DataViewUtils.cs (1)
1330var n = colIndices.Count;
DataLoadSave\Binary\BinarySaver.cs (15)
298_host.CheckIO(offsets[offsets.Count - 1] > offsets[offsets.Count - 2], "Bad offsets detected during write"); 302if (metadataInfos.Count == 0) 313long expectedPosition = offsets[metadataInfos.Count]; 314writer.WriteLeb128Int((ulong)metadataInfos.Count); 315expectedPosition += Utils.Leb128IntLength((ulong)metadataInfos.Count); 316for (int i = 0; i < metadataInfos.Count; ++i) 344_host.Assert(metadataInfos.Count == offsets.Count - 1); 345return offsets[metadataInfos.Count]; 442if (lookups.Count == block.BlockIndex) // Received in order. 444else if (lookups.Count < block.BlockIndex) // Received a block a little bit early. 447int deadToAdd = (int)block.BlockIndex - lookups.Count; 451ch.Assert(lookups.Count == block.BlockIndex); 492ch.CheckIO(stream.Position == lookupOffsets[c] + (16 * blockLookups[c].Count),
DataLoadSave\Binary\Codecs.cs (9)
336Writer.Write(_boundaries.Count); // Write the number of entries. 347return sizeof(int) * (1 + (long)_boundaries.Count) + _builder.Length; 703return (long)_offsets.Count * (sizeof(long) + sizeof(short)); 860Writer.Write(_counts.Count); 871int len = _lengths.Count == 0 ? 0 : _lengths[0]; 872for (int i = 1; i < _lengths.Count; ++i) 887Writer.Write(_indices.Count); 902long structureLength = sizeof(int) * (2 + (long)Utils.Size(_lengths) + _counts.Count + 1 + _indices.Count);
DataLoadSave\LegacyCompositeDataLoader.cs (6)
223tag = GenerateTag(exes.Count); 248if (index < exes.Count - 1) 251exes.RemoveRange(index + 1, exes.Count - index - 1); 489host.Assert(tagData.Count == acceptedIds.Count); 490if (tagData.Count == 0)
DataLoadSave\MultiFileSource.cs (1)
57if (concatenated != null && concatenated.Count > 0)
DataLoadSave\Text\TextLoader.cs (2)
247for (int i = 1; i < sortedRanges.Count; i++) 891ch.CheckUserArg(segsNew.Count > 0, nameof(Range.AllOther), "No index is selected as all other indexes.");
DataLoadSave\Transpose\TransposeSaver.cs (3)
164ch.Assert(offsets.Count == cols.Length + 2); 165ch.Assert(offsets[offsets.Count - 1] == stream.Position); 167for (int c = 1; c < offsets.Count; ++c)
DataView\ArrayDataViewBuilder.cs (5)
30if (_columns.Count == 0) 55if (_columns.Count > 0 && values.Length != _columns[0].Length) 191_host.Check(_columns.Count > 0, "Cannot construct data-view with neither any columns nor a specified row count"); 215_host.Assert(builder._names.Count == builder._columns.Count);
DataView\InternalSchemaDefinition.cs (2)
219Column[] dstCols = new Column[userSchemaDefinition.Count]; 221for (int i = 0; i < userSchemaDefinition.Count; ++i)
DataView\Transposer.cs (2)
172ch.Trace("{0} of {1} input columns sliced into {2} columns", slicedCount, _cols.Length, toSave.Count); 173if (toSave.Count > 0)
DataView\TypedCursor.cs (1)
274for (int i = 0; i < schemaDefinition.Count; ++i)
Deprecated\Instances\HeaderSchema.cs (4)
56Contracts.Assert(nameList.Count == indexList.Count); 58var editor = VBufferEditor.Create(ref dst, _collection.Count, nameList.Count); 60if (nameList.Count < _collection.Count)
Dirty\PredictionUtils.cs (1)
122return sepChars.Count > 0 ? sepChars.ToArray() : null;
EntryPoints\EntryPointNode.cs (3)
858_host.Assert(bindings.Count == 1); 865var arr = Array.CreateInstance(type, bindings.Count); 939if (parameterBindings == null || parameterBindings.Count > 1)
EntryPoints\InputBuilder.cs (6)
84_ectx.Assert(fields.Count == attrs.Count); 234Contracts.Assert(bindings.Count > 0); 239Contracts.Assert(bindings.Count == 1); 685_ectx.Assert(fields.Count == attrs.Count);
EntryPoints\TransformModelImpl.cs (1)
272for (int i = 0; i < mappers.Count; i++)
Evaluators\AnomalyDetectionEvaluator.cs (1)
311protected override long NumExamples { get { return _examples.Count; } }
Evaluators\BinaryClassifierEvaluator.cs (4)
373if (scores.Count > 0) 385if (weightedPrecision.Count > 0) 785for (int i = 0; i < Recall.Count; i++) 792for (int i = 0; i < WeightedRecall.Count; i++)
Evaluators\ClusteringEvaluator.cs (4)
249if (_confusionMatrix.Count > 1) 253for (int i = 0; i < _confusionMatrix.Count; i++) 348while (_numInstancesOfClass.Count <= intLabel) 354while (_confusionMatrix.Count <= intLabel)
Evaluators\EvaluatorUtils.cs (6)
881if (hidden.Count > 0) 1047ch.Assert(metricNames.Count == metricCount); 1130agg = new AggregatedMetric[metricNames.Count]; 1135weightedAgg = new AggregatedMetric[metricNames.Count]; 1211Contracts.Assert(iMetric == metricNames.Count); 1544for (int i = 0; i < metricNames.Count; i++)
Evaluators\Metrics\ConfusionMatrix.cs (1)
79_host.Assert(labelNames.Count == confusionTableCounts.Length);
Evaluators\MulticlassClassificationEvaluator.cs (1)
978for (int i = 0; i < overallList.Count; i++)
Evaluators\RankingEvaluator.cs (7)
1005int maxTrunc = Math.Min(truncationLevel, queryLabels.Count); 1014for (int l = 0; l < queryLabels.Count; l++) 1039int count = queryLabels.Count; 1061Contracts.Assert(0 <= i && i < queryLabels.Count && i < queryOutputs.Count); 1062Contracts.Assert(0 <= j && j < queryLabels.Count && j < queryOutputs.Count);
Model\Pfa\PfaContext.cs (7)
116if (_cellBlocks.Count > 0) 125if (_letSetBlocks.Count > 0) 137if (_funcBlocks.Count > 0) 165if (sets.Count == 0 || locals.Length == sets.Count) 167_letSetBlocks.Add(new VariableBlock(sets.Count == 0 ? "let" : "set", locals)); 171var lets = new List<KeyValuePair<string, JToken>>(locals.Length - sets.Count);
Training\TrainerUtils.cs (1)
443if (nameMap.Count > 0)
Transforms\ColumnBindingsBase.cs (2)
706for (int j = indices.Count - 1; j >= 0; j--) 717Contracts.Assert(indices.Count == addedColumns.Length + input.Count);
Transforms\ColumnConcatenatingTransformer.cs (2)
613Contracts.Assert(allValues.Count > 0); 615dst = new VBuffer<int>(allValues.Count, allValues.ToArray());
Transforms\Hashing.cs (1)
231InvertHashHelper[] helpers = new InvertHashHelper[invertIinfos.Count];
Transforms\NormalizeColumnDbl.cs (9)
749return new ImplVec(host, scales, offsets, (offsets != null && nz.Count < cv / 2) ? nz.ToArray() : null); 1620if (Aggregator.Min[i] != 0 && nz.Count < lim) 1636else if (nz.Count == 0) 1638else if (nz.Count < lim) 1806if (offset[i] != 0 && nz.Count < lim) 1821else if (nz.Count == 0) 1823else if (nz.Count < lim) 1890var numZeroes = checked((int)(Lim - Rem - _values.Count)); 1966var numZeroes = checked((int)(Lim - Rem - _values[i].Count));
Transforms\NormalizeColumnSng.cs (18)
553protected bool HasLeftChild(int elementIndex) => GetLeftChildIndex(elementIndex) < Elements.Count; 554protected bool HasRightChild(int elementIndex) => GetRightChildIndex(elementIndex) < Elements.Count; 570Contracts.Check(Elements.Count > 0, "Cannot peek with 0 elements"); 577Contracts.Check(Elements.Count > 0, "Cannot pop with 0 elements"); 580Elements[0] = Elements[Elements.Count - 1]; 585Elements.RemoveAt(Elements.Count - 1); 599public int Count() => Elements.Count; 638var index = Elements.Count - 1; 681var index = Elements.Count - 1; 906return new ImplVec(host, scales, offsets, (offsets != null && nz.Count < cv / 2) ? nz.ToArray() : null); 1783if (Aggregator.Min[i] != 0 && nz.Count < lim) 1799else if (nz.Count == 0) 1801else if (nz.Count < lim) 1969if (offset[i] != 0 && nz.Count < lim) 1984else if (nz.Count == 0) 1986else if (nz.Count < lim) 2053var numZeroes = checked((int)(Lim - Rem - _values.Count)); 2130var numZeroes = checked((int)(Lim - Rem - _values[i].Count));
Transforms\NormalizeUtils.cs (1)
156if (columnsToNormalize.Count == 0)
Transforms\SlotsDroppingTransformer.cs (3)
697Contracts.Assert(newCategoricalSlotRanges.Count % 2 == 0); 701if (newCategoricalSlotRanges.Count > 0) 702dst = new VBuffer<int>(newCategoricalSlotRanges.Count, newCategoricalSlotRanges.ToArray());
Utilities\StreamUtils.cs (2)
166for (var i = 0; i < matchList.Count - 1; i++) 168for (var j = i + 1; j < matchList.Count; j++)
Microsoft.ML.DataView (2)
DataViewSchema.cs (2)
432for (int i = 0; i < _items.Count; i++) 435var columns = new Column[_items.Count];
Microsoft.ML.Ensemble (6)
OutputCombiners\BaseStacking.cs (1)
135var maps = new ValueMapper<VBuffer<Single>, TOutput>[models.Count];
Selector\SubModelSelector\BaseDiverseSelector.cs (2)
90if (selectedModels.Count < modelCountToBeSelected) 98if (selectedModels.Count < modelCountToBeSelected)
Trainer\EnsembleTrainerBase.cs (3)
212if (models.Count == 0 || models[0].Metrics == null) 223var subsetModels = new FeatureSubsetModel<TOutput>[models.Count]; 224for (int i = 0; i < models.Count; i++)
Microsoft.ML.EntryPoints (2)
CrossValidationMacro.cs (1)
411var warningsIdv = warnings.Count > 0 ? AppendRowsDataView.Create(env, warnings[0].Schema, warnings.ToArray()) : null;
FeatureCombiner.cs (1)
65Contracts.Assert(concatNames.Count == featNames.Count);
Microsoft.ML.FastTree (92)
Dataset\FeatureFlock.cs (15)
341if (features.Count == 0 || !IsSplittable[0]) 354int lastFlockFeature = features[features.Count - 1]; 397for (int i = 0; i < features.Count && i < learner.MaxCategoricalSplitPointsPerNode; ++i) 521if (features.Count == 0 || !IsSplittable[0]) 534int lastFlockFeature = features[features.Count - 1]; 570if (lowPopulationFeatures.Count > 0) 577SubFeatures = lowPopulationFeatures.GetRange(1, lowPopulationFeatures.Count - 1).ToArray() 615for (int i = 0; i < virtualBins.Count && catFeatureCount < learner.MaxCategoricalSplitPointsPerNode; ++i) 717if (features.Count == 0 || !IsSplittable[0]) 730int lastFlockFeature = features[features.Count - 1]; 758if (lowPopulationFeatures.Count > 0) 760if (virtualBins.Count > 1) 761vBin = virtualBins[virtualBins.Count - 2]; 790lowPopulationFeatures.GetRange(1, lowPopulationFeatures.Count - 1).ToArray(); 837for (int i = 0; i < virtualBins.Count && catFeatureCount < learner.MaxCategoricalSplitPointsPerNode; ++i)
Dataset\RepeatIntArray.cs (1)
65_values = IntArray.New(tempValueList.Count, IntArrayType.Dense, bitsPerItem, tempValueList) as DenseIntArray;
Dataset\SparseIntArray.cs (3)
83_values = IntArray.New(tempValueList.Count, IntArrayType.Dense, bitsPerItem, tempValueList) as DenseIntArray; 134if (index <= currentIndex && (index < 0 || tempValueList.Count > 0)) 166_values = IntArray.New(tempValueList.Count, IntArrayType.Dense, bitsPerItem, tempValueList) as DenseIntArray;
FastTree.cs (56)
1028ch.Assert(features.Count > 0); 1030if (features.Count == 1) 1039int[] hotFeatureStarts = new int[features.Count + 1]; 1053int lim = features[features.Count - 1] + 1; 1056for (int i = 0; i < features.Count; ++i) 1103var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 1112ch.Assert(features.Count > 1); 1115int[] hotFeatureStarts = new int[features.Count + 1]; 1129int lim = features[features.Count - 1] + 1; 1131for (int i = 0; i < features.Count; ++i) 1177var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 1368Host.Assert(1 <= toTranspose.Count && toTranspose.Count <= 4); 1538if (pending.Count > 0) 1703maxSlots[maxSlots.Count - 1] = i; 1708Contracts.Assert(maxSlots.Count == minSlots.Count); 1950int[] hotFeatureStarts = new int[features.Count + 1]; 1955var kvEnums = new IEnumerator<KeyValuePair<int, int>>[features.Count]; 1961for (int i = 0; i < features.Count; ++i) 2008ch.Assert(kvp.Key > last || values.Count == 1 || values[values.Count - 1] > values[values.Count - 2]); 2032var denseBins = (DenseIntArray)IntArray.New(values.Count, IntArrayType.Dense, flockBits, values); 2033var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 2141if (pending.Count > 0) 2213ch.Assert(pending.Count > 0); 2249ch.Assert(pending.Count > 0); 2263if (pending.Count > 0) 2347if (pending.Count > 0) 2357ulong[] queryIds = new ulong[_boundaries.Count - 1]; // All zeros is fine 2394while (_dense.Count < index) 2418for (int i = 0; i < _dense.Count; i++) 2440Contracts.Assert(_sparse.Count == 0 || _sparse[_sparse.Count - 1].Key < length); 2441return _sparse.Count(kvp => kvp.Value > gtValue) + (0 > gtValue ? length - _sparse.Count : 0); 2445Contracts.Assert(_dense.Count <= length); 2446return _dense.Count(v => v > gtValue) + (0 > gtValue ? length - _dense.Count : 0); 2464Contracts.Assert(_sparse.Count == 0 || _sparse[_sparse.Count - 1].Key < lim); 2493Contracts.Assert(_dense.Count <= lim); 2494for (int i = 0; i < _dense.Count; ++i) 2503for (int i = _dense.Count; i < lim; ++i) 2515Contracts.Assert(_dense.Count <= length); 2521if (_dense.Count < length) 2524editor.Values.Slice(_dense.Count, length - _dense.Count).Clear(); 2532int count = _sparse.Count; 2535for (int i = 0; i < _sparse.Count; ++i) 2563Contracts.Assert(_dense.Count <= length); 2602Contracts.Assert(_dense.Count <= length); 2603for (int i = 0; i < _dense.Count; ++i) 2611for (int i = _dense.Count; i < length; ++i) 2655return rowIndex < values._dense.Count ? values._dense[rowIndex] : 0; 2661Contracts.Assert(sp.Count == 0 || sp[last].Key > lastRow); 2663while (last < sp.Count)
Training\DocumentPartitioning.cs (1)
102.Select(thread => perChunkDocumentLists[thread][leaf].Count)
TreeEnsemble\InternalRegressionTree.cs (4)
388for (int index = 0; index < categoricalNodeIndices.Count; index++) 840Contracts.Assert(path == null || path.Count == 0); 919Contracts.Assert(path == null || path.Count == 0); 1523path.RemoveAt(path.Count - 1);
TreeEnsemble\InternalTreeEnsemble.cs (9)
32public int NumTrees => _trees.Count; 236double[] values = new double[_trees.Count]; 237for (int w = 0; w < _trees.Count; ++w) 285return GetOutput(featureBins, _trees.Count); 290if (prefix > _trees.Count || prefix < 0) 291prefix = _trees.Count; 313if (_trees.Count == 0) 319if (prefix > _trees.Count || prefix < 0) 320prefix = _trees.Count;
TreeEnsembleFeaturizer.cs (1)
324for (int j = 0; j < nodes.Count; j++)
Utils\BufferPoolManager.cs (2)
53List<Array> buffers = availableBuffers.FirstOrDefault(x => x.Value.Count > 0 && x.Key >= size && (x.Key - size) < (size * 0.2)).Value as List<Array>; 55if (buffers != null && buffers.Count > 0)
Microsoft.ML.GenAI.Core (1)
Extension\ModuleExtension.cs (1)
243if (layerSizeMap.Count > 0)
Microsoft.ML.LightGbm (3)
LightGbmTrainerBase.cs (3)
573if (curFidx > catBoundaries[catBoundaries.Count - 1]) 600catMetaData.NumCol = catBoundaries.Count - 1; 785if (labelList.Count == Utils.ArrayMaxSize)
Microsoft.ML.Maml (3)
HelpCommand.cs (3)
185if (components.Count == 0) 221if (components.Count > 0) 299if (components.Count > 0)
Microsoft.ML.Mkl.Components (6)
SymSgdClassificationTrainer.cs (6)
447if (_storage.Count == 0) 458if (_storageIndex == _storage.Count - 1) 493if (_storage.Count == 0) 549public int Count => _instanceProperties.Count; 629if (_instanceProperties.Count > (1 << 30)) 666if (_instanceIndex == _instanceProperties.Count)
Microsoft.ML.OnnxConverter (2)
OnnxUtils.cs (2)
32for (int index = 0; index < dims.Count; index++) 38if (dimsParam != null && dimsParam.Count > index && dimsParam[index])
Microsoft.ML.OnnxTransformer (2)
OnnxTransform.cs (1)
457if (shape.Count > 0)
OnnxTypeParser.cs (1)
211if ((dims.Count > 0) && (dims[0] <= 0))
Microsoft.ML.OnnxTransformerTest (6)
OnnxTransformTests.cs (6)
721for (int i = 0; i < transformedDataPoints.Count; ++i) 774for (int i = 0; i < transformedDataPoints.Count; ++i) 933Assert.Equal(dataPoints.Count(), transformedDataPoints.Count); 945for (int i = 0; i < transformedDataPoints.Count; ++i) 1097Assert.Equal(dataPoints.Count(), transformedDataPoints.Count); 1109for (int i = 0; i < transformedDataPoints.Count; ++i)
Microsoft.ML.Parquet (5)
PartitionedFileLoader.cs (1)
562if (source >= 0 && source < values.Count)
PartitionedPathParser.cs (4)
290_columns = new PartitionedFileLoader.Column[names.Count]; 291for (int i = 0; i < names.Count; i++) 311if (values.Count != _columns.Length) 313throw Contracts.Except($"The extracted value count of {values.Count} does not match the expected Column count of {_columns.Length} for path {path}");
Microsoft.ML.Predictor.Tests (2)
TestTransposer.cs (2)
130T[] vals = new T[indices.Count]; 133vecs[r] = new VBuffer<T>(slotCount, indices.Count, vals, indices.ToArray());
Microsoft.ML.Recommender (3)
SafeTrainingAndModelBuffer.cs (3)
272e => { e.SetProgress(0, i); e.SetProgress(1, nodes.Count); }); 305pch.Checkpoint(i, nodes.Count); 309ch.Check(nodes.Count > 0, "No valid instances encountered during data loading");
Microsoft.ML.ResultProcessor (5)
ResultProcessor.cs (5)
736for (int i = 0; i < lines.Count; i++) 755int i = lines.Count - 1; 762while (i < lines.Count && lines[i] != SectionBreakSeparator) 779for (; i < lines.Count; i++) 868if (tempPredictorList.Count != 0)
Microsoft.ML.Samples (4)
Dynamic\Trainers\AnomalyDetection\RandomizedPcaSample.cs (1)
51for (int i = 0; i < samples.Count; ++i)
Dynamic\Trainers\AnomalyDetection\RandomizedPcaSampleWithOptions.cs (1)
59for (int i = 0; i < samples.Count; ++i)
Dynamic\Transforms\TimeSeries\Forecasting.cs (1)
50inputColumnName, 5, 11, data.Count, 5);
Dynamic\Transforms\TimeSeries\ForecastingWithConfidenceInterval.cs (1)
50inputColumnName, 5, 11, data.Count, 5,
Microsoft.ML.StandardTrainers (7)
Optimizer\DifferentiableFunction.cs (1)
214VBuffer<float> dir = new VBuffer<float>(x.Length, values.Count, values.ToArray(), indices.ToArray());
Optimizer\Optimizer.cs (6)
249int count = _roList.Count; 328if (_roList.Count < _m) 334_m = _roList.Count; 341if (_roList.Count == _m) 363_sList[_roList.Count] = nextS; 364_yList[_roList.Count] = nextY;
Microsoft.ML.Sweeper (24)
Algorithms\Grid.cs (1)
163int iPerm = (prevParamSets.Count - 1) % _nGridPoints;
Algorithms\KdoSweeper.cs (1)
241if (numericParamIndices.Count > 0)
Algorithms\NelderMead.cs (15)
116_dim = _sweepParameters.Count; 181Contracts.Assert(_pendingSweeps.Count == 1); 231Contracts.Assert(_pendingSweeps.Count == 1); 244Contracts.Assert(_pendingSweeps.Count == 1); 263Contracts.Assert(_pendingSweeps.Count == 1); 282Contracts.Assert(_pendingSweeps.Count + _pendingSweepsNotSubmitted.Count == _dim); 283if (_pendingSweeps.Count < _dim) 338Contracts.Assert(point.Length == _sweepParameters.Count); 339for (int i = 0; i < _sweepParameters.Count; i++) 375if (result.Count != _pendingSweeps.Count) 433Contracts.Assert(parameterSet.Count == _sweepParameters.Count); 436for (int i = 0; i < _sweepParameters.Count; i++) 447Contracts.Assert(array.Length == _sweepParameters.Count); 450for (int i = 0; i < _sweepParameters.Count; i++)
AsyncSweeper.cs (2)
236while (_results.Count < _numGenerated) 244_host.Check(0 <= id && id < _results.Count, "Invalid index");
ConfigRunner.cs (3)
115var args = Utils.BuildArray(RunNums.Count + 2, 118if (i == RunNums.Count) 120if (i == RunNums.Count + 1)
SweepCommand.cs (2)
94ch.Info("Could only generate {0} sweeps.", runs.Count); 97runs.AddRange(_runner.RunConfigs(sweeps, runs.Count));
Microsoft.ML.Sweeper.Tests (5)
TestSweeper.cs (5)
155Assert.Equal(sweeps, paramSets.Count); 175Assert.Equal(sweeps, paramSets.Count); 263Assert.Equal(sweeps, paramSets.Count); 345Assert.True(paramSets.Count <= sweeps); 399Assert.True(paramSets.Count <= sweeps);
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
477w.Write(modelFilePaths.Count);
Microsoft.ML.TestFramework (18)
BaseTestBaseline.cs (11)
454Fail("Baseline sequence had {0} items, but the suffix seems to have more", suffixList.Count); 460if (suffixList.Count == 0) // Empty suffix is trivially a suffix of anything. 462Contracts.Assert(suffixList.Count == seqList.Count); 465seqList[idx++ % seqList.Count] = seq.Current; 466Log("Suffix of length {0} compared against sequence of length {1}", suffixList.Count, seqList.Count + idx); 467for (int i = 0; i < suffixList.Count; ++i) 469if (!equalFunc(suffixList[i], seqList[(idx + i) % seqList.Count])) 472suffixList.Count, suffixList.Count - i - 1);
BaseTestPredictorsMaml.cs (3)
119loaderArgIndex = args.Count; 240for (int i = 0; i < args.Count; ++i) 335return settings.Count > 0 ? string.Join(" ", settings) : null;
DataPipe\TestDataPipeBase.cs (4)
407if (savable.Count < view.Schema.Count) 547if (savable.Count < view.Schema.Count) 583if (savable.Count == 0) 598if (savable.Count < view.Schema.Count)
Microsoft.ML.Tests (4)
TrainerEstimators\MatrixFactorizationTests.cs (1)
683Assert.Equal(6000, results.Count);
Transformers\GroupUngroup.cs (2)
59Assert.Equal(2, grouped.Count); 91Assert.Equal(4, ungrouped.Count);
Transformers\ValueMappingTests.cs (1)
788for (int i = 0; i < features.Count; ++i)
Microsoft.ML.TimeSeries (53)
AdaptiveSingularSpectrumSequenceModeler.cs (3)
931if (sortedComponents.Count > 1 && polynomialTrendFound) 936for (i = 0; i < sortedComponents.Count - 1; ++i) 953for (i = 1; i < sortedComponents.Count; ++i)
ExtensionsCatalog.cs (2)
339if (causes?.Count > 0) 429host.CheckUserArg(src.Slices.Count >= 1, nameof(src.Slices), "Must has more than one item");
PolynomialUtils.cs (9)
155for (var i = 0; i < Coefficients.Count; ++i) 179var len = Coefficients.Count; 182PolynomialMultiplication(destination, 0, len, len, factor.Coefficients.Count, 0, 1, 1); 184for (var i = 0; i < Coefficients.Count; ++i) 341while (factors.Count > 1) 344var k2 = Math.Abs(factors.ElementAt(factors.Count - 1).Key); 354f1 = factors.ElementAt(factors.Count - 1); 355factors.RemoveAt(factors.Count - 1); 362ind = Math.Min(factors.Count - 1, ind);
PredictionEngine.cs (1)
209if (rows.Count == 0)
RootCauseAnalyzer.cs (12)
162children = GetTopAnomaly(anomalyTree.ChildrenNodes[dimension.DimensionKey], anomalyTree.ParentNode, pointTree.ChildrenNodes[dimension.DimensionKey].Count > 0 ? pointTree.ChildrenNodes[dimension.DimensionKey] : pointTree.Leaves, dimension.DimensionKey, !(pointTree.ChildrenNodes[dimension.DimensionKey].Count > 0)); 215if (anomalyPoints.Count == 1) 236if (ShouldSeparateAnomaly(delta, root.Delta, pointSize, causeList.Count)) 249double totalEntropy = GetEntropy(totalPoints.Count, anomalyPoints.Count); 329double meanGain = sumGain / aggDim.Count; 353if (dst.Items.Count > 1) 370for (int i = 0; i < scoreList.Count; i++) 382else if (dst.Items.Count == 1) 459if (aggNum == aggDims.Count) 463else if (aggNum == aggDims.Count - 1)
SrCnnAnomalyDetectionBase.cs (4)
178int length = backAddList.Count; 194for (int i = 0; i < magLogList.Count; ++i) 261var n = data.Count; 275for (int i = n; i < cumSumList.Count; ++i)
SrCnnEntireAnomalyDetector.cs (15)
297public int Count => _batch.Count; 301_batchSize = _batch.Count; 302if (_batch.Count < MinBatchSize) 304if (_previousBatch.Count == 0) 308_bLen = _previousBatch.Count - _batch.Count; 309_previousBatch = _previousBatch.GetRange(_batch.Count, _bLen); 314for (int i = 0; i < _batch.Count; ++i) 792if (anomalyIndex.Count > 1) 795for (int i = 0; i < anomalyIndex.Count - 1; ++i) 797while (cursor < segments.Count && anomalyIndex[i] >= segments[cursor].Item2) 802if (cursor < segments.Count && segments[cursor].Item1 <= anomalyIndex[i] && anomalyIndex[i + 1] <= segments[cursor].Item2) 917while (fitValues.Count < minPointsToFit && (start > 0 || end < data.Length - 1)) 932if (fitValues.Count > 1) 941var n = values.Count;
STL\InnerStl.cs (5)
203List<double> virtualXValues = VirtualXValuesProvider.GetXValues(_cycleSubSeries[i].Count); 213_smoothedSubseries[i].Add(model.EstimateY(_cycleSubSeries[i].Count * 1.0)); 218for (int i = 0; i < _smoothedSubseries[0].Count; i++) 222if (_smoothedSubseries[j].Count <= i) 241List<double> virtualC3XValues = VirtualXValuesProvider.GetXValues(c3.Count);
STL\MathsTools.cs (2)
19if (values == null || values.Count == 0) 23return QuickSelect(values, values.Count / 2 + 1);
Microsoft.ML.TimeSeries.Tests (14)
TimeSeriesDirectApi.cs (10)
137while (enumerator.MoveNext() && index < expectedValues.Count) 195while (enumerator.MoveNext() && index < expectedValues.Count) 909for (int i = 0; i < data.Count; ++i) 964Assert.Equal(1, (int)rootCause.Items.Count); 967Assert.Equal(1, (int)rootCause.Items[0].Path.Count); 991Assert.Equal(2, preparedCauses.Count); 993Assert.Equal(1, (int)preparedCauses[0].Items.Count); 996Assert.Equal(1, (int)preparedCauses[0].Items[0].Path.Count); 1009Assert.Equal(1, (int)preparedCauses[1].Items.Count); 1012Assert.Equal(1, (int)preparedCauses[1].Items[0].Path.Count);
TimeSeriesSimpleApiTests.cs (4)
65while (enumerator.MoveNext() && index < expectedValues.Count) 109while (enumerator.MoveNext() && index < expectedValues.Count) 160for (var i = 0; enumerator.MoveNext() && i < expectedValues.Count; i++) 218for (var i = 0; enumerator.MoveNext() && i < expectedValues.Count; i++)
Microsoft.ML.Tokenizers (73)
Model\BPETokenizer.cs (3)
522EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), ids, maxTokenCount - ids.Count, out int length, ref priorityQueue); 525if (length < split.Length || ids.Count >= maxTokenCount) 536if (EndOfSentenceToken is not null && ids.Count < maxTokenCount)
Model\CodeGenTokenizer.cs (13)
632EncodeToIdsInternal(null, textSpanToEncode.Slice(split.Offset, split.Length), ids, agenda, out int length, maxTokenCount - ids.Count); 635if (length < split.Length || ids.Count >= maxTokenCount) 643EncodeToIdsInternal(addPrefixSpace ? null : (normalizedText ?? text), textSpanToEncode, ids, agenda, out charsConsumed, maxTokenCount - ids.Count); 646if (addEndOfSentence && EndOfSentenceId.HasValue && ids.Count < maxTokenCount) 1017if (tokens.Count <= maxTokens) 1028return tokens.Count; 1039while (j < tokens.Count && tokens[j].Offset.Start.Value == tokens[tokenCount].Offset.Start.Value) 1073if (tokens.Count <= maxTokens) 1084return tokens.Count; 1087int index = tokens.Count - maxTokens; 1090while (index < tokens.Count && tokens[index].Offset.Start.Value == tokens[index - 1].Offset.Start.Value) 1095for (int i = index; i < tokens.Count; i++) 1101return tokens.Count - index;
Model\EnglishRobertaTokenizer.cs (21)
441EncodeToIdsInternal(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 444if (length < split.Length || ids.Count >= maxTokenCount) 592if (tokens.Count <= maxTokens) 603return tokens.Count; 629if (tokens.Count <= maxTokens) 640return tokens.Count; 645for (int i = tokens.Count - maxTokens; i < tokens.Count; i++) 653for (int i = tokens.Count - maxTokens; i < tokens.Count; i++) 983if (word.Count == 1) 998while (i < word.Count) 1005for (int k = i; k < word.Count; k++) 1024if (i < word.Count - 1 && word[i + 1] == second) 1045var tokens = new List<EncodedToken>(word.Count); 1150Debug.Assert(rank < _symbols.Count); 1159if ((uint)rank >= _symbols.Count) 1176idx = _symbols.Count; 1188idx = _symbols.Count; 1213return idx < _symbols.Count ? _symbols[idx].Id : UnkIndex; 1217public int Count => _symbols.Count;
Model\SentencePieceUnigramModel.cs (17)
354int insertionStartPosition = tokens.Count; 371int end = tokens.Count - 1; 389while (start < tokens.Count) 416while (insertionStartPosition < tokens.Count) 598if (addEndOfSentence && ids.Count < maxTokenCount) 655if (ids.Count >= maxTokenCount) 675if (ids.Count < maxTokenCount) 688if (ids.Count < maxTokenCount) 740if (IdsIndex >= ids.Count) 770if (ids.Count >= maxTokenCount) 790int insertionStartPosition = ids.Count; 815unknownTokensTracking[unknownTokensCount - 1] = (ids.Count - 1, node.StartsAt, endsAt - node.StartsAt); 823ids.Reverse(insertionStartPosition, ids.Count - insertionStartPosition); 829int end = ids.Count - 1; 870while (index < ids.Count && index + addedTokensCount < maxTokenCount) 909if (index < ids.Count) 911ids.RemoveRange(index, ids.Count - index);
Model\TiktokenTokenizer.cs (2)
393EncodeToIds(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 396if (length < split.Length || ids.Count >= maxTokenCount)
Model\WordPieceTokenizer.cs (6)
328int initialTokensCount = tokens.Count; 372tokens.RemoveRange(initialTokensCount, tokens.Count - initialTokensCount); 420EncodeToIds(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 422if (length < split.Length || ids.Count >= maxTokenCount) 514accumulatedIds?.RemoveRange(accumulatedIds.Count - addedIds, addedIds); 521accumulatedIds?.RemoveRange(accumulatedIds.Count - addedIds, addedIds);
Utils\DoubleArrayTrie.cs (3)
66public bool IsEmpty => _units.Count == 0; 83_ranks = new uint[_units.Count]; 86for (int i = 0; i < _units.Count; ++i)
Utils\PriorityQueue.cs (8)
23int ci = _data.Count - 1; // child index; start at end 36int li = _data.Count - 1; // last index (before removal) 63public int Count => _data.Count; 68for (int i = 0; i < _data.Count; ++i) 70s += "count = " + _data.Count; 79if (_data.Count == 0) return true; 80int li = _data.Count - 1; // last index 81for (int pi = 0; pi < _data.Count; ++pi) // each parent index
Microsoft.ML.Tokenizers.Tests (21)
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (3)
66public bool IsEmpty => _units.Count == 0; 83_ranks = new uint[_units.Count]; 86for (int i = 0; i < _units.Count; ++i)
UnigramTests.cs (18)
290if (addBeginningOfSentence && writableTokens.Count > 0) 298if (addEndOfSentence && writableTokens.Count > 0) 300Assert.True(writableTokens[writableTokens.Count - 1].Id == tokenizer.EndOfSentenceId); 301Assert.True(writableTokens[writableTokens.Count - 1].Value == tokenizer.EndOfSentenceToken); 305Assert.True(writableTokens[writableTokens.Count - 1].Offset.Equals(new Range(normalized.Length, normalized.Length))); 307writableTokens.RemoveAt(writableTokens.Count - 1); 389if (ints.Count > 0) 397if (ints.Count > 0) 405if (ints.Count > 0) 408ints.RemoveAt(ints.Count - 1); 414if (ints.Count > 0) 417ints.RemoveAt(ints.Count - 1); 433if (ints.Count > 0) 437if (ints.Count > ids.Length) 439ints.RemoveAt(ints.Count - 1); 449if (ints.Count > 0) 453if (ints.Count > ids.Length) 455ints.RemoveAt(ints.Count - 1);
Microsoft.ML.TorchSharp (24)
AutoFormerV2\Attention.cs (1)
72int n = points.Count;
AutoFormerV2\AutoFormerV2Backbone.cs (2)
90for (int iLayer = 1; iLayer < depths.Count; iLayer++) 94outChannels: embedChannels[Math.Min(iLayer + 1, embedChannels.Count - 1)],
AutoFormerV2\BasicLayer.cs (2)
72for (int i = 0; i < hSlicesStartAndEnd.Count; i += 2) 74for (int j = 0; j < wSlicesStartAndEnd.Count; j += 2)
AutoFormerV2\FPN.cs (2)
93outs.Add(this.fpn_convs[i].forward(outs[outs.Count - 1])); 96for (int i = 0; i < outs.Count; i++)
AutoFormerV2\ObjectDetectionMetrics.cs (10)
69filterNum += objectLabelList.Count - objectLabelListOut[^1].Count; 70total += objectLabelList.Count; 183for (int annotaIndex = 0; annotaIndex < annotation.Count; annotaIndex++) 187for (int detectIndex = 0; detectIndex < objectLabel.Count; detectIndex++) 205bool[] annoSign = new bool[annotation.Count]; // whether a annotation bbox is used, default false 206bool[] predSign = new bool[objectLabel.Count]; // whether a predict bbox is used, default false 233for (int annoIndex = 0; annoIndex < annotations?.Count; annoIndex++) 254if (detectionList?.Count == 0) 261for (int index = 0; index < detectionList.Count; index++)
AutoFormerV2\RetinaHead.cs (1)
71for (int i = 0; i < inputs.Count; i++)
NasBert\Models\NasBertEncoder.cs (2)
124var hiddenTransferList = Enumerable.Range(0, HiddenSizePerBlock.Count) 264if (hiddenSizePerBlock.Count == 0)
NasBert\NasBertTrainer.cs (2)
273int[,] lengthArray = new int[inputTensors.Count, 1]; 274for (int i = 0; i < inputTensors.Count; i++)
TorchSharpBaseTrainer.cs (1)
261numRows = inputTensors.Count;
Utils\ImageUtils.cs (1)
74if (finalResult[0].Count > 0)
Microsoft.ML.TorchSharp.Tests (1)
ObjectDetectionTests.cs (1)
89Assert.True(logs.Count > 0);
Microsoft.ML.Transforms (83)
CountFeatureSelection.cs (1)
273if (slots.Count <= 0)
Expression\CodeGen.cs (4)
358Contracts.Assert(0 <= loc.Index && loc.Index < _cacheWith.Count); 1331int index = _cacheWith.Count; 1389Contracts.Assert(_cacheWith.Count == index + 1); 1398Contracts.Assert(_cacheWith.Count == index + 1);
Expression\LambdaBinder.cs (14)
61env.Assert(binder._rgwith.Count == 0); 150for (int i = _rgwith.Count; --i >= 0;) 1339if (candidates.Count == 0) 1377for (int i = 0; i < candidates.Count; i++) 1389if (0 < count && count < candidates.Count) 1390candidates.RemoveRange(count, candidates.Count - count); 1391_host.Assert(candidates.Count > 0); 1392_host.Assert(count == 0 || count == candidates.Count); 1403_host.Assert(0 <= icandMinBad && icandMinBad < candidates.Count); 1556for (int i = 0; i < candidates.Count; i++) 1565if (j >= candidates.Count) 1614int iwith = _rgwith.Count; 1621_host.Assert(_rgwith.Count == iwith + 1); 1624_host.Assert(_rgwith.Count == iwith);
Expression\LambdaParser.cs (10)
46if (index == lineMap.Count || IchLim < lineMap[index]) 64Contracts.Assert(ivMin <= map.Count); 65int ivLim = map.Count; 74Contracts.Assert(0 <= ivMin && ivMin <= map.Count); 75Contracts.Assert(ivMin == map.Count || value < map[ivMin]); 194Contracts.Assert(_errors == null || _errors.Count > 0); 196if (Utils.Size(_errors) > 0 && _errors[_errors.Count - 1].Token == err.Token) 378items.Add(ParseParam(items.Count)); 385if (items.Count != _types.Length) 641Contracts.Assert(list.Count >= 2);
Expression\MethodGenerator.cs (3)
152if (_locals != null && _locals.TryGetValue(key, out locals) && locals.Count > 0) 154var temp = locals[locals.Count - 1]; 155locals.RemoveAt(locals.Count - 1);
LearnerFeatureSelection.cs (2)
184var count = slots.Count; 225if (slots.Count > 0)
MissingValueHandlingTransformer.cs (4)
226if (naIndicatorCols.Count > 0) 230if (naConvCols.Count > 0) 240if (naIndicatorCols.Count > 0) 244if (dropCols.Count > 0)
MissingValueIndicatorTransformer.cs (7)
346if (indices.Count == 0) 363if (sense && indices.Count < srcLength / 2) 366int dstCount = indices.Count; 376else if (!sense && srcLength - indices.Count < srcLength / 2) 379int dstCount = srcLength - indices.Count; 401Host.Assert(iiSrc + 1 < indices.Count); 428Host.Assert(ii < indices.Count);
MissingValueReplacing.cs (3)
331StatAggregator[] statAggregators = new StatAggregator[columnsToImpute.Count]; 332for (int ii = 0; ii < columnsToImpute.Count; ii++) 357for (int ii = 0; ii < columnsToImpute.Count; ii++)
MutualInformationFeatureSelection.cs (4)
373if (slots.Count <= 0) 798Contracts.Assert(_singles.Count == 0); 817Contracts.Assert(_singles.Count == 0); 843Contracts.Assert(_doubles.Count == 0);
OneHotEncoding.cs (2)
308if (binaryCols.Count > 0) 310if (cols.Count > 0)
OneHotHashEncoding.cs (2)
358if (binaryCols.Count > 0) 360if (cols.Count > 0)
PermutationFeatureImportance.cs (9)
108evaluatedFeaturesCount = workingFeatureIndices.Count; 123if (workingFeatureIndices.Count == 0 && zeroWeightsCount == 0) 148while (initialfeatureValuesList.Count < maxSize && cursor.MoveNext()) 154valuesRowCount = initialfeatureValuesList.Count; 180if (processedCnt < workingFeatureIndices.Count - 1) 187Contracts.Assert(input.Count == 1); 191Contracts.Assert(output.Count == 1); 211processedCnt < workingFeatureIndices.Count - 1) 236if (processedCnt < workingFeatureIndices.Count - 1)
SvmLight\SvmLightLoader.cs (3)
240intermediate.FeatureKeys = new VBuffer<ReadOnlyMemory<char>>(keys.Count, keys.ToArray()); 241intermediate.FeatureValues = new VBuffer<float>(values.Count, values.ToArray()); 721env.Assert(schemaDef.Count == 1);
Text\LdaTransform.cs (1)
524int count = retTopics.Count;
Text\NgramTransform.cs (1)
617start += ngramIds[i].Count;
Text\SentimentAnalyzingTransform.cs (1)
129if (toHide.Count == 0)
Text\StopWordsRemovingTransformer.cs (2)
438VBufferUtils.Copy(list, ref dst, list.Count); 1126VBufferUtils.Copy(list, ref dst, list.Count);
Text\TextFeaturizingEstimator.cs (2)
580if (xfCols.Count > 0) 604if (srcTaggedCols.Count > 0)
Text\TextNormalizing.cs (1)
379VBufferUtils.Copy(list, ref dst, list.Count);
Text\WordBagTransform.cs (3)
488if (termCols.Count > 0) 491string[] missingDropColumns = termLoaderArgs != null && termLoaderArgs.DropUnknowns ? new string[termCols.Count] : null; 493for (int iinfo = 0; iinfo < termCols.Count; iinfo++)
Text\WordTokenizing.cs (4)
265var editor = VBufferEditor.Create(ref dst, terms.Count); 266if (terms.Count > 0) 296var editor = VBufferEditor.Create(ref dst, terms.Count); 297for (int i = 0; i < terms.Count; i++)
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
864int featureLength = featurizedImages.Count > 0 ? featurizedImages[0].Item2.Length : 0;
Microsoft.Net.Http.Headers (5)
CacheControlHeaderValue.cs (1)
568for (var i = 0; i < nameValueList.Count; i++)
SetCookieHeaderValue.cs (4)
244if (_extensions?.Count > 0) 302if (_extensions?.Count > 0) 387if (_extensions?.Count > 0) 748if (_extensions?.Count > 0)
Microsoft.NET.StringTools (9)
InternableString.cs (2)
79while (_spanIndex < _string._spans.Count) 292if (_inlineSpan.IsEmpty && _spans?.Count == 1 && _spans[0].Length == Length)
SpanBasedStringBuilder.cs (7)
66while (_spanIndex < _spans.Count) 167if (_spans.Count == 0 && other.IsEmpty) 172if (_spans.Count == 0 || other.IsEmpty || Length != other.Length) 268for (int spanIdx = 0; spanIdx < _spans.Count; spanIdx++) 290for (int spanIdx = 0; spanIdx < _spans.Count; spanIdx++) 315for (int spanIdx = _spans.Count - 1; spanIdx >= 0; spanIdx--) 337for (int spanIdx = _spans.Count - 1; spanIdx >= 0; spanIdx--)
Microsoft.NET.StringTools.net35 (1)
WeakStringCache.Locking.cs (1)
101for (int i = 0; i < keysToRemove.Count; i++)
Microsoft.VisualBasic.Core (53)
Microsoft\VisualBasic\Collection.vb (3)
126Dim i As Integer = m_Iterators.Count - 1 254Dim i As Integer = m_Iterators.Count - 1 573Dim i As Integer = m_Iterators.Count - 1
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (25)
590Debug.Assert(types.Count > 0, "unexpected empty set") 593For index As Integer = 1 To types.Count - 1 616Debug.Assert(types.Count > 0, "unexpected empty set") 620For index As Integer = 1 To types.Count - 1 671For i As Integer = operatorList.Count - 1 To 0 Step -1 756Dim operatorChoices As List(Of Method) = New List(Of Method)(operatorSet.Count) 757Dim candidates As List(Of Method) = New List(Of Method)(operatorSet.Count) 759Dim sourceBases As List(Of Type) = New List(Of Type)(operatorSet.Count) 760Dim targetDeriveds As List(Of Type) = New List(Of Type)(operatorSet.Count) 765sourceDeriveds = New List(Of Type)(operatorSet.Count) 766targetBases = New List(Of Type)(operatorSet.Count) 800ElseIf operatorChoices.Count = 0 Then 833If operatorChoices.Count = 0 AndAlso candidates.Count > 0 Then 836If sourceBases.Count > 0 Then 839Debug.Assert(Not wideningOnly AndAlso sourceDeriveds.Count > 0, "unexpected state") 845If targetDeriveds.Count > 0 Then 848Debug.Assert(Not wideningOnly AndAlso targetBases.Count > 0, "unexpected state") 862If operatorChoices.Count > 1 Then 956If operatorSet.Count = 0 Then 971If operatorChoices.Count = 1 Then 977ElseIf operatorChoices.Count = 0 AndAlso Not resolutionIsAmbiguous Then 979Debug.Assert(operatorSet.Count > 0, "expected operators") 992If operatorChoices.Count = 1 Then 998ElseIf operatorChoices.Count = 0 Then
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (1)
1314Select Case writeback.Count
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (2)
1075If RangeList.Count = 0 Then 1611Debug.Assert(RangeList IsNot Nothing AndAlso RangeList.Count > 0, "Empty RangeList unexpected")
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (2)
1384Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1460Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (4)
53If result.Count > 0 Then foundType1Operators = True 88If secondResult.Count > 0 Then foundType2Operators = True 167If candidates.Count > 0 Then 209Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (16)
551For index As Integer = 0 To candidates.Count - 1 911While index < candidates.Count 914While span < candidates.Count AndAlso candidates(span) Is Nothing 1657If errors IsNot Nothing AndAlso errors.Count > 0 Then 1688If errors Is Nothing OrElse errors.Count = 0 Then 1698If errors IsNot Nothing AndAlso errors.Count > 0 Then 1973If errors IsNot Nothing AndAlso errors.Count > 0 Then 2065For index As Integer = 0 To candidates.Count - 1 2374For leftIndex As Integer = 0 To candidates.Count - 1 2379For rightIndex As Integer = leftIndex + 1 To candidates.Count - 1 2527For index As Integer = 0 To candidates.Count - 1 2538While indexAhead < candidates.Count 2552Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 2713Dim candidateCount As Integer = candidates.Count 2836If candidates.Count = 1 AndAlso Not candidates.Item(0).NotCallable Then 2840If candidates.Count = 0 Then
Microsoft.VisualStudio.LanguageServices (40)
ChangeSignature\ChangeSignatureDialogViewModel.cs (15)
127if (matchingParameters.Count > 1) 165if (_parametersWithDefaultValues.Count + _parametersWithoutDefaultValues.Count > 0) 416if (index <= 0 || index == _parametersWithoutDefaultValues.Count || index >= _parametersWithoutDefaultValues.Count + _parametersWithDefaultValues.Count) 436if (index < 0 || index == _parametersWithoutDefaultValues.Count - 1 || index >= _parametersWithoutDefaultValues.Count + _parametersWithDefaultValues.Count - 1) 451Move(index < _parametersWithoutDefaultValues.Count ? _parametersWithoutDefaultValues : _parametersWithDefaultValues, index < _parametersWithoutDefaultValues.Count ? index : index - _parametersWithoutDefaultValues.Count, delta: -1); 460Move(index < _parametersWithoutDefaultValues.Count ? _parametersWithoutDefaultValues : _parametersWithDefaultValues, index < _parametersWithoutDefaultValues.Count ? index : index - _parametersWithoutDefaultValues.Count, delta: 1);
FindReferences\Contexts\AbstractTableDataSourceFindUsagesContext.cs (3)
195list.Capacity = list.Count + builder.Count; 616var result = new FixedSizeArrayBuilder<Entry>(entries.nonPrimary.Count + entries.primary.Count);
FindReferences\Contexts\WithoutReferencesFindUsagesContext.cs (1)
58if (this.Definitions.Count > 0)
FindReferences\Contexts\WithReferencesFindUsagesContext.cs (4)
266if (primary.Count == 0 && nonPrimary.Count == 0 && Definitions.Count > 0) 279if (this.Definitions.Count > 0)
GenerateType\GenerateTypeDialogViewModel.cs (2)
333Folders.RemoveAt(Folders.Count - 1); 533this.IsExistingFileEnabled = _previouslyPopulatedDocumentList.Count == 0 ? false : true;
Implementation\VsRefactorNotifyService.cs (2)
47(uint)itemIDs.Count, 84(uint)itemIDs.Count,
PickMembers\PickMembersDialogViewModel.cs (1)
151return index < MemberContainers.Count - 1;
ProjectSystem\Legacy\SolutionEventsBatchScopeCreator.cs (2)
88for (var i = 0; i < _fullSolutionLoadScopes.Count; i++) 162if (_fullSolutionLoadScopes.Count > 0)
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
334if (changedDocs.Count > 0)
Telemetry\CodeMarkerLogger.cs (1)
157for (var i = 0; i < items.Count; i++)
Venus\ContainedDocument.cs (8)
246if (newChanges.Count > 0) 264if (editorVisibleSpansInOriginal.Count == 0 || !changes.Any()) 277for (; spanIndex < editorVisibleSpansInOriginal.Count; spanIndex++) 313if (subChanges.Count > 0) 315if (subChanges.Count == 1 && subChanges[0] == change) 425=> TryGetWhitespaceGroup(leftText, spansInLeftText) && TryGetWhitespaceGroup(rightText, spansInRightText) && spansInLeftText.Count == spansInRightText.Count; 678for (var i = 0; i < replacementMap.Count; i++)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService.cs (1)
1308if (firstIndex < leadingTriviaList.Count &&
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
86if (newUsingDirectives.Count == 0)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
CodeModel\FileCodeClassTests.cs (1)
310Assert.Equal(2, z.Count);
MSBuild (28)
BuildEnvironmentHelper.cs (2)
301if (instances.Count == 0) 306if (instances.Count > 1)
CollectionHelpers.cs (3)
24List<T> inputsWithoutNulls = new List<T>(inputs.Count); 35return (inputsWithoutNulls.Count == inputs.Count) ? inputs : inputsWithoutNulls;
XMake.cs (23)
1352remoteLoggerRecords.Count == 0 && 3647if (actualProjectFiles.Count == 1 && actualSolutionFiles.Count == 1) 3657else if (actualSolutionFiles.Count > 1) 3662else if (actualProjectFiles.Count > 1) 3668if (actualProjectFiles.Count == 2) 3695else if (actualProjectFiles.Count == 0 && 3696actualSolutionFiles.Count == 0 && 3697solutionFilterFiles.Count == 0) 3705projectFile = actualSolutionFiles.Count == 1 ? actualSolutionFiles[0] : actualProjectFiles.Count == 1 ? actualProjectFiles[0] : solutionFilterFiles[0]; 3706InitializationException.VerifyThrow(actualSolutionFiles.Count == 1 || actualProjectFiles.Count == 1 || solutionFilterFiles.Count == 1, projectDirectory == null ? "AmbiguousProjectError" : "AmbiguousProjectDirectoryError", null, projectDirectory); 4355ErrorUtilities.VerifyThrow((loggerSpec.Count >= 1) && (loggerSpec.Count <= 2), 4370if (loggerSpec.Count > 1) 4401ErrorUtilities.VerifyThrow((loggerSpec.Count >= 1) && (loggerSpec.Count <= 2), 4409if (loggerSpec.Count == 2) 4417ErrorUtilities.VerifyThrow(loggerTypeSpec.Count >= 1, "SplitUnquoted() must return at least one string"); 4422if (loggerTypeSpec.Count >= 2) 4434for (int i = 2; i < loggerTypeSpec.Count; i++)
MSBuildTaskHost (9)
BinaryTranslator.cs (2)
1096int count = list.Count; 1135int count = list.Count;
BuildEnvironmentHelper.cs (2)
301if (instances.Count == 0) 306if (instances.Count > 1)
CollectionHelpers.cs (3)
24List<T> inputsWithoutNulls = new List<T>(inputs.Count); 35return (inputsWithoutNulls.Count == inputs.Count) ? inputs : inputsWithoutNulls;
InterningReadTranslator.cs (1)
80_pathIdsToString = new(_strings.Count);
InterningWriteTranslator.cs (1)
110index = _strings.Count;
OracleEndToEnd.ApiService (1)
Program.cs (1)
21totalEntries = users.Count,
OrderProcessor (2)
OrderProcessingWorker.cs (2)
69Activity.Current?.AddTag("product-count", order.Items.Count); 75""", order.Id, order.BuyerId, order.Items.Count);
ParameterEndToEnd.ApiService (1)
Program.cs (1)
35totalEntries = entries.Count,
PostgresEndToEnd.ApiService (1)
Program.cs (1)
34totalEntries = entries.Count,
PrepareTests (3)
MinimizeUtil.cs (2)
107if (pair.Value.Count > 1) 128.Where(x => x.Value.Count > 1)
TestDiscovery.cs (1)
26Console.WriteLine($"Found {assemblies.Count} test assemblies");
PresentationBuildTasks (24)
Microsoft\Build\Tasks\Windows\UidManager.cs (2)
689for (int i = 0; i < _uids.Count; i++) 737get { return _uids.Count; }
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (3)
233if (modifiedXamlFiles.Count > 0) 413for (int i = 0; i < modifiedXamlFiles.Count; i++) 439if (recompiledXaml.Count > 0)
src\Microsoft.DotNet.Wpf\src\PresentationCore\MS\Internal\Media\XamlSerializationHelper.cs (6)
199writer.Write( ( uint ) point3Ds.Count ) ; 202for ( int i = 0; i < point3Ds.Count ; i ++ ) 231writer.Write( ( uint ) points.Count ) ; 234for ( int i = 0; i < points.Count ; i ++ ) 263writer.Write( ( uint ) points.Count ) ; 266for ( int i = 0; i < points.Count ; i ++ )
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (5)
1066bamlAssemblyInfoRecord.AssemblyId = (short)(AssemblyIdMap.Count - 1); 1084bamlAssemblyInfoRecord.AssemblyId = (short)(AssemblyIdMap.Count - 1); 1239bamlTypeInfoRecord.TypeId = (short)(TypeIdMap.Count - 1); 1346bamlAttributeInfoRecord.AttributeId = (short)(AttributeIdMap.Count - 1); 1462stringInfo.StringId = (short)(StringIdMap.Count - 1);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (6)
1175bamlPropertyWithStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1); 1585if (staticResourceRecordList.Count > 0) 1588for (int j=0; j<staticResourceRecordList.Count; j++) 1592for (int k=0; k<srRecords.Count; k++) 1676valueDeferRecord = _staticResourceRecordList[_staticResourceRecordList.Count-1]; 1691bamlStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlInt32CollectionSerializer.cs (1)
89count = ints.Count ;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
3267for (int j = 0; j < namespaceAssemblyPair.Count; j++)
PresentationCore (524)
MS\Internal\DpiUtil\DpiUtil.cs (1)
180int sizeOfList = UIElement.DpiScaleXValues.Count;
MS\Internal\FontCache\FontSourceCollection.cs (1)
136fontSources = new List<Text.TextInterface.IFontSource>(resourceEntries.Count);
MS\Internal\Ink\Bezier.cs (2)
68for (int x = 0; x < points.Count; x++) 575get { return _bezierControlPoints.Count; }
MS\Internal\Ink\CuspData.cs (2)
156int s = 0, e = _cusps.Count; 189get { return _points.Count; }
MS\Internal\Ink\ErasingStroke.cs (10)
98if ((_erasingStrokeNodes == null) || (_erasingStrokeNodes.Count == 0)) 141if ((_erasingStrokeNodes == null) || (_erasingStrokeNodes.Count == 0)) 157int index = eraseAt.Count; 173for (int i = index; i < eraseAt.Count; i++) 186if ((fragment.EndFIndex <= lastFragment.EndFIndex) || ((i + 1) == eraseAt.Count)) 214if (eraseAt[eraseAt.Count - 1].IsFull) 220if ((index > 0) && (index < eraseAt.Count)) 242if (eraseAt.Count != 0) 250return (eraseAt.Count != 0); 299newPath[newPath.Count - 1] = path[i];
MS\Internal\Ink\ExtendedPropertyCollection.cs (10)
45for (int i = 0; i < _extendedProperties.Count; i++) 105for (int x = 0; x < _extendedProperties.Count; x++) 134for (int x = 0; x < _extendedProperties.Count; x++) 197if (_extendedProperties.Count > 0) 199Guid[] guids = new Guid[_extendedProperties.Count]; 200for (int i = 0; i < _extendedProperties.Count; i++) 235for (int i = 0; i < _extendedProperties.Count; i++) 294return _extendedProperties.Count; 337_optimisticIndex < _extendedProperties.Count && 344for (int i = 0; i < _extendedProperties.Count; i++)
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (1)
237if (foundAllGestures && gestures.Count != 1)
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (1)
86if (((compressedData.Count - 1/*for the algo byte we just made room for*/) >> 2) > input.Length)
MS\Internal\Ink\InkSerializedFormat\GuidTagList.cs (4)
67for (i = 0; i < _customGuids.Count; i++) 144if ((0 > nIndex) || (_customGuids.Count <= nIndex)) 207uint ul = (uint)(_customGuids.Count * Native.SizeOfGuid); 229for (int i = 0; i < _customGuids.Count; i++)
MS\Internal\Ink\InkSerializedFormat\HuffModule.cs (1)
57if ((int)codec >= _huffCodecs.Count + AlgoModule.DefaultBAACount)
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (36)
102if (0 == (byte)(charData[charData.Count - 1])) 105charData.RemoveAt(charData.Count - 1); 568if (_strokeDescriptorTable.Count <= strokeDescriptorTableIndex) 581if (_transformTable.Count <= transformTableIndex) 603if (_metricTable.Count <= metricDescriptorTableIndex) 617if (_drawingAttributesTable.Count <= drawingAttributesTableIndex) 1568while (cTags < strd.Template.Count) 1622for (int i = 0; i < tags.Count; i++) 2192if (_strokeDescriptorTable.Count == 0) 2199if (_strokeDescriptorTable.Count == 1) 2204if (tmp.Template.Count == 0) 2221for (count = 0; count < _strokeDescriptorTable.Count; count++) 2231for (count = 0; count < _strokeDescriptorTable.Count; count++) 2251if (0 == _metricTable.Count) 2254for (int i = 0; i < _metricTable.Count; i++) 2268else if (1 == _metricTable.Count) 2278for (int i = 0; i < _metricTable.Count; i++) 2300for (int count = 0; count < strd.Template.Count; count++) 2319if (_transformTable.Count == 1 && _transformTable[0].Size == 0) 2328for (int i = 0; i < _transformTable.Count; i++) 2352if (_transformTable.Count == 1) 2363for (int i = 0; i < _transformTable.Count; i++) 2373for (int i = 0; i < _transformTable.Count; i++) 2447if (1 == _drawingAttributesTable.Count) 2478uint[] sizes = new uint[_drawingAttributesTable.Count]; 2479MemoryStream[] drawingAttributeStreams = new MemoryStream[_drawingAttributesTable.Count]; 2482for (int i = 0; i < _drawingAttributesTable.Count; i++) 2495for (int i = 0; i < _drawingAttributesTable.Count; i++) 2543for (int descriptorIndex = 0; descriptorIndex < _strokeDescriptorTable.Count; descriptorIndex++) 2555_strokeLookupTable[stroke].StrokeDescriptorTableIndex = (uint)_strokeDescriptorTable.Count - 1; 2561for (int tmp = 0; tmp < _metricTable.Count; tmp++) 2584_strokeLookupTable[stroke].MetricDescriptorTableIndex = (uint)(_metricTable.Count - 1); 2596for (int i = 0; i < _transformTable.Count; i++) 2609_strokeLookupTable[stroke].TransformTableIndex = (uint)(_transformTable.Count - 1); 2618for (int i = 0; i < _drawingAttributesTable.Count; i++) 2631_strokeLookupTable[stroke].DrawingAttributesTableIndex = (uint)_drawingAttributesTable.Count - 1;
MS\Internal\Ink\InkSerializedFormat\StrokeDescriptor.cs (3)
38if( _strokeDescriptor.Count != strd.Template.Count ) 42for( int i = 0; i < _strokeDescriptor.Count; i++ )
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (2)
165for (int iTag = 1; iTag < strokeDescriptor.Template.Count && remainingBytesInStrokeBlock > 0; iTag++) 174while (iTag < strokeDescriptor.Template.Count && remainingBytesInStrokeBlock > 0)
MS\Internal\Ink\Lasso.cs (20)
51return (_points.Count < 3); 63return _points.Count; 77System.Diagnostics.Debug.Assert((0 <= index) && (index < _points.Count)); 127int last = _points.Count; 138Point prevLassoPoint = _points[_points.Count - 1]; 139for (int i = 0; i < _points.Count; i++) 188if (_points.Count < 3) 212Point lassoLastPoint = _points[_points.Count - 1]; 294if (crossingList.Count == 0) 382for (int x = 0; x <= crossingList.Count; x++) 399if (x == crossingList.Count) 445StrokeIntersection previousIntersection = strokeIntersections[strokeIntersections.Count - 1]; 454strokeIntersections[strokeIntersections.Count - 1] = previousIntersection; 505if (0 == _points.Count) 511Point lastPoint = _points[_points.Count - 1]; 684if (0 == points.Count) 705System.Diagnostics.Debug.Assert(intersection >= 0 && intersection <= points.Count - 2); 707if (intersection == points.Count - 2) 739for (int j = 0; j < points.Count; j++) 770int count = points.Count;
MS\Internal\Ink\StrokeIntersection.cs (8)
193if (inFIndices.Count > 0 && 194inFIndices[inFIndices.Count - 1].EndFIndex >= 198StrokeFIndices sfiPrevious = inFIndices[inFIndices.Count - 1]; 200inFIndices[inFIndices.Count - 1] = sfiPrevious; 225if (hitFIndices.Count > 0 && 226hitFIndices[hitFIndices.Count - 1].EndFIndex >= 230StrokeFIndices sfiPrevious = hitFIndices[hitFIndices.Count - 1]; 232hitFIndices[hitFIndices.Count - 1] = sfiPrevious;
MS\Internal\Ink\StrokeRenderer.cs (22)
159int cbEndIndex = connectingQuadPoints.Count - 1; 170for (int i = abIndex, j = connectingQuadPoints.Count - 1; i < j; i++, j--) 377if (pathFigureABSide.Count > 0) 480if (pathFigureABSide.Count == 0) 482Debug.Assert(pathFigureDCSide.Count == 0); 629if (pathFigureABSide.Count > 0) 646Debug.Assert(pathFigureDCSide.Count == 0); 672Debug.Assert(pathFigureABSide.Count == 0); 687if (pathFigureABSide.Count > 0) 707Debug.Assert(pathFigureDCSide.Count == 0); 802for (int i = 0, j = dcPoints.Count - 1; i < j; i++, j--) 867Debug.Assert(points.Count > 0); 869context.BeginFigure(startPoint: points[points.Count - 1], 895Debug.Assert(abPoints.Count > 0 && dcPoints.Count > 0); 919if (abPoints.Count == 0 || dcPoints.Count == 0) 932for (int i = startIndex; i < points.Count; ) 937if (polyLinePoints.Count > 0) 946Debug.Assert(i + 2 < points.Count); 947if (i + 2 < points.Count) 972if (polyLinePoints.Count > 0)
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (7)
399for (int i = 0; i < hitTestEdgeList.Count; i++) 534if (pointList.Count >= 2) 539else if (pointList.Count == 1) 945if (pointList.Count >= 2) 950else if (pointList.Count == 1) 1028for (int i=0, count = edges.Count; i < count; i++) 1176for (int i = 0, count = edges.Count; i < count; i++)
src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (7)
1057for (int i = 0; i < _others.Count; i++) 1126Debug.Assert(_others.Count > 0); 1127int j = _others.Count-1; 1149if (_others.Count == 1) 1209return _others.Count + 1; 1292for (int i = 0; i < others.Count; i++) 1447return ((List<Entry>)_head._key).Count;
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (2)
446buffer = _targetBuffer[_targetBuffer.Count - 1]; 458_targetBuffer[_targetBuffer.Count - 1] = buffer;
System\Windows\Automation\Peers\AutomationPeer.cs (14)
551int cnt = children.Count; 1257result = new IRawElementProviderSimple[controlledPeers.Count]; 1259for (int i = 0; i < controlledPeers.Count; i++) 1469if (_children != null && _children.Count > 0) 1489int count = _children.Count; 1515if (_children != null && _children.Count > 0) 1517peer = _children[_children.Count - 1]; 1542&& _index + 1 < parent._children.Count 1565&& _index < parent._children.Count 1649iterationParent = (_parent._children == null || _parent._children.Count == caller._children.Count) 1763int count = children.Count; 1903for(int count = oldChildren.Count, i = 0; i < count; i++) 1915for(int count = _children.Count, i = 0; i < count; i++)
System\Windows\FreezableCollection.cs (10)
151for (int i = _collection.Count - 1; i >= 0; i--) 158Debug.Assert(_collection.Count == 0); 350return _collection.Count; 367ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 477ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 488int count = _collection.Count; 708return _collection.Count; 793int count = source._collection.Count; 888int count = _collection.Count; 1009if (_index > -2 && _index < _list._collection.Count - 1)
System\Windows\Ink\IncrementalHitTester.cs (11)
94int count = _strokeInfos.Count; 180for (int i = 0; i < _strokeInfos.Count && localRemoved.Count > 0; ) 202if (_strokes.Count != _strokeInfos.Count) 208for (int i = 0; i < _strokeInfos.Count; i++) 230for (int x = 0; x < _strokeInfos.Count; x++) 251for (int x = 0; x < _strokeInfos.Count; x++) 261Debug.Assert(_strokeInfos.Count == _strokes.Count); 262for (int x = 0; x < _strokeInfos.Count; x++) 529for (int x = 0; x < this.StrokeInfos.Count; x++) 557System.Diagnostics.Debug.Assert(strokeHitEventArgCollection.Count != 0); 558for (int x = 0; x < strokeHitEventArgCollection.Count; x++)
System\Windows\Ink\Stroke.cs (5)
250Debug.Assert(bezierPoints != null && bezierPoints.Count > 0); 254new StylusPointCollection(_stylusPoints.Description, bezierPoints.Count); 264if (bezierPoints.Count == 1) 295for (int x = 1; x < bezierPoints.Count - 1; x++) 341bezierPoints[bezierPoints.Count - 1],
System\Windows\Input\AccessKeyManager.cs (4)
90return (targets != null && targets.Count > 0); 237for (int i = 0; i < targets.Count; i++) 276return (chosenIndex == targets.Count - 1) ? ProcessKeyResult.LastMatch : ProcessKeyResult.MoreMatches; 380for (int i = 0; i < possibleElements.Count; i++)
System\Windows\Input\Command\CanExecuteChangedEventManager.cs (3)
110removeList = (toRemove != null && toRemove.Count == list.Count); 298if (list.Count == 0)
System\Windows\Input\Command\CommandBindingCollection.cs (1)
278return _innerCBList?.Count ?? 0;
System\Windows\Input\Command\CommandManager.cs (2)
599for (int i = 0; i < list.Count; ++i) 606while (++i < list.Count && list[i].Item1 == classType)
System\Windows\Input\Command\InputBindingCollection.cs (3)
172if (index >= 0 && index < _innerBindingList.Count) 310if (index >= 0 && index < _innerBindingList.Count) 337return (_innerBindingList != null ? _innerBindingList.Count : 0);
System\Windows\Input\Command\InputGestureCollection.cs (1)
346return (_innerGestureList != null ? _innerGestureList.Count : 0 );
System\Windows\Input\ManipulationDevice.cs (3)
135for (int i = _manipulators.Count - 1; i >= 0; i--) 173if (_manipulators == null || _manipulators.Count == 0) 442Debug.Assert(_manipulators == null || _manipulators.Count == 0);
System\Windows\Input\ManipulationInertiaStartingEventArgs.cs (2)
206if (_inertiaParameters != null && _inertiaParameters.Count > 0) 242for (int i = 0, count = _inertiaParameters.Count; i < count; i++)
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (4)
176get { return _strokeInfoList.Count > 0; } 180get { return _strokeInfoList.Count == 1; } 875while (_strokeInfoList.Count > 0) 1015for (int i=0; i < _strokeInfoList.Count; i++)
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (5)
86if (points.Count == 0) 96((List<StylusPoint>)this.Items).Capacity = points.Count; 97for (int x = 0; x < points.Count; x++) 121if (stylusPoints.Count == 0) 126((List<StylusPoint>)this.Items).Capacity = stylusPoints.Count;
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (2)
50if (infos.Count < RequiredCountOfProperties || 67for (int x = RequiredCountOfProperties; x < infos.Count; x++)
System\Windows\Input\Stylus\Common\TabletDeviceCollection.cs (1)
34return TabletDevices.Count;
System\Windows\Input\Stylus\Pointer\PointerInteractionEngine.cs (1)
183UnsafeNativeMethods.SetInteractionConfigurationInteractionContext(_interactionContext, (uint)configuration.Count, configuration.ToArray());
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (2)
78for (i = 0; i < _plugInCollectionList.Count; i++) 86while (i < _plugInCollectionList.Count)
System\Windows\Input\Stylus\Pointer\PointerTabletDeviceInfo.cs (1)
267SupportedButtonPropertyIndex = supportedProperties.Count;
System\Windows\Input\Stylus\Wisp\PenContext.cs (3)
233return _stylusDevicesInRange != null && _stylusDevicesInRange.Count > 0; 357if (_stylusDevicesInRange.Count == 0) 375for(int i=0; i < _stylusDevicesInRange.Count; i++)
System\Windows\Input\Stylus\Wisp\PenContexts.cs (2)
276for (i=0; i < _plugInCollectionList.Count; i++) 284while (i < _plugInCollectionList.Count)
System\Windows\Input\Stylus\Wisp\PenThreadPool.cs (2)
90while (ignoredThreads.Count < MAX_PENTHREAD_RETRIES) 94for (int i = _penThreadWeakRefList.Count - 1; i >= 0; i--)
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (12)
1017if (penContextRefs.Count < MaxContextPerThread) 1026_pimcContexts = new IPimcContext3[penContextRefs.Count]; 1027_penContexts = new WeakReference[penContextRefs.Count]; 1028_handles = new IntPtr[penContextRefs.Count]; 1029_wispContextKeys = new UInt32[penContextRefs.Count]; 1031for (i=0; i < penContextRefs.Count; i++) 1080_pimcContexts = new IPimcContext3[penContextRefs.Count]; 1081_penContexts = new WeakReference[penContextRefs.Count]; 1082_handles = new IntPtr[penContextRefs.Count]; 1083_wispContextKeys = new UInt32[penContextRefs.Count]; 1085for (i=0; i < penContextRefs.Count; i++) 1165if (_workerOperation.Count > 0)
System\Windows\Input\Stylus\Wisp\WispLogic.cs (4)
1594int stagingItemCount = storedStagingItems.Count; 1664int count = touchDevice.StoredStagingAreaItems.Count; 3433int numDeferredTablets = _tabletDeviceCollection.DeferredTablets.Count; 3442&& _tabletDeviceCollection.DeferredTablets.Count == numDeferredTablets)
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (1)
658int c = Count + _deferredTablets.Count;
System\Windows\Input\TouchDevice.cs (9)
428int count = (_activeDevices != null) ? _activeDevices.Count : 0; 464int count = _activeDevices != null ? _activeDevices.Count : 0; 702if (_activeDevices.Count == 1) 806int count = _activeDevices != null ? _activeDevices.Count : 0; 1142int count = _activeDevices.Count; 1155if ((_activeDevices != null) && (_activeDevices.Count > 0)) 1171int count = _activeDevices.Count; 1217int count = _activeDevices.Count; 1237int count = _activeDevices.Count;
System\Windows\Media\Animation\Clock.cs (3)
1413if (_childIndex == parentChildren.Count - 1) 4270for (int childIndex = 0; childIndex < children.Count; childIndex++) 4294for (int index = 0; index < children.Count; index++)
System\Windows\Media\Animation\ClockGroup.cs (7)
130for (int index = 0; index < _children.Count; index++) 289for (int c = 0; c < _children.Count; c++) 310for (int c = 0; c < _children.Count; c++) 349for (int childIndex = 0; childIndex < _children.Count; childIndex++) 435for (int c = 0; c < _children.Count; c++) 498return (_rootChildren.Count > 0); 549for (int childIndex = 0; childIndex < _children.Count; childIndex++)
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ColorKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\DoubleKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\MatrixKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Point3DKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\PointKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\QuaternionKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\RectKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\SizeKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Vector3DKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\VectorKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\ParallelTimeline.cs (1)
99for (int childIndex = 0; childIndex < children.Count; childIndex++)
System\Windows\Media\Animation\TimelineClockCollection.cs (1)
34return childList.Count;
System\Windows\Media\Animation\WeakRefEnumerator.cs (2)
106_readIndex = _writeIndex = _list.Count; 131while (_readIndex < _list.Count)
System\Windows\Media\Effects\ShaderEffect.cs (14)
208for (int i = PS_2_0_FLOAT_REGISTER_LIMIT; i < _floatRegisters.Count; i++) 222for (int i = PS_2_0_SAMPLER_LIMIT; i < _samplerData.Count; i++) 473if (list.Count <= position) 475int numToAdd = position - list.Count + 1; 500if (_samplerData.Count <= position) 502int numToAdd = position - _samplerData.Count + 1; 622for (int i = 0; i < _floatRegisters.Count; i++) 639for (int i = 0; i < _intRegisters.Count; i++) 656for (int i = 0; i < _boolRegisters.Count; i++) 676int count = _samplerData.Count; 699for (int i = 0; i < _samplerData.Count; i++) 735for (int i = 0; i < list.Count; i++) 757int numSamplers = _samplerData.Count; 794int numSamplers = _samplerData.Count;
System\Windows\Media\Imaging\BitmapMetadata.cs (9)
192count = (UInt32)_metadataBlocks.Count; 206if (index >= _metadataBlocks.Count) 330if (index >= _metadataBlocks.Count) 358if (_fixedSize && _metadataBlocks.Count>0) 381if (index >= _metadataBlocks.Count) 409if (index >= _metadataBlocks.Count) 508if (_index >= _metadataBlocks.Count || celt == 0) 540if (newIndex > _metadataBlocks.Count) 542_index = (uint)_metadataBlocks.Count;
System\Windows\Media\Visual.cs (1)
4684if (UIElement.DpiScaleXValues.Count == 0)
System\Windows\Media3D\Matrix3DStack.cs (5)
40_stack.RemoveAt(_stack.Count - 1); 50if (_stack.Count > 0) 68return _stack.Count; 76return (_stack.Count == 0); 84return _stack[_stack.Count - 1];
System\Windows\Media3D\RayHitTestParameters.cs (1)
120for(int i = 0, count = results.Count; i < count; i++)
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
371list.RemoveRange(count, list.Count - count);
PresentationFramework (847)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (1)
716List<ContentLocatorBase> tempLocators = new List<ContentLocatorBase>(locatorsToReturn.Count * locatorParts.Count);
MS\Internal\Annotations\AnnotationMap.cs (2)
43if (list.Count == 0) 96if (result.Count == 0)
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (2)
428if (adorners.Count > 0) 430for (index = adorners.Count; index > 0; index--)
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (13)
82if (_segments.Count == 0) 241for (int i = 0; i < _segments.Count; i++) 350while ((ind < _segments.Count) && (!rangeSegment.IsNull)) 441if (ind == _segments.Count) ind--; 453for (int i = 0; i < _segments.Count; i++) 477for (int i = _segments.Count - 1; i >= 0; i--) 499for (int i = 0; i < _segments.Count; i++) 669for (int i = 0; i < _owners.Count; i++) 699return _owners.Count; 1149if (_activeOwners.Count != 0) 1153return _owners.Count > 0 ? _owners[0] : null; 1175if (_activeOwners.Count != 0) 1179return _owners.Count > 0 ? new SolidColorBrush(_owners[0].Background) : null;
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (12)
629if (componentsRegister.Components.Count == 0) 901bool[] active = new bool[components.Count]; 902for (int i = 0; i < components.Count; i++) 911for (int i = 0; i < components.Count; i++) 966Debug.Assert((components != null) && (components.Count > 0), "invalid component registry"); 968for (int i = 0; i < components.Count; i++) 1011if (_components.Count == 0) 1022for (; i < _components.Count; i++) 1031for (; i < _components.Count; i++) 1046for (; ind < _components.Count; ind++) 1052if (ind < _components.Count) 1057for (; ind < _components.Count; ind++)
MS\Internal\Annotations\TextAnchor.cs (19)
121for (int i = 0; i < _segments.Count; i++) 169if (other._segments.Count != this._segments.Count) 172for (int i = 0; i < _segments.Count; i++) 289while (currentIndex < anchor._segments.Count && hasMore) 347if (anchor._segments.Count > 0) 391while (current < anchor._segments.Count && hasMore) 446if (!hasMore && current < anchor._segments.Count) 448anchor._segments.RemoveRange(current, anchor._segments.Count - current); 451if (anchor._segments.Count == 0) 507return _segments.Count > 0 ? _segments[0].Start : null; 518return _segments.Count > 0 ? _segments[_segments.Count - 1].End : null; 530return (_segments.Count == 1 && (object)_segments[0].Start == (object)_segments[0].End); 545for (int i = 0; i < _segments.Count; i++) 599for (int i = orderedList.Count - 1; i >= 0; i--) 611if (orderedList.Count > 1) 627for (; i < _segments.Count; i++) 638if (i < _segments.Count && newSegment.End.CompareTo(_segments[i].Start) > 0)
MS\Internal\Controls\InkCanvasSelectionAdorner.cs (3)
155int count = hatchBounds.Count; 156if (count != _elementsBounds.Count) 237int count = _elementsBounds.Count;
MS\Internal\Data\CollectionViewGroupRoot.cs (3)
334List<GroupTreeNode> list = new List<GroupTreeNode>(parentGroups.Count + 1); 346for (int index = 0; index < list.Count; ++index) 360for (int k = list.Count - 1; k >= 0; --k)
MS\Internal\Data\LiveShapingItem.cs (1)
214if (list.Count == 1)
MS\Internal\Data\LiveShapingList.cs (2)
715for (; _dpIndex < s_dpList.Count; ++_dpIndex) 730$"LiveSortingTargetProperty{s_dpList.Count}"),
MS\Internal\Data\StaticPropertyChangedEventManager.cs (2)
487Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 514if (_toRemove.Count > 0)
MS\Internal\Data\ValueChangedEventManager.cs (2)
187Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 219if (_toRemove.Count > 0)
MS\Internal\Documents\ContentHostHelper.cs (1)
109for (int i = 0; i < pageViews.Count; i++)
MS\Internal\Documents\DocumentGrid.cs (1)
2931for (int i = 0; i < args.Changes.Count; i++)
MS\Internal\Documents\FlowDocumentPaginator.cs (4)
432for (int index = 0; index < _asyncRequests.Count; index++) 609if (_backgroundPagination && _backgroundPaginationOperation == null && (!_brt.IsClean || _asyncRequests.Count > 0)) 620for (int index = 0; index < _asyncRequests.Count; index++) 785for (int index = 0; index < _asyncRequests.Count; index++)
MS\Internal\Documents\MultiPageTextView.cs (11)
152for (int i = 0, count = _pageTextViews.Count; i < count; ++i) 647for (int i = 0; i < _pageTextViews.Count; i++) 668if (_pageTextViews != null && _pageTextViews.Count > 0) 688for (int i = 0; i < _pageTextViews.Count; i++) 718for (index = 0; index < _pageTextViews.Count; index++) 1073for (i = 0; i < _pageTextViews.Count; i++) 1086double[] textViewProximities = new double[_pageTextViews.Count]; 1087for (i = 0; i < _pageTextViews.Count; i++) 1139for (i = 0; i < _pageTextViews.Count; i++) 1164for (i = 0; i < _pageTextViews.Count; i++) 1194for (int i = 0; i < _pageTextViews.Count; i++)
MS\Internal\Documents\PageCache.cs (24)
163return _cache.Count; 256if (pageNumber >= 0 && pageNumber < _cache.Count) 291if (pageNumber >= 0 && pageNumber < _cache.Count) 375if (args.Start >= _cache.Count) 388if (args.Start + args.Count < _cache.Count) 400change = DirtyRange(args.Start, _cache.Count - args.Start); 406change = AddRange(_cache.Count, args.Count - (_cache.Count - args.Start) + 1); 419if (pageCount < _cache.Count) 421change = new PageCacheChange(pageCount, _cache.Count - pageCount, PageCacheChangeType.Remove); 425_cache.RemoveRange(pageCount, _cache.Count - pageCount); 523if (args.Start + args.Count >= _cache.Count || 526adjustedCount = _cache.Count - args.Start; 623if (args.PageNumber > _cache.Count - 1) 709for (int i = 0; i < _cache.Count; i++) 738if (PageCacheChanged != null && changes != null && changes.Count > 0) 761if (start >= _cache.Count) 763count += (start - _cache.Count); 764start = _cache.Count; 788ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _cache.Count); 815ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(start, _cache.Count); 817ArgumentOutOfRangeException.ThrowIfGreaterThan(count, _cache.Count - start); 842if (_cache.Count > 0) 847PageCacheChange change = new PageCacheChange(0, _cache.Count, PageCacheChangeType.Remove);
MS\Internal\Documents\RowCache.cs (32)
88return _rowCache.Count; 241ArgumentOutOfRangeException.ThrowIfGreaterThan(index, _rowCache.Count); 275for (int i = 0; i < _rowCache.Count; i++) 302if (_rowCache.Count == 0) 316for (int i = 0; i < _rowCache.Count; i++) 344i == _rowCache.Count - 1) 366return _rowCache.Count - 1; 372return _rowCache.Count - 1; 398if (_rowCache.Count == 0) 415for (int i = startRowIndex + 1; i < _rowCache.Count; i++) 451for (int i = 0; i < _rowCache.Count; i++) 478changes.Add(new RowCacheChange(0, _rowCache.Count)); 571changes.Add(new RowCacheChange(0, _rowCache.Count)); 595if (_rowCache.Count == 0) 603RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 684for (int i = tempRows.Count - 1; i >= 0; i--) 690pivotRowIndex = _rowCache.Count; 886RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 917startRow = _rowCache.Count - 1; 923startRow = _rowCache.Count; 963if (_rowCache.Count == 0) 973RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 1010while (currentPage < startPage + count && rowIndex < _rowCache.Count) 1060if (index > _rowCache.Count) 1078for (int i = index + 1; i < _rowCache.Count; i++) 1105for (int i = 0; i < _rowCache.Count; i++) 1149int removeCount = _rowCache.Count - rowIndex; 1152if (rowIndex < _rowCache.Count) 1200List<RowCacheChange> changes = new List<RowCacheChange>(args.Changes.Count); 1201for (int i = 0; i < args.Changes.Count; i++) 1264if (_rowCache.Count <= 1) 1268if (_rowCache.Count == 0 || _rowCache[0].PageCount < _layoutColumns)
MS\Internal\Documents\TextBoxView.cs (51)
391if (_lineMetrics.Count == 0 || constraintschanged) 406_lineMetrics.Count == 1 && _lineMetrics[0].EndOffset == 0) 433Invariant.Assert(_lineMetrics.Count >= 1); 464if (_lineMetrics == null || _lineMetrics.Count == 0) 532return (_visualChildren == null) ? 0 : _visualChildren.Count; 646int startOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, startPosition.Offset); 647int endOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, endPosition.Offset); 724int nextLineIndex = Math.Max(0, Math.Min(_lineMetrics.Count - 1, lineIndex + count)); 843if (lineIndex == _lineMetrics.Count - 1) 1056int lastValidOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 1068int newLastValidOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 1131int max = _lineMetrics.Count; 1133Invariant.Assert(_lineMetrics.Count >= 1); 1152if (offset == record.EndOffset && index < _lineMetrics.Count - 1) 1259ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[_lineMetrics.Count - 1].EndOffset, LogicalDirection.Forward); 1487if (_lineMetrics.Count == 0) 1596Invariant.Assert(_lineMetrics.Count >= 1); 1604if (point.Y >= _lineHeight * _lineMetrics.Count) 1606return snapToText ? _lineMetrics.Count - 1 : -1; 1613int max = _lineMetrics.Count; 1911int j = _visualChildren.Count - 1; // last non-discarded element index 1913for (int i = _visualChildren.Count - 1; i >= 0; i--) 1928if (j < _visualChildren.Count - 1) 1930_visualChildren.RemoveRange(j + 1, _visualChildren.Count - j - 1); 1943lineVisual._parentIndex = _visualChildren.Count; 1951for (int i = 0; i < _visualChildren.Count; i++) 2159firstLineIndex = Math.Max(0, Math.Min(firstLineIndex, _lineMetrics.Count - 1)); 2160lastLineIndex = Math.Max(0, Math.Min(lastLineIndex, _lineMetrics.Count - 1)); 2166lastLineIndex = _lineMetrics.Count - 1; 2186if (_lineMetrics.Count == 0) 2194lineOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 2284if (range.StartIndex > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2304if (range.StartIndex > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2343for (int i = lineIndex + 1; i < _lineMetrics.Count; i++) 2402if (endOffset > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2405endOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 2417for (int i = lastLineIndex + 1; i < _lineMetrics.Count; i++) 2510(lineIndex == _lineMetrics.Count || 2514if (lineIndex < _lineMetrics.Count && 2533if (lineIndex == _lineMetrics.Count || 2586if (endOfParagraph && lineIndex < _lineMetrics.Count) 2588int count = _lineMetrics.Count - lineIndex; 2600for (int i = 0; i < _lineMetrics.Count; i++) 2604desiredSize.Height = _lineMetrics.Count * _lineHeight; 2660int oldLastLineIndex = oldLineVisualsIndex + oldLineVisuals.Count - 1; 2680for (int i = lineIndex - oldLineVisualsIndex + lineCount; i < oldLineVisuals.Count; i++) 2718lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count) 2732lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count && 2754if (lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count) 2757count = Math.Min(count, _viewportLineVisuals.Count - start); 2865_lineMetrics[_lineMetrics.Count - 1].EndOffset >= position.Offset;
MS\Internal\Documents\TextContainerHelper.cs (2)
471int depth = Math.Min(ancestorsStart.Count, ancestorsEnd.Count);
MS\Internal\Documents\UndoManager.cs (6)
433if (!(_topUndoIndex < UndoStack.Count && PeekUndoStack() == null) // Non-null topmost stack item 434&& (UndoLimit == -1 || UndoStack.Count < UndoLimit)) 629if (_topUndoIndex < 0 || _topUndoIndex == UndoStack.Count) 715_topUndoIndex = undoStack.Count - 1; 865if (UndoStack.Count == 0 || _topUndoIndex < 0) 1103if (UndoStack.Count > 0)
MS\Internal\Globalization\BamlResourceSerializer.cs (1)
95for (int i = children.Count - 1; i >= 0; i--)
MS\Internal\Globalization\BamlTreeMap.cs (1)
603i < node.Children.Count && (comment.LocalizationComments.Length == 0 || comment.LocalizationAttributes.Length == 0);
MS\Internal\Globalization\BamlTreeNode.cs (4)
53get { return _nodeList.Count; } 104parent.Children = new List<BamlTreeNode>(children.Count); 116for (int i = 0; i < children.Count; i++) 504for (int i = 0; i < _children.Count; i++)
MS\Internal\Globalization\BamlTreeUpdater.cs (2)
59for (int i = 0; i < deferredResources.Count; i++) 297for (int i = 0; i < oldChildren.Count - 1; i++)
MS\Internal\Helper.cs (5)
756for (int i = 0; i < itemValues.Count; i++) 784for (int j = 0; j < itemValues.Count; j++) 809for (int i = 0; i < itemValues.Count; i++) 887for (int i = 0; i < itemValues.Count; i++) 1030for (int i=0; i<itemValuesList.Count; i++)
MS\Internal\Ink\ClipboardProcessor.cs (4)
139if ( strokes.Count != 0 || elements.Count != 0 ) 201if (elements != null && elements.Count != 0) 206if (elements.Count == 1 && elements[0] is InkCanvas inkCanvas) 324int elementCount = elements.Count;
MS\Internal\Ink\HighContrastHelper.cs (2)
84int count = __highContrastCallbackList.Count; 141int count = __highContrastCallbackList.Count;
MS\Internal\Ink\InkCanvasSelection.cs (2)
331if ( _selectedElements == null || _selectedElements.Count == 0 ) 340if ( _selectedElements.Count == 0 )
MS\Internal\Ink\LassoHelper.cs (4)
73int count = points.Count; 201int last = _lasso.Count; 213Point prevLassoPoint = _lasso[_lasso.Count - 1]; 215for (int i = 0; i < _lasso.Count; i++)
MS\Internal\Ink\XamlClipboardData.cs (1)
58return Elements != null && Elements.Count != 0;
MS\Internal\LayoutDump.cs (3)
360if (uiElements.Count > 0) 364writer.WriteAttributeString("Count", uiElements.Count.ToString(CultureInfo.InvariantCulture)); 366for (int index = 0; index < uiElements.Count; index++)
MS\Internal\PtsHost\BreakRecordTable.cs (25)
60Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "Invalid PageNumber."); 86if (pageNumber < _breakRecords.Count) 120Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "Invalid PageNumber."); 126while (pageNumber < _breakRecords.Count) 153if (_breakRecords.Count > 0) 156InvalidateBreakRecords(0, _breakRecords.Count); 177if (_breakRecords.Count > 0) 185pageCount = _breakRecords.Count - pageStart; 207if (_breakRecords.Count > 0) 210DisposePages(0, _breakRecords.Count); 214_owner.OnPagesChanged(0, _breakRecords.Count); 227if (_breakRecords.Count > 0) 255Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "The previous BreakRecord does not exist."); 274if (pageNumber == _breakRecords.Count) 321if (pageNumber > _breakRecords.Count) 342get { return _breakRecords.Count; } 352if (_breakRecords.Count == 0) 354Invariant.Assert(_breakRecords[_breakRecords.Count - 1] != null, "Invalid BreakRecordTable entry."); 355return (_breakRecords[_breakRecords.Count - 1].BreakRecord == null); 379Invariant.Assert(start >= 0 && start < _breakRecords.Count, "Invalid starting index for BreakRecordTable invalidation."); 380Invariant.Assert(start + count <= _breakRecords.Count, "Partial invalidation of BreakRecordTable is not allowed."); 405Invariant.Assert(start >= 0 && start < _breakRecords.Count, "Invalid starting index for BreakRecordTable invalidation."); 406Invariant.Assert(start + count == _breakRecords.Count, "Partial invalidation of BreakRecordTable is not allowed."); 439while (pageStart < _breakRecords.Count) 477pageCount = _breakRecords.Count - pageStart;
MS\Internal\PtsHost\FigureParaClient.cs (3)
216for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 318if (trackRectangles.Count != 0) 776for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\FloaterParaClient.cs (3)
221for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 323if (trackRectangles.Count != 0) 785for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\FlowDocumentPage.cs (4)
332if(this.PageVisual != null && rectangles.Count > 0) 334List<Rect> transformedRectangles = new List<Rect>(rectangles.Count); 338for(int index = 0; index < rectangles.Count; index++) 383for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\Line.cs (3)
314if (inlineObjects.Count == 0) 679Debug.Assert(cchGlyphRuns > 0 && glyphRunsCollection.Count > 0); 710Invariant.Assert(runIndex < glyphRunsCollection.Count);
MS\Internal\PtsHost\PtsCache.cs (11)
182for (index = 0; index < _contextPool.Count; index++) 193if (index == _contextPool.Count) 251for (index = 0; index < _contextPool.Count; index++) 258Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the Context pool."); 270for (index = 0; index < _contextPool.Count; index++) 277Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the context pool."); 311while (index < _contextPool.Count) 373for (index = 0; index < _contextPool.Count; index++) 382Invariant.Assert(index < _contextPool.Count, "PtsContext not found in the context pool."); 393if (cleanContextPool && _contextPool.Count > 4) 397while (index < _contextPool.Count)
MS\Internal\PtsHost\PtsHelper.cs (8)
73if(floatingElementList == null || floatingElementList.Count == 0) 79for(int index = 0; index < floatingElementList.Count; index++) 97if(visualChildren.Count > floatingElementList.Count) 99visualChildren.RemoveRange(floatingElementList.Count, visualChildren.Count - floatingElementList.Count); 498if (rectangles.Count != 0) 514List<Rect> offsetRectangles = new List<Rect>(rectangleList.Count); 516for(int index = 0; index < rectangleList.Count; index++)
MS\Internal\PtsHost\PtsHost.cs (4)
1965for(int objectIndex = 0; objectIndex < attachedObjects.Count; objectIndex++) 1982cObjects = attachedObjects.Count; 2080for(int objectIndex = 0; objectIndex < attachedObjects.Count; objectIndex++) 2097cObjects = attachedObjects.Count;
MS\Internal\PtsHost\PtsPage.cs (4)
1183for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 1286if (rectangles.Count != 0) 1408if (trackRectangles.Count != 0) 1559if(_floatingElementList.Count == 0)
MS\Internal\PtsHost\SubpageParaClient.cs (3)
155for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 256if (trackRectangles.Count != 0) 695for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\TableParaClient.cs (2)
474if (rectangles.Count != 0) 480if (rectangles.Count != 0)
MS\Internal\PtsHost\TextParaClient.cs (20)
278if (rectangles.Count != 0) 287if (rectangles.Count == 0 && textDetails.u.full.cLines > 0) 301if(rectangles.Count > 0 && ThisFlowDirection != PageFlowDirection) 305for(int index = 0; index < rectangles.Count; index++) 412return (floaters != null && floaters.Count > 0) ? new ReadOnlyCollection<ParagraphResult>(floaters) : null; 449return (figures != null && figures.Count > 0) ? new ReadOnlyCollection<ParagraphResult>(figures) : null; 1264for (int i = 0; i < inlineObjects.Count; i++) 1298for (int i = 0; i < inlineObjects.Count; i++) 1549if (lines.Count != 0) 1552TextParaLineResult lastLineResult = (TextParaLineResult)lines[lines.Count - 1]; 1560return (lines.Count > 0) ? new ReadOnlyCollection<LineResult>(lines) : null; 1611if (lines.Count != 0) 1614TextParaLineResult lastLineResult = (TextParaLineResult)lines[lines.Count - 1]; 1622return (lines.Count > 0) ? new ReadOnlyCollection<LineResult>(lines) : null; 2118for (int i = 0, count = rectangles.Count; i < count; ++i) 2228for (int i = 0, count = rectangles.Count; i < count; ++i) 3885if (lineRectangles.Count != 0) 3943Invariant.Assert(rectangles.Count > 0); 4065if (lineRectangles.Count != 0) 4142Invariant.Assert(elementRectangles.Count > 0);
MS\Internal\PtsHost\TextParagraph.cs (25)
924if(textElements.Count == 0) 929return textElements.Count; 941for(int index = 0; index < textElements.Count; index++) 988if(attachedObjects.Count != 0) 1057objects = new List<InlineObject>(_inlineObjects.Count); 1058for (int i = 0; i < _inlineObjects.Count; i++) 1073if(objects == null || objects.Count == 0) 1142for (int index=0; index < _attachedObjects.Count; index++) 1178if(_attachedObjects != null && _attachedObjects.Count > 0) 1209for (int index=0; index < _attachedObjects.Count; index++) 1233for (int index=0; index < _attachedObjects.Count; index++) 1354if(HasFiguresOrFloaters() || (_inlineObjects != null && _inlineObjects.Count > 0)) 1367return _attachedObjects != null && _attachedObjects.Count > 0; 1379for(int index = 0; _attachedObjects != null && index < _attachedObjects.Count; index++) 1523ErrorHandler.Assert(objectsNew == null || (objectsNew[0].Dcp >= dcpStart && objectsNew[objectsNew.Count-1].Dcp <= dcpLim), ErrorHandler.SubmitInvalidList); 1533objectsCached = new List<T>(objectsNew.Count); 1537int end = objectsCached.Count; 1572while (idx < objectsNew.Count) 1597if (idx >= objectsNew.Count) 1605if (idxNew < objectsNew.Count) 1608objectsCached.InsertRange(end, objectsNew.GetRange(idxNew, objectsNew.Count - idxNew)); 1643while (first < objectsCached.Count && objectsCached[first].Dcp < dcpStart) 1648while (last < objectsCached.Count && objectsCached[last].Dcp < dcpStart + cchDeleted) 1664while (last < objectsCached.Count) 1670if (objectsCached.Count == 0)
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.cs (2)
148var iids = new Guid[interfaceTableEntries.Count]; 149for (int i = 0; i < interfaceTableEntries.Count; i++)
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.net5.cs (1)
90count = entries.Count;
System\Windows\Annotations\AnnotationService.cs (8)
800if (annotations.Count > _maxAnnotationsBatch) 803List<IAttachedAnnotation> leftover = new List<IAttachedAnnotation>(annotations.Count); 804leftover = annotations.GetRange(_maxAnnotationsBatch, annotations.Count - _maxAnnotationsBatch); 809annotations.RemoveRange(_maxAnnotationsBatch, annotations.Count - _maxAnnotationsBatch); 968for (int i = existingAnnotations.Count - 1; i >= 0; i--) 984if ((existingAnnotations != null) && (existingAnnotations.Count > 0)) 1283if (_annotationMap.GetAttachedAnnotations(annotation.Id).Count > 0) 1514if (list.Count == 0)
System\Windows\Automation\Peers\CalendarAutomationPeer.cs (2)
464if (providers.Count > 0) 620if (providers.Count > 0)
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (2)
254if (providers.Count > 0) 284if (providers.Count > 0)
System\Windows\Automation\Peers\DataGridCellItemAutomationPeer.cs (1)
808if (this.Index != -1 && parent != null && parent.Children != null && this.Index < parent.Children.Count && parent.Children[this.Index] == this)
System\Windows\Automation\Peers\DataGridItemAutomationPeer.cs (1)
389if (selectedProviders.Count > 0)
System\Windows\Automation\Peers\DateTimeAutomationPeer.cs (1)
924if (this.Index != -1 && parent != null && parent.Children != null && this.Index < parent.Children.Count && parent.Children[this.Index] == this)
System\Windows\Automation\Peers\FlowDocumentPageViewerAutomationPeer.cs (4)
41if (Owner is IFlowDocumentViewer && children != null && children.Count > 0) 43if (children[children.Count-1] is DocumentAutomationPeer) 45children.RemoveAt(children.Count - 1); 46if (children.Count == 0)
System\Windows\Automation\Peers\GridViewAutomationPeer.cs (3)
132List<IRawElementProviderSimple> array = new List<IRawElementProviderSimple>(_owner.HeaderRowPresenter.ActualColumnHeaders.Count); 174return _owner.HeaderRowPresenter.ActualColumnHeaders.Count; 237if (columns.Count > column)
System\Windows\Automation\Peers\GridViewCellAutomationPeer.cs (2)
75return children != null && children.Count >= 1; 105if (gridview.HeaderRowPresenter != null && gridview.HeaderRowPresenter.ActualColumnHeaders.Count > Column)
System\Windows\Automation\Peers\GridViewHeaderRowPresenterAutomationPeer.cs (1)
43newList = new List<AutomationPeer>(list.Count);
System\Windows\Automation\Peers\GridViewItemAutomationPeer.cs (1)
49_dataChildren = new Hashtable(rowPresenter.ActualCells.Count);
System\Windows\Automation\Peers\GroupItemAutomationPeer.cs (2)
171if (itemsControlAP.RecentlyRealizedPeers.Count > 0 && this.AncestorsInvalid) 291for (int i=0; i<recentlyRealizedPeers.Count; i++)
System\Windows\Automation\Peers\ItemAutomationPeer.cs (1)
131if(this.Index != -1 && parent != null && parent.Children != null && this.Index < parent.Children.Count && parent.Children[this.Index] == this)
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (4)
93if (_recentlyRealizedPeers != null && _recentlyRealizedPeers.Count > 0 && this.AncestorsInvalid) 583for (int i = 0; i < _list.Count; i++) 643for (i = 0; i < _list.Count; i++) 649if(i < _list.Count)
System\Windows\BroadcastEventHelper.cs (1)
265for (int i=0; i< eventRoute.Count; i++)
System\Windows\Controls\AlternationConverter.cs (3)
36if (_values.Count > 0 && o is int) 38int index = ((int)o) % _values.Count; 40index += _values.Count;
System\Windows\Controls\CustomDictionarySources.cs (1)
172return _uriList.Count;
System\Windows\Controls\DataGrid.cs (11)
431if (displayIndex >= 0 && displayIndex < DisplayIndexMap.Count) 2178for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 2234for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 3683for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 4502int count = e.RemovedInfos.Count; 4510count = e.AddedInfos.Count; 7245for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7256for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7298for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7728if (_pendingInfos != null && _pendingInfos.Count > 0 && (columnCount = _columns.Count) > 0) 7732for (int i = _pendingInfos.Count - 1; i >= 0; --i)
System\Windows\Controls\DataGridCellsPanel.cs (27)
172if (blockList.Count > 0) 174for (int i = 0, count = blockList.Count; i < count; i++) 194measureWidth += GetColumnEstimatedMeasureWidthSum(blockList[blockList.Count - 1].EndIndex + 1, parentDataGrid.Columns.Count - 1, averageColumnWidth); 467if (indexList.Count == 1) 471else if (indexList.Count > 0) 474for (int i = 1, count = indexList.Count; i < count; i++) 478if (resultList.Count == 0) 484RealizedColumnsBlock lastRealizedColumnsBlock = resultList[resultList.Count - 1]; 494if (resultList.Count == 0) 500RealizedColumnsBlock lastRealizedColumnsBlock = resultList[resultList.Count - 1]; 762if (realizedChildIndex < _realizedChildren.Count) 796if (blockIndex == blockList.Count - 1) 1002for (int count = realizedColumnDisplayIndices.Count; displayIndexListIterator < count; displayIndexListIterator++) 1041int blockCount = blockList.Count; 1169UIElement realizedChild = _realizedChildren.Count > 0 ? _realizedChildren[0] : null; 1190if (realizedIndex < _realizedChildren.Count) 1329blockList != null && blockList.Count > 0, 1332RealizedColumnsBlock lastBlock = blockList[blockList.Count - 1]; 1333RealizedColumnsBlock lastDisplayIndexBlock = displayIndexBlockList[displayIndexBlockList.Count - 1]; 1366if (displayIndexBlockList != null && displayIndexBlockList.Count > 0) 1394for (int j = 0, additionalChildrenCount = additionalChildIndices.Count; 1421for (int i = 0, count = additionalChildIndices.Count; i < count; i++) 1540for (int i = 0, count = blockList.Count; i < count; i++) 1560RealizedColumnsBlock lastBlock = blockList[blockList.Count - 1]; 1570if (blockList.Count == 0) 1597if (blockIndex >= blockList.Count) 1643for (int j=0; j<blockList.Count; ++j)
System\Windows\Controls\DataGridColumnCollection.cs (15)
226Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated"); 430for (int i = 0; i < DisplayIndexMap.Count; i++) 469Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call."); 561Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated"); 569for (int i = 0; i < DisplayIndexMap.Count; i++) 669for (int i = 0; i < DisplayIndexMap.Count; i++) 690for (int i = 0; i < DisplayIndexMap.Count; i++) 725Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size"); 726for (int i = 0; i < DisplayIndexMap.Count; i++) 930while (unResolvedColumns.Count > 0) 936for (int i = 0, count = unResolvedColumns.Count; i < count; i++) 959for (int i = 0, count = unResolvedColumns.Count; i < count; i++) 987for (int i = 0, count = partialResolvedColumns.Count; i < count; i++) 1000for (int i = 0, count = partialResolvedColumns.Count; i < count; i++) 1010for (int i = 0, count = unResolvedColumns.Count; i < count; i++)
System\Windows\Controls\DataGridRowClipboardEventArgs.cs (1)
67int count = ClipboardRowContent.Count;
System\Windows\Controls\DefinitionBase.cs (5)
772if (_registry.Count == 0) 788for (int i = 0, count = _registry.Count; i < count; ++i) 837for (int i = 0, count = _registry.Count; i < count; ++i) 873for (int i = 0, count = _registry.Count; i < count; ++i) 881for (int i = 0, count = _registry.Count; i < count; ++i)
System\Windows\Controls\GridViewColumnCollection.cs (5)
324for (int sourceIndex = index + 1; sourceIndex < _actualIndices.Count; sourceIndex++) 337_actualIndices.RemoveAt(_actualIndices.Count - 1); 343for (int i = iStart; i < _columns.Count; i++) 351int count = _columns.Count; 421ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _actualIndices.Count, indexName);
System\Windows\Controls\GridViewHeaderRowPresenter.cs (4)
816if (DesiredWidthList == null || column.ActualIndex >= DesiredWidthList.Count) 1336for (int i = 0; i < HeadersPositionList.Count; i++) 1353if (i != HeadersPositionList.Count - 1) 1370Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index");
System\Windows\Controls\GridViewRowPresenter.cs (1)
539if (DesiredWidthList == null || column.ActualIndex >= DesiredWidthList.Count)
System\Windows\Controls\InkCanvas.cs (1)
2106else if ( newStrokes.Count == 0 && newElements.Count == 0 )
System\Windows\Controls\ItemContainerGenerator.cs (1)
1047if (errors.Count > 0)
System\Windows\Controls\PopupControlService.cs (3)
1362if (rects.Count == 1) 1385for (int i=1, N=points.Count; i<N; ++i) 1406int N = points.Count;
System\Windows\Controls\Primitives\GridViewRowPresenterBase.cs (2)
159if (DesiredWidthList.Count > e.ActualIndex) 192int c = count - DesiredWidthList.Count;
System\Windows\Controls\Primitives\Popup.cs (1)
218if (registeredPopups.Count == 0)
System\Windows\Controls\Primitives\Selector.cs (7)
1978knownCount = knownIndices.Count; 2305if (unselected.Count > 0 || selected.Count > 0) 2784return _list.Count; 2807int j=0, n=_list.Count; 2851_set = new Dictionary<ItemInfo, ItemInfo>(_list.Count); 2852for (int i=0; i<_list.Count; ++i)
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (1)
69int generatedItemsCount = (generatedItemsCollection != null) ? generatedItemsCollection.Count : 0;
System\Windows\Controls\Primitives\ToolBarPanel.cs (1)
57for (int i = 0; i < _generatedItemsCollection.Count; i++)
System\Windows\Controls\SelectionChangedEventArgs.cs (4)
51_removedItems = new object[unselectedInfos.Count]; 52for (int i=0; i<unselectedInfos.Count; ++i) 57_addedItems = new object[selectedInfos.Count]; 58for (int i=0; i<selectedInfos.Count; ++i)
System\Windows\Controls\TextAdaptor.cs (3)
539if (visibleTextSegments.Count > 0) 541ranges = new ITextRangeProvider[visibleTextSegments.Count]; 542for (int i = 0; i < visibleTextSegments.Count; i++)
System\Windows\Controls\TextBlock.cs (4)
1233int subsequentLinesInitialSize = (_subsequentLines == null) ? 1 : _subsequentLines.Count; 1820Debug.Assert(lineBounds.Count > 0); 3508return (_subsequentLines == null) ? 1 : _subsequentLines.Count + 1; 3740int subsequentLineCount = _subsequentLines.Count;
System\Windows\Controls\TextRangeAdaptor.cs (3)
2091if (peers.Count > 0) 2093elements = new IRawElementProviderSimple[peers.Count]; 2094for (int i = 0; i < peers.Count; i++)
System\Windows\Controls\TextSearch.cs (5)
202if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 265if (_charsEntered.Count > 0) 267string lastChar = _charsEntered[_charsEntered.Count - 1]; 270_charsEntered.RemoveAt(_charsEntered.Count - 1);
System\Windows\Controls\ToolBarTray.cs (20)
351for (bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 359for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 371for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 418for (bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 429for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 567if (toolBarIndex + 1 == band.Count) // If toolBar was the last item in the band 601if (toolBarIndex < band.Count - 1) // Swap toolbars 613if (toolBarIndex + 2 == band.Count) // If toolBar becomes the last item in the band 637if (hittestBand >= 0 && hittestBand < _bands.Count) 644for (int i = 0; i < oldBand.Count; i++) 776for (i = 0; i < newBand.Count; i++) 811for (int i = 0; i < _bands.Count; i++) 818return _bands.Count; 839for (int bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 842for (int toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 861for (int bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 864for (int toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 870totalNumber += band.Count; 880for (int i = 0; i < _bands.Count; i++) 917for (int i = 0; i < band.Count; i++)
System\Windows\Controls\VirtualizedCellInfoCollection.cs (34)
155int numRegions = _regions.Count; 182int numRegions = _regions.Count; 202int numRegions = _regions.Count; 241int numRegions = _regions.Count; 310int numRegions = _regions.Count; 401int numRegions = _regions.Count; 771int numRegions = _regions.Count; 793int numRegions = _regions.Count; 836int numRegions = _regions.Count; 840for (int c = 0; c < addList.Count; c++) 856if (addList.Count > 0) 864for (int c = 0; c < addList.Count; c++) 877int numToAdd = addList.Count; 896if ((removeList != null) && (removeList.Count > 0)) 908for (int i = 0; i < _regions.Count; i++) 931i += remainder.Count; // Skip the remainder 990int numKeptRegions = keepRegions.Count; 1022int numKeptRegions = keepRegions.Count; 1078int numKeptRegions = slideRegions.Count; 1094int numMovedRegions = movedRegions.Count; 1106int numKeptRegions = slideRegions.Count; 1163int numKeptRegions = keepRegions.Count; 1210int numKeptRegions = keepRegions.Count; 1269int numKeptRegions = slideRegions.Count; 1284int numMovedRegions = movedRegions.Count; 1296int numKeptRegions = slideRegions.Count; 1351int numRegions = collection._regions.Count; 1370int numRegions = c1._regions.Count; 1378numRegions = orig2._regions.Count; 1398if (_regions.Count == 1) 1420if (removeList.Count > 0) 1506int numRegions = _regions.Count; 1532int numRegions = _regions.Count; 1582int numRegions = regions.Count;
System\Windows\Controls\VirtualizingStackPanel.cs (25)
4515for (int i = 0, n = offsetList.Count; i < n; ++i) 4527object[] args = new object[offsetList.Count + 7]; 4535for (int i=0; i<offsetList.Count; ++i) 4548viewport.X = offsetList[offsetList.Count-1]; 4552viewport.Y = offsetList[offsetList.Count-1]; 4561if (index < 0 || offsetList.Count <= 1) 5671int count = childOffsetList.Count; 5695object[] args = new object[offsetList.Count + 2]; 5698for (int i = 0; i < offsetList.Count; ++i) 9222Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match"); 9243if (realizedChildIndex < _realizedChildren.Count) 9271UIElement realizedChild = _realizedChildren.Count > 0 ? _realizedChildren[0] : null; 9282if (realizedIndex < _realizedChildren.Count) 10938for (int i=0; i<previouslyMeasuredOffsets.Count; i++) 12088for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12101for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12484for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12543for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12555for (int i=0; i<s_TargetToTraceListMap.Count; ++i) 12595for (; _flushIndex < _traceList.Count; ++_flushIndex) 12608_flushIndex = _traceList.Count; 12811int n = children.Count; 12890writer.Write(_realizedChildren.Count); 12891for (int i=0; i<_realizedChildren.Count; ++i) 12902writer.Write(_effectiveOffsets.Count);
System\Windows\Data\BindingExpression.cs (1)
2358if (result != null && result.Count == 0)
System\Windows\Data\BindingExpressionBase.cs (9)
2288if (toAdd != null && toAdd.Count > 0) 2307if (toRemove != null && toRemove.Count > 0) 2316if (notifyDataErrors.Count == 0) 2325if (previousErrors == null || previousErrors.Count == 0) 2330else if (errors == null || errors.Count == 0) 2340for (int i=errors.Count-1; i>=0; --i) 2345for (j=toRemove.Count-1; j>=0; --j) 2455for (int k = 0; k < tempList.Count; ++k) 2471return tempList.Count > 0 ?
System\Windows\Data\BindingGroup.cs (3)
1098if (toAdd != null && toAdd.Count > 0) 1113if (toRemove != null && toRemove.Count > 0) 1121if (itemErrors.Count == 0)
System\Windows\Data\CollectionView.cs (8)
1806Debug.Assert(changeLog != null && changeLog.Count > 0, "don't defer when there's no work"); 1816_engine.ChangeCost(_databindOperation, changeLog.Count); 1820_databindOperation = _engine.Marshal(new DispatcherOperationCallback(ProcessInvoke), null, changeLog.Count); 1840for ( ; currentIndex < changeLog.Count && !mustDeferProcessing; currentIndex++) 1850if (mustDeferProcessing && currentIndex < changeLog.Count) 1891if (_changeLog.Count == 0 && CheckAccess()) 1910null, _changeLog.Count); 1936if (unprocessedChanges != null && unprocessedChanges.Count > 0)
System\Windows\Data\ListCollectionView.cs (1)
3093double dirtyDensity = ((double)list.SortDirtyItems.Count) / (list.Count + 1);
System\Windows\Diagnostics\BindingDiagnostics.cs (1)
106if (s_pendingEvents.Count < MaxPendingEvents)
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (3)
153if (!_dictionariesFromUri.TryGetValue(uri, out list) || list.Count == 0) 158List<ResourceDictionary> result = new List<ResourceDictionary>(list.Count); 262if (list.Count == 0)
System\windows\Documents\CaretElement.cs (1)
461for (int i = 0; i < textSegments.Count; i++)
System\Windows\Documents\DocumentSequenceTextContainer.cs (3)
732if (lastBlock != null && cdbScan != lastBlock && !(lastBlock.ChildContainer is NullTextContainer) && rangeArray.Count != 0) 750if (!(cdbScan.ChildContainer is NullTextContainer) && rangeArray.Count != 0) 777if (rangeArray.Count > 0 && (!(cdbScan == null || cdbScan.ChildContainer is NullTextContainer)))
System\Windows\Documents\FixedDSBuilder.cs (2)
67_visitedArray = new BitArray(fixedNodes.Count); 199for (int i = startIndex+1; i < _fixedNodes.Count; i++)
System\Windows\Documents\FixedElement.cs (1)
340for(int i = 0, n = _children.Count; i < n; i++)
System\Windows\Documents\FixedFlowMap.cs (4)
129Debug.Assert(fp >= 0 && fp < _flowOrder.Count); 167for (int i = index; i < _flowOrder.Count; i++) 309return _flowOrder.Count; 362for (int i = newFlow.Fp + 1, n = _flowOrder.Count; i < n; i++)
System\Windows\Documents\FixedSOMContainer.cs (5)
113if (This.FixedNodes.Count == 0 || compared.FixedNodes.Count == 0) 120FixedNode thisObjLastNode = This.FixedNodes[This.FixedNodes.Count - 1]; 123FixedNode otherObjLastNode = compared.FixedNodes[compared.FixedNodes.Count - 1]; 148int i=_semanticBoxes.Count-1;
System\Windows\Documents\FixedSOMFixedBlock.cs (7)
38if (this.SemanticBoxes.Count > 1) 40FixedSOMTextRun run = this.SemanticBoxes[this.SemanticBoxes.Count - 2] as FixedSOMTextRun; 65return (_semanticBoxes.Count == 1 && (_semanticBoxes[0] is FixedSOMImage)); 81if (_semanticBoxes.Count == 0) 125for (int i=_semanticBoxes.Count - 1; i>=0 && run==null; i--) 156for (int i=0; i<SemanticBoxes.Count; i++) 237if (_semanticBoxes.Count == 1)
System\Windows\Documents\FixedSOMLineCollection.cs (3)
79for (int i=0; i < ranges.Count; i++) 113int endIndex = lines.Count; 145while (i<lines.Count && lines[i].Line <= parallelHighEnd)
System\Windows\Documents\FixedSOMLineRanges.cs (3)
15for (int i = 0; i < Start.Count; ) 50int endIndex = Start.Count - 1; 107get { return Start.Count; }
System\Windows\Documents\FixedSOMPage.cs (2)
49for (int i=0; i<_semanticBoxes.Count; i++) 60for (int j=0; j<groupBoxes.Count; j++)
System\Windows\Documents\FixedSOMPageConstructor.cs (24)
573Debug.Assert (fixedBlock.SemanticBoxes.Count > 0); 574if (fixedBlock.SemanticBoxes.Count == 0) 589FixedSOMTextRun lastLine = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count - 1] as FixedSOMTextRun; 609compareLine = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count-1] as FixedSOMTextRun; 680FixedSOMElement element = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count - 1] as FixedSOMElement; 755if (horizontal.Count < 2 || vertical.Count < 2) 762for (int h = 0; h < horizontal.Count; h++) 780while (v < vertical.Count && vertical[v].Line < hStart) 784for (; v < vertical.Count && vertical[v].Line < hEnd; v++) 821for (h2 = h + 1; h2 < horizontal.Count && horizontal[h2].Line < vBottom + minLineSeparation; h2++) 858if (_fixedSOMPage.SemanticBoxes.Count < 2) 867prevBoxCount = _fixedSOMPage.SemanticBoxes.Count; 870for (int i = 0; i < boxes.Count; i++) 876for (int j = i + 1; j < boxes.Count; j++) 895for (int j = i + 1; j < boxes.Count; j++) 909} while (_fixedSOMPage.SemanticBoxes.Count > 1 && _fixedSOMPage.SemanticBoxes.Count != prevBoxCount); 1045for (int i=0; i<tables.Count-1; i++) 1047for (int j=i+1; j<tables.Count; j++) 1075for (int i = 0; i < _fixedSOMPage.SemanticBoxes.Count;) 1100for (int i=0; i<cell.SemanticBoxes.Count;) 1127if (container.SemanticBoxes.Count > 0) 1140for (int i=1; i<container.SemanticBoxes.Count; i++)
System\Windows\Documents\FixedSOMTable.cs (9)
52for (int i = 0; i < _semanticBoxes.Count; i++) 61int colCount = row.SemanticBoxes.Count; 160if (this.SemanticBoxes.Count == 1) 164return (row.SemanticBoxes.Count == 1); 176for (int i=0; i<this.SemanticBoxes.Count;) 196int nRows = this.SemanticBoxes.Count; 210deleteCol = deleteCol && idx < row.SemanticBoxes.Count; 219if (idx + 1 < row.SemanticBoxes.Count) 267if (idx + 1 < row.SemanticBoxes.Count && row.SemanticBoxes[idx + 1].BoundingRect.Left == nextCol)
System\Windows\Documents\FixedSOMTableRow.cs (1)
51for (int i = 0; i < _semanticBoxes.Count; i++)
System\Windows\Documents\FixedTextBuilder.cs (16)
158DocumentsTrace.FixedTextOM.Builder.Trace($"AppendVirtualPage {_pageStructures.Count}"); 160FixedPageStructure pageStructure = new FixedPageStructure(_pageStructures.Count); 947fixedNodes.Count); 1277if (relUri == null && _hyperlinks.Count > 0) 1318for (int i=0; i<_hyperlinks.Count; i++) 1342for (int i = 0; i < _hyperlinks.Count; i++) 1476FixedSOMTextRun lastRun = _textRuns[_textRuns.Count - 1]; 1501if (_fixedNodes.Count == 0 || _fixedNodes[_fixedNodes.Count - 1] != element.FixedNode) 1550_pageStructure.SetFlowBoundary(_flowNodes[0], _flowNodes[_flowNodes.Count-1]); 1631if (_textRuns.Count > 0) 1635for (int i=0; i<_textRuns.Count; i++) 1649run.LineIndex = _lineResults.Count; 1650if (_nodesInLine.Count == 0 || _nodesInLine[_nodesInLine.Count - 1] != run.FixedNode) 1750if (_nodesInLine.Count > 0)
System\Windows\Documents\Glyphs.cs (1)
324Debug.Assert(parsedGlyphs.Count == glyphCount);
System\Windows\Documents\Highlights.cs (1)
369if (ranges.Count > 0)
System\Windows\Documents\MsSpellCheckLib\SpellChecker\SpellChecker.cs (1)
428int cacheSize = (hasErrorsCache != null) ? hasErrorsCache.Count : 0;
System\windows\Documents\TextEditorDragDrop.cs (1)
610for (int i = 0; i < selection.TextSegments.Count; i++)
System\Windows\Documents\TextRange.cs (2)
375Invariant.Assert(_textSegments.Count > 0, "_textSegments.Count must be > 0"); 1619for (int i = 0; i < _textSegments.Count; i++)
System\Windows\Documents\TextRangeBase.cs (11)
81for (int i = 0; i < thisRange._TextSegments.Count; i++) 394for (int i = 0; i < thisRange._TextSegments.Count; i++) 463for (int i = 0; i < thisRange._TextSegments.Count; i++) 1190Invariant.Assert(thisRange._TextSegments != null && thisRange._TextSegments.Count > 0, "expecting nonempty _TextSegments array for Start position"); 1198Invariant.Assert(thisRange._TextSegments != null && thisRange._TextSegments.Count > 0, "expecting nonempty _TextSegments array for End position"); 1199return thisRange._TextSegments[thisRange._TextSegments.Count - 1].End; 1209(thisRange._TextSegments.Count == 1 && 1215return (thisRange._TextSegments.Count == 1 && 1265for (int i = 0; i < thisRange._TextSegments.Count; i++) 1918ITextPointer end = thisRange._TextSegments[thisRange._TextSegments.Count - 1].End; 2038ITextPointer finalEnd = thisRange._TextSegments[thisRange._TextSegments.Count - 1].End;
System\Windows\Documents\TextRangeEditTables.cs (3)
404for (int i = 0; i < textSegments.Count; i++ ) 421end = textSegments[textSegments.Count - 1].End; 984for (int i = 0; i < textSegments.Count; i++)
System\Windows\Documents\TextRangeSerialization.cs (2)
274if (ignoreList.Count > 0) 345for (int i = 0; i < textSegments.Count; i++)
System\windows\Documents\TextSelection.cs (3)
415movingPosition = thisSelection.TextSegments[thisSelection.TextSegments.Count - 1].Start; 1881else if (thisSelection.TextSegments.Count < 2) 1901else if (movingPosition.CompareTo(thisSelection.TextSegments[thisSelection.TextSegments.Count-1].Start) == 0)
System\windows\Documents\TextSelectionHighlightLayer.cs (4)
84segmentCount = textSegments.Count; 112segmentCount = textSegments.Count; 307Invariant.Assert(textRange._TextSegments.Count > 0); 308return textRange._TextSegments[0].Start.CompareTo(textRange._TextSegments[textRange._TextSegments.Count - 1].End) == 0;
System\Windows\Documents\TextStore.cs (12)
1360CompositionEventRecord previousRecord = (this.CompositionEventList.Count == 0) ? null : this.CompositionEventList[this.CompositionEventList.Count - 1]; 3493if (this.CompositionEventList.Count == 0 || 3604IMECompositionTracer.Trace(this, IMECompositionTraceOp.BRaiseCompositionEvents, CompositionEventList.Count); 3613for (int i = 0; i < this.CompositionEventList.Count; i++) 4733for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 4746for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 4956for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 5015for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 5027for (int i=0; i<s_TargetToTraceListMap.Count; ++i) 5067for (; _flushIndex < _traceList.Count; ++_flushIndex) 5080_flushIndex = _traceList.Count;
System\Windows\Documents\WinRTSpellerInteropExtensions.cs (6)
88if (allTokens.Count > 0) 90var substToken = GetSpellCheckCleanSubstitutionToken(spellChecker, text, allTokens[allTokens.Count - 1], missingFragment); 93allTokens[allTokens.Count - 1] = new SpellerSegment(text, substToken.Value, spellChecker, owner); 125if (allTokens.Count > 0) 127var substToken = GetSpellCheckCleanSubstitutionToken(spellChecker, text, allTokens[allTokens.Count - 1], missingFragment); 130allTokens[allTokens.Count - 1] = new SpellerSegment(text, substToken.Value, spellChecker, owner);
System\Windows\Documents\WpfPayload.cs (3)
433for (int imageIndex = 0; imageIndex < _images.Count; imageIndex++) 504for (int i = 0; i < _images.Count; i++) 520imagePartUriString = GetImageName(_images.Count, imageContentType);
System\Windows\FrameworkContextData.cs (3)
58int last = _currentWalkers.Count - 1; 72if (_currentWalkers.Count > 0) 74int last = _currentWalkers.Count - 1;
System\Windows\Ink\Events.cs (1)
310if (results.Count == 0)
System\Windows\Input\KeyboardNavigation.cs (5)
3471public int Count { get { return _list.Count; } } 3479if (_list.Count == _list.Capacity) 3491for (int i=0; i<_list.Count; ++i) 3518for (int i=0; i<_list.Count; ++i) 3546int n = _list.Count;
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (3)
59get { return (_resources != null && _resources.Count > 0); } 66Debug.Assert(StaticResources[StaticResources.Count - 1] is StaticResource); 67return StaticResources[StaticResources.Count - 1] as StaticResource;
System\Windows\Markup\Baml2006\Baml2006ReaderContext.cs (2)
51if (KeyList != null && KeyList.Count > 0) 53return KeyList[KeyList.Count - 1];
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (12)
314if (stringId >= 0 && stringId < _bamlString.Count) 343if (assemblyId == _bamlAssembly.Count) 348else if (assemblyId > _bamlAssembly.Count) 367if (typeId == _bamlType.Count) 375else if (typeId > _bamlType.Count) 394if (propertyId == _bamlProperty.Count) 399else if (propertyId > _bamlProperty.Count) 413if (stringId == _bamlString.Count) 417else if (stringId > _bamlString.Count) 565if (assemblyId >= 0 && assemblyId < _bamlAssembly.Count) 589if (typeId >= 0 && typeId < _bamlType.Count) 618if (propertyId >= 0 && propertyId < _bamlProperty.Count)
System\Windows\Markup\BamlMapTable.cs (19)
358if (AttributeIdMap.Count > 0 || TypeIdMap.Count > 0) 369for (int i = 0; i < AttributeIdMap.Count; i++) 380for (int j = 0; j < TypeIdMap.Count; j++) 508for (int i = 0; i < AssemblyIdMap.Count; i++) 611Debug.Assert(id < StringIdMap.Count); 1066bamlAssemblyInfoRecord.AssemblyId = (short)(AssemblyIdMap.Count - 1); 1084bamlAssemblyInfoRecord.AssemblyId = (short)(AssemblyIdMap.Count - 1); 1102Debug.Assert(AssemblyIdMap.Count == record.AssemblyId || record.AssemblyFullName == AssemblyIdMap[record.AssemblyId].AssemblyFullName); 1104if (AssemblyIdMap.Count == record.AssemblyId) 1239bamlTypeInfoRecord.TypeId = (short)(TypeIdMap.Count - 1); 1256Debug.Assert(TypeIdMap.Count == record.TypeId || record.TypeFullName == TypeIdMap[record.TypeId].TypeFullName); 1258if (TypeIdMap.Count == record.TypeId) 1346bamlAttributeInfoRecord.AttributeId = (short)(AttributeIdMap.Count - 1); 1462stringInfo.StringId = (short)(StringIdMap.Count - 1); 1635Debug.Assert(AttributeIdMap.Count == record.AttributeId || record.Name == AttributeIdMap[record.AttributeId].Name); 1637if (AttributeIdMap.Count == record.AttributeId) 1649Debug.Assert(StringIdMap.Count == record.StringId || record.Value == StringIdMap[record.StringId].Value); 1651if (StringIdMap.Count == record.StringId)
System\Windows\Markup\BamlReader.cs (4)
485if (_currentStaticResourceRecordIndex == _currentStaticResourceRecords.Count) 1378BamlKeyInfo keyInfo = _deferKeys[_deferKeys.Count-1]; 2301if (_deferKeys.Count > 0) 2739for (int i=0; i<xmlnsList.Count; i++)
System\Windows\Markup\BamlRecordReader.cs (5)
1878object[] staticResourceValues = ParserContext.StaticResourcesStack[ParserContext.StaticResourcesStack.Count-1]; 1957object[] staticResourceValues = ParserContext.StaticResourcesStack[ParserContext.StaticResourcesStack.Count-1]; 4284if (_stackDataFactoryCache.Count == 0) 4291d = _stackDataFactoryCache[_stackDataFactoryCache.Count-1]; 4292_stackDataFactoryCache.RemoveAt(_stackDataFactoryCache.Count-1);
System\Windows\Markup\BamlRecordWriter.cs (6)
1175bamlPropertyWithStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1); 1585if (staticResourceRecordList.Count > 0) 1588for (int j=0; j<staticResourceRecordList.Count; j++) 1592for (int k=0; k<srRecords.Count; k++) 1676valueDeferRecord = _staticResourceRecordList[_staticResourceRecordList.Count-1]; 1691bamlStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1);
System\Windows\Markup\ParserContext.cs (1)
619get { return (_staticResourcesStack != null && _staticResourcesStack.Count > 0); }
System\Windows\Markup\Primitives\MarkupWriter.cs (3)
305result = _entries.Count; 345for (int i=0; i<_entries.Count; ++i) 351for (int i=0; i<_entries.Count; ++i)
System\Windows\Markup\XamlTypeMapper.cs (1)
3267for (int j = 0; j < namespaceAssemblyPair.Count; j++)
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ThicknessKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Navigation\Journal.cs (2)
100return _journalEntryList.Count; 329_journalEntryList.RemoveRange(_currentEntryIndex, _journalEntryList.Count - _currentEntryIndex);
System\Windows\ResourcesChangeInfo.cs (3)
202get { return _key != null || (_newDictionaries != null && _newDictionaries.Count > 0); } 245for (int i=0; i<_oldDictionaries.Count; i++) 256for (int i=0; i<_newDictionaries.Count; i++)
System\Windows\Shell\JumpList.cs (20)
333&& JumpItems.Count == 0 493successList = new List<JumpItem>(JumpItems.Count); 496rejectedList = new List<_RejectedJumpItemPair>(JumpItems.Count); 545if (list.Count > 0 && list[0].JumpItem.CustomCategory == jumpItem.CustomCategory) 588if (categoryList.Count > 0) 641if (rejectedList.Count > 0 && rejectedHandler != null) 643var items = new List<JumpItem>(rejectedList.Count); 644var reasons = new List<JumpItemRejectionReason>(rejectedList.Count); 655if (removedList.Count > 0 && removedHandler != null) 657var items = new List<JumpItem>(removedList.Count); 667if (items.Count > 0) 679if (removedList.Count == 0) 794Debug.Assert(jumpItems.Count != 0); 818for (int i = jumpItems.Count; --i >= 0;) 847if (linksOnlyList.Count > 0) 850Debug.Assert(jumpItems.Count != linksOnlyList.Count); 1099if (_jumpItems.Count > 0) 1101var reasons = new List<JumpItemRejectionReason>(_jumpItems.Count); 1102for (int i = 0; i < _jumpItems.Count; ++i)
System\Windows\StaticResourceExtension.cs (1)
243for(int i=0; i<ambientList.Count; i++)
System\Windows\StyleHelper.cs (14)
2146Debug.Assert(templatedChildren.Count > 0, 2215int[] childIndices = new int[templateChain.Count]; 2222for (int i=0; i< templateChain.Count; i++) 2253for (int i=0; i< templateChain.Count; i++) 2517for (int i = 0; i < actionsList.Count; i++) 3456if ((oldStyleTables != null && oldStyleTables.Count > 0) || 3457(newStyleTables != null && newStyleTables.Count > 0)) 3518if (dictionaries != null && dictionaries.Count > 0 && !fo.ShouldLookupImplicitStyles) 3520for (int i=0; i<dictionaries.Count; i++) 4345for( int i = 0; i < triggerList.Count; i++ ) 4389if ((styledChildren != null) && (childIndex <= styledChildren.Count)) 4796for (int i = 0; i < actionList.Count; i++) 5275for( int i = 0; i < triggerList.Count; i++ ) 5427if (styledChildren == null || childIndex > styledChildren.Count)
System\Windows\SystemResources.cs (1)
1219int count = keys.Count;
System\Windows\TemplateContent.cs (2)
260for (int i = 0; i < sharedProperties.Count; i++) 326for (int i = sharedProperties.Count - 1; i >= 0; i--)
System\Windows\TemplateNameScope.cs (1)
161Debug.Assert(_affectedChildren.Count == childIndex);
System\Windows\ThemeDictionaryExtension.cs (3)
121for (int i = 0; i < _themeDictionaryInfos.Count; i++) 196for (int i = 0; i < _themeDictionaryInfos.Count; i++) 232for (int i = 0; i < _themeDictionaryInfos.Count; i++)
System\Windows\TriggerActionCollection.cs (3)
52return _rawList.Count; 74for (int i = _rawList.Count - 1; i >= 0; i--) 266for( int i = 0; i < _rawList.Count; i++ )
System\Windows\Window.cs (1)
3627for (int i = 0; i < _threadWindowHandles.Count; i++)
PresentationFramework.Aero (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Aero2 (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.AeroLite (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Classic (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Fluent.Tests (1)
ResourceTests\FluentResourceDictionaryTests.cs (1)
55if (dictionary1ExtraStringKeys.Count == 0)
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Royale (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationUI (1)
MS\Internal\Documents\Application\TransactionalPackage.cs (1)
444PackagePart[] result = new PackagePart[_proxiedParts.Count];
Publishers.ApiService (1)
Program.cs (1)
28totalEntries = entries.Count,
ReachFramework (37)
AlphaFlattener\Flattener.cs (15)
292int count = commands.Count; 611if ((gj == null) || (pj.underlay == null) || (pj.underlay.Count == 0)) 616for (int n = pj.underlay.Count - 1; n >= 0; n --) 629if ((gi != null) && (gi.Pen == null) && (pi.overlap.Count == 1) && pj.FullyCovers(pi)) 669if ((pi.underlay != null) && (pi.underlay.Count != 0)) 671qi = commands[pi.underlay[pi.underlay.Count - 1]]; 733for (int k = 0; k < pi.underlay.Count; k++) 758int len = pi.underlay.Count; 792oldUnderlay[i] = new List<int>(l.Count); 794for (int j = 0; j < l.Count; j++) 839for (int j = 0; j < pi.overlap.Count; j++) 859if ((pi.overlap != null) && (pi.overlap.Count != 0)) 867if ((pj.underlay[pj.underlay.Count - 1] == i) && pj.FullyCovers(pi) && !pi.FullyCovers(pj)) 992for (int i = 0; i < transparentCluster.Count; i++) 1045for (int i = 0; i < transparentCluster.Count; i++)
AlphaFlattener\Optimizer.cs (6)
145bool[] addedPrimitives = new bool[commands.Count]; 177for (int clusterIndex = 0; clusterIndex < transparentCluster.Count; clusterIndex++) 286for (int i = 0; i < c.m_primitives.Count; i++) 408for (int j = 0; j < transparentCluster.Count; j++) 444for (int i = 0; i < transparentCluster.Count; i++) 445for (int j = i + 1; j < transparentCluster.Count; j++)
AlphaFlattener\PrimitiveList.cs (4)
115Console.Write(LeftPad(info.underlay.Count, 3)); 120Console.Write(' ' + LeftPad(info.overlap.Count, 3)); 247int index = _commands.Count; 308int pos = list.Count;
AlphaFlattener\PrimitiveRenderer.cs (2)
329for (int s = start; s < _overlapping.Count; s++) 347while (start < _overlapping.Count)
Packaging\XpsFixedDocumentReaderWriter.cs (1)
986IXpsFixedPageReader pageReader = new XpsFixedPageReaderWriter(CurrentXpsManager, this, pagePart, null, _pageCache.Count+1);
Packaging\XpsFixedDocumentSequenceReaderWriter.cs (1)
625IXpsFixedDocumentReader fixedDocument = new XpsFixedDocumentReaderWriter(CurrentXpsManager, null, documentPart, _documentCache.Count+1);
Packaging\XpsFixedPageReaderWriter.cs (1)
2071if ( _currentChildren!= null && _currentChildren.Count > 0)
Serialization\DrawingContextFlattener.cs (7)
137Debug.Assert(_fullTransform.Count == _fullClip.Count); 139int lastIndex = _fullTransform.Count - 1; 152if (_fullTransform.Count == 0) 158return _fullTransform[_fullTransform.Count - 1]; 170if (_fullClip.Count == 0) 176return _fullClip[_fullClip.Count - 1];
Replay (6)
Replay.cs (6)
43if (rest.Count == 1) 47else if (rest.Count > 1) 115Console.WriteLine($"Compilation Events: {compilerCalls.Count}"); 153while (tasks.Count < maxParallel && index < compilerCalls.Count) 168} while (index < compilerCalls.Count);
Roslyn.Diagnostics.Analyzers (47)
DoNotMixAttributesFromDifferentVersionsOfMEF.cs (1)
70if (appliedExportAttributes.Count == 0)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
87for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 100if (result == 0 && usedFieldsAndValues.Count > 0) 104for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 155for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (4)
27addBlankLine = newImports.Count > 0; 49for (var i = 0; i < newImports.Count; i++) 78if (originalLastUsingCurrentIndex != newImports.Count - 1) 86for (var i = 0; i < newImports.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
Roslyn.Diagnostics.CSharp.Analyzers (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
900finalTrivia.RemoveAt(finalTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
227if (members.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
30if (members.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
324if (types.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
180for (var i = 0; i < list.Count; i++)
Roslyn.Test.PdbUtilities (3)
EditAndContinue\EditAndContinueTest.cs (2)
98output?.WriteLine($"Emitting generation #{_generations.Count}"); 129if (readers.Count > 0)
Reader\Token2SourceLineExporter.cs (1)
1464if (modList.Count > 0)
Roslyn.Test.Performance.Utilities (2)
TraceManager.cs (2)
151var average = _durations.Count != 0 ? totalDuration / _durations.Count : 0;
Roslyn.VisualStudio.DiagnosticsWindow (2)
OptionPages\ForceLowMemoryMode.cs (2)
69get { return _blocks.Count; } 119for (var b = 0; b < _blocks.Count; b++)
Roslyn.VisualStudio.Next.UnitTests (1)
Services\AssetProviderTests.cs (1)
63Assert.Equal(1, stored2.Count);
RunTests (12)
AssemblyScheduler.cs (4)
85if (longTests.Count > 0) 87ConsoleUtil.Warning($"There are {longTests.Count} tests have execution times greater than the maximum execution time of {s_maxExecutionTime}"); 209if (currentFilters.Count > 0) 231workItems.Count,
Options.cs (1)
203if (includeFilter.Count == 0)
Program.cs (1)
345if (list.Count == 0)
TestRunner.cs (6)
89while (i < running.Count) 132while (running.Count < max && waiting.Count > 0) 140ConsoleUtil.Write($" {running.Count,2} running, {waiting.Count,2} queued, {completed.Count,2} completed"); 147if (running.Count > 0) 151} while (running.Count > 0);
Sample (1)
Endpoints\MapSchemasEndpoints.cs (1)
26schemas.MapPost("/list-of-ints", (List<int> values) => values.Count);
Shared (5)
JsonSchemaExporter\JsonSchemaExporter.cs (5)
142List<JsonSchema>? anyOf = new(derivedTypes.Count); 165state.PushSchemaNode(anyOf.Count.ToString(CultureInfo.InvariantCulture)); 178if (anyOf.Count == 0) 498public int CurrentDepth => _currentPath.Count; 512_currentPath.RemoveAt(_currentPath.Count - 1);
SqlServerEndToEnd.ApiService (2)
Program.cs (2)
32totalEntries = entries1.Count + entries2.Count,
Stress.ApiService (4)
TestMetrics.cs (2)
47for (var i = 0; i < uploadSpeed.Count; i++) 51return new Measurement<double>(sum / uploadSpeed.Count);
TraceCreator.cs (2)
111var activityLinkCount = Random.Shared.Next(0, Math.Min(5, _allActivities.Count)); 128var a = _allActivities[Random.Shared.Next(0, _allActivities.Count)];
Swaggatherer (6)
SwaggathererApplication.cs (6)
62Console.WriteLine($"Processing {Input.Values.Count} files..."); 64for (var i = 0; i < Input.Values.Count; i++) 71for (var i = entries.Count - 1; i >= 0; i--) 83for (var i = entries.Count - 1; i >= 0; i--) 107for (var i = entries.Count - 1; i >= 0; i--) 184for (var j = 0; j < others.Count; j++)
System.CodeDom (3)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (3)
236for (int i = 0; i < typeArgumentList.Count; i++) 252else if (typeArgumentList.Count > 0) 254for (int i = 0; i < typeArgumentList.Count; i++)
System.Collections (3)
System\Collections\Generic\SortedSet.cs (1)
1445for (int i = matches.Count - 1; i >= 0; i--)
System\Collections\Generic\SortedSet.TreeSubSet.cs (2)
101while (toRemove.Count != 0) 104toRemove.RemoveAt(toRemove.Count - 1);
System.Collections.Concurrent (6)
System\Collections\Concurrent\BlockingCollection.cs (6)
989handles.RemoveAt(handles.Count - 1); //remove the linked token 998Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1377if (handles.Count == 0 && isTakeOperation) //case#5 1380if (handles.Count == 0) //case#4 1396Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1401if (collections.Length != handles.Count - 1) // -1 because of the combined token handle
System.Collections.Immutable (10)
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (1)
74count = list.Count;
System\Collections\Immutable\ImmutableSortedSet_1.cs (9)
1131if (list.Count == 0) 1144Debug.Assert(list.Count > 0); 1150for (int i = 1; i < list.Count; i++) 1157list.RemoveRange(index, list.Count - index); 1160Node root = Node.NodeTreeFromList(list.AsReadOnlyList(), 0, list.Count); 1202Debug.Assert(list.Count > 0); 1208for (int i = 1; i < list.Count; i++) 1215list.RemoveRange(index, list.Count - index); 1218Node root = Node.NodeTreeFromList(list.AsReadOnlyList(), 0, list.Count);
System.ComponentModel.Annotations (7)
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (1)
248for (int i = attributes.Count - 1; i >= 0; --i)
System\ComponentModel\DataAnnotations\Validator.cs (6)
225if (errors.Count > 0) 288if (errors.Count > 0) 318if (errors.Count > 0) 414if (errors.Count > 0) 424if (errors.Count > 0) 496if (breakOnFirstError && errors.Count > 0)
System.ComponentModel.Composition (17)
Microsoft\Internal\Collections\CollectionServices.cs (3)
107if ((source == null) || (source.Count == 0)) 115if (secondAsList.Count == 0) 119else if (secondAsList.Count == 1)
Microsoft\Internal\Collections\WeakReferenceCollection.cs (2)
16if (_items.Capacity == _items.Count) 47int count = _items.Count;
System\ComponentModel\Composition\CompositionException.cs (1)
166WriteHeader(writer, Errors.Count, paths.Count);
System\ComponentModel\Composition\Hosting\AtomicComposition.cs (1)
155for (int i = _revertActionList.Count - 1; i >= 0; i--)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (1)
837if (resurrectedExports.Count != 0)
System\ComponentModel\Composition\Hosting\ComposablePartCatalogCollection.cs (2)
93if (_catalogs.Count == 0) 156return _catalogs.Count;
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (1)
212if (parts.Count == 0)
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (2)
595if (catalogsToAdd.Count == 0 && catalogsToRemove.Count == 0)
System\ComponentModel\Composition\Hosting\ImportEngine.RecompositionManager.cs (3)
106if (aliveItems.Count == 0) 122if (partsToIndex.Count == 0 && partsToUnindex.Count == 0)
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (1)
483if (parameters.Count > 0)
System.ComponentModel.Composition.Registration (3)
System\ComponentModel\Composition\Registration\PartBuilder.cs (3)
295if (_interfaceExports.Count != 0) 419if (_propertyImports.Count != 0 || _propertyExports.Count != 0)
System.ComponentModel.TypeConverter (17)
System\ComponentModel\Design\Serialization\ContextStack.cs (7)
36if (_contextStack != null && _contextStack.Count > 0) 38return _contextStack[_contextStack.Count - 1]; 53if (_contextStack != null && level < _contextStack.Count) 55return _contextStack[_contextStack.Count - 1 - level]; 74int level = _contextStack.Count; 112if (_contextStack != null && _contextStack.Count > 0) 114int idx = _contextStack.Count - 1;
System\ComponentModel\ExtendedPropertyDescriptor.cs (1)
37Attribute[] temp = new Attribute[attrList.Count];
System\ComponentModel\MemberDescriptor.cs (2)
113_attributes = new Attribute[newList.Count]; 347for (int i = 0; i < list.Count;)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
632PropertyDescriptor[] fullArray = new PropertyDescriptor[propertyList.Count]; 1298extendedProperties = new ReflectPropertyDescriptor[extendedList.Count];
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (5)
100int ifaceStartIdx = attributes.Count; 115if (attributes.Count != 0) 117var filter = new HashSet<object>(attributes.Count); 120for (int idx = 0; idx < attributes.Count; idx++) 143attributes.RemoveRange(next, attributes.Count - next);
System.Composition.Convention (3)
System\Composition\Convention\PartConventionBuilder.cs (3)
493if (_interfaceExports.Count != 0) 664if (_propertyImports.Count != 0 || _propertyExports.Count != 0)
System.Composition.Hosting (1)
System\Composition\Hosting\Core\UpdateResult.cs (1)
52if (_providedDescriptors.Count == 0)
System.Configuration.ConfigurationManager (9)
System\Configuration\BaseConfigurationRecord.cs (3)
454Debug.Assert(inputsPerConfigKey.Count > 0, "We won't get here unless we have inputs."); 1299int i = locationInputs.Count; 2166for (int i = sectionRecord.IndirectLocationInputs.Count - 1; i >= 0; i--)
System\Configuration\ErrorsHelper.cs (2)
13return errors?.Count ?? 0; 53Debug.Assert(errors.Count != 0, "errors.Count != 0");
System\Configuration\SectionRecord.cs (4)
106internal bool HasLocationInputs => (LocationInputs != null) && (LocationInputs.Count > 0); 110internal SectionInput LastLocationInput => HasLocationInputs ? LocationInputs[LocationInputs.Count - 1] : null; 117=> (IndirectLocationInputs != null) && (IndirectLocationInputs.Count > 0); 122=> HasIndirectLocationInputs ? IndirectLocationInputs[IndirectLocationInputs.Count - 1] : null;
System.Console (2)
System\TermInfo.Database.cs (2)
256iName < names.Count && iValue < values.Count;
System.Data.Common (61)
System\Data\Common\DataColumnMappingCollection.cs (1)
80return ((null != _items) ? _items.Count : 0);
System\Data\Common\DataTableMappingCollection.cs (1)
55public int Count => (null != _items) ? _items.Count : 0;
System\Data\DataColumnCollection.cs (1)
535for (int i = 0; i < column._dependentColumns.Count; i++)
System\Data\DataRelation.cs (1)
432for (int i = 0; i < list.Count; ++i)
System\Data\DataSet.cs (1)
3252return topTables.Count == 0 ?
System\Data\DataTable.cs (29)
997int numIndexes = _shadowIndexes!.Count; 1126for (int i = _indexes.Count - 1; 0 <= i; --i) 1601return (null == nestedParents) || (nestedParents.Count == 0) ? 2051if (_delayedViews.Count > 0) 3171DataRow[] temp = NewRowArray(errorList.Count); 3187for (int i = 0; i < _indexes.Count; i++) 3358if (_dependentColumns != null && _dependentColumns.Count > 0) 3768int numIndexes = _shadowIndexes!.Count; 3791Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes"); 3794int numIndexes = _shadowIndexes.Count; 3815int numIndexes = _shadowIndexes!.Count; 3838int numIndexes = _shadowIndexes!.Count; 3872int indexCount = LiveIndexes.Count; 3906int indexCount = LiveIndexes.Count; 4072int numIndexes = _shadowIndexes!.Count; 4352_dependentColumns != null && _dependentColumns.Count > 0) 4364cachedRows.InsertRange(cachedRows.Count, row.GetParentRows(relation)); 4374cachedRows.InsertRange(cachedRows.Count, row.GetChildRows(relation)); 4393if (LiveIndexes.Count != 0) 4450if (_dependentColumns != null && _dependentColumns.Count > 0) 4503if (LiveIndexes.Count != 0) 4583Debug.Assert(0 < _indexes.Count, "unexpected"); 6387for (int i = 0; i < tableList.Count; i++) 6547if (relationList.Count == 0) 6856if (t_usedTables.Count == 0) 6923if (RowDiffIdUsageSection.t_usedTables != null && RowDiffIdUsageSection.t_usedTables.Count == 0) 6967if ((null != _dependentColumns) && (0 < _dependentColumns.Count)) 7149int count = columns.Count; 7202count = columns.Count;
System\Data\DataTableCollection.cs (1)
618Debug.Assert(_list.Count == tableList.Count, "Both lists should have equal numbers of tables");
System\Data\DataView.cs (1)
1737for (int i = 0; i < arraylist.Count; i++)
System\Data\DataViewListener.cs (1)
193for (int i = listeners.Count - 1; 0 <= i; --i)
System\Data\EnumerableRowCollection.cs (2)
157if ((null != _selector) && (0 < _listOfPredicates.Count)) 192else if (0 < _listOfPredicates.Count)
System\Data\Filter\AggregateNode.cs (2)
120for (i = 0; i < list.Count; i++) 129if (i >= list.Count)
System\Data\Filter\LookupNode.cs (2)
69for (i = 0; i < list.Count; i++) 78if (i >= list.Count)
System\Data\Filter\NameNode.cs (2)
64for (i = 0; i < list.Count; i++) 73if (i >= list.Count)
System\Data\Merger.cs (1)
302if (targetRow.Table._dependentColumns != null && targetRow.Table._dependentColumns.Count > 0)
System\Data\ProviderBase\SchemaMapping.cs (1)
543for (int i = items.Count - 1; 0 <= i; --i)
System\Data\RecordManager.cs (4)
101if (_freeRecordList.Count != 0) 103record = _freeRecordList[_freeRecordList.Count - 1]; 104_freeRecordList.RemoveAt(_freeRecordList.Count - 1); 169_freeRecordList.Capacity = _freeRecordList.Count + _table.Rows.Count;
System\Data\Select.cs (3)
210int count = _table._indexes.Count; 266int count = _table._indexes.Count; 852resultRows = _table.NewRowArray(matchingRows.Count);
System\Data\Selection.cs (3)
1031for (int i = 0; i < list.Count; ++i) 1068internal bool HasListeners => (0 < _listeners.Count); 1107int count = _listeners.Count;
System\Data\SortExpressionBuilder.cs (1)
97Debug.Assert(a != null && b != null && a.Count == Count);
System\Xml\XmlDataDocument.cs (3)
3069if (tableList.Count > 0) 3078for (int readPos = 0; readPos < tableList.Count; readPos++) 3116for (int counter = 0; counter < tableList.Count; counter++)
System.Data.Odbc (12)
Common\System\Data\ProviderBase\DbConnectionPool.cs (6)
352int count = _objectList.Count; 408_totalObjects = _objectList.Count; 421oldConnectionPool._totalObjects = oldConnectionPool._objectList.Count; 557_totalObjects = _objectList.Count; 1064count = _objectList.Count; 1105count = reclaimedObjects.Count;
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (2)
256if (0 != _poolsToRelease.Count) 279if (0 != _poolGroupsToRelease.Count)
System\Data\Odbc\OdbcDataReader.cs (1)
2152if ((qrytables != null) && (qrytables.Count > 0))
System\Data\Odbc\OdbcParameterCollectionHelper.cs (3)
19return ((null != _items) ? _items.Count : 0); 196int count = items.Count; 321if (InnerList.Count > 0)
System.Diagnostics.DiagnosticSource (7)
System\Diagnostics\ActivityTagsCollection.cs (4)
98List<string> list = new List<string>(_list.Count); 114List<object?> list = new List<object?>(_list.Count); 131public int Count => _list.Count; 261for (int i = 0; i < _list.Count; i++)
System\Diagnostics\Metrics\InstrumentAdvice.cs (1)
58for (int i = 1; i < values.Count; i++)
System\Diagnostics\Metrics\Meter.cs (1)
605if (s_allMeters.Count > 0)
System\Diagnostics\Metrics\MeterListener.cs (1)
295internal static List<MeterListener>? GetAllListeners() => s_allStartedListeners.Count == 0 ? null : new List<MeterListener>(s_allStartedListeners);
System.Diagnostics.Process (2)
System\Diagnostics\Process.cs (1)
595int count = _processInfo!._threadInfoList.Count;
System\Diagnostics\Process.NonUap.cs (1)
30if (result != null && result.Count != 0)
System.Diagnostics.TraceSource (12)
System\Diagnostics\Switch.cs (5)
78List<WeakReference<Switch>> buffer = new List<WeakReference<Switch>>(s_switches.Count); 79for (int i = 0; i < s_switches.Count; i++) 86if (buffer.Count < s_switches.Count) 278for (int i = 0; i < s_switches.Count; i++)
System\Diagnostics\SwitchAttribute.cs (1)
62SwitchAttribute[] ret = new SwitchAttribute[switchAttribs.Count];
System\Diagnostics\TraceListeners.cs (1)
66return _list.Count;
System\Diagnostics\TraceSource.cs (5)
49List<WeakReference<TraceSource>> buffer = new List<WeakReference<TraceSource>>(s_tracesources.Count); 50for (int i = 0; i < s_tracesources.Count; i++) 57if (buffer.Count < s_tracesources.Count) 168for (int i = 0; i < s_tracesources.Count; i++)
System.Formats.Cbor (2)
System\Formats\Cbor\Writer\CborWriter.Map.cs (2)
133if (!_keysRequireSorting && keyValuePairEncodingRanges.Count > 0) 136KeyValuePairEncodingRange previousKeyValueRange = keyValuePairEncodingRanges[keyValuePairEncodingRanges.Count - 1];
System.Formats.Nrbf (8)
System\Formats\Nrbf\ArrayRecord.cs (1)
159Debug.Assert(numElementsWritten == (uint)source.Count, "We should have traversed the entirety of the source records collection.");
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
38for (int recordIndex = 0; recordIndex < Records.Count; recordIndex++)
System\Formats\Nrbf\ArraySingleStringRecord.cs (1)
52for (int recordIndex = 0; recordIndex < Records.Count; recordIndex++)
System\Formats\Nrbf\ClassRecord.cs (1)
158if (MemberValues.Count < ExpectedValuesCount)
System\Formats\Nrbf\ClassWithIdRecord.cs (1)
85=> MetadataClass.MemberTypeInfo.GetNextAllowedRecordType(MemberValues.Count);
System\Formats\Nrbf\ClassWithMembersAndTypesRecord.cs (1)
37=> MemberTypeInfo.GetNextAllowedRecordType(MemberValues.Count);
System\Formats\Nrbf\MemberTypeInfo.cs (1)
41for (int i = 0; i < info.Count; i++)
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (1)
102=> MemberTypeInfo.GetNextAllowedRecordType(MemberValues.Count);
System.Formats.Tar (2)
System\Formats\Tar\TarReader.cs (2)
62if (_dataStreamsToDispose?.Count > 0) 87if (_dataStreamsToDispose?.Count > 0)
System.IO.Compression (10)
System\IO\Compression\ZipArchive.Async.cs (5)
328entriesToWrite = new(_entries.Count); 372bool archiveEpilogueRequiresUpdate = _entries.Count == 0; 400|| _entries.Count >= ZipHelper.Mask16Bit 411await Zip64EndOfCentralDirectoryRecord.WriteBlockAsync(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, cancellationToken).ConfigureAwait(false); 423await ZipEndOfCentralDirectoryBlock.WriteBlockAsync(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, _archiveComment, cancellationToken).ConfigureAwait(false);
System\IO\Compression\ZipArchive.cs (5)
775entriesToWrite = new(_entries.Count); 819bool archiveEpilogueRequiresUpdate = _entries.Count == 0; 851|| _entries.Count >= ZipHelper.Mask16Bit 862Zip64EndOfCentralDirectoryRecord.WriteBlock(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory); 874ZipEndOfCentralDirectoryBlock.WriteBlock(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, _archiveComment);
System.IO.Packaging (22)
System\IO\Packaging\InterleavedZipPackagePartStream.PieceDirectory.cs (7)
113Debug.Assert(sortedPieceInfoList.Count > 0); 126_lastPieceIndex = sortedPieceInfoList.Count - 1; 271for (int i = _indexOfLastPieceStreamInfoAccessed + 1; i < _pieceStreamInfoList.Count; i++) 275_pieceStreamInfoList.RemoveRange(_indexOfLastPieceStreamInfoAccessed + 1, _pieceStreamInfoList.Count - (_indexOfLastPieceStreamInfoAccessed + 1)); 393while (pieceNumber < _sortedPieceInfoList.Count) 399_sortedPieceInfoList.RemoveRange(_lastPieceIndex + 1, _sortedPieceInfoList.Count - (_lastPieceIndex + 1)); 446Debug.Assert(_pieceStreamInfoList.Count == 0);
System\IO\Packaging\Package.cs (2)
435if (partIndex.Count > 0) 437precedingPartName = (partIndex[partIndex.Count - 1]);
System\IO\Packaging\PackagePart.cs (1)
771for (int i = _requestedStreams.Count - 1; i >= 0; i--)
System\IO\Packaging\ZipPackage.cs (11)
135if (partToDelete.PieceDescriptors.Count > 0) 541if (sortedPieceInfoList.Count > 0) 582for (int i = 0; i < pieces.Count; ++i) 661_ignoredItemHelper.AddItemsForInvalidSequence(normalizedPrefixNameForCurrentSequence, pieces, startIndexOfCurrentSequence, checked(pieces.Count - startIndexOfCurrentSequence)); 1085_ignoredItemHelper.AddItemsForInvalidSequence(ContentTypesFileUpperInvariant, partPieces, 0, partPieces.Count); 1094for (int pieceNumber = 0; pieceNumber < partPieces.Count; ++pieceNumber) 1098_ignoredItemHelper.AddItemsForInvalidSequence(ContentTypesFileUpperInvariant, partPieces, 0, partPieces.Count); 1116_ignoredItemHelper.AddItemsForInvalidSequence(ContentTypesFileUpperInvariant, partPieces, 0, partPieces.Count); 1123if (lastPieceNumber < partPieces.Count - 1) 1127_ignoredItemHelper.AddItemsForInvalidSequence(ContentTypesFileUpperInvariant, partPieces, lastPieceNumber + 1, partPieces.Count - lastPieceNumber - 1); 1128partPieces.RemoveRange(lastPieceNumber + 1, partPieces.Count - lastPieceNumber - 1);
System\IO\Packaging\ZipPackagePart.cs (1)
44else if (_pieces.Count > 0)
System.IO.Pipelines (1)
System\IO\Pipelines\PipeCompletionCallbacks.cs (1)
22var count = _callbacks.Count;
System.Linq (13)
System\Linq\AppendPrepend.SpeedOpt.cs (1)
270_appended?.FillReversed(SetCountAndGetSpan(list, list.Count + _appendCount));
System\Linq\DebugView.cs (1)
81if (tempList.Count == 0)
System\Linq\DefaultIfEmpty.SpeedOpt.cs (1)
22if (list.Count == 0)
System\Linq\Enumerable.cs (1)
32/// Sets the <paramref name="list"/>'s <see cref="List{T}.Count"/> to be <paramref name="count"/>
System\Linq\Select.cs (1)
223private int CountForDebugger => _source.Count;
System\Linq\Select.SpeedOpt.cs (5)
433int count = _source.Count; 460if ((uint)index < (uint)_source.Count) 472if (_source.Count != 0) 484int len = _source.Count; 497int count = _source.Count;
System\Linq\Shuffle.SpeedOpt.cs (3)
121if (i < buffer.Count) 240while (reservoir.Count < takeCount) 244totalElementCount = reservoir.Count;
System.Linq.AsyncEnumerable (1)
System\Linq\ToAsyncEnumerable.cs (1)
48for (int i = 0; i < source.Count; i++)
System.Linq.Expressions (40)
System\Dynamic\ExpandoClass.cs (1)
58for (int i = 0; i < infos.Count; i++)
System\Linq\Expressions\Compiler\BoundConstants.cs (3)
72internal int Count => _values.Count; 85if (_indexes.TryAdd(value, _values.Count)) 186_indexes.Add(value, index = _values.Count);
System\Linq\Expressions\Compiler\LabelInfo.cs (1)
208if (_references.Count > 0 && _definitions.Count == 0)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (1)
214Debug.Assert(wb.Count > 0);
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (15)
295Debug.Assert(key > buckets[buckets.Count - 1].Key); 302return (buckets.Count + count) * 2 > jumpTableSlots; 307while (buckets.Count > 1) 309List<SwitchLabel> first = buckets[buckets.Count - 2]; 310List<SwitchLabel> second = buckets[buckets.Count - 1]; 312if (!FitsInBucket(first, second[second.Count - 1].Key, second.Count)) 319buckets.RemoveAt(buckets.Count - 1); 326if (buckets.Count > 0) 328List<SwitchLabel> last = buckets[buckets.Count - 1]; 437EmitSwitchBuckets(info, buckets, 0, buckets.Count - 1); 567if (bucket.Count == 1) 608int len = (int)(bucket[bucket.Count - 1].Key - bucket[0].Key + 1); 623Debug.Assert(key == bucket[bucket.Count - 1].Key + 1); 701Utils.Constant(initializers.Count)
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (2)
216comma.Capacity = comma.Count + 1; 379Debug.Assert(_comma!.Capacity == _comma.Count + 1);
System\Linq\Expressions\Compiler\StackSpiller.cs (1)
116if (_tm.Temps.Count > 0)
System\Linq\Expressions\Compiler\StackSpiller.Temps.cs (1)
116for (int i = _freeTemps.Count - 1; i >= 0; i--)
System\Linq\Expressions\Interpreter\InstructionList.cs (6)
220Instruction instruction = _instructions[_instructions.Count - 1]; 221_instructions.RemoveAt(_instructions.Count - 1); 245public int Count => _instructions.Count; 378if (_objects.Count < s_loadObjectCached!.Length) 380uint index = (uint)_objects.Count; 770Debug.Assert(_instructions[_instructions.Count - 1] == NullCheckInstruction.Instance);
System\Linq\Expressions\Interpreter\LabelInfo.cs (1)
160if (_references.Count > 0 && !HasDefinitions)
System\Linq\Expressions\Interpreter\TypeOperations.cs (4)
586indexes[i] = vars.Count; 591indexes[i] = -1 - boxes.Count; 597if (boxes.Count == 0) 604if (vars.Count == 0)
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (4)
141indexes[i] = vars.Count; 146indexes[i] = -1 - boxes.Count; 152if (boxes.Count == 0) 159if (vars.Count == 0)
System.Linq.Parallel (11)
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (4)
208while (buffer.Count < _count && _source.MoveNext(ref current!, ref index)) 246if (_count == 0 || _bufferIndex.Value >= _buffer.Count - 1) 279if (_bufferIndex.Value < _buffer.Count - 1) 281for (_bufferIndex.Value++; _bufferIndex.Value < _buffer.Count; _bufferIndex.Value++)
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (3)
349if (_bufferIndex.Value >= _buffer.Count - 1) 372if (_bufferIndex.Value < _buffer.Count - 1) 374for (_bufferIndex.Value++; _bufferIndex.Value < _buffer.Count; _bufferIndex.Value++)
System\Linq\Parallel\Utils\Sorting.cs (4)
269Debug.Assert(keys.Count == values.Count); 272int[] indices = new int[values.Count]; 289TInputOutput[] sortedValues = new TInputOutput[values.Count]; 301_sharedValues[_partitionIndex] = new TInputOutput[values.Count];
System.Net.Http (43)
System\Net\Http\Headers\HttpHeaders.cs (4)
235rawValues.EnsureCapacity(rawValues.Count + count); 541if (parsedValues.Count == 0) 978if (parsedValues.Count == 0 && addWhenInvalid && info.ParsedAndInvalidValues is null) 1284valueStore is List<T> list ? list.Count :
System\Net\Http\MultipartContent.cs (6)
165for (int contentIndex = 0; contentIndex < _nestedContent.Count; contentIndex++) 210for (int contentIndex = 0; contentIndex < _nestedContent.Count; contentIndex++) 253var streams = new Stream[2 + (_nestedContent.Count * 2)]; 260for (int contentIndex = 0; contentIndex < _nestedContent.Count; contentIndex++) 363if (_nestedContent.Count > 1) 366currentLength += (_nestedContent.Count - 1) * (CrLfLength + DashDashLength + _boundary.Length + CrLfLength);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (4)
912_associatedHttp2ConnectionCount -= _availableHttp2Connections.Count; 920_associatedHttp3ConnectionCount -= _availableHttp3Connections.Count; 937Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (14)
80int availableConnectionCount = _availableHttp2Connections?.Count ?? 0; 145int availableHttp2ConnectionCount = _availableHttp2Connections?.Count ?? 0; 375Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0)); 394Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0), 395$"Expected _associatedHttp2ConnectionCount={_associatedHttp2ConnectionCount} > _availableHttp2Connections.Count={(_availableHttp2Connections?.Count ?? 0)}"); 417Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"With {(_availableHttp2Connections?.Count ?? 0)} available HTTP2 connections, we shouldn't have a waiter."); 544Debug.Assert(_associatedHttp2ConnectionCount >= _availableHttp2Connections.Count); 587while (freeIndex < list.Count && list[freeIndex].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 595if (freeIndex < list.Count) 603while (current < list.Count) 607while (current < list.Count && !list[current].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 614if (current < list.Count) 625removed = list.Count - freeIndex;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (14)
140int availableConnectionCount = _availableHttp3Connections?.Count ?? 0; 215int availableHttp3ConnectionCount = _availableHttp3Connections?.Count ?? 0; 373Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0)); 392Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0), 393$"Expected _associatedHttp3ConnectionCount={_associatedHttp3ConnectionCount} > _availableHttp3Connections.Count={(_availableHttp3Connections?.Count ?? 0)}"); 415Debug.Assert((_availableHttp3Connections?.Count ?? 0) == 0, $"With {(_availableHttp3Connections?.Count ?? 0)} available HTTP3 connections, we shouldn't have a waiter."); 535Debug.Assert(_associatedHttp3ConnectionCount >= _availableHttp3Connections.Count); 565while (freeIndex < list.Count && list[freeIndex].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 573if (freeIndex < list.Count) 581while (current < list.Count) 585while (current < list.Count && !list[current].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 592if (current < list.Count) 603removed = list.Count - freeIndex;
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
654if (_trailingHeaders?.Count > 0)
System.Net.HttpListener (11)
System\Net\HttpListenerRequest.cs (1)
391int n = values.Count;
System\Net\HttpListenerRequestUriBuilder.cs (3)
150Debug.Assert(_rawOctets.Count == 0, 296if (_rawOctets!.Count == 0) 344StringBuilder octetString = new StringBuilder(octets.Count * 3);
System\Net\Managed\ChunkStream.cs (2)
108int count = _chunks.Count; 196int count = _chunks.Count;
System\Net\Managed\HttpEndPointListener.cs (3)
277int c = list.Count; 296if (list != null && list.Count > 0) 300if (list != null && list.Count > 0)
System\Net\Managed\HttpListener.Managed.cs (2)
198if (_asyncWaitQueue.Count == 0) 261if (_contextQueue.Count == 0)
System.Net.Mail (9)
System\Net\Mail\MailAddressCollection.cs (1)
44for (int i = 0; i < result.Count; i++)
System\Net\Mail\SmtpAuthenticationManager.cs (2)
33ISmtpAuthenticationModule[] copy = new ISmtpAuthenticationModule[s_modules.Count]; 34s_modules.CopyTo(0, copy, 0, s_modules.Count);
System\Net\Mail\SmtpClient.cs (1)
531var e = failedRecipientExceptions.Count == 1
System\Net\Mail\SmtpFailedRecipientsException.cs (2)
50innerExceptions.Count > 0 ? innerExceptions[0].FailedRecipient : null, 51innerExceptions.Count > 0 ? innerExceptions[0] : null)
System\Net\Mail\SmtpTransport.cs (3)
133if (failedRecipientExceptions?.Count > 0 && failedRecipientExceptions.Count == recipients.Count) 135var exception = failedRecipientExceptions.Count == 1
System.Net.NetworkInformation (5)
System\Net\NetworkInformation\GatewayIPAddressInformationCollection.cs (1)
31return _addresses.Count;
System\Net\NetworkInformation\InternalIPAddressCollection.cs (1)
31return _addresses.Count;
System\Net\NetworkInformation\IPAddressInformationCollection.cs (1)
25return _addresses.Count;
System\Net\NetworkInformation\MulticastIPAddressInformationCollection.cs (1)
25return _addresses.Count;
System\Net\NetworkInformation\UnicastIPAddressInformationCollection.cs (1)
26return _addresses.Count;
System.Net.Primitives (1)
System\Net\CookieContainer.cs (1)
704for (int i = 0; i < matchingDomainKeys.Count; i++)
System.Net.Quic (5)
System\Net\Quic\Internal\MsQuicConfiguration.Cache.cs (3)
81if (ApplicationProtocols.Count != other.ApplicationProtocols.Count) 86for (int i = 0; i < ApplicationProtocols.Count; i++)
System\Net\Quic\Internal\MsQuicConfiguration.cs (1)
127if (alpnProtocols is null || alpnProtocols.Count <= 0)
System\Net\Quic\QuicListenerOptions.cs (1)
47if (ApplicationProtocols is null || ApplicationProtocols.Count <= 0)
System.Net.Requests (5)
System\Net\TimerThread.cs (1)
146for (int i = 0; i < garbage.Count; i++)
System\Net\WebRequest.cs (4)
106for (int i = 0; i < prefixList.Count; i++) 274while (i < prefixList.Count) 364Debug.Assert(prefixList.Count == Count, $"Expected {Count}, got {prefixList.Count}");
System.Net.Security (10)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (4)
190bool hasAlpn = sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0; 277if (sslAuthenticationOptions.IsServer && sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0) 425if (sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0) 893for (int i = 0; i < protocolList.Count; i++)
System\Net\Security\SslStream.Protocol.cs (3)
491if (filteredCerts != null && filteredCerts.Count != 0) 493NetEventSource.Log.CertsAfterFiltering(filteredCerts.Count, this); 512for (int i = 0; i < filteredCerts.Count; ++i)
System\Net\Security\SslStreamCertificateContext.Linux.cs (2)
275Debug.Assert(_ocspUrls.Count > 0); 317for (int i = 0; i < _ocspUrls.Count; i++)
System\Net\Security\SslStreamPal.Unix.cs (1)
223&& sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
402if (options._requestedSubProtocols?.Count > 0)
System.ObjectModel (1)
System\Collections\ObjectModel\KeyedCollection.cs (1)
142for (int i = 0; i < Items.Count; i++)
System.Private.CoreLib (108)
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (3)
168: base(message, innerExceptionInfos.Count != 0 ? innerExceptionInfos[0].SourceException : null) 170_innerExceptions = new Exception[innerExceptionInfos.Count]; 308while (exceptionsToFlatten.Count > nDequeueIndex)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (1)
122/// <exception cref="ArgumentOutOfRangeException"><paramref name="index"/> is less than 0 or greater than <paramref name="list"/>'s <see cref="List{T}.Count"/>.</exception>
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (9)
236return Count - 1; 313=> BinarySearch(0, Count, item, null); 316=> BinarySearch(0, Count, item, comparer); 668Count == 0 ? SZGenericArrayEnumerator<T>.Empty : 910if ((Count != 0) && (index < 0)) 915if ((Count != 0) && (count < 0)) 1053=> Reverse(0, Count); 1085=> Sort(0, Count, null); 1090=> Sort(0, Count, comparer);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (1)
145_numOfFrames = frameList.Count;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (3)
192if (s_needsResetIncrementingPollingCounters.Count > 0) 237counters = new DiagnosticCounter[_counters.Count]; 306if (s_needsResetIncrementingPollingCounters.Count > 0)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (3)
4320if (s_EventSources.Count % 64 == 63) // on every block of 64, fill up the block before continuing 4322int i = s_EventSources.Count; // Work from the top down. 4337newIndex = s_EventSources.Count;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (5)
763int lenPos = traitMetaData.Count; 772byte[] providerMetadata = Statics.MetadataForString(this.Name, 0, traitMetaData.Count, 0); 773int startPos = providerMetadata.Length - traitMetaData.Count; 800int startPos = metaData.Count; 831return metaData.Count - startPos;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingTypeInfo.cs (2)
148int recursionCheckCount = recursionCheck.Count; 151recursionCheck.RemoveRange(recursionCheckCount, recursionCheck.Count - recursionCheckCount);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (7)
152for (int i = 0; i < datePatternsList.Count; i++) 172if (shortDatePatterns.Count == 0) 239for (int i = 1; i < shortDatePatterns.Count; i++) 378if (callbackContext.Results.Count == 12) 383if (callbackContext.Results.Count > 13) 385Debug.Assert(calendarId == CalendarId.HEBREW && callbackContext.Results.Count == 14); 391callbackContext.Results.RemoveRange(13, callbackContext.Results.Count - 13);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (4)
413if (data.strings.Count > 0) 418if (!useUserOverride && data.strings.Count > 1) 500CultureInfo[] cultures = new CultureInfo[context.strings.Count]; 528for (int i = 0; i < context.strings.Count; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (3)
522if (m_dateWords != null && m_dateWords.Count > 0) 524result = new string[m_dateWords.Count]; 525for (i = 0; i < m_dateWords.Count; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (4)
112int startIndex = abbrevEnglishEraNames == s_abbreviatedEnglishEraNames ? eras.Count - 1 : abbrevEnglishEraNames.Length - 1; 114Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 117for (int i = 0; i < eras.Count; i++) 119eras[i].era = eras.Count - i;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (2)
278for (int i = nestings.Count - 1; i >= 0; i--) 283if (i == nestings.Count - 1 && !string.IsNullOrEmpty(enclosingType.Namespace))
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (1)
152if (edis.Count > 0)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (3)
44if (tokens.Count == 0 && 67if (tokens.Count == 0) 86tokens = new Token[registrations.Count];
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (2)
597Debug.Assert(results.Count > 1); 649Debug.Assert(results.Count > 1);
src\libraries\System.Private.CoreLib\src\System\SR.cs (2)
56if (_currentlyLoading != null && _currentlyLoading.Count > 0 && _currentlyLoading.LastIndexOf(key) >= 0) 95_currentlyLoading.RemoveAt(_currentlyLoading.Count - 1); // Pop
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (2)
54StartupHookNameOrPath[] startupHooks = new StartupHookNameOrPath[startupHookParts.Count]; 55for (int i = 0; i < startupHookParts.Count; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (2)
838Debug.Assert(exceptionList.Count > 0, $"Expected {exceptionList.Count} > 0");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (2)
192(cs.m_exceptions != null && cs.m_exceptions.Count > 0) || 216bool success = (exceptions != null && exceptions.Count > 0) ?
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (8)
4593if (list.Count == list.Capacity) 5089Debug.Assert(tasks.Count > 0, "Expected at least one task"); 5092var mres = new SetOnCountdownMres(tasks.Count); 6184Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6282return taskList.Count == 0 ? 6456Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6769if (taskList.Count == 0) 7516if (lookForOce && edis.Count > 0 &&
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource.cs (1)
173if (defensiveCopy.Count == 0)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource_T.cs (1)
173if (defensiveCopy.Count == 0)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (5)
189Debug.Assert(exceptions.Count > 0, "There should be at least one dispatch info."); 205if (exceptions.Count > 0) 256Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 268Exception[] combinedExceptions = new Exception[exceptions.Count + 1]; 285Debug.Assert(exceptions.Count > 0, "Expected at least one exception.");
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (1)
631int freeIdCount = _freeIds.Count;
src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (3)
99for (int i = timers.Count - 1; i >= 0; --i) 108int lastIndex = timers.Count - 1; 124if (timersToFire.Count > 0)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (2)
229(_equivalentZones is not null && _equivalentZones.Count > 0 ? _equivalentZones[0].Id : (GetAlternativeId(Id, out _) ?? Id)); 541if (rulesList.Count == 0 && index < dts.Length)
src\System\Attribute.CoreCLR.cs (2)
48Attribute[] array = CreateAttributeArrayHelper(type, attributeList.Count); 152Attribute[] array = CreateAttributeArrayHelper(type, attributeList.Count);
src\System\GC.CoreCLR.cs (3)
611int count = s_notifications.Count; 667if (s_notifications.Count == 1) 777for (int i = 0; i < s_notifications.Count; ++i)
src\System\Reflection\Emit\DynamicILGenerator.cs (10)
982if (token < 0 || token > m_tokens.Count) 992return m_tokens.Count - 1 | (int)MetadataTokenType.MemberRef; 1030return m_tokens.Count - 1 | (int)MetadataTokenType.MethodDef; 1035return m_tokens.Count - 1 | (int)MetadataTokenType.MethodDef; 1040return m_tokens.Count - 1 | (int)MetadataTokenType.MethodDef; 1045return m_tokens.Count - 1 | (int)MetadataTokenType.FieldDef; 1050return m_tokens.Count - 1 | (int)MetadataTokenType.FieldDef; 1055return m_tokens.Count - 1 | (int)MetadataTokenType.TypeDef; 1060return m_tokens.Count - 1 | (int)MetadataTokenType.String; 1065return m_tokens.Count - 1 | (int)MetadataTokenType.Signature;
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (1)
574for (i = m_containingType.m_lastTokenizedMethod + 1; i < m_containingType.m_listMethods.Count; ++i)
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (6)
1501int[] interfaceTokens = new int[m_typeInterfaces.Count]; 1502for (int i = 0; i < m_typeInterfaces.Count; i++) 1521constraints = new int[m_typeInterfaces.Count + 2]; 1526constraints = new int[m_typeInterfaces.Count + 1]; 1529for (int i = 0; i < m_typeInterfaces.Count; i++) 1577int size = m_listMethods!.Count;
src\System\Reflection\RuntimeAssembly.cs (3)
779if (exceptions.Count != 0) 781int numTypes = types.Count; 782int numExceptions = exceptions.Count;
src\System\RuntimeType.CoreCLR.cs (1)
1340for (int j = 0; j < cache.Count; j++)
System.Private.DataContractSerialization (73)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (3)
236for (int i = 0; i < typeArgumentList.Count; i++) 252else if (typeArgumentList.Count > 0) 254for (int i = 0; i < typeArgumentList.Count; i++)
System\Runtime\Serialization\ClassDataContract.cs (21)
363XmlDictionaryString?[] childElementNamespaces = new XmlDictionaryString?[Members.Count + baseChildElementNamespaceCount]; 368for (int i = 0; i < Members.Count; i++) 473for (int i = 0; i < Members.Count; i++) 556for (int i = 0; i < Members.Count; i++) 683XmlDictionary dictionary = new XmlDictionary(2 + Members.Count); 691MemberNames = new XmlDictionaryString[Members.Count]; 692MemberNamespaces = new XmlDictionaryString[Members.Count]; 702MemberNames = new XmlDictionaryString[Members.Count + baseMemberCount]; 704MemberNamespaces = new XmlDictionaryString[Members.Count + baseMemberCount]; 711for (int i = 0; i < Members.Count; i++) 729XmlDictionary dictionary = new XmlDictionary(1 + Members.Count); 733MemberNames = new XmlDictionaryString[Members.Count]; 734MemberNamespaces = new XmlDictionaryString[Members.Count]; 735for (int i = 0; i < Members.Count; i++) 950if (tempMembers.Count > 1) 999for (int i = 0; i < membersInHierarchy.Count - 1; i++) 1004while (endIndex < membersInHierarchy.Count - 1 1373boundClassContract.Members = new List<DataMember>(Members.Count); 1421Dictionary<string, DataMember> membersDictionary = new Dictionary<string, DataMember>(Members.Count); 1423for (int i = 0; i < Members.Count; i++) 1428for (int i = 0; i < dataContract.Members.Count; i++)
System\Runtime\Serialization\DataContract.cs (10)
1504else if (nestedParamCounts.Count > 1 || !parametersFromBuiltInNamespaces) 1627if (nestedParamCounts.Count > 1 || !parametersFromBuiltInNamespaces) 2394if (level >= _nestedParamCounts.Count) 2398_nestedParamCounts.Add((level == _nestedParamCounts.Count) ? count : 0); 2399} while (level >= _nestedParamCounts.Count); 2412return _paramGenericInfos?.Count ?? 0; 2432if (_paramGenericInfos == null || _paramGenericInfos.Count == 0) 2436for (int j = 0; j < _paramGenericInfos.Count; j++) 2454if (_paramGenericInfos == null || _paramGenericInfos.Count == 0) 2457for (int j = 0; j < _paramGenericInfos.Count; j++)
System\Runtime\Serialization\DataContractSet.cs (2)
151for (int i = 0; i < classDataContract.Members.Count; i++) 590for (int i = 0; i < types.Count; i++)
System\Runtime\Serialization\EnumDataContract.cs (14)
138XmlDictionary dictionary = new XmlDictionary(2 + Members.Count); 141_childElementNames = new XmlDictionaryString[Members.Count]; 142for (int i = 0; i < Members.Count; i++) 286for (int i = 0; i < Values!.Count; i++) 298for (int i = 0; i < Values.Count; i++) 378for (int i = 0; i < Members.Count; i++) 422if (Members.Count != enumContract.Members.Count || Values?.Count != enumContract.Values?.Count) 424string[] memberNames1 = new string[Members.Count], memberNames2 = new string[Members.Count]; 425for (int i = 0; i < Members.Count; i++) 432for (int i = 0; i < Members.Count; i++)
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (2)
364for (int i = 0; i < classContract.Members!.Count; i++, memberCount++) 427for (int i = 0; i < members.Count; i++, memberCount++)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (1)
237int classMemberCount = classContract.Members!.Count;
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (2)
211context.IncrementItemCount(classContract.Members!.Count); 212for (int i = 0; i < classContract.Members.Count; i++, memberCount++)
System\Runtime\Serialization\ReflectionReader.cs (1)
215for (int i = 0; i < classContract.Members!.Count; i++, memberCount++)
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (1)
146for (int i = 0; i < members.Count; i++, memberCount++)
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (3)
146context.IncrementItemCount(classContract.Members!.Count); 147for (int i = 0; i < classContract.Members.Count; i++, memberCount++) 245for (int j = 0; j < members.Count; j++)
System\Runtime\Serialization\SchemaExporter.cs (3)
129for (int i = 0; i < classDataContract.Members!.Count; i++) 328typeNestedLevelsAttribute.Value = genericArgumentCounts.Count.ToString(CultureInfo.InvariantCulture); 436for (int i = 0; i < enumDataContract.Values.Count; i++)
System\Runtime\Serialization\SchemaImporter.cs (6)
126if (elementNameList.Count > 0) 1000int prevMemberIndex = dataContract.Members.Count - 1; 1005memberOrder = dataContract.Members.Count; 1011memberOrder = dataContract.Members.Count; 1106if (keyValueContract == null || keyValueContract.Members == null || keyValueContract.Members.Count != 2 1213long enumValue = (valueInnerText == null) ? SchemaExporter.GetDefaultEnumValue(isFlags, dataContract.Members.Count)
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (2)
423for (int i = 0; i < classContract.Members!.Count; i++, memberCount++) 480for (int i = 0; i < members.Count; i++, memberCount++)
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (2)
307int classMemberCount = classContract.Members!.Count; 805for (int j = 0; j < members.Count; j++)
System.Private.Windows.Core (6)
System\Collections\Generic\CollectionExtensions.cs (1)
29list.RemoveRange(count, list.Count - count);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
356list.Count, 391list.Count,
System\Private\Windows\Ole\FormatEnumerator.cs (2)
57if (_current >= _formats.Count || celt <= 0) 82if (_current + celt >= _formats.Count)
Windows\Win32\System\Com\ComPointerList.cs (1)
18public int Count => _pointers.Count;
System.Private.Windows.Core.Tests (1)
System\Private\Windows\Ole\BinaryFormatUtilitiesTests.cs (1)
425result!.Count.Should().Be(1);
System.Private.Xml (142)
System\Xml\Core\QueryOutputWriter.cs (1)
56if (settings.CDataSectionElements.Count > 0)
System\Xml\Core\QueryOutputWriterV1.cs (1)
70if (settings.CDataSectionElements != null && settings.CDataSectionElements.Count > 0)
System\Xml\Core\XmlEventCache.cs (4)
114for (idxPage = 0; idxPage < _pages!.Count; idxPage++) 125Debug.Assert(idxPage + 1 == _pages.Count); 268for (idxPage = 0; idxPage < _pages!.Count; idxPage++) 279Debug.Assert(idxPage + 1 == _pages.Count);
System\Xml\Core\XmlWriterSettings.cs (2)
331private bool IsQuerySpecific => CDataSectionElements.Count != 0 || _docTypePublic != null || _docTypeSystem != null || _standalone == XmlStandalone.Yes; 626writer.Write(CDataSectionElements.Count);
System\Xml\Dom\DocumentXmlWriter.cs (8)
378for (int i = _fragment.Count - 1; i >= 0; i--) 391for (int i = 0; i < _fragment.Count; i++) 398for (int i = _fragment.Count - 1; i >= 0; i--) 405for (int i = 0; i < _fragment.Count; i++) 415if (_fragment.Count == 0) 435for (int i = 0; i < _fragment.Count; i++) 446for (int i = 0; i < _fragment.Count; i++) 478for (int i = _fragment.Count - 1; i >= 1; i--)
System\Xml\Dom\DocumentXPathNavigator.cs (1)
1813for (int i = elements.Count - 1; i >= 0; i--)
System\Xml\Dom\XmlNamedNodeMap.SmallXmlNodeList.cs (1)
31return list.Count;
System\Xml\Dom\XPathNodeList.cs (4)
32return _list.Count; 44int count = _list.Count; 68if (_list.Count <= index) 72if (index < 0 || _list.Count <= index)
System\Xml\Schema\ContentValidator.cs (1)
1976if (matchCount + 2 >= runningPositions.Count)
System\Xml\Schema\Preprocessor.cs (1)
778for (int i = 0; i < removeItemsList.Count; ++i)
System\Xml\Schema\SchemaAttDef.cs (2)
179(values.Count <= 2)) 183if (values.Count == 2)
System\Xml\Schema\SchemaCollectionpreProcessor.cs (1)
580for (int i = 0; i < removeItemsList.Count; ++i)
System\Xml\Schema\XmlSchemaObjectTable.cs (2)
80for (index = 0; index < _entries.Count; index++) 94Debug.Assert(_table.Count == _entries.Count);
System\Xml\Schema\XmlSchemaSet.cs (2)
1011for (int i = 0; i < newMembers.Count; ++i) 1313for (int i = 0; i < reprocessList.Count; ++i)
System\Xml\Schema\XsdBuilder.cs (2)
788if (_namespaces != null && _namespaces.Count > 0) 793if (_unhandledAttributes.Count != 0)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (4)
245if (attributeMembersList.Count > 0) 546if (collection is Array currentArray && currentArray.Length == collectionMember.Count) 552a = Array.CreateInstanceFromArrayType(collectionType, collectionMember.Count); 555for (int i = 0; i < collectionMember.Count; i++)
System\Xml\Serialization\SoapReflectionImporter.cs (1)
581if (constants.Count == 0)
System\Xml\Serialization\Types.cs (1)
1094for (int i = 0; i < list.Count; i++)
System\Xml\Serialization\XmlReflectionImporter.cs (2)
910for (int i = 0; i < members.Count; i++) 1224if (constants.Count == 0)
System\Xml\Serialization\XmlSerializationReader.cs (2)
1954if (xmlNodeList.Count <= skippableNodeCount) 2576if (attributeMembersList.Count > 0)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (4)
513if (attributeMembersList.Count > 0) 1102for (int i = 0; i < caseLabels.Count; i++) 1997if (attributes.Count > 0) 2001for (int i = 0; i < attributes.Count; i++)
System\Xml\Serialization\XmlSerializationWriterILGen.cs (2)
645for (int i = 0; i < caseLabels.Count; i++) 693for (int i = 0; i < caseLabels.Count; i++)
System\Xml\XPath\Internal\CacheAxisQuery.cs (4)
40Debug.Assert(0 <= count && count <= outputBuffer.Count); 41if (count < outputBuffer.Count) 52Debug.Assert(0 <= count && count <= outputBuffer.Count); 62public override int Count { get { return outputBuffer.Count; } }
System\Xml\XPath\Internal\CacheChildrenQuery.cs (1)
62if (_elementStk.Count == 0)
System\Xml\XPath\Internal\CacheOutputQuery.cs (4)
51Debug.Assert(0 <= count && count <= outputBuffer.Count); 52if (count < outputBuffer.Count) 63Debug.Assert(0 <= count && count <= outputBuffer.Count); 74public override int Count { get { return outputBuffer.Count; } }
System\Xml\XPath\Internal\ClonableStack.cs (2)
19int last = base.Count - 1; 27return base[base.Count - 1];
System\Xml\XPath\Internal\FollSiblingQuery.cs (2)
40for (int i = 0; i < _parentStk.Count; i++) 72if (_elementStk.Count == 0)
System\Xml\XPath\Internal\PrecedingQuery.cs (1)
81if (_ancestorStk.Count == 0)
System\Xml\XPath\Internal\PreSiblingQuery.cs (1)
32for (int i = 0; i < parentStk.Count; i++)
System\Xml\XPath\Internal\Query.cs (1)
106int r = buffer.Count;
System\Xml\XPath\Internal\QueryBuilder.cs (3)
374if (root.ArgumentList != null && root.ArgumentList.Count > 0) 400if (root.ArgumentList != null && root.ArgumentList.Count > 0) 442int numArgs = args.Count;
System\Xml\XPath\Internal\ReversePositionQuery.cs (1)
14public override int CurrentPosition { get { return outputBuffer.Count - count + 1; } }
System\Xml\XPath\Internal\SortQuery.cs (5)
59SortKey key = new SortKey(numSorts, /*originalPosition:*/_results.Count, eNext.Clone()); 82Debug.Assert(0 <= count && count <= _results.Count); 83if (count < _results.Count) 94Debug.Assert(0 <= count && count <= _results.Count); 112public override int Count { get { return _results.Count; } }
System\Xml\XPath\Internal\XPathAncestorQuery.cs (1)
61public override int CurrentPosition { get { return outputBuffer.Count - count + 1; } }
System\Xml\XPath\Internal\XPathParser.cs (1)
527int argCount = argList.Count;
System\Xml\Xsl\IlGen\StaticDataManager.cs (3)
31id = _list.Count; 129return _prefixMappingsList.Count - 1; 149idx = _globalNames.Count;
System\Xml\Xsl\Runtime\DocumentOrderComparer.cs (2)
62for (int idx = 0; idx < _roots.Count; idx++) 74return _roots.Count - 1;
System\Xml\Xsl\Runtime\DodSequenceMerge.cs (6)
74if (_sequencesToMerge == null || _sequencesToMerge.Count <= 1) 80while (_sequencesToMerge.Count != 1) 83IEnumerator<XPathNavigator> sequence = _sequencesToMerge[_sequencesToMerge.Count - 1]; 84_sequencesToMerge.RemoveAt(_sequencesToMerge.Count - 1); 94Debug.Assert(_sequencesToMerge.Count == 1, "While loop should terminate when count == 1"); 120for (int i = _sequencesToMerge!.Count - 1; i >= 0; i--)
System\Xml\Xsl\Runtime\StringConcat.cs (1)
93int capacity = (_strList == null) ? 8 : _strList.Count;
System\Xml\Xsl\Runtime\XslNumber.cs (1)
212int cFormats = _tokens.Count;
System\Xml\Xsl\Runtime\XsltLibrary.cs (2)
190return _decimalFormatters.Count - 1; 196Debug.Assert(_decimalFormatters != null && 0 <= idx && idx < _decimalFormatters.Count, "Value of decimalFormatterIndex is out of range");
System\Xml\Xsl\XmlQueryTypeFactory.cs (10)
268for (int i = 0; i < accumulator.Count; i++) 727if (members.Count == 0) 730if (members.Count == 1) 741Debug.Assert(members != null && members.Count != 1, "ChoiceType must contain a list with 0 or >1 types."); 746for (int i = 0; i < members.Count; i++) 813writer.Write(_members.Count); 814for (int i = 0; i < _members.Count; i++) 891get { return _members.Count == 0; } 901for (int i = 0; i < _members.Count; i++) 943get { return _members.Count; }
System\Xml\Xsl\Xslt\MatcherBuilder.cs (4)
398Debug.Assert(patternList.Count > 0); 412if (patternList.Count == 0) 431if (patternList.Count == 0) 471if (patternBag.FixedNamePatternsNames.Count == 0)
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (4)
439Debug.Assert(defList != null && defList.Count > 0); 440if (defList.Count == 1) 456Debug.Assert(defList != null && defList.Count > 0); 465return defList.Count == 1 ? keyRef! : result;
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (1)
237List<QilNode> convertedPredicates = new List<QilNode>(predicates.Count);
System\Xml\Xsl\Xslt\XPathPatternParser.cs (1)
240if (predicates.Count > 0)
System\Xml\Xsl\Xslt\XslAst.cs (1)
250Debug.Assert(list != null && list.Count > 0);
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (4)
762if (templates[templates.Count - 1] == dependentTemplate) 1428newtemplate.SetContent(new List<XslNode>(content.Count - split + 8)); 1469for (int t = split; t < content.Count; ++t) 1476content.RemoveRange(split + 1, content.Count - split - 1);
System\Xml\Xsl\Xslt\XsltLoader.cs (19)
255_curStylesheet.Imports = new Stylesheet[importHrefs.Count]; 257for (int i = importHrefs.Count; 0 <= --i;) 755if (useCharacterMaps.Count != 0) ReportNYI("xsl:output/@use-character-maps"); 878if (content.Count != 0) 882if ((use == null) == (content.Count == 0)) 1529if (content.Count != 0) 1545if (content.Count != 0) ReportNYI("xsl:apply-imports/xsl:with-param"); 1764if (content.Count != 0) 1870CheckError(select == null && content.Count == 0, /*[???]*/SR.Xslt_NoSelectNoContent, _input.ElementName); 1871if (content.Count != 0) 1956CheckError((required == TriState.True) && (select != null || content.Count != 0), /*[???]*/SR.Xslt_RequiredAndSelect, name!.ToString()); 1981CheckError(hasSelect && content.Count != 0, /*[XT0620]*/SR.Xslt_ElementCntSel, parentName); 1983if (content.Count != 0) 2145if (content.Count != 0) 2594if (fallbacksArray.Count == 0) 2716if (1 < modes.Count) 2721if (modes.Count == 0) 2891Debug.Assert(list != null && list.Count == 0, "It happened that we always add use-attribute-sets first. Otherwise we can't call list.Clear()"); 3081if (content != null && content.Count == 0)
System\Xml\Xsl\XsltOld\ActionFrame.cs (1)
162SortKey key = new SortKey(numSorts, /*originalPosition:*/results.Count, _newNodeSet!.Current!.Clone());
System\Xml\Xsl\XsltOld\Compiler.cs (1)
732return _queryStore.Count - 1;
System\Xml\Xsl\XsltOld\NumberAction.cs (1)
495cFormats = tokens.Count;
System\Xml\Xsl\XsltOld\Processor.cs (3)
335_queryList = new Query[queryStore.Count]; 337for (int i = 0; i < queryStore.Count; i++) 360_keyList = new Key[_rootAction.KeyList.Count];
System\Xml\Xsl\XsltOld\TemplateAction.cs (1)
145copy._matchKey = compiler.QueryStore.Count - 1;
System.Reflection.Context (6)
System\Reflection\Context\CollectionServices.cs (1)
45Array typedArray = Array.CreateInstance(arrayType, list.Count);
System\Reflection\Context\Custom\AttributeUtils.cs (2)
37if (isSealed && results.Count > 0 && !allowMultiple) 77if (isSealed && results.Count > 0 && !allowMultiple)
System\Reflection\Context\Custom\CustomType.cs (3)
134if (matchingProperties.Count == 0) 260if (matchingMethods.Count == 0) 269if (matchingMethods.Count == 1)
System.Reflection.DispatchProxy (2)
System\Reflection\DispatchProxyGenerator.cs (2)
280Type[] args = new Type[_fields.Count]; 351int methodInfoIndex = _methodInfos.Count;
System.Reflection.Emit (23)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (2)
278for (int i = nestings.Count - 1; i >= 0; i--) 283if (i == nestings.Count - 1 && !string.IsNullOrEmpty(enclosingType.Namespace))
System\Reflection\Emit\ILGeneratorImpl.cs (10)
88if (_exceptionStack.Count < 1) 93ExceptionBlock currentExBlock = _exceptionStack[_exceptionStack.Count - 1]; 135if (_exceptionStack.Count < 1) 140ExceptionBlock currentExBlock = _exceptionStack[_exceptionStack.Count - 1]; 178if (_exceptionStack.Count < 1) 183ExceptionBlock currentExBlock = _exceptionStack[_exceptionStack.Count - 1]; 206if (_exceptionStack.Count < 1) 211ExceptionBlock currentExBlock = _exceptionStack[_exceptionStack.Count - 1]; 743if (_exceptionStack.Count < 1) 748ExceptionBlock currentExBlock = _exceptionStack[_exceptionStack.Count - 1];
System\Reflection\Emit\ModuleBuilderImpl.cs (3)
228if (typeBuilder._eventDefinitions.Count == 0) 266if (typeBuilder._propertyDefinitions.Count == 0) 474for (int i = 0; i < sequencePoints.Count; i++)
System\Reflection\Emit\SignatureHelper.cs (1)
18LocalVariablesEncoder encoder = new BlobEncoder(localSignature).LocalVariableSignature(locals.Count);
System\Reflection\Emit\TypeBuilderImpl.cs (7)
115if (_constructorDefinitions.Count == 0 && (_attributes & TypeAttributes.Interface) == 0 && !IsValueType && 129for (int i = 0; i < _methodDefinitions.Count; i++) 913List<FieldInfo> fields = new List<FieldInfo>(_fieldDefinitions.Count); 1021List<PropertyInfo> candidates = new List<PropertyInfo>(_propertyDefinitions.Count); 1047if (candidates.Count == 0) 1055if (candidates.Count == 1) 1283for (int j = 0; j < mapping.Count; j++)
System.Reflection.Metadata (141)
System\Reflection\Internal\Utilities\EnumerableExtensions.cs (1)
30int[] map = new int[source.Count];
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (10)
114return new LabelHandle(_labels.Count); 120Debug.Assert(_branches.Count == 0 || operandOffset > _branches[_branches.Count - 1].OperandOffset); 165if (label.Id > _labels.Count) 258internal int BranchCount => _branches.Count; 260internal int ExceptionHandlerCount => _lazyExceptionHandlers?.Count ?? 0; 341if (branchIndex == _branches.Count) 368if (_lazyExceptionHandlers == null || _lazyExceptionHandlers.Count == 0) 373var regionEncoder = ExceptionRegionEncoder.SerializeTableHeader(builder, _lazyExceptionHandlers.Count, HasSmallExceptionRegions()); 416if (!ExceptionRegionEncoder.IsSmallRegionCount(_lazyExceptionHandlers.Count))
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (1)
544int totalCount = sorted.Count + 1;
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (128)
211if (rowCount > table.Count) 228case TableIndex.AssemblyRef : return _assemblyRefTable.Count; 229case TableIndex.ClassLayout : return _classLayoutTable.Count; 230case TableIndex.Constant : return _constantTable.Count; 231case TableIndex.CustomAttribute : return _customAttributeTable.Count; 232case TableIndex.DeclSecurity : return _declSecurityTable.Count; 233case TableIndex.EncLog : return _encLogTable.Count; 234case TableIndex.EncMap : return _encMapTable.Count; 235case TableIndex.EventMap : return _eventMapTable.Count; 236case TableIndex.Event : return _eventTable.Count; 237case TableIndex.ExportedType : return _exportedTypeTable.Count; 238case TableIndex.FieldLayout : return _fieldLayoutTable.Count; 239case TableIndex.FieldMarshal : return _fieldMarshalTable.Count; 240case TableIndex.FieldRva : return _fieldRvaTable.Count; 241case TableIndex.Field : return _fieldTable.Count; 242case TableIndex.File : return _fileTable.Count; 243case TableIndex.GenericParamConstraint : return _genericParamConstraintTable.Count; 244case TableIndex.GenericParam : return _genericParamTable.Count; 245case TableIndex.ImplMap : return _implMapTable.Count; 246case TableIndex.InterfaceImpl : return _interfaceImplTable.Count; 247case TableIndex.ManifestResource : return _manifestResourceTable.Count; 248case TableIndex.MemberRef : return _memberRefTable.Count; 249case TableIndex.MethodImpl : return _methodImplTable.Count; 250case TableIndex.MethodSemantics : return _methodSemanticsTable.Count; 251case TableIndex.MethodSpec : return _methodSpecTable.Count; 252case TableIndex.MethodDef : return _methodDefTable.Count; 253case TableIndex.ModuleRef : return _moduleRefTable.Count; 255case TableIndex.NestedClass : return _nestedClassTable.Count; 256case TableIndex.Param : return _paramTable.Count; 257case TableIndex.PropertyMap : return _propertyMapTable.Count; 258case TableIndex.Property : return _propertyTable.Count; 259case TableIndex.StandAloneSig : return _standAloneSigTable.Count; 260case TableIndex.TypeDef : return _typeDefTable.Count; 261case TableIndex.TypeRef : return _typeRefTable.Count; 262case TableIndex.TypeSpec : return _typeSpecTable.Count; 263case TableIndex.Document : return _documentTable.Count; 264case TableIndex.MethodDebugInformation : return _methodDebugInformationTable.Count; 265case TableIndex.LocalScope : return _localScopeTable.Count; 266case TableIndex.LocalVariable : return _localVariableTable.Count; 267case TableIndex.LocalConstant : return _localConstantTable.Count; 268case TableIndex.StateMachineMethod : return _stateMachineMethodTable.Count; 269case TableIndex.ImportScope : return _importScopeTable.Count; 270case TableIndex.CustomDebugInformation : return _customDebugInformationTable.Count; 300rowCounts[(int)TableIndex.AssemblyRef] = _assemblyRefTable.Count; 301rowCounts[(int)TableIndex.ClassLayout] = _classLayoutTable.Count; 302rowCounts[(int)TableIndex.Constant] = _constantTable.Count; 303rowCounts[(int)TableIndex.CustomAttribute] = _customAttributeTable.Count; 304rowCounts[(int)TableIndex.DeclSecurity] = _declSecurityTable.Count; 305rowCounts[(int)TableIndex.EncLog] = _encLogTable.Count; 306rowCounts[(int)TableIndex.EncMap] = _encMapTable.Count; 307rowCounts[(int)TableIndex.EventMap] = _eventMapTable.Count; 308rowCounts[(int)TableIndex.Event] = _eventTable.Count; 309rowCounts[(int)TableIndex.ExportedType] = _exportedTypeTable.Count; 310rowCounts[(int)TableIndex.FieldLayout] = _fieldLayoutTable.Count; 311rowCounts[(int)TableIndex.FieldMarshal] = _fieldMarshalTable.Count; 312rowCounts[(int)TableIndex.FieldRva] = _fieldRvaTable.Count; 313rowCounts[(int)TableIndex.Field] = _fieldTable.Count; 314rowCounts[(int)TableIndex.File] = _fileTable.Count; 315rowCounts[(int)TableIndex.GenericParamConstraint] = _genericParamConstraintTable.Count; 316rowCounts[(int)TableIndex.GenericParam] = _genericParamTable.Count; 317rowCounts[(int)TableIndex.ImplMap] = _implMapTable.Count; 318rowCounts[(int)TableIndex.InterfaceImpl] = _interfaceImplTable.Count; 319rowCounts[(int)TableIndex.ManifestResource] = _manifestResourceTable.Count; 320rowCounts[(int)TableIndex.MemberRef] = _memberRefTable.Count; 321rowCounts[(int)TableIndex.MethodImpl] = _methodImplTable.Count; 322rowCounts[(int)TableIndex.MethodSemantics] = _methodSemanticsTable.Count; 323rowCounts[(int)TableIndex.MethodSpec] = _methodSpecTable.Count; 324rowCounts[(int)TableIndex.MethodDef] = _methodDefTable.Count; 325rowCounts[(int)TableIndex.ModuleRef] = _moduleRefTable.Count; 327rowCounts[(int)TableIndex.NestedClass] = _nestedClassTable.Count; 328rowCounts[(int)TableIndex.Param] = _paramTable.Count; 329rowCounts[(int)TableIndex.PropertyMap] = _propertyMapTable.Count; 330rowCounts[(int)TableIndex.Property] = _propertyTable.Count; 331rowCounts[(int)TableIndex.StandAloneSig] = _standAloneSigTable.Count; 332rowCounts[(int)TableIndex.TypeDef] = _typeDefTable.Count; 333rowCounts[(int)TableIndex.TypeRef] = _typeRefTable.Count; 334rowCounts[(int)TableIndex.TypeSpec] = _typeSpecTable.Count; 336rowCounts[(int)TableIndex.Document] = _documentTable.Count; 337rowCounts[(int)TableIndex.MethodDebugInformation] = _methodDebugInformationTable.Count; 338rowCounts[(int)TableIndex.LocalScope] = _localScopeTable.Count; 339rowCounts[(int)TableIndex.LocalVariable] = _localVariableTable.Count; 340rowCounts[(int)TableIndex.LocalConstant] = _localConstantTable.Count; 341rowCounts[(int)TableIndex.StateMachineMethod] = _stateMachineMethodTable.Count; 342rowCounts[(int)TableIndex.ImportScope] = _importScopeTable.Count; 343rowCounts[(int)TableIndex.CustomDebugInformation] = _customDebugInformationTable.Count; 441return AssemblyReferenceHandle.FromRowId(_assemblyRefTable.Count); 478return TypeDefinitionHandle.FromRowId(_typeDefTable.Count); 534return InterfaceImplementationHandle.FromRowId(_interfaceImplTable.Count); 578return TypeReferenceHandle.FromRowId(_typeRefTable.Count); 588return TypeSpecificationHandle.FromRowId(_typeSpecTable.Count); 598return StandaloneSignatureHandle.FromRowId(_standAloneSigTable.Count); 616return PropertyDefinitionHandle.FromRowId(_propertyTable.Count); 644return EventDefinitionHandle.FromRowId(_eventTable.Count); 680return ConstantHandle.FromRowId(_constantTable.Count); 762return CustomAttributeHandle.FromRowId(_customAttributeTable.Count); 779return MethodSpecificationHandle.FromRowId(_methodSpecTable.Count); 789return ModuleReferenceHandle.FromRowId(_moduleRefTable.Count); 813return ParameterHandle.FromRowId(_paramTable.Count); 848return GenericParameterHandle.FromRowId(_genericParamTable.Count); 870return GenericParameterConstraintHandle.FromRowId(_genericParamConstraintTable.Count); 891return FieldDefinitionHandle.FromRowId(_fieldTable.Count); 1008return MethodDefinitionHandle.FromRowId(_methodDefTable.Count); 1058return MethodImplementationHandle.FromRowId(_methodImplTable.Count); 1086return MemberReferenceHandle.FromRowId(_memberRefTable.Count); 1111return ManifestResourceHandle.FromRowId(_manifestResourceTable.Count); 1126return AssemblyFileHandle.FromRowId(_fileTable.Count); 1154return ExportedTypeHandle.FromRowId(_exportedTypeTable.Count); 1185return DeclarativeSecurityAttributeHandle.FromRowId(_declSecurityTable.Count); 1231return DocumentHandle.FromRowId(_documentTable.Count); 1252return MethodDebugInformationHandle.FromRowId(_methodDebugInformationTable.Count); 1286return LocalScopeHandle.FromRowId(_localScopeTable.Count); 1310return LocalVariableHandle.FromRowId(_localVariableTable.Count); 1328return LocalConstantHandle.FromRowId(_localConstantTable.Count); 1346return ImportScopeHandle.FromRowId(_importScopeTable.Count); 1414return CustomDebugInformationHandle.FromRowId(_customDebugInformationTable.Count); 1472for (int i = 1; i < _classLayoutTable.Count; i++) 1483for (int i = 1; i < _fieldLayoutTable.Count; i++) 1494for (int i = 1; i < _fieldRvaTable.Count; i++) 1506if (_genericParamTable.Count == 0) 1512for (int i = 1; i < _genericParamTable.Count; i++, previous = current) 1532for (int i = 1; i < _genericParamConstraintTable.Count; i++) 1543for (int i = 1; i < _implMapTable.Count; i++) 1554for (int i = 1; i < _interfaceImplTable.Count; i++) 1565for (int i = 1; i < _methodImplTable.Count; i++) 1576for (int i = 1; i < _nestedClassTable.Count; i++) 1587if (_localScopeTable.Count == 0) 1595for (int i = 1; i < _localScopeTable.Count; i++, previous = current) 1623for (int i = 1; i < _stateMachineMethodTable.Count; i++)
System\Reflection\PortableExecutable\DebugDirectory\DebugDirectoryBuilder.cs (1)
216internal int TableSize => DebugDirectoryEntry.Size * _entries.Count;
System.Reflection.MetadataLoadContext (3)
System\Reflection\TypeLoading\Assemblies\RoAssembly.GetForwardedTypes.cs (2)
55int numTypes = types.Count; 56int numExceptions = exceptions.Count;
System\Reflection\TypeLoading\Types\RoModifiedFunctionPointerType.cs (1)
82return builder.Count == 0 ? EmptyTypes : builder.ToArray();
System.Resources.Extensions (2)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
344bw.Write(typeNames.Count); 490typeIndex = types.Count;
System.Resources.Writer (2)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
344bw.Write(typeNames.Count); 490typeIndex = types.Count;
System.Runtime.Caching (1)
System\Runtime\Caching\MemoryCache.cs (1)
419if (keysClone.Count == 0)
System.Runtime.Serialization.Formatters (2)
System\Runtime\Serialization\FormatterServices.cs (2)
75if (allMembers != null && allMembers.Count > 0) 77var membersTemp = new FieldInfo[allMembers.Count + typeMembers.Length];
System.Security.Claims (12)
System\Security\Claims\ClaimsIdentity.cs (5)
375for (int i = 0; i < _instanceClaims.Count; i++) 380for (int j = 0; j < _externalClaims!.Count; j++) 525for (int i = 0; i < _instanceClaims.Count; i++) 904if (_instanceClaims.Count > 0) 951writer.Write(_instanceClaims.Count);
System\Security\Claims\ClaimsPrincipal.cs (7)
369for (int i = 0; i < _identities.Count; i++) 395for (int i = 0; i < _identities.Count; i++) 423for (int i = 0; i < _identities.Count; i++) 475for (int i = 0; i < _identities.Count; i++) 510if (_identities.Count > 0) 526writer.Write(_identities.Count); 550if (_identities.Count > 0)
System.Security.Cryptography (34)
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (3)
47for (int index = 0; index < _list.Count; index++) 73int indexOfNewItem = _list.Count; 103return _list.Count;
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (2)
122if (authSafeData.Count == 0) 128Pkcs12SafeContents[] contentsArray = new Pkcs12SafeContents[authSafeData.Count];
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
296if (serializedBags.Count == 0) 306List<Pkcs12SafeBag> bags = new List<Pkcs12SafeBag>(serializedBags.Count); 308for (int i = 0; i < serializedBags.Count; i++)
System\Security\Cryptography\AsnEncodedDataCollection.cs (2)
28int indexOfNewItem = _list.Count; 52return _list.Count;
System\Security\Cryptography\CryptoConfig.cs (1)
459if (candidates.Count == 0)
System\Security\Cryptography\X509Certificates\CertificatePolicy.cs (6)
41_policies = new CertificatePolicy[chain.Count]; 81for (int iMapping = 0; iMapping < policy.PolicyMapping.Count; iMapping++) 158for (int i = 0; i < chain.Count; i++) 163int explicitPolicyDepth = chain.Count; 167for (int i = 1; i <= chain.Count; i++) 174int dataIdx = chain.Count - i;
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
1034if (extensionAsns.Count > 0)
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (1)
384if (_revoked.Count > 0)
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.cs (1)
248for (int i = _revoked.Count - 1; i >= 0; i--)
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (1)
147OpenSslX509ChainEventSource.Log.FindChainViaAiaFinished(status, tmp?.Count ?? 0);
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (6)
311for (int i = downloadedCerts.Count - 1; i >= 0; i--) 322if (downloadedCerts.Count == 0) 947var elementStatus = new List<X509ChainStatus>(overallStatus.Count); 1037for (int i = 0; i < list.Count; i++) 1050for (int i = 0; i < list.Count; i++) 1063for (int i = 0; i < list.Count; i++)
System\Security\Cryptography\X509Certificates\X500DistinguishedName.cs (2)
112for (int i = parsedAttributes.Count - 1; i >= 0; i--) 119for (int i = 0; i < parsedAttributes.Count; i++)
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
347for (int i = _encodedComponents.Count - 1; i >= 0; i--)
System\Security\Cryptography\X509Certificates\X500NameEncoder.ManagedDecode.cs (1)
62int entryCount = rdnReaders.Count;
System\Security\Cryptography\X509Certificates\X509ExtensionCollection.cs (3)
24get { return _list.Count; } 43if (index >= _list.Count) 69return _list.Count - 1;
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseMessage.cs (1)
346if (signatures.Count < 1)
System.Security.Cryptography.Pkcs (11)
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (3)
47for (int index = 0; index < _list.Count; index++) 73int indexOfNewItem = _list.Count; 103return _list.Count;
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (2)
122if (authSafeData.Count == 0) 128Pkcs12SafeContents[] contentsArray = new Pkcs12SafeContents[authSafeData.Count];
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
296if (serializedBags.Count == 0) 306List<Pkcs12SafeBag> bags = new List<Pkcs12SafeBag>(serializedBags.Count); 308for (int i = 0; i < serializedBags.Count; i++)
System\Security\Cryptography\Pkcs\CmsRecipientCollection.cs (3)
41if (index < 0 || index >= _recipients.Count) 52return _recipients.Count; 60int indexOfNewItem = _recipients.Count;
System.ServiceModel.NetFramingBase (15)
System\ServiceModel\Channels\ConnectionPool.cs (10)
107for (int i = 0; i < endpointKeysToRemove.Count; i++) 134if (itemsToClose != null && itemsToClose.Count > 0) 138for (int i = 0; i < itemsToClose.Count; i++) 267if (_busyConnections.Count > 0) 332var closeTasks = new List<Task>(itemsToClose.Count); 333for (int i = 0; i < itemsToClose.Count; i++) 358for (int i = 0; i < idleItemsToClose.Count; i++) 363for (int i = 0; i < _busyConnections.Count; i++) 461for (int i = 0; i < itemsToClose.Count; i++) 471WcfEventSource.Instance.ConnectionPoolMiss(Key != null ? Key.ToString() : string.Empty, _busyConnections.Count);
System\ServiceModel\Channels\ConnectionPoolRegistry.cs (3)
35for (int i = 0; i < registryEntry.Count; i++) 85for (int i = 0; i < registryEntry.Count; i++) 94if (registryEntry.Count == 0)
System\ServiceModel\Channels\IdlingCommunicationPool.cs (1)
220for (int i = 0; i < itemsToClose.Count; i++)
System\ServiceModel\Security\SecurityUtilsEx.cs (1)
144for (int i = 0; i < identities.Count; ++i)
System.ServiceModel.Primitives.Tests (3)
ServiceModel\MessageContractTest.4.4.0.cs (3)
308for (int i = 0; i < headerValues.Count; ++i) 314Assert.True(values.Length == headerValues.Count, 315String.Format("Expected header '{0}' to have {1} values, actual = {2}", name, values.Length, headerValues.Count));
System.ServiceModel.Syndication (1)
System\ServiceModel\XmlBuffer.cs (1)
55public int SectionCount => _sections.Count;
System.Text.Json (33)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (5)
118for (int i = 0; i < nodes.Count; i++) 131var adjacencyRow = new bool[Math.Max(nodes.Count, count)]; 139index = nodes.Count; 161var sortedNodes = new T[nodes.Count]; 170for (int i = 0; i < adjacency.Count; i++)
System\Text\Json\Nodes\JsonArray.cs (10)
87_list = new List<JsonNode?>(list.Count) 90for (int i = 0; i < list.Count; i++) 111if (currentList.Count != otherList.Count) 116for (int i = 0; i < currentList.Count; i++) 153for (int i = 0; i < list.Count; i++) 174for (int i = 0; i < list.Count; i++) 361DebugViewItem[] properties = new DebugViewItem[_node.List.Count]; 363for (int i = 0; i < _node.List.Count; i++) 399return $"JsonArray[{jsonArray.List.Count}]";
System\Text\Json\Nodes\JsonArray.IList.cs (3)
14public int Count => List.Count; 42for (int i = 0; i < list.Count; i++) 168if (list.Count - index < count)
System\Text\Json\Schema\JsonSchemaExporter.cs (5)
103List<JsonSchema>? anyOf = new(derivedTypes.Count); 126state.PushSchemaNode(anyOf.Count.ToString(CultureInfo.InvariantCulture)); 139if (anyOf.Count == 0) 403public int CurrentDepth => _currentPath.Count; 420_currentPath.RemoveAt(_currentPath.Count - 1);
System\Text\Json\Serialization\ConfigurationList.cs (1)
46public int Count => _list.Count;
System\Text\Json\Serialization\Converters\Collection\ListOfTConverter.cs (2)
47for (; index < list.Count; index++) 54for (; index < list.Count; index++)
System\Text\Json\Serialization\Converters\FSharp\FSharpMapConverter.cs (1)
47int totalItemsAdded = listToConvert.Count;
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
648Debug.Assert(conflictingFields.Count > 0);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (1)
214if (state.CompletedAsyncDisposables?.Count > 0)
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverChain.cs (1)
66if (_list.Count > 0)
System\Text\Json\Serialization\Metadata\PropertyRefCacheBuilder.cs (2)
22public int Count => _propertyRefs.Count; 23public int TotalCount => OriginalCache.Length + _propertyRefs.Count;
System\Text\Json\Serialization\WriteStack.cs (1)
283Debug.Assert(CompletedAsyncDisposables?.Count > 0);
System.Text.Json.SourceGeneration (9)
JsonSourceGenerator.Parser.cs (4)
116Debug.Assert(rootSerializableTypes.Count > 0); 203Debug.Assert(typeDeclarations?.Count > 0); 1011AddPropertyWithConflictResolution(propertySpec, memberInfo, propertyIndex: properties.Count, ref state); 1056if (state.AddedProperties.TryAdd(propertySpec.EffectiveJsonPropertyName, (propertySpec, memberInfo, state.Properties.Count)))
src\libraries\System.Text.Json\Common\JsonHelpers.cs (5)
118for (int i = 0; i < nodes.Count; i++) 131var adjacencyRow = new bool[Math.Max(nodes.Count, count)]; 139index = nodes.Count; 161var sortedNodes = new T[nodes.Count]; 170for (int i = 0; i < adjacency.Count; i++)
System.Text.RegularExpressions (118)
System\Text\RegularExpressions\MatchCollection.cs (3)
50return _matches.Count; 79if (_matches.Count > i) 102} while (_matches.Count <= i);
System\Text\RegularExpressions\Regex.Cache.cs (12)
90else if (value < s_cacheList.Count) 98for (int i = value; i < s_cacheList.Count; i++) 102s_cacheList.RemoveRange(value, s_cacheList.Count - value); 104Debug.Assert(s_cacheList.Count == value); 199Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 212if (s_cacheList.Count == s_maxCacheSize) 221itemsToExamine = s_cacheList.Count; 236int minListIndex = useRandom ? s_random.Next(s_cacheList.Count) : 0; 242int nextIndex = useRandom ? s_random.Next(s_cacheList.Count) : i; 256s_cacheList.RemoveAt(s_cacheList.Count - 1); 271Debug.Assert(s_cacheList.Count <= s_maxCacheSize); 272Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count);
System\Text\RegularExpressions\Regex.Split.cs (3)
110if (state.results.Count == 0) 138if (state.results.Count == 0) 144state.results.Reverse(0, state.results.Count);
System\Text\RegularExpressions\RegexCharClass.cs (10)
373int ccRangeCount = cc._rangelist?.Count ?? 0; 480int count = rangeList.Count; 1664for (int i = 0; i < rangelist.Count; i++) 1701if (rangelist.Count > 1) 1713if (i == rangelist.Count || last == LastChar) 1746rangelist.RemoveRange(j, rangelist.Count - j); 1756if (rangelist.Count == 2) 1769else if (rangelist.Count == 1) 1797rangelist.Count == 1 && rangelist[0].First == 0 && rangelist[0].Last == LastChar) 1813rangelist.Count == 2 && rangelist[0].First == 0 && rangelist[0].Last + 2 == rangelist[1].First && rangelist[1].Last == LastChar)
System\Text\RegularExpressions\RegexCompiler.cs (4)
844Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 849int setsToUse = Math.Min(sets.Count, MaxSets); 1175Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 6193int index = list.Count;
System\Text\RegularExpressions\RegexFindOptimizations.cs (11)
202Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 239fixedDistanceSets.Count == 1 && 251if (fixedDistanceSets.Count > MaxSetsToUse) 253fixedDistanceSets.RemoveRange(MaxSetsToUse, fixedDistanceSets.Count - MaxSetsToUse); 258FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].Distance == 0) ? 261_asciiLookups = new uint[fixedDistanceSets.Count][]; 344if (fixedDistanceSets.Count >= 2) 354for (int i = 0; i < fixedDistanceSets.Count + 1; i++) 356char[]? chars = i < fixedDistanceSets.Count ? fixedDistanceSets[i].Chars : null; 767for (int i = 1; i < sets.Count; i++) 795for (int i = 1; i < sets.Count; i++)
System\Text\RegularExpressions\RegexNode.cs (27)
647Debug.Assert(branches is not null && branches.Count != 0); 661for (int i = 1; i < branches.Count - 1; i++) 665branches.RemoveRange(i + 1, branches.Count - (i + 1)); 684for (int start = 0; start < branches.Count; start++) 695while (endExclusive < branches.Count && branches[endExclusive].FindBranchOneOrMultiStart() is not null) 970for (i = 0, j = 0; i < children.Count; i++, j++) 983for (int k = 0; k < atChildren.Count; k++) 1078Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1096for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1098Debug.Assert(children[startingIndex].Children is List<RegexNode> { Count: >= 2 }); 1122for (; endingIndex < children.Count; endingIndex++) 1182while (i < children.Count) 1204children.RemoveRange(j, children.Count - j); 1220Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1235for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1255for (; endingIndex < children.Count; endingIndex++) 1554for (i = 0, j = 0; i < children.Count; i++, j++) 1568for (int k = 0; k < atChildren.Count; k++) 1635while (next < children.Count) 1789if (nextSave < children.Count) 1791children.RemoveRange(nextSave, children.Count - nextSave); 2225if (currentIndex + 1 == peers.Count) 2781return children.Count; 2861sb.Append(new string(' ', stack.Count * 2)).Append(curNode.Describe()).AppendLine(); 2865if (stack.Count == 0) 2870curChild = stack[stack.Count - 1]; 2871stack.RemoveAt(stack.Count - 1);
System\Text\RegularExpressions\RegexParser.cs (2)
1827for (int i = 0; i < _capnamelist!.Count; i++) 1889next = (k == oldcapnamelist.Count) ? -1 : (int)_capnames[oldcapnamelist[k]]!;
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (21)
38if (results.Count > MaxPrefixes || !results.TrueForAll(sb => sb.Length >= MinPrefixLength)) 44string[] resultStrings = new string[results.Count]; 45for (int i = 0; i < results.Count; i++) 66results.Count > MaxPrefixes) 169int existingCount = results.Count; 261if ((allBranchResults?.Count ?? 0) + alternateBranchResults.Count > MaxPrefixes) 266Debug.Assert(alternateBranchResults.Count > 0); 299if (results.Count == 1 && results[0].Length == 0) 307int existingCount = results.Count; 308for (int i = 1; i < allBranchResults!.Count; i++) 528for (int i = 0; i < results.Count; i++) 540if (results.Count == 0) 554for (int i = 0; i < results.Count; i++) 601if (results.Count < MaxFixedResults) 614for (; i < minIterations && results.Count < MaxFixedResults; i++) 625for (; i < s.Length && results.Count < MaxFixedResults; i++) 634if (results.Count < MaxFixedResults) 645for (; i < minIterations && results.Count < MaxFixedResults; i++) 723if (localResults.Count == 0) 759if (results.Count >= MaxFixedResults)
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (1)
459BDD result = conditions.Count == 0 ?
System\Text\RegularExpressions\Symbolic\SparseIntMap.cs (5)
22public int Count => _dense.Count; 38if (idx < dense.Count) 49sparse[key] = index = _dense.Count; 68Debug.Assert(0 <= index && index < _dense.Count); 82_sparse[key] = index = _dense.Count;
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (3)
164for (int i = 0; i < nodes.Count; i++) 179for (int i = nodes.Count - 1; i >= 0; --i) 347SymbolicRegexNode<TNewSet>[] reverseTransformed = new SymbolicRegexNode<TNewSet>[concatElements.Count];
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (1)
115if (possibleEndings.Count > 0)
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (13)
541int firstRightElem = elems.Count; 548for (int i = 0; i < elems.Count; i++) 566for (int i = elems.Count - 1; i >= 0; i--) 1393for (int i = 0; i < elems.Count; i++) 1441alternativesAndEffects.Add((this, currentEffects.Count > 0 ? 1453int oldEffectCount = currentEffects.Count; 1458currentEffects.RemoveRange(oldEffectCount, currentEffects.Count - oldEffectCount); 1467int oldAlternativesCount = alternativesAndEffects.Count; 1469for (int i = oldAlternativesCount; i < alternativesAndEffects.Count; i++) 1490alternativesAndEffects.Add((builder.Epsilon, currentEffects.Count > 0 ? 1497alternativesAndEffects.Add((builder.Epsilon, currentEffects.Count > 0 ? 1505int oldAlternativesCount = alternativesAndEffects.Count; 1507for (int i = oldAlternativesCount; i < alternativesAndEffects.Count; i++)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (2)
121for (int i = 0; i < ranges.Count; i++) 134public int Count => ranges.Count;
System.Text.RegularExpressions.Generator (78)
RegexGenerator.Emitter.cs (9)
577int uncheckedStart = lines.Count; 578lines.Add(excludedAsciiChars.Count == 128 ? $" int i = span.IndexOfAnyExceptInRange('\\0', '\\u007f');" : // no ASCII is in the set 579excludedAsciiChars.Count == 0 ? $" int i = 0;" : // all ASCII is in the set 583if (excludedAsciiChars.Count is not (0 or 128)) 613for (int i = uncheckedStart + 2; i < lines.Count - 1; i++) 617lines.Insert(lines.Count - 1, " }"); 1138Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1143int setsToUse = Math.Min(sets.Count, MaxSets); 1326Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 });
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (10)
373int ccRangeCount = cc._rangelist?.Count ?? 0; 480int count = rangeList.Count; 1664for (int i = 0; i < rangelist.Count; i++) 1701if (rangelist.Count > 1) 1713if (i == rangelist.Count || last == LastChar) 1746rangelist.RemoveRange(j, rangelist.Count - j); 1756if (rangelist.Count == 2) 1769else if (rangelist.Count == 1) 1797rangelist.Count == 1 && rangelist[0].First == 0 && rangelist[0].Last == LastChar) 1813rangelist.Count == 2 && rangelist[0].First == 0 && rangelist[0].Last + 2 == rangelist[1].First && rangelist[1].Last == LastChar)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (9)
202Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 239fixedDistanceSets.Count == 1 && 251if (fixedDistanceSets.Count > MaxSetsToUse) 253fixedDistanceSets.RemoveRange(MaxSetsToUse, fixedDistanceSets.Count - MaxSetsToUse); 258FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].Distance == 0) ? 261_asciiLookups = new uint[fixedDistanceSets.Count][]; 344if (fixedDistanceSets.Count >= 2) 354for (int i = 0; i < fixedDistanceSets.Count + 1; i++) 356char[]? chars = i < fixedDistanceSets.Count ? fixedDistanceSets[i].Chars : null;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (27)
647Debug.Assert(branches is not null && branches.Count != 0); 661for (int i = 1; i < branches.Count - 1; i++) 665branches.RemoveRange(i + 1, branches.Count - (i + 1)); 684for (int start = 0; start < branches.Count; start++) 695while (endExclusive < branches.Count && branches[endExclusive].FindBranchOneOrMultiStart() is not null) 970for (i = 0, j = 0; i < children.Count; i++, j++) 983for (int k = 0; k < atChildren.Count; k++) 1078Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1096for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1098Debug.Assert(children[startingIndex].Children is List<RegexNode> { Count: >= 2 }); 1122for (; endingIndex < children.Count; endingIndex++) 1182while (i < children.Count) 1204children.RemoveRange(j, children.Count - j); 1220Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1235for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1255for (; endingIndex < children.Count; endingIndex++) 1554for (i = 0, j = 0; i < children.Count; i++, j++) 1568for (int k = 0; k < atChildren.Count; k++) 1635while (next < children.Count) 1789if (nextSave < children.Count) 1791children.RemoveRange(nextSave, children.Count - nextSave); 2225if (currentIndex + 1 == peers.Count) 2781return children.Count; 2861sb.Append(new string(' ', stack.Count * 2)).Append(curNode.Describe()).AppendLine(); 2865if (stack.Count == 0) 2870curChild = stack[stack.Count - 1]; 2871stack.RemoveAt(stack.Count - 1);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (2)
1827for (int i = 0; i < _capnamelist!.Count; i++) 1889next = (k == oldcapnamelist.Count) ? -1 : (int)_capnames[oldcapnamelist[k]]!;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (21)
38if (results.Count > MaxPrefixes || !results.TrueForAll(sb => sb.Length >= MinPrefixLength)) 44string[] resultStrings = new string[results.Count]; 45for (int i = 0; i < results.Count; i++) 66results.Count > MaxPrefixes) 169int existingCount = results.Count; 261if ((allBranchResults?.Count ?? 0) + alternateBranchResults.Count > MaxPrefixes) 266Debug.Assert(alternateBranchResults.Count > 0); 299if (results.Count == 1 && results[0].Length == 0) 307int existingCount = results.Count; 308for (int i = 1; i < allBranchResults!.Count; i++) 528for (int i = 0; i < results.Count; i++) 540if (results.Count == 0) 554for (int i = 0; i < results.Count; i++) 601if (results.Count < MaxFixedResults) 614for (; i < minIterations && results.Count < MaxFixedResults; i++) 625for (; i < s.Length && results.Count < MaxFixedResults; i++) 634if (results.Count < MaxFixedResults) 645for (; i < minIterations && results.Count < MaxFixedResults; i++) 723if (localResults.Count == 0) 759if (results.Count >= MaxFixedResults)
System.Threading.Tasks.Dataflow (22)
Base\DataflowBlock.cs (1)
2440if (_tempSendAsyncTaskList != null && _tempSendAsyncTaskList.Count > 0)
Blocks\BatchBlock.cs (11)
801while (reserved.Count < _batchSize) 816Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch."); 819if (reserved.Count > 0) 849if (shouldProceedToConsume && (allowFewerThanBatchSize || reserved.Count == _batchSize)) 915while (reserved.Count < itemCountNeededToCompleteBatch) 928Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch."); 931if (reserved.Count > 0) 985for (int i = 0; i < reserved.Count; i++) 1013if (_boundingState != null) _boundingState.CurrentCount += reserved.Count; 1037for (int i = 0; i < reserved.Count; i++) 1089for (int i = 0; i < reserved.Count; i++)
Blocks\BatchedJoinBlock.cs (2)
550internal int Count { get { return _messages.Count; } } 628$"{Common.GetNameForDebugger(this)} InputCount = {_messages.Count}";
Blocks\TransformManyBlock.cs (1)
407itemCount = itemCopy.Count;
Blocks\TransformManyBlock.IAsyncEnumerable.cs (1)
161itemCount = itemCopy.Count;
Internal\QueuedMap.cs (4)
78Debug.Assert(0 <= _freeIndex && _freeIndex < _storage.Count, "Index is out of range."); 86newIndex = _storage.Count; 122Debug.Assert(0 <= _headIndex && _headIndex < _storage.Count, "Head is out of range."); 140Debug.Assert(0 <= index && index < _storage.Count, "Index is out of range.");
Internal\SourceCore.cs (2)
340countReceived = tmpList.Count; 420for (int i = 0; i < itemsAsList.Count; i++)
System.Windows.Controls.Ribbon (35)
Microsoft\Windows\Automation\Peers\RibbonAutomationPeer.cs (2)
182if (ribbonTabs != null && ribbonTabs.Count > 0) 188for (int i=0; i<ribbonTabs.Count; i++)
Microsoft\Windows\Automation\Peers\RibbonGalleryAutomationPeer.cs (1)
182if (selectedProviders.Count != 0)
Microsoft\Windows\Controls\KeyTipService.cs (9)
845if (_currentActiveKeyTipElements.Count > 0) 992activeKeyTipElements.Count == 0) 999int currentActiveCount = _currentActiveKeyTipElements.Count; 1000int newActiveCount = activeKeyTipElements.Count; 1507current._cachedKeyTipControls.Count > 0) 1510int count = current._cachedKeyTipControls.Count; 1626for (int i = 0; i < handlerList.Count; i++) 1647for (int i = 0; i < handlerList.Count; i++) 1672for (int i = 0; i < handlerList.Count; i++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupItemsPanel.cs (5)
60double starLayoutCombinationCount = _starLayoutCombinations.Count; 169if (starChildIndices.Count > 0) 180int starLayoutIndex = _starLayoutCombinations.Count - 1; 271int starLayoutCombinationCount = _starLayoutCombinations.Count; 343if (columnStarChildren != null && columnStarChildren.Count > 0 && starLayoutIndex >= 0)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupsPanel.cs (3)
438int elementCount = starInfoList.Count; 474Debug.Assert(index >= 0 && index < starInfoList.Count); 501Debug.Assert(distributionCount > 0 && distributionCount <= starInfoList.Count);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonMenuItemsPanel.cs (2)
176if (InvalidateRegisteredLayoutProvidersList.Count > 0) 178for (int i = 0; i < InvalidateRegisteredLayoutProvidersList.Count; i++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (4)
180for (int i = 0; i < generatedItems.Count; i++) 305Debug.Assert(GeneratedChildren.Count > InternalChildren.Count); 306int numItemsExpectedInOverflowPanel = GeneratedChildren.Count - InternalChildren.Count; 324for (int k = InternalChildren.Count; k < GeneratedChildren.Count; k++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (2)
506int sizeCount = elementSizes.Count; 561int sizeCount = desiredPaddings.Count;
Microsoft\Windows\Controls\TextSearchInternal.cs (7)
118if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 259if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 323if (_charsEntered.Count > 0) 325string lastChar = _charsEntered[_charsEntered.Count - 1]; 328_charsEntered.RemoveAt(_charsEntered.Count - 1);
System.Windows.Forms (266)
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (1)
594if (oleControls.Count > 0)
System\Windows\Forms\ActiveX\AxHost.AxPropertyDescriptor.cs (1)
252if (_updateAttributes.Count == 0)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
619_accelCount = (short)mnemonicList.Count;
System\Windows\Forms\Application.ThreadContext.cs (8)
134if (_parkingWindows.Count == 0) 143Debug.Assert(_parkingWindows.Count == 1, "parkingWindows count can not be > 1 for legacy OS/target framework versions"); 211if (_messageFilters.Count > 0 && filter is IMessageModifyAndFilter) 345if (_parkingWindows.Count != 0) 358for (int i = 0; i < _parkingWindows.Count; i++) 850if (_messageFilters.Count > 0) 862if (_messageFilterSnapshot is not null && _messageFilterSnapshot.Count != 0) 865int count = _messageFilterSnapshot.Count;
System\Windows\Forms\AutoCompleteStringCollection.cs (3)
42public int Count => _data.Count; 92if (nonNullItems.Count <= 0) 137ArgumentOutOfRangeException.ThrowIfGreaterThan(index, _data.Count);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (5)
169if (attributes.Count != baseCount) 171_baseAttributes = new Attribute[attributes.Count]; 239if (attributeList.Count > 0) 244for (int i = 0; i < attributeList.Count; i++) 261Attribute[] temp = new Attribute[newAttributes.Count];
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (7)
122if (handles.Count > 0) 124ITypeInfo*[] typeInfos = new ITypeInfo*[handles.Count]; 125for (int i = 0; i < handles.Count; i++) 277Com2PropertyDescriptor[] temp2 = new Com2PropertyDescriptor[propList.Count]; 779if (strings.Count > 0) 789if (vars.Count > 0 && vars[0] is { } var) 795for (int i = 0; i < strings.Count; i++)
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.cs (1)
255return attributes.Count == 0 ? new(s_staticAttributes) : new(attributes.ToArray());
System\Windows\Forms\Control.cs (6)
5459holders.Add(new ControlTabOrderHolder(holders.Count, tabIndex, ctl)); 5464int[] indexes = new int[holders.Count]; 5465for (int i = 0; i < holders.Count; i++) 5487holders.Add(new ControlTabOrderHolder(holders.Count, c.TabIndex, c)); 5493Control[] controls = new Control[holders.Count]; 5494for (int i = 0; i < holders.Count; i++)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxAccessibleObject.cs (1)
134Debug.Assert(index < entries.Count);
System\Windows\Forms\Controls\ComboBox\ComboBox.ObjectCollection.cs (3)
61public int Count => InnerList.Count; 268int count = InnerList.Count; 283int count = InnerList.Count;
System\Windows\Forms\Controls\ComboBox\ComboBox.ObjectCollection.EntryEnumerator.cs (3)
35if (_current < _entries.Count - 1) 42_current = _entries.Count; 62if (_current == -1 || _current == _entries.Count)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (20)
954for (columnEntry = 0; columnEntry < autoFillColumns!.Count; columnEntry++) 969for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 993for (columnEntry = 0; columnEntry < autoFillColumns!.Count; columnEntry++) 996if (columnEntry == autoFillColumns.Count - 1) 1021for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1033for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1046for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1064for (columnEntry = 0; columnEntry < autoFillColumns!.Count; columnEntry++) 1070float[] floatDesiredWidths = new float[autoFillColumns.Count]; 1075for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1085for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1104for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1115for (columnEntry = 0; columnEntry < autoFillColumns!.Count; columnEntry++) 1134for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1171for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1191for (columnEntry = 0; columnEntry < autoFillColumns!.Count; columnEntry++) 1206while (autoFillColumns!.Count > 0) 1209if (autoFillColumns.Count == 1) 1218for (columnEntry = 0; columnEntry < autoFillColumns.Count; columnEntry++) 1596for (int j = 0; j < boundColumns.Count; j++)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (2)
46int ICollection.Count => _items.Count; 311int itemsCount = _items.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (25)
53int ICollection.Count => _items.Count; 92int itemCount = _items.Count; 209while (initialColumns.Count > 0) 213for (index = 0; index < initialColumns.Count; index++) 293DataGridViewColumn[] aColumns = new DataGridViewColumn[_items.Count]; 337int itemCount = _items.Count; 365if (displayIndex < 0 || displayIndex >= _items.Count) 377for (int columnIndex = 0; columnIndex < _items.Count; columnIndex++) 439for (int columnIndex = 0; columnIndex < _items.Count; columnIndex++) 460for (int columnIndex = 0; columnIndex < _items.Count; columnIndex++) 516while (index < _itemsSorted.Count) 536for (int columnIndex = 0; columnIndex < _items.Count; columnIndex++) 576for (int columnIndex = 0; columnIndex < _items.Count; columnIndex++) 613while (index < _itemsSorted.Count) 657while (index < _itemsSorted.Count) 696int index = _itemsSorted.Count - 1; 744for (index = 0; index < _items.Count; index++) 769while (index < _itemsSorted.Count) 817for (index = 0; index < _items.Count; index++) 996int itemsCount = _items.Count; 1016int itemsCount = _items.Count; 1143for (int columnDisplayIndex = 0; columnDisplayIndex < _items.Count; columnDisplayIndex++) 1161if (_itemsSorted.Count != _items.Count) 1167while (index < _itemsSorted.Count - 1)
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.ObjectCollection.cs (6)
32public int Count => InnerArray.Count; 155ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, InnerArray.Count); 164ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, InnerArray.Count); 176if (InnerArray.Count > 0) 222ArgumentOutOfRangeException.ThrowIfGreaterThan(index, InnerArray.Count); 259ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, InnerArray.Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (42)
89public int Count => _items.Count; 253int index = SharedList.Count - 1; 439int index = SharedList.Count - 1; 442Debug.Assert(_rowStates.Count == SharedList.Count); 508index = SharedList.Count - 1; 584int index, indexStart = _items.Count; 595index = SharedList.Count - 1; 628index = SharedList.Count - 1; 708return SharedList.Count - 1; 741int indexStart = _items.Count; 765int index = SharedList.Count - 1; 778Debug.Assert(_rowStates.Count == SharedList.Count); 811int rowCount = _items.Count; 833_items.Count == 0) // accessing AllowUserToAddRowsInternal can trigger a nested call to ClearInternal. Rows count needs to be checked again. 914while (index < _items.Count && !((GetRowState(index) & includeFilter) == includeFilter)) 919return (index < _items.Count) ? index : -1; 970while (index < _items.Count && (!((GetRowState(index) & includeFilter) == includeFilter) || !((GetRowState(index) & excludeFilter) == 0))) 975return (index < _items.Count) ? index : -1; 1013int index = _items.Count - 1; 1048while (index < _items.Count && !((GetRowState(index) & includeFilter) == includeFilter)) 1053return (index < _items.Count) ? index : -1; 1080while (index < _items.Count && (!((GetRowState(index) & includeFilter) == includeFilter) || !((GetRowState(index) & excludeFilter) == 0))) 1085return (index < _items.Count) ? index : -1; 1096ArgumentOutOfRangeException.ThrowIfGreaterThan(indexStart, _items.Count); 1128ArgumentOutOfRangeException.ThrowIfGreaterThan(indexStart, _items.Count); 1177for (int rowIndex = 0; rowIndex < _items.Count; rowIndex++) 1266for (int rowIndex = 0; rowIndex < _items.Count; rowIndex++) 1309Debug.Assert(toRowIndex == _items.Count || (GetRowState(toRowIndex) & includeFilter) == includeFilter); 1329if (rowIndex < 0 || rowIndex >= _items.Count) 1543Debug.Assert(_rowStates.Count == SharedList.Count); 1654Debug.Assert(_rowStates.Count == SharedList.Count); 1683Debug.Assert(_rowStates.Count == SharedList.Count); 1736Debug.Assert(_rowStates.Count == SharedList.Count); 1817Debug.Assert(_rowStates.Count == SharedList.Count); 2371if (_items.Count > 0)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowList.cs (2)
21Debug.Assert(Count > 0); 24CustomQuickSort(0, Count - 1);
System\Windows\Forms\Controls\DataGridView\DataGridViewSelectedCellCollection.cs (1)
59int ICollection.Count => _items.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewSelectedColumnCollection.cs (1)
55int ICollection.Count => _items.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewSelectedRowCollection.cs (1)
44int ICollection.Count => _items.Count;
System\Windows\Forms\Controls\ImageList\ImageList.cs (1)
437for (int i = 0; i < _originals.Count; i++)
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (4)
40for (int i = 0; i < _imageInfoCollection.Count; i++) 229Debug.Assert((Count == _imageInfoCollection.Count), "The count of these two collections should be equal."); 247Debug.Assert((Count == _imageInfoCollection.Count), "The count of these two collections should be equal."); 553if ((_imageInfoCollection is not null) && (index >= 0 && index < _imageInfoCollection.Count))
System\Windows\Forms\Controls\Labels\LinkLabel.cs (16)
165get => _links.Count == 0 265get => _links.Count != 0 && _links[0].Visited; 273if (_links.Count == 0) 589if (_links is not null && _links.Count == 1) 653if (_links is null || _links.Count != 1 || Text is null) 842for (int i = 0; i < _links.Count; i++) 876for (int i = 0; i < _links.Count; i++) 1196for (int i = 0; i < _links.Count; i++) 1451for (int i = 0; i < _links.Count; i++) 1523return focusIndex < 0 || focusIndex >= _links.Count ? -1 : focusIndex; 1555if (directed && _links.Count > 0) 1578newFocus = GetNextLinkIndex(_links.Count, forward); 1606if (_links.Count == 1) 1646for (int i = 0; i < _links.Count; i++) 1667for (int x = 0; x < _links.Count; x++) 1675for (int y = x; y < _links.Count; y++)
System\Windows\Forms\Controls\Labels\LinkLabel.LinkCollection.cs (5)
84public int Count => _owner._links.Count; 120if (_owner._links.Count == 1 148if (_owner._links.Count == 1 302bool doLayout = _owner._links.Count > 0 && _owner.AutoSize; 357if (_owner.FocusLink is null && _owner._links.Count > 0)
System\Windows\Forms\Controls\ListView\ListView.cs (5)
476if (_savedCheckedItems.Count > 0) 540if (_savedCheckedItems.Count > 0) 2235if (newItems.Count > 0) 5617s += $", Items.Count: {_listViewItems.Count}"; 5618if (_listViewItems.Count > 0)
System\Windows\Forms\Controls\ListView\ListView.SelectedIndexCollection.cs (1)
38return _owner._savedSelectedItems.Count;
System\Windows\Forms\Controls\ListView\ListView.SelectedListViewItemCollection.cs (3)
63ListViewItem[] cloned = new ListViewItem[_owner._savedSelectedItems.Count]; 64for (int i = 0; i < _owner._savedSelectedItems.Count; i++) 100return _owner._savedSelectedItems.Count;
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (4)
24public int Count => List.Count; 63for (int i = 0; i < _list.Count; i++) 84for (int i = 0; i < _list.Count; i++) 127_listView.InsertGroupInListView(List.Count, group);
System\Windows\Forms\Controls\ListView\ListViewGroupItemCollection.cs (1)
18public int Count => Items.Count;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (1)
239_owner._subItems.EnsureCapacity(_owner._subItems.Count + additionalCapacity);
System\Windows\Forms\Controls\Menus\MenuStrip.cs (1)
252if (m.Msg == (int)PInvokeCore.WM_MOUSEACTIVATE && (ActiveDropDowns.Count == 0))
System\Windows\Forms\Controls\Menus\MenuTimer.cs (1)
147if (toolStrip.IsDropDown && toolStrip.ActiveDropDowns.Count > 0)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (6)
1529int length = _annualBoldDates.Count; 1561for (int i = 0; i < _boldDates.Count; i++) 1580int length = _monthlyBoldDates.Count; 1899=> _annualBoldDates.Count > 0; 1902=> _boldDates.Count > 0; 1917=> _monthlyBoldDates.Count > 0;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (23)
1036if (showEvents && _tabs.Count > EventsTabIndex 1098if (selectedTab < _tabs.Count && (selectedTab == PropertiesTabIndex || _tabs[selectedTab].Button.Visible)) 1462for (int i = 0; i < _tabs.Count; i++) 1491tabIndex = _tabs.Count; 1505for (int i = 1; i < _tabs.Count; i++) 2167for (int i = 1; i < components.Length && tabClasses.Count > 0; i++) 2176for (int j = tabClasses.Count - 1; j >= 0; j--) 3467for (int i = 0; i < _tabs.Count; i++) 3530if (_tabs.Count == 0) 3547Debug.Assert(_tabs.Count > 0, "We don't have any tabs left!"); 3562Debug.Assert(_tabs.Count > 0, "Tab array destroyed!"); 3565ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(tabIndex, _tabs.Count); 3599for (int i = 0; i < _tabs.Count; i++) 3700Debug.Assert(_tabs.Count > 0, "No view tab buttons to select!"); 3772if (state >= (_tabs.Count * _viewSortButtons.Length)) 3778state = (_tabs.Count * _viewSortButtons.Length) - 1; 3905int count = buttonList.Count; 3925if (_tabs.Count > 1) 3979for (int j = 0; j < buttonList.Count; j++) 3996if (_tabs.Count > EventsTabIndex && _tabs[EventsTabIndex] is { } info && info.Tab is EventsTab) 4120if (_tabs.Count <= 1) 4128for (int i = 1; i < _tabs.Count; i++) 4143if (!GetFlag(Flags.PropertiesChanged) || _tabs.Count == 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyTabCollection.cs (3)
33return _ownerPropertyGrid._tabs.Count; 98if (_ownerPropertyGrid._tabs.Count > 0) 105_ownerPropertyGrid._tabs.Count);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiSelectRootGridEntry.PropertyMerger.cs (5)
33var entries = new MultiPropertyDescriptorGridEntry[commonProperties.Count]; 56var firstPropertyDescriptors = new PropertyDescriptor[firstProperties.Count]; 57for (int i = 0; i < firstProperties.Count; i++) 64var entries = new MultiPropertyDescriptorGridEntry[properties.Count]; 276int length = sortedMergedEntries.Count;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (1)
269if (gridEntries.Count > 0)
System\Windows\Forms\Controls\TabControl\TabControl.cs (5)
733if (index == -1 || _tabPages.Count == 0) 806public int TabCount => _tabPages?.Count ?? 0; 1045for (int i = 0; i < _tabPages.Count; i++) 1074if (_tabPages.Count > 0) 1611if (index < _tabPages.Count)
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
683if (_associatedToolTips.Count == 1)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (3)
1069if (ActiveDropDowns.Count == 0) 1940int count = ActiveDropDowns.Count; 1952for (int i = 0; i < dropDowns.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (4)
233if (_inputFilterQueue is not null && _inputFilterQueue.Count > 0) 323int countDropDowns = _inputFilterQueue?.Count ?? 0; 370int countDropDowns = _inputFilterQueue?.Count ?? 0; 461if (!InMenuMode && _inputFilterQueue.Count > 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.cs (2)
288if (index >= array.Length || InnerList.Count > array.Length - index) 293for (int i = 0; i < InnerList.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (1)
92if (toolStripSettingsToApply.Count == 0)
System\Windows\Forms\Controls\UpDown\NumericUpDownAccelerationCollection.cs (2)
29while (index < _items.Count) 71get { return _items.Count; }
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (2)
53if (list.Count > 0) 55object[] temp = new object[list.Count];
System\Windows\Forms\DataBinding\BindingsCollection.cs (1)
23public override int Count => _list.Count;
System\Windows\Forms\Design\EventsTab.cs (1)
163var mergedEvents = new PropertyDescriptor[componentEventProperties.Count + matchingPropertyEvents.Count];
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.ControlItemAccessibleObject.cs (1)
38private int ControlItemsCount => _window?.ControlItems.Count ?? 0;
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (7)
192for (int i = 0; i < _items.Count; i++) 216for (int i = 0; i < _items.Count; i++) 232for (int i = 0; i < _items.Count; i++) 241for (int j = 0; j < _items.Count; j++) 266if (_items.Count == 0) 309for (int i = 0; i < _items.Count; i++) 318for (int i = 0; i < _items.Count; i++)
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.ErrorWindowAccessibleObject.cs (1)
56public override int GetChildCount() => _owner.ControlItems.Count;
System\Windows\Forms\Form.cs (5)
3569for (int i = ownedForms.Count - 1; i >= 0; i--) 4868for (int i = ownedForms.Count - 1; i >= 0; i--) 4896for (int i = ownedForms.Count - 1; i >= 0; i--) 6723for (int i = ownedForms.Count - 1; i >= 0; i--) 6792for (int i = ownedForms.Count - 1; i >= 0; i--)
System\Windows\Forms\Internal\ItemArray.cs (1)
106public int Count => _entries.Count;
System\Windows\Forms\Layout\ArrangedElementCollection.cs (1)
144public virtual int Count => InnerList.Count;
System\Windows\Forms\Layout\TableLayout.cs (2)
1470for (int i = 0; i < layoutInfos.Count; i++) 1476for (int j = i + 1; j < layoutInfos.Count; j++)
System\Windows\Forms\Layout\TableLayout.ReservationGrid.cs (3)
18if (rowOffset >= _rows.Count) 34while (rowOffset >= _rows.Count) 67if (_rows.Count > 0)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutStyleCollection.cs (1)
131public int Count => _innerList.Count;
System\Windows\Forms\Screen.cs (1)
115s_screens = screens.Count > 0 ? [.. screens] : [new(s_primaryMonitor)];
System.Windows.Forms.Design (145)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
273if (_originalItems is not null && _originalItems.Count > 0)
System\ComponentModel\Design\DesignerActionPanel.cs (10)
376for (int i = 0; i < _lines.Count; i++) 495while ((index < (_lineYPositions.Count - 1)) && (_lineYPositions[index + 1] <= originalClip.Top)) 501for (int i = index; i < _lineYPositions.Count; i++) 781for (int i = 0; i < _lines.Count; i++) 790for (int i = 0; i < _lines.Count; i++) 832for (int i = 0; i < categoryList.Count; i++) 855for (int i = 0; i < newLines.Count; i++) 860if (i < _lines.Count) 891for (int i = _lines.Count - 1; i >= newLines.Count; i--)
System\ComponentModel\Design\DesignerActionService.cs (1)
211if (verbsArray.Count != 0)
System\ComponentModel\Design\DesignerHost.cs (2)
797if (exceptions.Count > 0) 1136List<IComponent> selectedComponents = new(_savedSelection.Count);
System\ComponentModel\Design\MenuCommandService.cs (9)
255verbCount += _globalVerbs.Count; 265for (int i = 0; i < _globalVerbs!.Count; i++) 269buildVerbs[key] = verbsOrder.Count - 1; 273if (designerActionVerbs.Count > 0) 275for (int i = 0; i < designerActionVerbs.Count; i++) 279buildVerbs[designerActionVerb.Text] = verbsOrder.Count - 1; 289buildVerbs[localVerb.Text] = verbsOrder.Count - 1; 296for (int i = 0; i < verbsOrder.Count; i++) 494if (commands.Count == 0)
System\ComponentModel\Design\ReferenceService.cs (5)
95if (_addedComponents is not null && _addedComponents.Count > 0) 107if (_removedComponents is not null && _removedComponents.Count > 0) 176int size = _references.Count; 269object[] references = new object[_references.Count]; 287List<object> results = new(_references.Count);
System\ComponentModel\Design\SelectionService.cs (8)
168internal IComponent? PrimarySelection => _selection?.Count > 0 ? _selection[0] : null; 217if (_selection.Count == 0) 221else if (_selection.Count == 1) 231for (int i = 0; i < _selection.Count; i++) 256int count = _selection.Count; 305int ISelectionService.SelectionCount => _selection?.Count ?? 0; 416IComponent[] selections = new IComponent[_selection.Count]; 467if (_selection?.Count > 0)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (1)
243if (_shimObjectNames.Count > 0)
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (1)
623if (arrayList.Count > 0)
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (1)
392if (oldEntry?.Dependencies is { Count: > 0 })
System\ComponentModel\Design\Serialization\StatementContext.cs (4)
59for (int idx = 0; idx < _table.Count; idx++) 96for (int idx = 0; idx < _table.Count; idx++) 217if (_position < 0 || _table._table is null || _position >= _table._table.Count) 238if (_table._table is not null && (_position + 1) < _table._table.Count)
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (9)
53public virtual bool IsEmpty => _events is null || _events.Count == 0; 143for (int i = startIndex + 1; i < _events!.Count; i++) 169for (int i = 0; i < _events.Count; i++) 176if (_events[i] is ChangeUndoEvent ce && ChangeEventsSymmetric(ce.ComponentChangingEventArgs, e) && i != _events.Count - 1) 214for (int idx = 0; idx < _changeEvents.Count; idx++) 288for (int idx = _events.Count - 1; idx >= 0; idx--) 303if (idx != _events.Count - 1 && changeEvt is not null) 438for (int idx = _events.Count - 1; idx >= 0; idx--) 488int count = _events.Count;
System\Windows\Forms\Design\BaseContextMenuStrip.cs (1)
111nParentControls = parentControls.Count;
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (1)
69if (s_adornerWindowList.Count == 0 && s_mouseHook is not null)
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (2)
63Debug.Assert(s_adornerWindowList.Count > 0, "No AdornerWindow available to create the mouse hook"); 66if (_mouseHookHandle != 0 || s_adornerWindowList.Count == 0)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (5)
144public Behavior? CurrentBehavior => _behaviorStack.Count > 0 ? _behaviorStack[0] : null; 339if (_behaviorStack.Count > 0) 342if ((index != -1) && (index < _behaviorStack.Count - 1)) 389if (_behaviorStack.Count == 0) 570return _behaviorStack.Count > 0 ? _behaviorStack[0] : g?.Behavior;
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (1)
237if (dragControls.Count > 0)
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (12)
275for (int i = 0; i < snapLines.Count; i++) 289for (int j = 0; j < targetSnapLines.Count; j++) 343for (int j = 0; j < tempLines.Count; j++) 411lines = new Line[tempLines.Count]; 526if (dragComponents is not null && dragComponents.Count > 0) 618_verticalDistances = new int[_verticalSnapLines.Count]; 619_horizontalDistances = new int[_horizontalSnapLines.Count]; 735_vertLines = new Line[_tempVertLines.Count]; 741_horzLines = new Line[_tempHorzLines.Count]; 904for (int i = 0; i < currentLines.Count; i++) 1104for (int i = 0; i < _targetHorizontalSnapLines.Count; i++) 1109for (int i = 0; i < _targetVerticalSnapLines.Count; i++)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (7)
94if (dragComponents is null || dragComponents.Count <= 0) 109_dragComponents = new DragComponent[dragComponents.Count]; 421for (int j = 0; j < temp.Count; j++) 512for (int i = 0; i < originalControls.Count; i++) 574for (int i = 0; i < originalControls.Count; i++) 692for (int i = 0; i < _dragObjects.Count; i++) 943for (int i = 0; i < _dragObjects.Count; i++)
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (3)
343if (components.Count == 0) 348_resizeComponents = new ResizeComponent[components.Count]; 349for (int i = 0; i < components.Count; i++)
System\Windows\Forms\Design\Behavior\SelectionManager.cs (1)
420_currentSelectionBounds = new Rectangle[selComps.Count];
System\Windows\Forms\Design\Behavior\TableLayoutPanelBehavior.cs (3)
191if (moveIndex <= -1 || moveIndex == _styles.Count) 211for (int i = startIndex + 1; ((i < _styles.Count) && (i < widths.Length)); i++) 310for (int i = 0; i < _styles.Count; i++)
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (4)
130if (controls.Count <= 0) 143for (int i = 0; i < controls.Count; i++) 195if (controls.Count == 1 && control is ToolStrip) 210controls.Count);
System\Windows\Forms\Design\CommandSet.cs (9)
1718List<ITreeDesigner> shorterList = designerChain.Count < parentDesignerChain.Count ? designerChain : parentDesignerChain; 1722if (shorterList.Count > 0 && longerList.Count > 0) 1724int shortIndex = Math.Max(0, shorterList.Count - 1); 1725int longIndex = Math.Max(0, longerList.Count - 1); 2115if (compsWithControlDesigners.Count > 0) 3235if (controls.Count == 0) 3372if (controls.Count > 1)
System\Windows\Forms\Design\ComponentTray.cs (8)
351if (_controls is null || _controls.Count <= 0) 920for (int i = 0; i < _controls.Count; i++) 926if (targetIndex >= 0 && targetIndex < _controls.Count) 937if (_controls.Count > 0) 939int targetIndex = (forward ? 0 : _controls.Count - 1); 1737if (_controls.Count > 1) 1768if (_controls.Count > 1) 1793if (_controls.Count > 1)
System\Windows\Forms\Design\ControlDesigner.cs (1)
1450if (dragControls.Count > 0)
System\Windows\Forms\Design\DataGridViewDesigner.cs (1)
685for (int i = 0; i < columnsToBeAdded.Count; i++)
System\Windows\Forms\Design\DesignerFrame.cs (2)
463for (int i = _overlayList.Count - 1; i >= 0; i--) 480for (int i = _overlayList.Count - 1; i >= 0; i--)
System\Windows\Forms\Design\DesignerUtils.cs (1)
778Debug.Assert(newObjects.Count == objects.Count, "Why is the count of the copied objects not the same?");
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (6)
338if (_dragControls.Count == 1) 349return string.Format(performCopy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, _dragControls.Count); 637for (int j = 0; j < tempList.Count; j++) 670for (int i = _dragControls.Count - 1; i >= 0; i--) 692for (int i = 0; i < originalControls.Count; i++) 795|| _commonSizes.Count == 0)
System\Windows\Forms\Design\GroupedContextMenuStrip.cs (1)
54if (Items.Count > 0 && items.Count > 0)
System\Windows\Forms\Design\ImageListDesigner.OriginalImageCollection.cs (2)
39return _items.Count; 149for (int i = 0; i < _items.Count; i++)
System\Windows\Forms\Design\MaskDesignerDialog.cs (3)
401for (int index = 0; index < _maskDescriptors.Count; index++) 424for (int selectedIndex = 0; selectedIndex < _maskDescriptors.Count; selectedIndex++) 493_maskDescriptors.RemoveAt(_maskDescriptors.Count - 1);
System\Windows\Forms\Design\NavigationalTableLayoutPanel.cs (3)
37for (int i = 0; i < radioButtons.Count; i++) 45focusIndex = i == RadioButtons.Count - 1 ? 0 : i + 1; 49focusIndex = i == 0 ? RadioButtons.Count - 1 : i - 1;
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
1261if (selectedControls is null || selectedControls.Count == 0) 1887if (selection.Count > 0)
System\Windows\Forms\Design\SelectionUIService.cs (1)
1008if (list.Count == 0)
System\Windows\Forms\Design\StyleEditorForm.cs (1)
1050if (_deleteList.Count > 0)
System\Windows\Forms\Design\TabControlDesigner.cs (1)
504for (int i = 0; i < dragControls.Count; i++)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (2)
1283(_localDragControl is not null && _dragComponents.Count > 1) || 1895if (deleteList.Count > 0)
System\Windows\Forms\Design\TabOrder.cs (2)
659_tabGlyphs = new Rectangle[_tabControls.Count]; 813if (_tabComplete.Count == _tabControls.Count)
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1883if (dragComponents.Count == 1) 1895transDesc = string.Format(copy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, dragComponents.Count);
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
307t_customToolStripItemCount = creatableTypes.Count;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (2)
658if (dragComponents.Count == 1) 670transDesc = string.Format(copy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, dragComponents.Count);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
2694if (dragComponents.Count == 1) 2706transDesc = string.Format(copy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, dragComponents.Count);
System.Windows.Forms.Design.Tests (1)
System\Windows\Forms\Design\MaskDescriptorTemplateTests.cs (1)
62descriptors.Count.Should().Be(templateCount);
System.Windows.Forms.Interop.Tests (2)
AccessibleObjectTests.cs (2)
733Assert.Equal(35, memberNames.Count); 734Assert.Equal(10, getterNames.Count);
System.Windows.Forms.Primitives (6)
System\Collections\Generic\WeakRefCollection.cs (2)
62for (int i = 0; i < _list.Count; i++) 89public int Count => _list.Count;
System\Windows\Forms\Automation\UiaTextProvider.cs (3)
83if (rectArray is null || rectArray.Count == 0) 88SafeArrayScope<double> result = new((uint)(rectArray.Count * 4)); 90for (int i = 0; i < rectArray.Count; i++)
System\Windows\Forms\NonNullCollection.cs (1)
32public int Count => _list.Count;
System.Windows.Forms.Primitives.TestUtilities (3)
DeviceContextState.cs (3)
106while (GdiObjects.Count <= index) 127index = _savedStates.Count + state; 131_savedStates.RemoveRange(index, _savedStates.Count - index);
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
337Assert.True(lines.Count > 0);
System.Windows.Forms.Tests (15)
BindingNavigatorTests.cs (1)
100for (int i = 0; i < items.Count; i++)
System\Windows\Forms\AccessibleObjects\ErrorProviderAccessibleObjectTests.cs (2)
48_controlItem1 = _errorWindow.ControlItems.Count > 0 ? _errorWindow.ControlItems[0] : null; 49_controlItem2 = _errorWindow.ControlItems.Count > 0 ? _errorWindow.ControlItems[1] : null;
System\Windows\Forms\AccessibleObjects\ListBox.ListBoxItemAccessibleObjectTests.cs (2)
34Assert.Equal(persons.Count, accessibleObject.GetChildCount()); 36for (int i = 0; i < persons.Count; i++)
System\Windows\Forms\BindingSourceTests.cs (1)
772public int Count => _innerList.Count;
System\Windows\Forms\Combobox.ObjectCollectionTests.cs (2)
417Assert.Equal(3, comboBoxObjectCollection.InnerList.Count); 439Assert.Equal(2, comboBoxObjectCollection.InnerList.Count);
System\Windows\Forms\ComboBoxTests.cs (1)
2585Assert.Equal(3, ownerDrawComboBox.MeasureItemEventArgs.Count);
System\Windows\Forms\DataGridViewComboBoxCell.ObjectCollectionTests.cs (1)
105_collection.InnerArray.Count.Should().Be(3);
System\Windows\Forms\NativeWindowTests.cs (1)
378Assert.Equal(2, window1.Messages.Count);
System\Windows\Forms\SendKeysTests.cs (1)
20Assert.Equal(4, form.KeyEvents.Count);
System\Windows\Forms\TabPageTests.cs (2)
5115Assert.Equal(2, associatedToolTips.Count); 5203Assert.Equal(2, associatedToolTips.Count);
System\Windows\Forms\TreeNodeTests.cs (1)
4619Assert.Equal(4, nodes.Count);
System.Windows.Forms.UI.IntegrationTests (3)
Infra\ScreenRecordService.cs (3)
128if (s_frames.Count == 0) 138if (s_frames.Count < 2) 602if (s_frames.Count > 0 && (s_timer.Elapsed - s_frames[^1].elapsed) < throttle)
System.Windows.Input.Manipulations (4)
System\Windows\Input\Manipulations\ManipulationSequence.cs (4)
394(addedManipulatorList == null || addedManipulatorList.Count == 0) && 419if (addedManipulatorList != null && addedManipulatorList.Count > 0) 437if ((addedManipulatorList != null && addedManipulatorList.Count > 0) || 470if (addedManipulatorList != null && addedManipulatorList.Count > 0)
System.Xaml (75)
System\Xaml\Context\NameFixupGraph.cs (5)
209if (token.NeededNames.Count == 0) 359while (markupExtensionTokens.Count > 0) 363while (i < markupExtensionTokens.Count) 374for (int j = dependencies.Count - 1; j >= 0; j--) 408for (int j = dependencies.Count - 1; j >= 0; j--)
System\Xaml\Context\ObjectWriterContext.cs (3)
175return (valueList.Count == 0) ? null : valueList[0]; 181return (valueList.Count == 0) ? null : valueList[0]; 405if (stopAfterFirst && retList.Count > 0)
System\Xaml\Context\ServiceProviderContext.cs (1)
295if (token.CanAssignDirectly && token.NeededNames.Count != 1)
System\Xaml\Context\XamlContext.cs (1)
281typeArgs = new XamlType[typeNames.Count];
System\Xaml\InfosetObjects\XamlObjectWriter.cs (7)
1239object[] argInstances = new object[rawArgs.Count]; 1240IList<XamlType> paramTypes = meType.GetPositionalParameters(rawArgs.Count); 1245string msg = string.Format(TypeConverterHelper.InvariantEnglishUS, SR.NoSuchConstructor, rawArgs.Count, meType.Name); 1252if (i >= rawArgs.Count) 1962keyToken.Target.TemporaryCollectionIndex = pendingCollection.Count; 1968valueToken.Target.TemporaryCollectionIndex = pendingCollection.Count; 2489Debug.Assert(token.NeededNames.Count == 0 || nameResolutionIsComplete);
System\Xaml\Parser\GenericTypeNameParser.cs (1)
302if (frame.TypeArgs.Count != 1)
System\Xaml\Parser\NodeStreamSorter.cs (4)
37if (_seenStack.Count == 0) 49if (_seenStack.Count <=_startObjectDepth) 560if (_moveList.Count == 0) 565for (int i = 0; i < _moveList.Count; i++)
System\Xaml\Parser\XamlPullParser.cs (2)
577for (int i = 0; i < savedPrefixDefinitions.Count; i++) 763for (int i = 0; i < _savedPrefixDefinitions.Count; i++)
System\Xaml\Parser\XamlScanner.cs (5)
589if (list.Count > 0) 602for (int i = 0; i < attrList.Count; i++) 733for (int i = _attributes.Count - 1; i >= 0; i--) 741if (_attributes.Count == 0) 822if (_nextAttribute >= _attributes.Count)
System\Xaml\Schema\Reflector.cs (1)
338if (cads.Count == 0)
System\Xaml\Schema\TypeReflector.cs (7)
671if (candidates.Count > 0) 676else if (setters is null || setters.Count == 0 677|| (getters is not null && getters.Count > 0 && UnderlyingType.IsVisible && getters[0].IsPublic && !setters[0].IsPublic)) 712if ((setters is null || setters.Count == 0) && (getters is null || getters.Count == 0)) 727if (adders is null || adders.Count == 0) 1205for (int i = 0; i < listOfNulls.Count; i++)
System\Xaml\XamlMember.cs (1)
573if (doPropertyNames is null || doPropertyNames.Count == 0)
System\Xaml\XamlNodeList.cs (2)
64return new ReaderMultiIndexDelegate(_writer.SchemaContext, Index, _nodeList.Count, _hasLineInfo); 120get { return _nodeList.Count; }
System\Xaml\XamlObjectReader.cs (25)
267return (children.Count == 1) && (children[0] is ValueMarkupInfo); 275if (children.Count != 1) 304if (Children.Count > 1) { return false; } 307if (Children.Count == 0 || Children[0] is ValueMarkupInfo) { return true; } 534if (itemsInfo is not null && itemsInfo.Children.Count != 0) 562if (itemsInfo is not null && itemsInfo.Children.Count != 0) 671if (memberInfo.Children.Count == 1) 673if (memberInfo.Children[0] is ObjectMarkupInfo objectInfo && objectInfo.Properties.Count == 1 && memberType == objectInfo.XamlNode.XamlType) 677if (objectInfo.Properties[0] is MemberMarkupInfo itemsMemberInfo && itemsMemberInfo.Children.Count > 0) 745if (itemInfo.Properties is not null && itemInfo.Properties.Count == 1) 754if (memberInfo.Children.Count == 1) 1072for (i = 0; i < Properties.Count; i++) 1092for (int i = 0; i < properties.Count; ) 1205if (propertyInfo is not null && propertyInfo.Children.Count != 0) 1647if (constructorParameters.Length != ctorArgProps.Count) { continue; } 1676if (constructorArguments.Count == ctorArgProps.Count) 1699if (ctorArgProps.Count == 0) 1840if (items.Children.Count != 0) 2090if (propertyInfo.Children.Count == 1) 2103return propertyInfo.Children.Count == 1 && 2133if (propertyInfo.Children.Count == 1) 2914objectPosition = nodes.Count; 3086result = _entries.Count; 3128for (int i = 0; i < _entries.Count; ++i) 3134for (int i = 0; i < _entries.Count; ++i)
System\Xaml\XamlSchemaContext.cs (1)
1459for (int i = 0; i < Count; i++)
System\Xaml\XamlType.cs (1)
828contentWrappers = new List<XamlType>(wrapperTypes.Count);
System\Xaml\XamlTypeName.cs (1)
146return _typeArguments is not null && _typeArguments.Count > 0;
System\Xaml\XamlXmlWriter.cs (7)
1915int numOfParameters = writer.ppStateInfo.NodesList.Count; 1921if (constructorParameters.Length != ctorArgProps.Count) 2058writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2077Debug.Assert(writer.ppStateInfo.NodesList.Count != 0); 2078writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2095writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2124writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node);
Templates.Blazor.Tests (6)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
85if (list.Count > 0)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
886var certificatesDescription = list.Count switch 890_ => $"{list.Count} certificates",
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
118if (nssDbs.Count > 0) 285if (nssDbs.Count > 0) 421if (nssDbs.Count > 0)
Templates.Blazor.WebAssembly.Auth.Tests (7)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
85if (list.Count > 0)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
886var certificatesDescription = list.Count switch 890_ => $"{list.Count} certificates",
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
118if (nssDbs.Count > 0) 285if (nssDbs.Count > 0) 421if (nssDbs.Count > 0)
src\Shared\E2ETesting\WebDriverExtensions.cs (1)
24if (logs.Count > 0)
Templates.Blazor.WebAssembly.Tests (7)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
85if (list.Count > 0)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
886var certificatesDescription = list.Count switch 890_ => $"{list.Count} certificates",
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
118if (nssDbs.Count > 0) 285if (nssDbs.Count > 0) 421if (nssDbs.Count > 0)
src\Shared\E2ETesting\WebDriverExtensions.cs (1)
24if (logs.Count > 0)
Templates.Mvc.Tests (7)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
85if (list.Count > 0)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
886var certificatesDescription = list.Count switch 890_ => $"{list.Count} certificates",
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
118if (nssDbs.Count > 0) 285if (nssDbs.Count > 0) 421if (nssDbs.Count > 0)
src\Shared\E2ETesting\WebDriverExtensions.cs (1)
24if (logs.Count > 0)
Templates.Tests (7)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
85if (list.Count > 0)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
886var certificatesDescription = list.Count switch 890_ => $"{list.Count} certificates",
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
118if (nssDbs.Count > 0) 285if (nssDbs.Count > 0) 421if (nssDbs.Count > 0)
src\Shared\E2ETesting\WebDriverExtensions.cs (1)
24if (logs.Count > 0)
Test.Utilities (35)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
TestDiscoveryWorker (1)
Program.cs (1)
38if (extra.Count > 0)
Text.Analyzers (46)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
77ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (3)
593if (sorted.Count <= 1) 601IList<TextSpan> normalized = new List<TextSpan>(sorted.Count); 605for (var i = 1; i < sorted.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
120for (var i = list.Count - 1; i >= 0; i--) 259if (list.Count == 0) 300if (list.Count == 0) 317for (var i = list.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
87for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 100if (result == 0 && usedFieldsAndValues.Count > 0) 104for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 155for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (4)
27addBlankLine = newImports.Count > 0; 49for (var i = 0; i < newImports.Count; i++) 78if (originalLastUsingCurrentIndex != newImports.Count - 1) 86for (var i = 0; i < newImports.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
UIAutomationClientSideProviders (8)
MS\Internal\AutomationProxies\ClickablePoint.cs (2)
419for (int i = 0; i < listIn.Count; i++) 438for (int i = 0; i < rectList.Count; i++)
MS\Internal\AutomationProxies\WinEventTracker.cs (6)
234for (int index = eventCreateParams.Count - 1; index >= 0; index--) 287for (int index = eventCreateParams.Count - 1; index >= 0; index--) 400for (int index = eventCreateParams.Count - 1; index >= 0; index--) 418if (eventCreateParams.Count == 0) 434for (int index = eventCreateParams.Count - 1; index >= 0; index--) 457if (eventCreateParams.Count == 0)
VBCSCompiler (6)
src\Compilers\Server\VBCSCompiler\AnalyzerConsistencyChecker.cs (1)
115for (int i = 0; i < resolvedPaths.Count; i++)
src\Compilers\Server\VBCSCompiler\BuildProtocolUtil.cs (1)
64while (argIndex >= commandLineArguments.Count)
src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (4)
140} while (_connectionList.Count > 0 || _state == State.Running); 247if (_state == State.Running && _connectionList.Count == 0 && _timeoutTask is null && _keepAlive.HasValue) 256if (_state == State.Running && _connectionList.Count == 0 && _gcTask is null) 270while (i < _connectionList.Count)
VBCSCompiler.UnitTests (8)
BuildClientTests.cs (1)
188Assert.Equal(0, _serverDataList.Count);
CompilerServerTests.cs (7)
841Assert.Equal(5, listener.CompletionDataList.Count); 955Assert.Equal(5, listener.CompletionDataList.Count); 1040Assert.Equal(numberOfCompiles, listener.CompletionDataList.Count); 1089Assert.Equal(2, listener.CompletionDataList.Count); 1140Assert.Equal(2, listener.CompletionDataList.Count); 1295Assert.Equal(2, listener.CompletionDataList.Count); 1453Assert.Equal(2, listener.CompletionDataList.Count);
WaitForSandbox.ApiService (1)
Program.cs (1)
28totalEntries = entries.Count,
WindowsBase.Tests (27)
System\Windows\Markup\Primitives\MarkupObjectTests.cs (4)
111Assert.Equal(2, properties.Count); 146Assert.Equal(instance.Count, properties[1].Items.Count()); 222Assert.Equal(list.Count, properties[0].Items.Count()); 415Assert.Equal(2, properties.Count);
System\Windows\Markup\Primitives\MarkupPropertyTests.cs (4)
98Assert.Equal(2, properties.Count); 133Assert.Equal(instance.Count, properties[1].Items.Count()); 209Assert.Equal(list.Count, properties[0].Items.Count()); 388Assert.Equal(2, properties.Count);
System\Windows\WeakEventManagerTests.cs (19)
2090for (int i = 0; i < handlers.Count; i++) 2100if (expectedHandlers.Count != 0) 2103Assert.Equal(expectedHandlers.Count, list.Count); 2105for (int i = 0; i < expectedHandlers.Count; i++) 2116for (int i = 0; i < expectedHandlers.Count; i++) 2515for (int i = 0; i < listeners.Count; i++) 2525if (expectedListeners.Count != 0) 2528Assert.Equal(expectedListeners.Count, list.Count); 2530for (int i = 0; i < expectedListeners.Count; i++) 2541for (int i = 0; i < expectedListeners.Count; i++) 5349for (int i = 0; i < listeners.Count; i++) 5359Assert.Equal(expectedListeners.Count, list.Count); 5360Assert.Equal(expectedListeners.Count == 0, list.IsEmpty); 5361for (int i = 0; i < expectedListeners.Count; i++) 5367for (int i = 0; i < expectedListeners.Count; i++) 5618Assert.Equal(expectedHandlers.Count, list.Count); 5619Assert.Equal(expectedHandlers.Count == 0, list.IsEmpty); 5620for (int i = 0; i < expectedHandlers.Count; i++) 5626for (int i = 0; i < expectedHandlers.Count; i++)
WindowsFormsIntegration (2)
System\Windows\Integration\ApplicationInterop.cs (2)
323for (int i = _internalList.Count - 1; i >= 0; i--) 368for (int i = 0; i < _internalList.Count; i++)
WinFormsControlsTest (6)
DataGridViewInVirtualModeTest.cs (6)
51dataGridView1.RowCount = _customers.Count + 1; // Add 1 as a new edit row 86if (e.RowIndex < _customers.Count) 130if (e.RowIndex >= _customers.Count && e.RowIndex != dataGridView1.Rows.Count - 1) 137else if (_customerInEdit is not null && e.RowIndex < _customers.Count) 163if (_rowInEdit == dataGridView1.Rows.Count - 2 && _rowInEdit == _customers.Count) 180if (e.Row.Index < _customers.Count)
XmlFileLogger (1)
ObjectModel\TaskParameter.cs (1)
49if (collapseSingleItem && items.Count == 1 && !items[0].Metadata.Any())
xunit.assert (9)
CollectionAsserts.cs (2)
90 if (errors.Count > 0) 144 if (errors.Count > 0)
MultipleAsserts.cs (2)
45 if (exceptions.Count == 0) 47 if (exceptions.Count == 1)
Sdk\ArgumentFormatter.cs (2)
352 if (parameters.Count == 0) 357 if (parameters.Count > MAX_OBJECT_ITEM_COUNT)
Sdk\AssertHelper.cs (3)
574 for (; actualIdx < actualValues.Count; ++actualIdx) 578 if (actualIdx == actualValues.Count) 584 if (strict && actualValues.Count != 0)
xunit.console (8)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (3)
117if (targets == null || targets.Count == 0) 419if (targetLibrary.Runtimes != null && targetLibrary.Runtimes.Count > 0) 424if (targetLibrary.Natives != null && targetLibrary.Natives.Count > 0)
common\AssemblyResolution\XunitPackageCompilationAssemblyResolver.cs (1)
66if (nugetPackageDirectories.Count == 0 || !string.Equals(library.Type, "package", StringComparison.OrdinalIgnoreCase))
ConsoleRunner.cs (4)
245if (switchableReporters.Count > 0) 276var needsXml = xmlTransformers.Count > 0; 376var testCasesDiscovered = discoverySink.TestCases.Count; 378var testCasesToRun = filteredTestCases.Count;