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
7480 references to Count
AnalyzerRunner (1)
Program.cs (1)
178Console.WriteLine("Number of projects:\t\t" + projects.Count);
Aspire.Components.Common.Tests (2)
ActivityNotifier.cs (1)
25if (activityList.Count == count)
ConformanceTests.cs (1)
132Assert.Equal(2, registeredNames.Count);
Aspire.Dashboard (59)
Components\Controls\Chart\ChartBase.cs (1)
417for (var i = 0; i < xValues.Count; i++)
Components\Controls\Chart\MetricTable.razor.cs (4)
119for (var i = 0; i < xValues.Count; i++) 156for (var traceIndex = 0; traceIndex < traces.Count; traceIndex++) 212Debug.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 (2)
118for (var i = 0; i <= xValues.Count; i++) 121var end = i < xValues.Count ? xValues[i] : (DateTimeOffset?)null;
Components\Controls\StructuredLogDetails.razor.cs (2)
106var insertStart = destination.Count; 107for (var i = source.Count - 1; i >= 0; i--)
Components\Pages\Resources.razor.cs (4)
419if (displayedEndpoints.Count == 0) 424if (displayedEndpoints.Count == 1) 432if (displayedEndpoints.Count > maxShownEndpoints) 434tooltipBuilder.Append(CultureInfo.CurrentCulture, $" + {displayedEndpoints.Count - maxShownEndpoints}");
Components\Pages\StructuredLogs.razor.cs (1)
421if (filters.Count > 0)
Components\Pages\Traces.razor.cs (1)
261if (filters.Count > 0)
Configuration\ValidateDashboardOptions.cs (2)
79for (var i = 0; i < options.Otlp.AllowedCertificates.Count; i++) 147return errorMessages.Count > 0
ConsoleLogs\AnsiParser.cs (4)
495if (classes.Count == 0 && styles.Count == 0) 502if (classes.Count > 0) 507if (styles.Count > 0)
DashboardWebApplication.cs (5)
59if (_frontendEndPointAccessor.Count == 0) 72if (_frontendEndPointAccessor.Count == 0) 76else if (_frontendEndPointAccessor.Count > 1) 291if (_frontendEndPointAccessor.Count > 0) 656if (options.Otlp.AllowedCertificates is { Count: > 0 } allowList)
Model\KnownPropertyLookup.cs (1)
71for (var i = 0; i < knownProperties.Count; i++)
Model\Otlp\ApplicationsSelectHelpers.cs (1)
51if (replicas.Count == 1)
Model\ResourceOutgoingPeerResolver.cs (1)
153if (_subscriptions.Count == 0 || _watchContainersTokenSource.IsCancellationRequested)
Model\ThemeManager.cs (1)
138if (_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)
235if (values.Count < readLimit) 246for (var i = 0; i < values.Count; i++)
Otlp\Storage\TelemetryRepository.cs (14)
388if (applications.Count == 0) 399if (applications?.Count > 0) 430if (applications?.Count > 0) 457if (applications?.Count > 0) 478if (applications.Count == 0) 493if (applications?.Count > 0) 565for (var i = 0; i < applications.Count; i++) 598if (applications is null || applications.Count == 0) 636if (applications is null || applications.Count == 0) 1063if (currentSpanLinks.Count > 0) 1066sb.AppendLine(CultureInfo.InvariantCulture, $"There are {currentSpanLinks.Count} orphaned span links."); 1127if (events.Count >= context.Options.MaxSpanEventCount) 1138if (applications.Count == 0) 1142else if (applications.Count == 1)
src\Shared\CircularBuffer.cs (8)
48public int Count => _buffer.Count; 110if (shiftLength > 0 || internalIndex == _buffer.Count - 1) 116else if (internalIndex < _end && _end < _buffer.Count - 1) 134if (internalIndex > _buffer.Count) 136internalIndex = internalIndex % _buffer.Count; 143if (_end != _buffer.Count) 205if (_end != _buffer.Count) 262return (_start + index) % _buffer.Count;
Aspire.Dashboard.Tests (3)
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 (1)
851Assert.Equal(5, trace.FirstSpan.Events.Count);
Aspire.Hosting (26)
ApplicationModel\ReferenceExpression.cs (2)
127var index = _valueProviders.Count; 186var index = _valueProviders.Count;
ApplicationModel\ResourceCollection.cs (1)
16public int Count => _resources.Count;
ApplicationModel\ResourceLoggerService.cs (2)
83if (scopes.Count == 0) 87else if (scopes.Count == 1)
Dashboard\ResourceServiceOptions.cs (1)
56return errorMessages is { Count: > 0 }
Dcp\DcpExecutor.cs (4)
587if (needAddressAllocated.Count == 0) 617if (needAddressAllocated.Count == 0) 859if (cmdArgs.Count > 0) 1187if (cr.ServicesProduced.Count > 0)
Dcp\DcpKubernetesClient.cs (1)
131if (_parameters.Count > 0)
Dcp\ResourceSnapshotBuilder.cs (2)
237if (effectiveSource is null or { Count: 0 }) 242var environment = ImmutableArray.CreateBuilder<EnvironmentVariableSnapshot>(effectiveSource.Count);
Eventing\DistributedApplicationEventing.cs (1)
30var pendingSubscriptionCallbacks = new List<Task>(subscriptions.Count);
Publishing\ManifestPublishingContext.cs (3)
547if (args.Count > 0) 596if (bindMounts.Count > 0) 622if (volumes.Count > 0)
src\Shared\CircularBuffer.cs (8)
48public int Count => _buffer.Count; 110if (shiftLength > 0 || internalIndex == _buffer.Count - 1) 116else if (internalIndex < _end && _end < _buffer.Count - 1) 134if (internalIndex > _buffer.Count) 136internalIndex = internalIndex % _buffer.Count; 143if (_end != _buffer.Count) 205if (_end != _buffer.Count) 262return (_start + index) % _buffer.Count;
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 (1)
src\Shared\CustomResourceSnapshotExtensions.cs (1)
42for (var i = 0; i < existingProperties.Count; i++)
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
431if (endpointsByTargetPort.Count > 5)
Aspire.Hosting.Azure.EventHubs (1)
EventHub.cs (1)
88if (hub.ConsumerGroups.Count >= 0)
Aspire.Hosting.Azure.Functions (2)
AzureFunctionsProjectResourceExtensions.cs (2)
168if (commandLineArgs is { Count: > 0 } && 171indexOfPort + 1 < commandLineArgs.Count &&
Aspire.Hosting.Dapr (1)
CommandLineBuilder.cs (1)
21for (int i = 0; i < args.Count; i++)
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
157if (containerAnnotations.Count == 1
Aspire.Hosting.Testing.Tests (3)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
103return table.Count == 0;
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (2)
22if (logs.Count >= targetLogCount) 39if (logs.Count >= targetLogCount)
Aspire.Hosting.Tests (11)
Dcp\DcpExecutorTests.cs (4)
85Assert.Equal(2, executables.Count); 431Assert.Equal(replicaCount, executables.Count); 670Assert.Equal(3, exes.Count); 715Assert.Equal(3, exes.Count);
ResourceNotificationTests.cs (2)
59if (values.Count == 2) 112if (values.Count == 3)
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (2)
22if (logs.Count >= targetLogCount) 39if (logs.Count >= targetLogCount)
Utils\LoggerNotificationExtensions.cs (1)
103return table.Count == 0;
Utils\StringComparersTests.cs (2)
56if (extraComparers.Count + extraComparisons.Count != 0)
Aspire.Playground.Tests (4)
AppHostTests.cs (3)
57for (int i = 0; i < testEndpoints.WaitForTexts.Count; i++) 75if (testEndpoints.WaitForResources?.Count > 0) 91if (endpoints.Count == 0)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
103return table.Count == 0;
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
DistributedCacheConformanceTests.cs (1)
67Assert.Equal(3, activityList.Count);
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
OutputCacheConformanceTests.cs (1)
67Assert.Equal(3, activityList.Count);
Aspire.Workload.Tests (2)
WorkloadTestsBase.cs (2)
215if (expectedEndpoints.Length != endpointsFound.Count) 222AssertEqual(expectedEndpoints.Length, endpointsFound.Count, $"#endpoints for {resourceName}");
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 (1)
Program.cs (1)
92totalEntries = entries.Count,
BuildActionTelemetryTable (1)
Program.cs (1)
539if (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)
91logger.LogInformation("Seeding {CatalogBrandCount} catalog brands", brands.Count); 101logger.LogInformation("Seeding {CatalogTypeCount} catalog item types", types.Count); 111logger.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 (4)
ConfigSchemaEmitter.cs (2)
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)
46totalEntries = entries.Count,
CSharpSyntaxGenerator (42)
AbstractFileWriter.cs (1)
377while ((field.Kinds is null || field.Kinds.Count == 0) && IsOverride(field))
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)
30totalEntries = entries.Count,
dotnet-dev-certs (6)
Program.cs (1)
305if (trustedCertificates.Count == 0)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
847var certificatesDescription = list.Count switch 851_ => $"{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)
253if (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)
98Assert.True(clientReceiver.ServerLog.Count > 0, 166Assert.True(clientReceiver.ServerLog.Count > 0, 234Assert.True(clientReceiver.ServerLog.Count > 0, 330Assert.True(clientReceiver.ServerLog.Count > 0, 401Assert.True(clientReceiver.ServerLog.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)
241return 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 (1)
246await context.Response.Body.WriteAsync(data.ToArray(), 0, data.Count);
Http3\Http3StreamTests.cs (1)
737while (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\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++)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
119if (_blockAccessExceptions.Count > 0) 138if (_blockAccessExceptions.Count > 0)
Interop.FunctionalTests (5)
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)
809return requestTasks.Count;
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
68logger.LogInformation("Found {count} unavailable endpoints.", unavailableEndpoints.Count);
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)
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 (34)
CascadingValueSource.cs (2)
101var subscribersCount = subscribers.Count; 181if (subscribersForDispatcher.Count == 0)
Infrastructure\ComponentStatePersistenceManager.cs (2)
97for (var i = 0; i < _registeredCallbacks.Count; i++) 132for (var i = 0; i < _registeredCallbacks.Count; i++)
NavigationManager.cs (3)
323var handlerCount = _locationChangingHandlers.Count; 484var isFirstHandler = _locationChangingHandlers.Count == 0; 500if (_locationChangingHandlers.Remove(locationChangingHandler) && _locationChangingHandlers.Count == 0)
Reflection\MemberAssignment.cs (1)
58var count = list.Count;
RenderTree\Renderer.cs (7)
344Debug.Assert(_pendingTasks is null || _pendingTasks.Count == 0); 353while (_pendingTasks?.Count > 0) 984if (exceptions?.Count > 1) 988else if (exceptions?.Count == 1) 1207if (asyncDisposables?.Count >= 1) 1233if (exceptions?.Count > 1) 1237else 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 (5)
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++)
Rendering\EndpointHtmlRenderer.Prerendering.cs (2)
167else if (_nonStreamingPendingTasks.Count > 0) 179while (_nonStreamingPendingTasks.Count > 0)
Microsoft.AspNetCore.Components.Endpoints.Tests (10)
Binding\FormDataMapperTests.cs (9)
491Assert.Equal(rented.Count, returned.Count); 551Assert.Equal(rented.Count, returned.Count); 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 (2)
Circuits\RevalidatingServerAuthenticationStateProviderTest.cs (1)
49Assert.Equal(10, provider.RevalidationCallLog.Count);
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
88Assert.Equal(4, buildersAffected.Count);
Microsoft.AspNetCore.Components.Tests (48)
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);
LayoutViewTest.cs (2)
179Assert.Equal(2, _renderer.Batches.Count); 221Assert.Equal(2, _renderer.Batches.Count);
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)
306if (matchingTabs.Count == 1) 312else 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)
847var certificatesDescription = list.Count switch 851_ => $"{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 (14)
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\Server\InterceptorPipelineBuilder.cs (1)
140for (var i = _interceptors.Count - 1; i >= 0; i--)
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 (2)
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++)
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.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.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)
2820if (SupportedTypes.Count == 0) 2846if (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.TagHelpers (1)
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 (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.OpenApi.Microbenchmarks (1)
src\Shared\BenchmarkRunner\Program.cs (1)
84if (index >= 0 && index < argsList.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.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 (67)
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)
91var endpoints = new RouteEndpoint[_routeEntries.Count]; 92for (int i = 0; i < _routeEntries.Count; i++) 102var endpoints = new RouteEndpoint[_routeEntries.Count]; 103for (int i = 0; i < _routeEntries.Count; i++) 115if (_routeEntries.Count is not 1) 117throw 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)
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 (10)
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 (3)
24Assert.Equal(2, allMatches.Count); 44Assert.Equal(3, allMatches.Count); 64Assert.Equal(3, allMatches.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)
644for (var i = actions.Count - 1; i >= 0; i--) 735for (var i = actions.Count - 1; i >= 0; i--)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
119if (_blockAccessExceptions.Count > 0) 138if (_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)
119if (_blockAccessExceptions.Count > 0) 138if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Core (37)
Internal\Http\Http1OutputProducer.cs (1)
541Debug.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)
62if (_transportFactories.Count == 0 && _multiplexedTransportFactories.Count == 0) 174if (hasHttp3 && _multiplexedTransportFactories.Count == 0 && !(hasHttp1 || hasHttp2)) 181var addAltSvcHeader = !options.DisableAltSvcHeader && _multiplexedTransportFactories.Count > 0; 190if (_transportFactories.Count == 0) 204if (hasHttp3 && _multiplexedTransportFactories.Count > 0) 350if (endpointsToStop.Count > 0) 364var configsToStop = new List<EndpointConfig>(endpointsToStop.Count); 378if (endpointsToStart.Count > 0)
Internal\ServerAddressesCollection.cs (1)
33return _addresses.Count;
KestrelConfigurationLoader.cs (1)
400if (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\CertificateGeneration\CertificateManager.cs (2)
847var certificatesDescription = list.Count switch 851_ => $"{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 (8)
KestrelServerTests.cs (3)
832Assert.Equal(2, mockTransports.Count); 853Assert.Equal(4, mockTransports.Count); 882Assert.Equal(5, mockTransports.Count);
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (1)
423if (_revocationList?.Count > 0)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
68logger.LogInformation("Found {count} unavailable endpoints.", unavailableEndpoints.Count);
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
119if (_blockAccessExceptions.Count > 0) 138if (_blockAccessExceptions.Count > 0)
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
172int expectedCount = Math.Min(finalMaxSize / 64, headers.Count);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (6)
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)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
119if (_blockAccessExceptions.Count > 0) 138if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
1492Assert.Equal(2, endpointsToStart.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)
119if (_blockAccessExceptions.Count > 0) 138if (_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)
119if (_blockAccessExceptions.Count > 0) 138if (_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 (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)
119if (_blockAccessExceptions.Count > 0) 138if (_blockAccessExceptions.Count > 0)
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)
172int 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)
5444if (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.Build (174)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (7)
217TraceEngine("CFB: Cleaning up build. Requests Count {0} Status {1}", _requests.Count, _status); 223var deactivateExceptions = new List<Exception>(_requests.Count); 230var requestsToWait = new List<BuildRequestEntry>(_requests.Count); 280if (deactivateExceptions.Count > 0) 566if (requestsToIssue.Count != 0) 775if (completedEntries.Count > 0) 1279ErrorUtilities.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)
1107if (_loggers.Count > 0)
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
727if (projectCacheDescriptors.Count == 0) 752Task[] 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)
551itemsCount += allAdds?.Count ?? 0; // Add all the additions 552itemsCount -= allRemoves?.Count ?? 0; // Remove the removals
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
757bool pushedTargets = (targetsToPush.Count > 0);
BackEnd\Components\RequestBuilder\TargetEntry.cs (2)
436int numberOfBuckets = buckets.Count; 651if (batchingBuckets.Count == 1)
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (14)
167if (targetOutputItemSpecs.Count == 0) 189if (itemVectorsReferencedOnlyInTargetOutputs.Count == 0) 204ErrorUtilities.VerifyThrow(itemVectorsReferencedInBothTargetInputsAndOutputs.Count > 0, "The target must have inputs."); 228((itemVectorsReferencedOnlyInTargetOutputs?.Count > 0))) 272if (result == DependencyAnalysisResult.FullBuild && _dependencyAnalysisDetail.Count > 0) 547if (discreteTargetInputItemSpecs.Count > 0) 552if (inputs.Count == 0) 557if (outputs.Count == 0) 633if (upToDateInputItems.Count == outputItems.Count) 635for (int i = 0; i < upToDateInputItems.Count; i++) 713ErrorUtilities.VerifyThrow(numberOfInputItemVectorsWithAllChangedItems <= itemVectorsReferencedInBothTargetInputsAndOutputs.Count, 717if (numberOfInputItemVectorsWithAllChangedItems == itemVectorsReferencedInBothTargetInputsAndOutputs.Count) 750if (inputs.Count == 0) 755if (outputs.Count == 0)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (3)
321if (buckets.Count > 1) 329for (int i = 0; i < buckets.Count; i++) 763if (undeclaredProjects?.Count > 0)
BackEnd\Components\Scheduler\Scheduler.cs (10)
723if (_schedulingData.UnscheduledRequestsCount > 0 || responses.Count == 0) 781ErrorUtilities.VerifyThrow(responses.Count > 0, "We failed to request a node to be created."); 784TraceScheduler("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); 2003request.Targets.Count == 0 2262if (existingRequest.BuildRequest.Targets.Count == request.Targets.Count) 2269for (int i = 0; i < leftTargets.Count; i++) 2552for (int i = 0; i < childRequests.Count; i++) 2555WriteRecursiveSummary(loggingService, context, submissionId, childRequest, level + 1, useConfigurations, i == childRequests.Count - 1); 2629if (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)
69MSBuildEventSource.Log.SdkResolverLoadAllResolversStop(resolvers.Count); 265MSBuildEventSource.Log.SdkResolverLoadResolversStop(manifest.DisplayName ?? string.Empty, resolvers.Count);
BackEnd\Components\SdkResolution\SdkResolverService.cs (1)
199if (matchingResolversManifests.Count != 0)
BackEnd\Shared\BuildRequestConfiguration.cs (4)
778bool hasInitialTargets = request.Targets.Count == 0 ? false : true; 781_projectInitialTargets.Count + 782(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)
77for (int i = editorConfigFiles.Count - 1; i >= 0; i--)
BuildEnvironmentHelper.cs (2)
302if (instances.Count == 0) 307if (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)
893HashSet<string> projectPaths = new HashSet<string>(_projectsInOrder.Count, _pathComparer);
Construction\Solution\SolutionProjectGenerator.cs (1)
747var projectInstances = new List<ProjectInstance>(projectsInOrder.Count + 1);
Definition\Project.cs (7)
2256var imports = new List<ResolvedImport>(_data.ImportClosure.Count - 1 /* outer project */); 2279var imports = new List<ResolvedImport>(_data.ImportClosureWithDuplicates.Count - 1 /* outer project */); 2565if (projectItemElements.Count == 0) 2590var removeElementCache = new Dictionary<string, CumulativeRemoveElementData>(projectItemElements.Count); 2591var globResults = new List<GlobResult>(projectItemElements.Count); 2593for (var i = projectItemElements.Count - 1; i >= 0; i--) 3538if (items.Count != 1)
Definition\ProjectCollection.cs (1)
2587if (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)
509if (orderedSubToolsetList.Count > 0) 511_defaultSubToolsetVersion = orderedSubToolsetList[orderedSubToolsetList.Count - 1]; 922int count = _environmentProperties.Count + reservedProperties.Count + Properties.Values.Count + _globalProperties.Count + 1;
Evaluation\Conditionals\FunctionCallExpressionNode.cs (2)
191_arguments.Count == expected, 195_arguments.Count,
Evaluation\Evaluator.cs (10)
660List<string> initialTargets = new List<string>(_initialTargetsList.Count); 748var targetElementsCount = _targetElements.Count; 749if (_data.DefaultTargets.Count == 0 && targetElementsCount > 0) 959for (int i = 0; i < temp.Count; i++) 964_data.DefaultTargets ??= new List<string>(temp.Count); 1555var pathsToSearch = new string[fallbackSearchPathMatch.SearchPaths.Count + 1]; 1651if (allProjects.Count == 0 && 1831if (projects?.Count > 0) 1844if (additionalProjects?.Count > 0) 2310if (imports?.Count > 0)
Evaluation\Expander.cs (10)
966if (itemVectorExpressions?.Count == 1 && itemVectorExpressions[0].Value == expression && itemVectorExpressions[0].Separator == null) 981for (int n = 0; n < itemVectorExpressions.Count; n++) 1882ErrorUtilities.VerifyThrow(matches.Count == 1, "Expected just one item vector"); 1945result = new List<T>(itemsFromCapture.Count); 2103for (int i = 0; i < matches.Count; i++) 2138ProjectErrorUtilities.VerifyThrowInvalidProject(match.Captures.Count > 0, elementLocation, "InvalidFunctionPropertyExpression"); 2140Stack<TransformFunction<S>> transformFunctionStack = new Stack<TransformFunction<S>>(match.Captures.Count); 2146for (int n = match.Captures.Count - 1; n >= 0; n--) 2200for (int i = 0; i < itemsFromCapture.Count; i++) 2223if (i < itemsFromCapture.Count - 1)
Evaluation\ItemDataCollectionValue.cs (1)
58public bool IsEmpty => _value == null || (_value is List<I> list && list.Count == 0);
Evaluation\ItemSpec.cs (3)
103if (ReferencedItems.Count == 1) 316var result = new List<ItemSpecFragment>(Fragments.Count); 380if (Fragments.Count == 1)
Evaluation\LazyItemEvaluator.cs (1)
377for (i = 0; i < op.Spec.Fragments.Count; i++)
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
320if (itemSpec.Fragments.Count != 1)
FileMatcher.cs (2)
912if (files?.Count > 0) 2559if (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) 150if (_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 (5)
774_properties = new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 775_globalProperties = new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 777new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 2887if (sp.SolutionParserComments.Count > 0) 3329inheritedItemDefinitions = new List<ProjectItemDefinitionInstance>(item.InheritedItemDefinitions.Count);
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}."); 1705if (index >= 0 && index < this.stringRecords.Count) 1714$"String record number {_recordNumber} is invalid: string index {index} is not within {stringRecords.Count}.");
Logging\BinaryLogger\BuildEventArgsWriter.cs (6)
902count = reusableItemsList.Count; 990if (reusableProjectItemList.Count > 0) 1108if (nameValueListBuffer.Count == 0) 1149Write(nameValueIndexListBuffer.Count); 1150for (int i = 0; i < nameValueListBuffer.Count; i++) 1174for (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)
LogMessagePacketBase.cs (3)
1114BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count); 1146BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count); 1185BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count);
PropertyParser.cs (2)
146if (finalPropertiesList.Count > 0) 151finalPropertiesList[finalPropertiesList.Count - 1].Value.Add(propertyValue);
Microsoft.Build.BuildCheck.UnitTests (9)
DoubleWritesAnalyzer_Tests.cs (2)
55_registrationContext.Results.Count.ShouldBe(1); 76_registrationContext.Results.Count.ShouldBe(4);
EditorConfigParser_Tests.cs (2)
86listOfEditorConfigFile.Count.ShouldBe(1); 115listOfEditorConfigFile.Count.ShouldBe(2);
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 (61)
TerminalLogger_Tests.cs (6)
753mockLogFromPlaybackWithoutTL.Errors.Count.ShouldBe(mockLogFromPlaybackWithTL.Errors.Count); 754mockLogFromPlaybackWithoutTL.Warnings.Count.ShouldBe(mockLogFromPlaybackWithTL.Warnings.Count); 755mockLogFromPlaybackWithoutTL.AllBuildEvents.Count.ShouldBe(mockLogFromPlaybackWithTL.AllBuildEvents.Count);
XMake_Tests.cs (55)
166sa.Count.ShouldBe(1); 171sa.Count.ShouldBe(2); 177sa.Count.ShouldBe(2); 183sa.Count.ShouldBe(3); 191sa.Count.ShouldBe(2); 198sa.Count.ShouldBe(2); 205sa.Count.ShouldBe(4); 213sa.Count.ShouldBe(1); 218sa.Count.ShouldBe(1); 223sa.Count.ShouldBe(1); 228sa.Count.ShouldBe(1); 234sa.Count.ShouldBe(2); 240sa.Count.ShouldBe(1); 246sa.Count.ShouldBe(2); 252sa.Count.ShouldBe(1); 258sa.Count.ShouldBe(2); 264sa.Count.ShouldBe(1); 269sa.Count.ShouldBe(1); 274sa.Count.ShouldBe(2); 280sa.Count.ShouldBe(1); 285sa.Count.ShouldBe(1); 291sa.Count.ShouldBe(2); 297sa.Count.ShouldBe(1); 302sa.Count.ShouldBe(1); 307sa.Count.ShouldBe(1); 312sa.Count.ShouldBe(2); 318sa.Count.ShouldBe(3); 325sa.Count.ShouldBe(1); 331sa.Count.ShouldBe(2); 337sa.Count.ShouldBe(3); 344sa.Count.ShouldBe(4); 2044distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2045loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2063distributedLoggerRecords.Count.ShouldBe(1); // "Expected one distributed loggers to be attached" 2064loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2082distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2083loggers.Count.ShouldBe(0); // "Expected a central loggers to be attached" 2094distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2095loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2105distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2106loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2124loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2125distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2137loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2138distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2150loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2151distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2163loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2164distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2176loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2177distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2187loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" 2188distributedLoggerRecords.Count.ShouldBe(1); // "Expected a distributed logger to be attached" 2216distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" 2217loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached"
Microsoft.Build.Engine.OM.UnitTests (72)
BuildEnvironmentHelper.cs (2)
302if (instances.Count == 0) 307if (instances.Count > 1)
Construction\ConstructionEditing_Tests.cs (3)
94Assert.Equal(2, targets.Count); 454Assert.Equal(2, children.Count); 531Assert.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)
70Assert.Equal(2, items.Count);
Construction\ProjectPropertyGroupElement_Tests.cs (1)
68Assert.Equal(2, properties.Count);
Construction\ProjectRootElement_Tests.cs (7)
543Console.WriteLine(@"Targets: {0}", Helpers.MakeList(project.Targets).Count); 544Console.WriteLine(@"Root ItemGroups: {0}", Helpers.MakeList(project.ItemGroups).Count); 545Console.WriteLine(@"Root PropertyGroups: {0}", Helpers.MakeList(project.PropertyGroups).Count); 546Console.WriteLine(@"UsingTasks: {0}", Helpers.MakeList(project.UsingTasks).Count); 547Console.WriteLine(@"ItemDefinitionGroups: {0}", Helpers.MakeList(project.ItemDefinitionGroups).Count); 832Assert.Equal(6, properties.Count); 890Assert.Equal(6, items.Count);
Construction\ProjectTargetElement_Tests.cs (1)
204Assert.Equal(2, tasks.Count);
Definition\DefinitionEditing_Tests.cs (7)
293Assert.Equal(2, items.Count); 1239Assert.Equal(2, Helpers.MakeList(itemElement.Metadata).Count); 1283Assert.Equal(2, Helpers.MakeList(itemGroupElement.Items).Count); 1473int environmentPropertyCount = Helpers.MakeList(project.Properties).Count; 1498int environmentPropertyCount = Helpers.MakeList(project.Properties).Count; 1819int environmentPropertyCount = Helpers.MakeList(project.Properties).Count; 2217Assert.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)
128Assert.Equal(2, itemMetadata.Count); 1532Assert.Equal(2, itemMetadata.Count); 3408Assert.Equal(4, items.Count);
Instance\ProjectInstance_Tests.cs (4)
142Assert.Equal(3, metadataOut.Count); 309Assert.Equal(2, Helpers.MakeList(projectInstance.GetItems("i")).Count); 334Assert.Equal(4, Helpers.MakeList(first.GetItems("i")).Count); 335Assert.Equal(3, Helpers.MakeList(second.GetItems("i")).Count);
Instance\ProjectItemInstance_Tests.cs (5)
455Assert.Equal(0 + BuiltInMetadataCount, Helpers.MakeList(item.MetadataNames).Count); 482Assert.Equal(2, itemMetadata.Count); 557Assert.Equal(3, Helpers.MakeList(item.Metadata).Count); 558Assert.Equal(3 + BuiltInMetadataCount, Helpers.MakeList(item.MetadataNames).Count); 637Assert.Equal(2, itemMetadata.Count);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (4)
176for (int i = 0; i < viewResult.Count; i++) 685Assert.Equal(realPLocList.Count, viewPLocList.Count); 686for (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 (129)
BackEnd\BatchingEngine_Tests.cs (2)
62Assert.Equal(5, buckets.Count); 150Assert.Equal(2, buckets.Count);
BackEnd\BuildManager_Tests.cs (16)
255_logger.ProjectStartedEvents.Count.ShouldBe(1); 347int numberProcsOriginally = (new List<Process>(Process.GetProcessesByName("MSBuild"))).Count; 378int numberProcsAfterBuild = (new List<Process>(Process.GetProcessesByName("MSBuild"))).Count; 389int numberProcsAfterShutdown = (new List<Process>(Process.GetProcessesByName("MSBuild"))).Count; 788Assert.Equal(3, _logger.ProjectStartedEvents.Count); 1015logger.BuildStartedEvents.Count.ShouldBe(1); 1016logger.BuildFinishedEvents.Count.ShouldBe(1); 1017logger.ProjectStartedEvents.Count.ShouldBe(1); 1018logger.ProjectFinishedEvents.Count.ShouldBe(1); 1019logger.TargetStartedEvents.Count.ShouldBe(1); 1020logger.TargetFinishedEvents.Count.ShouldBe(1); 1021logger.TaskStartedEvents.Count.ShouldBe(2); 1022logger.TaskFinishedEvents.Count.ShouldBe(2); 1089Assert.Equal(3, _logger.TaskStartedEvents.Count); 1090Assert.Equal(3, _logger.TaskFinishedEvents.Count); 4366logger.EvaluationStartedEvents.Count.ShouldBe(3);
BackEnd\BuildRequest_Tests.cs (3)
133Assert.Equal(request.Targets.Count, deserializedRequest.Targets.Count); 134for (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)
121for (int i = 0; i < NewRequests.Count; ++i)
BackEnd\LoggingService_Tests.cs (1)
999while (logger.ProjectFinishedEvents.Count == 0)
BackEnd\RequestedProjectState_Tests.cs (4)
40clone.PropertyFilters.Count.Should().NotBe(properties.Count); 84clone.ItemFilters["item2"].Count.Should().NotBe(items["item2"].Count);
BackEnd\Scheduler_Tests.cs (14)
131Assert.Equal(2, response.Count); 155Assert.Equal(2, response.Count); 185Assert.Equal(2, response.Count); 229Assert.Equal(2, response.Count); 252Assert.Equal(3, response.Count); 357Assert.Equal(2, response.Count); 407Assert.Equal(2, moreResponses.Count); 465Assert.Equal(2, response.Count); 495Assert.Equal(2, response.Count); 630Assert.Equal(2, response.Count); 649Assert.Equal(2, response.Count); 669Assert.Equal(2, response.Count); 688Assert.Equal(2, response.Count); 881if (nodeInfos.Count > 0)
BackEnd\TargetBuilder_Tests.cs (1)
1547Assert.Equal(tasks.Length, mockBuilder.ExecutedTasks.Count);
BackEnd\TargetEntry_Tests.cs (10)
225Assert.Equal(2, taskBuilder.ExecutedTasks.Count); 235Assert.Equal(3, taskBuilder.ExecutedTasks.Count); 263Assert.Equal(3, taskBuilder.ExecutedTasks.Count); 276Assert.Equal(2, taskBuilder.ExecutedTasks.Count); 280Assert.Equal(2, entry.GetErrorTargets(GetProjectLoggingContext(entry.RequestEntry)).Count); 289Assert.Equal(3, taskBuilder.ExecutedTasks.Count); 294Assert.Equal(2, entry.GetErrorTargets(GetProjectLoggingContext(entry.RequestEntry)).Count); 302Assert.Equal(3, taskBuilder.ExecutedTasks.Count); 700Assert.Equal(3, log.TargetFinishedEvents.Count); 797Assert.Equal(3, log.TargetFinishedEvents.Count);
BackEnd\TaskExecutionHost_Tests.cs (1)
1116ml.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)
40results.Count.ShouldBe(3); 69results.Count.ShouldBe(2); 77metadata.Count.ShouldBe(2); 111results.Count.ShouldBe(2); 119metadata.Count.ShouldBe(2); 127results.Count.ShouldBe(2); 132metadata.Count.ShouldBe(2);
BuildEventArgsSerialization_Tests.cs (5)
1013readerErrors.Count.ShouldBe(1); 1021readerErrors.Count.ShouldBe(1); 1073readerErrors.Count.ShouldBe(1); 1124readerErrors.Count.ShouldBe(1); 1180readerErrors.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)
163projectStartedEvents.Count.ShouldBe(1); 168targetStartedEvents.Count.ShouldBe(1);
Construction\SolutionFile_NewParser_Tests.cs (1)
123aspNetProjectReferences.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)
587Assert.Equal(paths.SearchPaths.Count, expectedPaths.Length); 589for (int i = 0; i < paths.SearchPaths.Count; i++)
Definition\ToolsVersion_Tests.cs (2)
278Assert.Equal(sortedTasksExpectedPaths.Count, foundFiles.Length); 284Assert.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++) 5182logger.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)
256Assert.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)
73_logger.AllBuildEvents.Count.ShouldBe(6); 569_logger.AllBuildEvents.Count.ShouldBe(6);
Instance\ProjectInstance_Internal_Tests.cs (3)
179properties.Count.ShouldBe(2); 217items.Count.ShouldBe(3); 238metadata1.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)
903logger.ProjectStartedEvents.Count.ShouldBe(2); 1637logger.ProjectStartedEvents.Count.ShouldBe(2 * projectPaths.Length);
Microsoft.Build.Framework (6)
BinaryTranslator.cs (2)
1024int count = list.Count; 1063int count = list.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)
ManagedToolTask.cs (2)
159var items = new ITaskItem[commandLineArgs.Count]; 160for (var i = 0; i < commandLineArgs.Count; i++)
Vbc.cs (2)
578if (links.Count > 0) 583if (references.Count > 0)
Microsoft.Build.Tasks.Core (94)
AssemblyDependency\AssemblyInformation.cs (1)
512if (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)
1299if (parentReferenceFolders.Count > 0 && (assemblyName == null || !_externallyResolvedPrimaryReferences.Contains(assemblyName.Name))) 1754if (newEntries.Count > 0) 1817while (comparisonIndex < assemblyReferences.Count) 1917var idealRemappingsList = new List<DependentAssembly>(assemblyNamesList.Count); 2208if (kvp.Value.Count == 1) 2738if (relatedFileExtensions.Count > 0 || satellites.Count > 0 || serializationAssemblyFiles.Count > 0 || scatterFiles.Length > 0)
AssemblyDependency\ResolveAssemblyReference.cs (10)
1114bool logWarning = idealAssemblyRemappingsIdentities.Any(i => i.assemblyName.FullName.Equals(fusionName) && i.reference.GetConflictVictims().Count == 0); 1168for (int i = 0; i < idealAssemblyRemappings.Count; i++) 1176for (int j = 0; j < idealRemapping.BindingRedirects.Count; j++) 1239if (idealAssemblyRemappings.Count > 0 && foundAtLeastOneValidBindingRedirect) 1430bool hadProblems = reference.GetErrors().Count > 0; 2296for (int i = 0; i < inclusionListErrors.Count; ++i) 2468bool shouldRerunClosure = autoUnifiedRemappedAssemblies?.Count > 0 || excludedReferencesExist; 2987for (int i = 0; i < idealAssemblyRemappings.Count; i++) 2996if (conflictVictims == null || 0 == conflictVictims.Count) 3001for (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)
302if (instances.Count == 0) 307if (instances.Count > 1)
Copy.cs (1)
573for (int partitionIndex = 0; partitionIndex < partition.Count && !_cancellationTokenSource.IsCancellationRequested; partitionIndex++)
FileMatcher.cs (2)
912if (files?.Count > 0) 2559if (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) 2443for (int i = 0; i < _inFiles.Count; ++i) 2725ErrorUtilities.VerifyThrow(_readers.Count == 1, 2727_readers.Count); 2735ErrorUtilities.VerifyThrow(_readers.Count == 1, 2737_readers.Count); 3050_logger.LogMessageFromResources(MessageImportance.Low, "GenerateResource.ReadResourceMessage", reader.resources.Count, filename);
ManifestUtil\AssemblyReferenceCollection.cs (1)
69public int Count => _list.Count;
ManifestUtil\ComImporter.cs (1)
107if (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)
385if (projectsToBuildInParallel.Count > 0) 495var projectDirectory = new string[projects.Count]; 496var projectNames = new string[projects.Count]; 497var toolsVersions = new string[projects.Count]; 498var projectProperties = new Dictionary<string, string>[projects.Count]; 499var undefinePropertiesPerProject = new IList<string>[projects.Count]; 618for (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)
672for (int i = 0; i < manifestEntryPointList.Count; i++)
ResolveProjectBase.cs (1)
196_projectReferences = new ITaskItem[updatedProjectReferenceList.Count];
ResolveSDKReference.cs (6)
418if (listOfIncompatibleReferences.Count > 0) 447if (listOfIncompatibleReferences.Count > 0) 500if (dependentSDKs.Count > 0) 613else if (reference.ResolutionErrors == null || reference.ResolutionErrors.Count == 0) 928if (!treatErrorsAsWarnings && ResolutionErrors.Count > 0) 1410if (appxLocationComponents.Count > 0)
WriteCodeFragment.cs (4)
219if (index > orderedParameters.Count || index < 1) 236for (int i = 0; i < orderedParameters.Count; i++) 485if (candidates.Count == 1) 489else if (candidates.Count > 1)
XmlPeek.cs (1)
149Result = new ITaskItem[peekValues.Count];
XslTransformation.cs (1)
523if (types.Count == 1)
Microsoft.Build.Tasks.UnitTests (22)
Copy_Tests.cs (4)
2021Assert.Equal(2, filesActuallyCopied.Count); 2088Assert.Equal(4, filesActuallyCopied.Count); 2094Assert.Equal(3, xaCopies.Count); 3072if (FilesCopiedSuccessfully.Count > 0 || _countOfSuccess == _tries)
GetSDKReference_Tests.cs (1)
285readInfo.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)
85Assert.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)
390for (expectedItemIndex = 0; expectedItemIndex < expectedItems.Count; expectedItemIndex++)
TestEnvironment.cs (1)
91for (int i = _variants.Count - 1; i >= 0; i--)
Microsoft.Build.Utilities.Core (7)
BuildEnvironmentHelper.cs (2)
302if (instances.Count == 0) 307if (instances.Count > 1)
FileMatcher.cs (2)
912if (files?.Count > 0) 2559if (searchesToExclude?.Count == 0)
ToolLocationHelper.cs (3)
1388if (availablePlatformVersions?.Count > 0) 2944if (sdkDiskRoots.Count == 0) 2971if (sdkDiskRoots.Count == 0 && diskRoots?.Length > 0)
Microsoft.Build.Utilities.UnitTests (6)
MuxLogger_Tests.cs (3)
125mockLogger2.BuildFinishedEvents.Count.ShouldBeGreaterThan(0); 126mockLogger.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\CommandLineParser.cs (1)
645for (var i = splitList.Count - 1; i >= 0; i--)
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)
936if (_deferredCustomAttributes.Count == 0)
InternalUtilities\EnumerableExtensions.cs (1)
335return source.Count == 0;
MetadataReader\MetadataHelpers.cs (6)
850Debug.Assert(typesInLastChildNamespace.Count != 0); 868Debug.Assert(typesInLastChildNamespace.Count != 0); 885var names = new Dictionary<string, int>(nestedNamespaces.Count, nameComparer); 887for (int i = nestedNamespaces.Count - 1; i >= 0; i--) 892if (names.Count != nestedNamespaces.Count) // nothing to merge otherwise 894for (int i = 1; i < nestedNamespaces.Count; i++)
MetadataReader\PEModule.cs (6)
1653if (attrInfos is null || attrInfos.Count == 0) 1658var result = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1693if (attrInfos is null || attrInfos.Count == 0) 1698var whenTrue = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1699var whenFalse = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1738var result = ArrayBuilder<string>.GetInstance(attrInfos.Count);
PEWriter\MetadataWriter.cs (6)
569index = (ushort)result.Count; 686_fileRefIndex.Add(key, _fileRefList.Count); 849_fileRefIndex.Add(key, index = _fileRefList.Count); 2435metadata.SetCapacity(TableIndex.File, _fileRefList.Count); 2589metadata.SetCapacity(TableIndex.MethodImpl, methodImplList.Count); 4233int 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)
246uint n = (uint)directory.Entries.Count; 265k += 16 + 8 * (uint)subDir.Entries.Count; 331k += 16 + 8 * (uint)subDir.Entries.Count; 339uint n = (uint)directory.Entries.Count; 346size += 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!");
Syntax\GreenNode.cs (2)
913switch (list.Count) 925var array = new ArrayElement<GreenNode>[list.Count];
Syntax\SeparatedSyntaxList.cs (3)
429if (nodesToInsertWithSeparators.Count > 0 || (insertionIndex > 0 && nodesWithSeps[insertionIndex - 1].IsNode)) 545if (newNodeList.Count == 0) 552if (newNodeList.Count > 1)
Syntax\SyntaxDiffer.cs (7)
574if (_changes.Count > 0) 576var last = _changes[_changes.Count - 1]; 580_changes[_changes.Count - 1] = new ChangeRecord( 595if (_changes.Count > 0) 597var last = _changes[_changes.Count - 1]; 603_changes[_changes.Count - 1] = new ChangeRecord( 740var textChanges = new List<ChangeRangeWithText>(changeRecords.Count);
Syntax\SyntaxList`1.cs (2)
269if (list.Count == 0) 345if (items.Count == 0)
Syntax\SyntaxNodeOrTokenList.cs (1)
347if (items.Count == 0)
Syntax\SyntaxTokenList.cs (2)
361if (items.Count == 0) 369if (list.Count == 0)
Text\SourceText.cs (1)
904var textChanges = new List<TextChange>(ranges.Count);
TreeDumper.cs (3)
93for (int i = 0; i < children.Count; ++i) 98_sb.Append(i == children.Count - 1 ? '\u2514' : '\u251C'); 103DoDumpCompact(child, indent + (i == children.Count - 1 ? " " : "\u2502 "));
Microsoft.CodeAnalysis.CodeStyle (34)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
335return 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)
32for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 41list.RemoveRange(targetIndex, list.Count - targetIndex); 51for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 60list.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)
128if (_initialIndentBlockOperations.Count <= 0) 146var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 150for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
109if (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)
20while (trimmedLeadingTrivia.Count >= 3 && 25trimmedLeadingTrivia.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)
500for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 520Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 522_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
32if (orderedExistingConstants.Count == 0) 42else if (orderedExistingConstants.Count > 0) 115if (existingConstants.Count >= 1 && 120if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (1)
59Contract.ThrowIfTrue(_index + values.Count > _values.Length);
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)
146.Where(nameAttributes => nameAttributes.Count == 1) 159if (paramNameAttributesForNode.Count != 1)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
96if (paramNodeIndex + 1 < paramNodeSiblings.Count)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
162for (var i = removalList.Count - 1; i >= 0; i--)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
86for (var i = classTypes.Count - 1; i >= 0; i--) 91for (var j = 0; j < classTypes.Count; j++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
279if (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)
57_analyzerConfigIndex = _test.TestState.AnalyzerConfigFiles.Count;
Microsoft.CodeAnalysis.CSharp (17)
CommandLine\CSharpCommandLineParser.cs (6)
181if (sourceFiles.Count > 0) 653int before = sourceFiles.Count; 655if (sourceFiles.Count > before) 1460if (embeddedFiles.Count > 0 && !emitPdb) 1548InteractiveMode = interactiveMode || IsScriptCommandLineParser && sourceFiles.Count == 0, 1966commandLineReferences.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)
133for (int i = 0; i < referencedAssemblySymbols.Count; i++) 473if (newSymbols.Count > 0) 544Debug.Assert(newSymbols.Count > 0);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
898finalTrivia.RemoveAt(finalTrivia.Count - 1);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
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)
31if (members.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
325if (types.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (1)
83if (constraints.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
183for (var i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (6)
CommandLineTests.cs (6)
920Assert.Equal(0, diags.Count); 925Assert.Equal(0, diags.Count); 930Assert.Equal(0, diags.Count); 935Assert.Equal(0, diags.Count); 942Assert.Equal(0, diags.Count); 949Assert.Equal(0, diags.Count);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (18)
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)
65if (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)
775if (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());
NavigateTo\NavigateToTests.cs (1)
1033Assert.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)
1436Assert.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)
1631Assert.Equal(expectedSymbolCallbacks.Count, analyzer.AnalyzedSymbols.Count); 1635Assert.Equal(expectedSyntaxNodeCallbacks.Count, analyzer.AnalyzedSyntaxNodes.Count); 1639Assert.Equal(expectedSyntaxNodeInsideBlockCallbacks.Count, analyzer.AnalyzedSyntaxNodesInsideCodeBlock.Count); 1644Assert.Equal(expectedOperationCallbacks.Count, analyzer.AnalyzedOperations.Count); 1648Assert.Equal(expectedOperationInsideBlockCallbacks.Count, analyzer.AnalyzedOperationsInsideOperationBlock.Count); 1661Assert.Equal(expectedBlockSymbolCallbacks.Count, actualBlockSymbolCallbacks.Count); 1666Assert.Equal(expectedSymbolStartSymbolCallbacks.Count, analyzer.AnalyzedSymbolStartSymbols.Count); 1668Assert.Equal(expectedSymbolStartSymbolCallbacks.Count, analyzer.AnalyzedSymbolEndSymbols.Count); 1672Assert.Equal(expectedSemanticModelTreeCallbacks.Count, analyzer.AnalyzedSemanticModels.Count);
Microsoft.CodeAnalysis.CSharp.Features (16)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
356Debug.Assert(annotatedNodesOrTokens.Count == 1, "Only a single variable declarator should have been annotated.");
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (4)
77if (triviaList.Count > 0) 87if (list.Count == 0) 90if (triviaList.Count == 0) 105if (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)
594if (namespaceContainers.Count + indexDone > containers.Count || 600indexDone += namespaceContainers.Count; 601if (indexDone == containers.Count) 609for (var i = 0; i < namespaceContainers.Count; ++i)
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
103if (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 (125)
Diagnostics\LocationsTests.cs (2)
566Assert.Equal(1, diagnostics.Count); 594Assert.Equal(1, diagnostics.Count);
LexicalAndXml\LexicalTests.cs (1)
3445Assert.Equal(6, results.Count);
LexicalAndXml\XmlDocCommentTests.cs (2)
3307Assert.Equal(actual.Count(), expected.Count); 3316for (int i = 0; i < expected.Count; i++)
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 (8)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
765var baseTypeList = itypes?.Count > 0 ? SyntaxFactory.BaseList([.. itypes]) : null; 781if (itypes?.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
898finalTrivia.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)
31if (members.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
325if (types.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (1)
83if (constraints.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
183for (var i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.EditorFeatures (10)
Editor\GoToAdjacentMemberCommandHandler.cs (3)
108if (members.Count == 0) 128if (index >= members.Count) 134index = members.Count - 1;
ExtractMethod\ExtractMethodCommandHandler.cs (1)
96if (spans.Count != 1)
Preview\AbstractPreviewFactoryService.cs (2)
773if (lineSpans.Count > 0) 782lineSpans.RemoveAt(lineSpans.Count - 1);
Preview\SolutionPreviewResult.cs (1)
77return 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)
307Assert.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)
169Assert.Equal(expecteditems.Count, items.Count()); 171for (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.EditorFeatures.Wpf (4)
InlineRename\UI\Dashboard\RenameDashboard.xaml.cs (2)
164=> FocusElement(_tabNavigableChildren.First(), i => i == _tabNavigableChildren.Count - 1 ? 0 : i + 1); 167=> FocusElement(_tabNavigableChildren.Last(), i => i == 0 ? _tabNavigableChildren.Count - 1 : i - 1);
Peek\DefinitionPeekableItem.cs (2)
85if (sourceLocations.Count == 0) 103callback.ReportProgress(100 * ++processedSourceLocations / sourceLocations.Count);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (4)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\ArrayBuilder.cs (4)
42get { return _items.Count; } 65return _items[_items.Count - 1]; 75var position = _items.Count - 1; 106return (_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)
42get { return _items.Count; } 65return _items[_items.Count - 1]; 75var position = _items.Count - 1; 106return (_items.Count > 0) ? new ReadOnlyCollection<T>(_items.ToArray()) : s_empty;
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 (40)
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (1)
54if (otherProjects.Count > projectsToShow)
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)
474if (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)
183Debug.Assert(lines.Count > 2); 250for (var i = 1; i < lines.Count; i++) 341Debug.Assert(lines.Count > 2);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (8)
1579if (exceptionHandlingAncestors.Count == 0) 1587for (var i = exceptionHandlingAncestors.Count - 1; i >= 0; i--) 1862var oldNodeCount = (oldNodes != null) ? oldNodes.Count : 0; 1864for (var i = 0; i < newNodes.Count; i++) 1900for (var newIndex = 0; newIndex < newNodes.Count; newIndex++) 1909while (oldIndex < oldNodes.Count) 1922if (oldIndex == oldNodes.Count) 1986for (var i = startIndex; i < oldNodes.Count; i++)
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)
188var arity = arguments.Count; 197var argument = i < arguments.Count ? arguments[i] : null;
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
72if (listOfParametersOrdinals.Count < 2)
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
102var 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)
146.Where(nameAttributes => nameAttributes.Count == 1) 159if (paramNameAttributesForNode.Count != 1)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
96if (paramNodeIndex + 1 < paramNodeSiblings.Count)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
162for (var i = removalList.Count - 1; i >= 0; i--)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
86for (var i = classTypes.Count - 1; i >= 0; i--) 91for (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 (1)
Interactive\Core\InteractiveHost.Service.cs (1)
642if (attempts.Count > 0)
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\DecompiledSource\AssemblyResolver.cs (2)
88if (assemblies.Count == 1) 100Log(FeaturesResources.Found_0_assemblies_for_1, assemblies.Count, name.Name);
Handler\ResolveCache.cs (1)
66if (_resultIdToCachedItem.Count >= _maxCacheSize)
Protocol\Converters\SumConverter.cs (1)
89if ((objectUnionTypeInfosSet?.Count ?? 0) > 1)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (3)
163Assert.Equal(supportedOptions.Sum(option => option is IPerLanguageValuedOption ? 2 : 1), expectedValues.Count); 168for (var i = 0; i < expectedValues.Count; i++) 213Assert.Equal(expectConfigurationItemsNumber, MockClientSideValues.Count);
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Host\TestUtils.cs (1)
87if (items.Count == 0)
Services\DiagnosticAnalyzer\PerformanceQueue.cs (1)
121var squareLength = Math.Sqrt(data.Count);
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (1)
TelemetryLoggerTests.cs (1)
83Assert.Equal((level < LogLevel.Information) ? 0 : 1, logger.PostedEvents.Count);
Microsoft.CodeAnalysis.Scripting (2)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (1)
298for (int i = 0; i < members.Count; i++)
Hosting\SynchronizedList.cs (1)
42return _list.Count;
Microsoft.CodeAnalysis.Test.Utilities (11)
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;
Platform\Custom\MetadataSignatureHelper.cs (3)
178return list.Count > 0; 197return list.Count > 0; 210return list.Count > 0;
SourceGeneration\TestGenerators.cs (1)
33hintName ??= "generatedFile" + (_sources.Any() ? (_sources.Count + 1).ToString() : "");
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)
245Assert.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.VisualBasic.Syntax.UnitTests (5)
Syntax\SyntaxAnnotationTests.vb (5)
439Dim count = GetAllNodesAndTokens(currentRoot).Count 468Dim numberOfCandidates = candidatePool.Count 717Dim annotation = Me._annotations(Me._myRandom.Next(0, _annotations.Count - 1)) 726Dim annotation = Me._annotations(Me._myRandom.Next(0, _annotations.Count - 1)) 740Dim annotation = Me._annotations(Me._myRandom.Next(0, _annotations.Count - 1))
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)
444for (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);
SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (2)
122if (currentMembers.Count != previousMembers.Count)
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\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
335return 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)
32for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 41list.RemoveRange(targetIndex, list.Count - targetIndex); 51for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 60list.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)
128if (_initialIndentBlockOperations.Count <= 0) 146var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 150for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
109if (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)
20while (trimmedLeadingTrivia.Count >= 3 && 25trimmedLeadingTrivia.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)
500for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 520Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 522_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
32if (orderedExistingConstants.Count == 0) 42else if (orderedExistingConstants.Count > 0) 115if (existingConstants.Count >= 1 && 120if (existingConstants.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (1)
59Contract.ThrowIfTrue(_index + values.Count > _values.Length);
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)
279if (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)
575var hasAnalyzerChanges = _analyzersAddedInBatch.Count > 0 || _analyzersRemovedInBatch.Count > 0; 697if (metadataReferencesAddedInBatch.Count > 0) 752if (analyzersRemovedInBatch.Count == 0 && analyzersAddedInBatch.Count == 0) 772Contract.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 (6)
MSBuild\ProjectFile\ProjectFile.cs (1)
464if (items.Count == 1)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
335return source.Count == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (1)
59Contract.ThrowIfTrue(_index + values.Count > _values.Length);
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)
247while (_completionSources.Count <= index)
VisualStudioMSBuildWorkspaceTests.cs (8)
79Assert.Equal(4, references.Count); 89Assert.Equal(5, compReferences.Count); 764Assert.Equal(6, documents.Count); 844Assert.Equal(2, documents.Count); 2021Assert.Equal(4, documents.Count); 2040Assert.Equal(4, documentsB.Count); 2064Assert.Equal(3, documents.Count); 2992Assert.Equal(3, docs.Count);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestHelpers.cs (1)
164var id = namingRules.Count;
Microsoft.CodeAnalysis.Workspaces.UnitTests (23)
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)
2881Assert.Equal(docs.Count, trees.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)
368Debug.Assert(argNames.Count <= argCount - discard);
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (1)
912Debug.Assert(expressions.Count == arrinit.DimensionSizes[0]);
Microsoft\CSharp\RuntimeBinder\Semantics\Binding\Better.cs (3)
489Debug.Assert(list.Count != 0); 512for (int i = 1; i < list.Count; i++) 535if (i < list.Count)
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (15)
812iuciBestSrc = prguci.Count - 1; 819iuciBestSrc = prguci.Count - 1; 823Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count - 1); 828iuciBestSrc = prguci.Count - 1; 839iuciBestDst = prguci.Count - 1; 846iuciBestDst = prguci.Count - 1; 850Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count - 1); 855iuciBestDst = prguci.Count - 1; 870Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 871Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 878for (int iuci = 0; iuci < prguci.Count; iuci++) 1057Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 1058Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 1496return list == null || list.Count == 0; 1504T[] array = new T[list.Count];
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (4)
303for (int i = 0; i < src.prgexpr.Count; i++) 317if (_methList.Count == 1) 469if (i < pArguments.prgexpr.Count) 1010if (_pArguments.prgexpr == null || _pArguments.prgexpr.Count == 0)
Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs (1)
112if (paramNames[i] != named.Name || i == paramNames.Count - 1 && i != args.carg - 1)
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (1)
1600if (_pExactBounds[iParam].Count >= 2)
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (14)
401if (binopSignatures.Count == 1) 409for (index = 1; index < binopSignatures.Count; index++) 437for (index = 0; index < binopSignatures.Count; index++) 527Debug.Assert(binopSignatures.Count > 0); 528bestBinopSignature = binopSignatures.Count - 1; 530else if (binopSignatures.Count == 0) 553Debug.Assert(bestBinopSignature < binopSignatures.Count); 1188int nBestSignature = pSignatures.Count - 1; 1204if (pSignatures.Count == 0) 1211if (pSignatures.Count != 1) 1214for (int iuofs = 1; iuofs < pSignatures.Count; iuofs++) 1240for (int iuofs = 0; iuofs < pSignatures.Count; iuofs++) 1255nBestSignature = pSignatures.Count - 1; 1259Debug.Assert(nBestSignature < pSignatures.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (1)
48if (iv >= prgptvs.Count)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (3)
154for (int i = inheritance.Count - 1; i >= 0; --i) 589for (int i = 0; i < declarationChain.Count; i++) 629Debug.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)
101if (tokenCredentials.Count == 0)
Microsoft.DotNet.Build.Tasks.Installers (2)
src\RpmBuilder.cs (2)
295directoryIndex = directories.Count; 303fileClassIndex = fileClassDictionary.Count;
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)
350if (commands.Count == 1)
Microsoft.DotNet.SignCheck (1)
SignCheck.cs (1)
282if (downloadFiles.Count > 0)
Microsoft.DotNet.SignCheckLibrary (1)
Verification\Exclusions.cs (1)
21return _exclusions.Count;
Microsoft.DotNet.SignTool (8)
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)
src\StrongName.cs (2)
422Debug.Assert(segment.Count > 0); 425int 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)
Discoverers\ConditionalTestDiscoverer.cs (1)
85if (falseConditions.Count > 0)
XunitParallelTheoryTestCaseRunner.cs (1)
133var runningTests = new List<Task<RunSummary>>(_testRunners.Count);
Microsoft.Extensions.AI (5)
ChatCompletion\ChatClientBuilder.cs (1)
49for (var i = _clientFactories.Count - 1; i >= 0; i--)
ChatCompletion\FunctionInvokingChatClient.cs (3)
352int preFccCount = functionCallContents.Count; 357int addedFccs = functionCallContents.Count - preFccCount; 382|| functionCallContents is not { Count: > 0 })
Embeddings\EmbeddingGeneratorBuilder.cs (1)
54for (var i = _generatorFactories.Count - 1; i >= 0; i--)
Microsoft.Extensions.AI.Abstractions (8)
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (2)
205while (start < contents.Count - 1) 226for (; i < contents.Count && contents[i] is TextContent 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);
Microsoft.Extensions.AI.Abstractions.Tests (4)
ChatCompletion\ChatCompletionTests.cs (1)
42Assert.Equal(3, messages.Count);
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (3)
182Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), message.Contents.Count); 185Assert.Equal(expected.Count, contents.Length); 186for (int i = 0; i < expected.Count; i++)
Microsoft.Extensions.AI.AzureAIInference.Tests (5)
AzureAIInferenceChatClientTests.cs (5)
233Assert.Equal(12, updates.Count); 234for (int i = 0; i < updates.Count; i++) 865Assert.Equal(10, updates.Count); 866for (int i = 0; i < updates.Count; i++) 875FunctionCallContent fcc = Assert.IsType<FunctionCallContent>(Assert.Single(updates[updates.Count - 1].Contents));
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
129Assert.True(chunks.Count > 1);
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
260if (message.Content?.Length > 0 || contents.Count == 0)
Microsoft.Extensions.AI.Ollama.Tests (7)
OllamaChatClientTests.cs (7)
182Assert.Equal(21, updates.Count); 186for (int i = 0; i < updates.Count; i++) 189Assert.Equal(i < updates.Count - 1 ? 1 : 2, updates[i].Contents.Count); 193Assert.Equal(i < updates.Count - 1 ? null : ChatFinishReason.Length, updates[i].FinishReason); 197Assert.Equal(2, updates[updates.Count - 1].Contents.Count); 198Assert.IsType<TextContent>(updates[updates.Count - 1].Contents[0]); 199UsageContent usage = Assert.IsType<UsageContent>(updates[updates.Count - 1].Contents[1]);
Microsoft.Extensions.AI.OpenAI (2)
OpenAIModelMapper.ChatMessage.cs (1)
236if (parts.Count == 0)
OpenAIModelMappers.StreamingChatCompletion.cs (1)
37index: toolCallUpdates.Count,
Microsoft.Extensions.AI.OpenAI.Tests (5)
OpenAIChatClientTests.cs (5)
267Assert.Equal(12, updates.Count); 268for (int i = 0; i < updates.Count; i++) 858Assert.Equal(10, updates.Count); 859for (int i = 0; i < updates.Count; i++) 870FunctionCallContent fcc = Assert.IsType<FunctionCallContent>(Assert.Single(updates[updates.Count - 1].Contents));
Microsoft.Extensions.AI.Tests (8)
ChatCompletion\FunctionInvokingChatClientTests.cs (8)
491for (int i = 0; i < activities.Count - 1; i++) 494Assert.Same(activities[activities.Count - 1], activities[i].Parent); 680Assert.Equal(expected.Count, chat.Count); 681for (int i = 0; i < expected.Count; i++) 770Assert.Equal(expected.Count, chat.Count); 771for (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.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)
392for (int i = 0; i < _allStats.Count; 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)
106var childCount = Configuration.ConfigurationSectionDebugView.FromConfiguration(this, _root).Count;
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
855Array 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 (11)
DependencyInjectionEventSource.cs (1)
158for (int i = _providers.Count - 1; i >= 0; i--)
ServiceLookup\CallSiteFactory.cs (5)
340callSites = new ServiceCallSite[callSitesByIndex.Count]; 726if (_items != null && _items.Count > 0) 728return _items[_items.Count - 1]; 746return 1 + (_items?.Count ?? 0); 780return _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 (5)
CircularBufferTests.cs (1)
34var expectedBufferElements = elementsToAdd.Skip(Math.Max(0, elementsToAdd.Count - BufferSize)).ToList();
Linux\LinuxCountersTests.cs (1)
109samples.Count.Should().Be(22);
Linux\LinuxUtilizationProviderTests.cs (2)
78Assert.Equal(5, samples.Count); 147Assert.Equal(5, 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)
90if (changeTokens.Count == 0)
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)
54return 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)
274if (_configureHostConfigActions.Count > 0) 315if (_configureContainerActions.Count > 0)
Internal\Host.cs (4)
153if (exceptions.Count > 0) 155if (exceptions.Count == 1) 287if (exceptions.Count > 0) 289if (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)
2319if (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)
87return _formatter.ValueNames.Count + 1;
LoggerMessage.cs (1)
456int actualCount = logValuesFormatter.ValueNames.Count;
LogValuesFormatter.cs (4)
69vsb.Append(_valueNames.Count.ToString()); 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)
53(lm.TemplateParameters.Count <= MaxLoggerMessageDefineArguments) && // more args than LoggerMessage.Define can handle 55(lm.TemplateList.Count == lm.TemplateParameters.Count); // mismatch in template to args, which LoggerMessage.Define can't handle 60for (int i = 0; i < lm.TemplateList.Count; i++) 96for (int i = parentClasses.Count - 1; i >= 0; i--) 147if (lm.TemplateParameters.Count > 0) 173{nestedIndentation}public int Count => {lm.TemplateParameters.Count + 1}; 188{nestedIndentation}for (int i = 0; i < {lm.TemplateParameters.Count + 1}; i++) 233if (index < lm.TemplateParameters.Count) 279if (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)
694int capacity = modelToValidate.MembersToValidate.Count == 0 ? 0 : modelToValidate.MembersToValidate.Max(static vm => vm.ValidationAttributes.Count); 705if (vm.ValidationAttributes.Count > 0) 757if (attr.ConstructorArguments.Count > 0) 761for (var i = 0; i < attr.ConstructorArguments.Count; i++) 763if (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 (3)
DnsServiceEndpointProvider.cs (1)
45if (endpoints.Count == 0)
DnsServiceEndpointProviderBase.cs (2)
88if (_lastEndpointCollection is { Count: > 0 } eps) 109if (endpoints is { Count: > 0 })
Microsoft.Extensions.Telemetry (8)
Logging\ExtendedLogger.LegacyTagJoiner.cs (3)
57else if (index < _incomingTagCount + _extraTags.Count) 63return StaticTags![index - _incomingTagCount - _extraTags.Count]; 68public int Count => _incomingTagCount + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLogger.ModernTagJoiner.cs (3)
67else if (index < _incomingTagsCount + _redactedTagsCount + _extraTags.Count) 73return StaticTags![index - _incomingTagsCount - _redactedTagsCount - _extraTags.Count]; 78public int Count => _incomingTagsCount + _redactedTagsCount + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLoggerFactory.cs (2)
209var loggers = new LoggerInformation[_providerRegistrations.Count]; 210for (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.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 (7)
src\Generators\Microsoft.Gen.ComplianceReports\Emitter.cs (2)
55if (member.Classifications.Count > 0) 99if (p.Classifications.Count > 0)
src\Generators\Microsoft.Gen.Metrics\Emitter.cs (3)
114for (int i = parentTypes.Count - 1; i >= 0; i--) 183metricMethod.StrongTypeConfigs.Count != 0; 210metricMethod.StrongTypeConfigs.Count > MaxTagsWithoutEnabledCheck)
src\Generators\Microsoft.Gen.Metrics\MetricFactoryEmitter.cs (1)
104var count = metricType.Methods.Count;
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.JavaScript.JSImportGenerator (2)
JSExportCodeGenerator.cs (1)
123if (finallyStatements.Count > 0)
JSImportCodeGenerator.cs (1)
117if (finallyStatements.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 (29)
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++)
Graphics\PaintExtensions.iOS.cs (5)
139 if (gradientStops == null || gradientStops.Count == 0) 142 if (gradientStops.Count > 1 && gradientStops.Any(gt => gt.Offset != 0)) 146 int itemCount = gradientStops.Count; 171 if (gradientStops == null || gradientStops.Count == 0) 174 CGColor[] colors = new CGColor[gradientStops.Count];
Handlers\HybridWebView\HybridWebViewHandler.cs (1)
461 for (var i = 0; i < uniqueMatches.Count; i++)
Handlers\WebView\WebViewHandler.iOS.cs (2)
287 if (OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsTvOSVersionAtLeast(11) || deleteCookies.Count == 0) 388 if (cookies.Count > 0)
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;
Platform\iOS\MauiUIApplicationDelegate.Menu.cs (2)
46 if (activeWindowScenes.Count > 0) 52 if ((OperatingSystem.IsMacCatalystVersionAtLeast(16) || OperatingSystem.IsIOSVersionAtLeast(16)) && activeWindowScenes.Count > 1)
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 (308)
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)
Compatibility\Handlers\ListView\iOS\ContextActionCell.cs (17)
154 if (_menuItems.Count > 0) 192 for (var i = 0; i < _buttons.Count; i++) 237 for (var i = _buttons.Count - 1; i >= 0; i--) 279 for (var i = 0; i < _buttons.Count; i++) 304 for (var i = 0; i < _buttons.Count; i++) 362 while (largestButtonWidth * (_buttons.Count + (needMoreButton ? 1 : 0)) > acceptableTotalWidth && _buttons.Count > 1) 366 var button = _buttons[_buttons.Count - 1]; 367 _buttons.RemoveAt(_buttons.Count - 1); 373 if (needMoreButton && _cell.ContextActions.Count - _buttons.Count == 1) 374 _buttons.RemoveAt(_buttons.Count - 1); 415 for (var i = 0; i < _buttons.Count; i++) 518 if (_buttons.Count == 3) 525 _buttons.RemoveAt(_buttons.Count - 1); 543 var needMore = _cell.ContextActions.Count > _buttons.Count; 587 var totalWidth = _buttons.Count * largestWidth; 588 for (var n = 0; n < _buttons.Count; n++)
Compatibility\Handlers\ListView\iOS\ContextScrollViewDelegate.cs (3)
59 for (var i = 0; i < buttons.Count; i++) 104 var count = _buttons.Count; 296 for (var i = 0; i < _buttons.Count; i++)
Compatibility\Handlers\Shell\iOS\ShellSectionRenderer.cs (3)
421 for (int i = pages.Count - 1; i >= 1; i--) 448 for (int i = pages.Count - 1; i >= 1; i--) 677 stack?.RemoveAt(stack.Count - 1);
Compatibility\Handlers\Shell\iOS\ShellTableViewSource.cs (3)
193 if (section < Groups.Count - 1) 206 return Groups.Count; 220 return Groups[(int)section].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--)
Handlers\Items\iOS\ItemsViewDelegator.cs (2)
122 var visibleItems = indexPathsForVisibleItems.Count > 0; 171 if (indexPathsForVisibleItems.Count == 0)
Handlers\Items\iOS\ObservableGroupedSource.cs (1)
120 for (int n = _groups.Count - 1; n >= 0; n--)
Handlers\Items2\iOS\ItemsViewDelegator2.cs (2)
123 var visibleItems = indexPathsForVisibleItems.Count > 0; 172 if (indexPathsForVisibleItems.Count == 0)
Internals\ProfilePage.cs (1)
49 while (i < Data.Count)
Label\Label.cs (2)
404 if (!point.IsEmpty && spans.Count > 1) // More than 2 elements overlapping, deflate to see which one is actually hit. 405 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)
587 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)
381 if (_pendingActions.Count > 0) 601 if (startingLayout.Count <= i || c.Bounds != startingLayout[i])
Platform\GestureManager\GesturePlatformManager.iOS.cs (1)
690 for (int i = 0; i < toRemove.Count; i++)
Platform\iOS\ControlsModalWrapper.cs (2)
73 if (modalStack.Count > 0) 74 modalStack.RemoveAt(modalStack.Count - 1);
Platform\iOS\Extensions\BrushExtensions.cs (5)
208 if (gradientStops == null || gradientStops.Count == 0) 211 if (gradientStops.Count > 1 && gradientStops.Any(gt => gt.Offset != 0)) 215 int itemCount = gradientStops.Count; 240 if (gradientStops == null || gradientStops.Count == 0) 243 CGColor[] colors = new CGColor[gradientStops.Count];
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;
Platform\ModalNavigationManager\ModalNavigationManager.iOS.cs (4)
127 if (_platformModalPages.Count > 1) 129 var topPage = _platformModalPages[_platformModalPages.Count - 2]; 173 if (_platformModalPages.Count > 0) 175 var uiViewController = (_platformModalPages[_platformModalPages.Count - 1].Handler as IPlatformViewHandler)?.ViewController;
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)
911 for (int i = 0; i < _appearanceObservers.Count; i++) 1869 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 (47)
64 if (_navStack.Count > 1) 65 return _navStack[_navStack.Count - 1]; 114 if (_navStack.Count <= 1) 117 var page = _navStack[_navStack.Count - 1]; 131 if (_navStack.Count <= 1) 137 for (int i = 1; i < oldStack.Count; i++) 143 for (int i = 1; i < oldStack.Count; i++) 154 if (_navStack.Count <= 1) 157 var last = _navStack[_navStack.Count - 1]; 170 if (_navStack.Count <= 1) 331 for (int i = 1; i < navStackCopy.Count; i++) 334 if (i > globalRoutes.Count || routeToRemove != globalRoutes[i - 1]) 352 for (int i = 0; i < globalRoutes.Count; i++) 354 bool isLast = i == globalRoutes.Count - 1; 357 if (navIndex < _navStack.Count && Routing.GetRoute(_navStack[navIndex]) == globalRoutes[i]) 362 var page = GetOrCreateFromRoute(globalRoutes[i], queryData, services, i == globalRoutes.Count - 1, false); 368 else if (!isLast && navIndex < _navStack.Count) 382 for (int i = 0; i < globalRoutes.Count; i++) 384 bool isLast = i == globalRoutes.Count - 1; 390 if (navStack.Count == 1) 393 Page navPage = navStack.Count > i + 1 ? navStack[i + 1] : null; 420 while (navStack.Count > popCount && Navigation.ModalStack.Count > 0) 422 bool isAnimated = animate ?? IsNavigationAnimated(navStack[navStack.Count - 1]); 423 if (Navigation.ModalStack.Contains(navStack[navStack.Count - 1])) 435 while (_navStack.Count > popCount) 439 if ((_navStack.Count - popCount) == 1) 441 bool isAnimated = animate ?? IsNavigationAnimated(_navStack[_navStack.Count - 1]); 446 OnRemovePage(_navStack[_navStack.Count - 2]); 464 for (int i = 0; i < globalRoutes.Count; i++) 467 for (int j = 1; j < _navStack.Count; j++) 500 if (globalRoutes == null || globalRoutes.Count == 0) 502 if (_navStack.Count == 2) 519 bool weveGoneTotalModal = currentNavStack.Count > _navStack.Count; 523 whereToStartNavigation = currentNavStack.Count - 1; 525 for (int i = whereToStartNavigation; i < globalRoutes.Count; i++) 527 bool isLast = i == globalRoutes.Count - 1; 557 for (int i = 0; i < modalPageStacks.Count; i++) 559 bool isLast = i == modalPageStacks.Count - 1; 599 for (int i = pages.Count - 1; i >= 0; i--) 601 bool isLast = i == pages.Count - 1; 760 if (_navStack.Count <= 1) 777 var page = _navStack[_navStack.Count - 1]; 801 if (_navStack.Count <= 1) 816 var page = _navStack[_navStack.Count - 1]; 832 for (int i = 1; i < oldStack.Count; i++) 957 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)
1530 if (changedResources.Count != 0)
VisualStateManager.cs (2)
468 if (conflicts.Count > 1) 772 public int Count => _internalList.Count;
WebView\WebView.cs (1)
317 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) 1086 yield return Create(Ldc_I4, handlers.Count); 1089 for (var i = 0; i < handlers.Count; i++)
Microsoft.Maui.Controls.Compatibility (40)
iOS\CollectionView\ItemsViewDelegator.cs (2)
124 var visibleItems = indexPathsForVisibleItems.Count > 0; 156 if (indexPathsForVisibleItems.Count == 0)
iOS\CollectionView\ListSource.cs (3)
47 public int ItemCount => Count; 51 for (int n = 0; n < Count; n++) 74 return Count;
iOS\CollectionView\LoopListSource.cs (2)
28 public int LoopCount => Loop ? Count * LoopBy : Count;
iOS\CollectionView\ObservableGroupedSource.cs (1)
111 for (int n = _groups.Count - 1; n >= 0; n--)
iOS\ContextActionCell.cs (17)
159 if (_menuItems.Count > 0) 197 for (var i = 0; i < _buttons.Count; i++) 242 for (var i = _buttons.Count - 1; i >= 0; i--) 284 for (var i = 0; i < _buttons.Count; i++) 309 for (var i = 0; i < _buttons.Count; i++) 367 while (largestButtonWidth * (_buttons.Count + (needMoreButton ? 1 : 0)) > acceptableTotalWidth && _buttons.Count > 1) 371 var button = _buttons[_buttons.Count - 1]; 372 _buttons.RemoveAt(_buttons.Count - 1); 378 if (needMoreButton && _cell.ContextActions.Count - _buttons.Count == 1) 379 _buttons.RemoveAt(_buttons.Count - 1); 419 for (var i = 0; i < _buttons.Count; i++) 522 if (_buttons.Count == 3) 529 _buttons.RemoveAt(_buttons.Count - 1); 547 var needMore = _cell.ContextActions.Count > _buttons.Count; 591 var totalWidth = _buttons.Count * largestWidth; 592 for (var n = 0; n < _buttons.Count; n++)
iOS\ContextScrollViewDelegate.cs (3)
59 for (var i = 0; i < buttons.Count; i++) 104 var count = _buttons.Count; 296 for (var i = 0; i < _buttons.Count; i++)
iOS\Extensions\GeometryExtensions.cs (4)
186 CGPoint[] cgpoints = new CGPoint[points.Count]; 188 for (int i = 0; i < points.Count; i++) 193 lastPoint = points.Count > 0 ? points[points.Count - 1] : Point.Zero;
iOS\Platform.cs (5)
132 if (_modals.Count >= 1 && controller != null) 555 if (_modals.Count > 1) 557 var topPage = _modals[_modals.Count - 2]; 583 if (_modals.Count > 0) 585 var uiViewController = GetRenderer(_modals[_modals.Count - 1]) as UIViewController;
iOS\Renderers\WkWebViewRenderer.cs (2)
498 if (Forms.IsiOS11OrNewer || deleteCookies.Count == 0) 533 if (cookies.Count > 0)
iOS\VisualElementRenderer.cs (1)
319 for (var i = 0; i < _elementChangedHandlers.Count; i++)
Microsoft.Maui.Controls.SourceGen (2)
src\Controls\src\Xaml\XmlTypeXamlExtensions.cs (2)
55 if (lookupAssemblies.Count == 0) 68 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)
55 if (lookupAssemblies.Count == 0) 68 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)
99 var linesToDraw = lines.Count; 104 linesToDraw = (int)Math.Min(maxLines, lines.Count); 111 var startIndex = (lines.Count / 2); 154 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)
549if (curFidx > catBoundaries[catBoundaries.Count - 1]) 576catMetaData.NumCol = catBoundaries.Count - 1; 761if (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 (52)
Model\BPETokenizer.cs (2)
388EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), ids, maxTokenCount - ids.Count, out int length, ref priorityQueue); 391if (length < split.Length || ids.Count >= maxTokenCount)
Model\CodeGenTokenizer.cs (13)
629EncodeToIdsInternal(null, textSpanToEncode.Slice(split.Offset, split.Length), ids, agenda, out int length, maxTokenCount - ids.Count); 632if (length < split.Length || ids.Count >= maxTokenCount) 640EncodeToIdsInternal(addPrefixSpace ? null : (normalizedText ?? text), textSpanToEncode, ids, agenda, out charsConsumed, maxTokenCount - ids.Count); 643if (addEndOfSentence && EndOfSentenceId.HasValue && ids.Count < maxTokenCount) 1014if (tokens.Count <= maxTokens) 1025return tokens.Count; 1036while (j < tokens.Count && tokens[j].Offset.Start.Value == tokens[tokenCount].Offset.Start.Value) 1070if (tokens.Count <= maxTokens) 1081return tokens.Count; 1084int index = tokens.Count - maxTokens; 1087while (index < tokens.Count && tokens[index].Offset.Start.Value == tokens[index - 1].Offset.Start.Value) 1092for (int i = index; i < tokens.Count; i++) 1098return 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\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\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.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)
574if (xfCols.Count > 0) 598if (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 (5)
InternableString.cs (2)
79while (_spanIndex < _string._spans.Count) 292if (_inlineSpan.IsEmpty && _spans?.Count == 1 && _spans[0].Length == Length)
SpanBasedStringBuilder.cs (3)
66while (_spanIndex < _spans.Count) 209for (int spanIdx = 0; spanIdx < _spans.Count; spanIdx++) 234for (int spanIdx = _spans.Count - 1; spanIdx >= 0; spanIdx--)
Microsoft.NET.StringTools.net35 (1)
WeakStringCache.Locking.cs (1)
97for (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 (33)
ChangeSignature\ChangeSignatureDialogViewModel.cs (15)
128if (matchingParameters.Count > 1) 166if (_parametersWithDefaultValues.Count + _parametersWithoutDefaultValues.Count > 0) 417if (index <= 0 || index == _parametersWithoutDefaultValues.Count || index >= _parametersWithoutDefaultValues.Count + _parametersWithDefaultValues.Count) 437if (index < 0 || index == _parametersWithoutDefaultValues.Count - 1 || index >= _parametersWithoutDefaultValues.Count + _parametersWithDefaultValues.Count - 1) 452Move(index < _parametersWithoutDefaultValues.Count ? _parametersWithoutDefaultValues : _parametersWithDefaultValues, index < _parametersWithoutDefaultValues.Count ? index : index - _parametersWithoutDefaultValues.Count, delta: -1); 461Move(index < _parametersWithoutDefaultValues.Count ? _parametersWithoutDefaultValues : _parametersWithDefaultValues, index < _parametersWithoutDefaultValues.Count ? index : index - _parametersWithoutDefaultValues.Count, delta: 1);
FindReferences\Contexts\AbstractTableDataSourceFindUsagesContext.cs (3)
194list.Capacity = list.Count + builder.Count; 615var result = new FixedSizeArrayBuilder<Entry>(entries.nonPrimary.Count + entries.primary.Count);
GenerateType\GenerateTypeDialogViewModel.cs (2)
333Folders.RemoveAt(Folders.Count - 1); 533this.IsExistingFileEnabled = _previouslyPopulatedDocumentList.Count == 0 ? false : true;
Implementation\VsRefactorNotifyService.cs (2)
48(uint)itemIDs.Count, 85(uint)itemIDs.Count,
PickMembers\PickMembersDialogViewModel.cs (1)
152return index < MemberContainers.Count - 1;
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
327if (changedDocs.Count > 0)
Telemetry\CodeMarkerLogger.cs (1)
159for (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 (1)
CodeModel\CSharpCodeModelService.cs (1)
1308if (firstIndex < leadingTriviaList.Count &&
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
CodeModel\FileCodeClassTests.cs (1)
310Assert.Equal(2, z.Count);
MSBuild (28)
BuildEnvironmentHelper.cs (2)
302if (instances.Count == 0) 307if (instances.Count > 1)
CollectionHelpers.cs (3)
24List<T> inputsWithoutNulls = new List<T>(inputs.Count); 35return (inputsWithoutNulls.Count == inputs.Count) ? inputs : inputsWithoutNulls;
XMake.cs (23)
1329remoteLoggerRecords.Count == 0 && 3578if (actualProjectFiles.Count == 1 && actualSolutionFiles.Count == 1) 3588else if (actualSolutionFiles.Count > 1) 3593else if (actualProjectFiles.Count > 1) 3599if (actualProjectFiles.Count == 2) 3626else if (actualProjectFiles.Count == 0 && 3627actualSolutionFiles.Count == 0 && 3628solutionFilterFiles.Count == 0) 3636projectFile = actualSolutionFiles.Count == 1 ? actualSolutionFiles[0] : actualProjectFiles.Count == 1 ? actualProjectFiles[0] : solutionFilterFiles[0]; 3637InitializationException.VerifyThrow(actualSolutionFiles.Count == 1 || actualProjectFiles.Count == 1 || solutionFilterFiles.Count == 1, projectDirectory == null ? "AmbiguousProjectError" : "AmbiguousProjectDirectoryError", null, projectDirectory); 4257ErrorUtilities.VerifyThrow((loggerSpec.Count >= 1) && (loggerSpec.Count <= 2), 4272if (loggerSpec.Count > 1) 4303ErrorUtilities.VerifyThrow((loggerSpec.Count >= 1) && (loggerSpec.Count <= 2), 4311if (loggerSpec.Count == 2) 4319ErrorUtilities.VerifyThrow(loggerTypeSpec.Count >= 1, "SplitUnquoted() must return at least one string"); 4324if (loggerTypeSpec.Count >= 2) 4336for (int i = 2; i < loggerTypeSpec.Count; i++)
MSBuildTaskHost (7)
BinaryTranslator.cs (2)
1024int count = list.Count; 1063int count = list.Count;
BuildEnvironmentHelper.cs (2)
302if (instances.Count == 0) 307if (instances.Count > 1)
CollectionHelpers.cs (3)
24List<T> inputsWithoutNulls = new List<T>(inputs.Count); 35return (inputsWithoutNulls.Count == inputs.Count) ? inputs : inputsWithoutNulls;
PrepareTests (3)
MinimizeUtil.cs (2)
107if (pair.Value.Count > 1) 128.Where(x => x.Value.Count > 1)
TestDiscovery.cs (1)
27Console.WriteLine($"Found {assemblies.Count} test assemblies");
PresentationBuildTasks (19)
Microsoft\Build\Tasks\Windows\UidManager.cs (2)
690for (int i = 0; i < _uids.Count; i++) 738get { return _uids.Count; }
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (3)
234if (modifiedXamlFiles.Count > 0) 414for (int i = 0; i < modifiedXamlFiles.Count; i++) 440if (recompiledXaml.Count > 0)
src\Microsoft.DotNet.Wpf\src\PresentationCore\MS\Internal\Media\XamlSerializationHelper.cs (6)
200writer.Write( ( uint ) point3Ds.Count ) ; 203for ( int i = 0; i < point3Ds.Count ; i ++ ) 232writer.Write( ( uint ) points.Count ) ; 235for ( int i = 0; i < points.Count ; i ++ ) 264writer.Write( ( uint ) points.Count ) ; 267for ( int i = 0; i < points.Count ; i ++ )
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (6)
1176bamlPropertyWithStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1); 1586if (staticResourceRecordList.Count > 0) 1589for (int j=0; j<staticResourceRecordList.Count; j++) 1593for (int k=0; k<srRecords.Count; k++) 1677valueDeferRecord = _staticResourceRecordList[_staticResourceRecordList.Count-1]; 1692bamlStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlInt32CollectionSerializer.cs (1)
90count = ints.Count ;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
3268for (int j = 0; j < namespaceAssemblyPair.Count; j++)
PresentationCore (530)
MS\Internal\DpiUtil\DpiUtil.cs (1)
181int sizeOfList = UIElement.DpiScaleXValues.Count;
MS\Internal\FontCache\FontSourceCollection.cs (1)
137fontSources = new List<Text.TextInterface.IFontSource>(resourceEntries.Count);
MS\Internal\Ink\Bezier.cs (2)
69for (int x = 0; x < points.Count; x++) 576get { return _bezierControlPoints.Count; }
MS\Internal\Ink\CuspData.cs (2)
157int s = 0, e = _cusps.Count; 190get { return _points.Count; }
MS\Internal\Ink\ErasingStroke.cs (10)
99if ((_erasingStrokeNodes == null) || (_erasingStrokeNodes.Count == 0)) 142if ((_erasingStrokeNodes == null) || (_erasingStrokeNodes.Count == 0)) 158int index = eraseAt.Count; 174for (int i = index; i < eraseAt.Count; i++) 187if ((fragment.EndFIndex <= lastFragment.EndFIndex) || ((i + 1) == eraseAt.Count)) 215if (eraseAt[eraseAt.Count - 1].IsFull) 221if ((index > 0) && (index < eraseAt.Count)) 243if (eraseAt.Count != 0) 251return (eraseAt.Count != 0); 300newPath[newPath.Count - 1] = path[i];
MS\Internal\Ink\ExtendedPropertyCollection.cs (10)
46for (int i = 0; i < _extendedProperties.Count; i++) 106for (int x = 0; x < _extendedProperties.Count; x++) 135for (int x = 0; x < _extendedProperties.Count; x++) 198if (_extendedProperties.Count > 0) 200Guid[] guids = new Guid[_extendedProperties.Count]; 201for (int i = 0; i < _extendedProperties.Count; i++) 236for (int i = 0; i < _extendedProperties.Count; i++) 295return _extendedProperties.Count; 338_optimisticIndex < _extendedProperties.Count && 345for (int i = 0; i < _extendedProperties.Count; i++)
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (1)
238if (foundAllGestures && gestures.Count != 1)
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (1)
87if (((compressedData.Count - 1/*for the algo byte we just made room for*/) >> 2) > input.Length)
MS\Internal\Ink\InkSerializedFormat\GuidTagList.cs (4)
68for (i = 0; i < _customGuids.Count; i++) 145if ((0 > nIndex) || (_customGuids.Count <= nIndex)) 208uint ul = (uint)(_customGuids.Count * Native.SizeOfGuid); 230for (int i = 0; i < _customGuids.Count; i++)
MS\Internal\Ink\InkSerializedFormat\HuffModule.cs (1)
58if ((int)codec >= _huffCodecs.Count + AlgoModule.DefaultBAACount)
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (36)
103if (0 == (byte)(charData[charData.Count - 1])) 106charData.RemoveAt(charData.Count - 1); 569if (_strokeDescriptorTable.Count <= strokeDescriptorTableIndex) 582if (_transformTable.Count <= transformTableIndex) 604if (_metricTable.Count <= metricDescriptorTableIndex) 618if (_drawingAttributesTable.Count <= drawingAttributesTableIndex) 1569while (cTags < strd.Template.Count) 1623for (int i = 0; i < tags.Count; i++) 2193if (_strokeDescriptorTable.Count == 0) 2200if (_strokeDescriptorTable.Count == 1) 2205if (tmp.Template.Count == 0) 2222for (count = 0; count < _strokeDescriptorTable.Count; count++) 2232for (count = 0; count < _strokeDescriptorTable.Count; count++) 2252if (0 == _metricTable.Count) 2255for (int i = 0; i < _metricTable.Count; i++) 2269else if (1 == _metricTable.Count) 2279for (int i = 0; i < _metricTable.Count; i++) 2301for (int count = 0; count < strd.Template.Count; count++) 2320if (_transformTable.Count == 1 && _transformTable[0].Size == 0) 2329for (int i = 0; i < _transformTable.Count; i++) 2353if (_transformTable.Count == 1) 2364for (int i = 0; i < _transformTable.Count; i++) 2374for (int i = 0; i < _transformTable.Count; i++) 2448if (1 == _drawingAttributesTable.Count) 2479uint[] sizes = new uint[_drawingAttributesTable.Count]; 2480MemoryStream[] drawingAttributeStreams = new MemoryStream[_drawingAttributesTable.Count]; 2483for (int i = 0; i < _drawingAttributesTable.Count; i++) 2496for (int i = 0; i < _drawingAttributesTable.Count; i++) 2544for (int descriptorIndex = 0; descriptorIndex < _strokeDescriptorTable.Count; descriptorIndex++) 2556_strokeLookupTable[stroke].StrokeDescriptorTableIndex = (uint)_strokeDescriptorTable.Count - 1; 2562for (int tmp = 0; tmp < _metricTable.Count; tmp++) 2585_strokeLookupTable[stroke].MetricDescriptorTableIndex = (uint)(_metricTable.Count - 1); 2597for (int i = 0; i < _transformTable.Count; i++) 2610_strokeLookupTable[stroke].TransformTableIndex = (uint)(_transformTable.Count - 1); 2619for (int i = 0; i < _drawingAttributesTable.Count; i++) 2632_strokeLookupTable[stroke].DrawingAttributesTableIndex = (uint)_drawingAttributesTable.Count - 1;
MS\Internal\Ink\InkSerializedFormat\StrokeDescriptor.cs (3)
39if( _strokeDescriptor.Count != strd.Template.Count ) 43for( int i = 0; i < _strokeDescriptor.Count; i++ )
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (2)
166for (int iTag = 1; iTag < strokeDescriptor.Template.Count && remainingBytesInStrokeBlock > 0; iTag++) 175while (iTag < strokeDescriptor.Template.Count && remainingBytesInStrokeBlock > 0)
MS\Internal\Ink\Lasso.cs (20)
52return (_points.Count < 3); 64return _points.Count; 78System.Diagnostics.Debug.Assert((0 <= index) && (index < _points.Count)); 128int last = _points.Count; 139Point prevLassoPoint = _points[_points.Count - 1]; 140for (int i = 0; i < _points.Count; i++) 189if (_points.Count < 3) 213Point lassoLastPoint = _points[_points.Count - 1]; 295if (crossingList.Count == 0) 383for (int x = 0; x <= crossingList.Count; x++) 400if (x == crossingList.Count) 446StrokeIntersection previousIntersection = strokeIntersections[strokeIntersections.Count - 1]; 455strokeIntersections[strokeIntersections.Count - 1] = previousIntersection; 506if (0 == _points.Count) 512Point lastPoint = _points[_points.Count - 1]; 685if (0 == points.Count) 706System.Diagnostics.Debug.Assert(intersection >= 0 && intersection <= points.Count - 2); 708if (intersection == points.Count - 2) 740for (int j = 0; j < points.Count; j++) 771int count = points.Count;
MS\Internal\Ink\StrokeIntersection.cs (8)
194if (inFIndices.Count > 0 && 195inFIndices[inFIndices.Count - 1].EndFIndex >= 199StrokeFIndices sfiPrevious = inFIndices[inFIndices.Count - 1]; 201inFIndices[inFIndices.Count - 1] = sfiPrevious; 226if (hitFIndices.Count > 0 && 227hitFIndices[hitFIndices.Count - 1].EndFIndex >= 231StrokeFIndices sfiPrevious = hitFIndices[hitFIndices.Count - 1]; 233hitFIndices[hitFIndices.Count - 1] = sfiPrevious;
MS\Internal\Ink\StrokeRenderer.cs (22)
160int cbEndIndex = connectingQuadPoints.Count - 1; 171for (int i = abIndex, j = connectingQuadPoints.Count - 1; i < j; i++, j--) 378if (pathFigureABSide.Count > 0) 481if (pathFigureABSide.Count == 0) 483Debug.Assert(pathFigureDCSide.Count == 0); 630if (pathFigureABSide.Count > 0) 647Debug.Assert(pathFigureDCSide.Count == 0); 673Debug.Assert(pathFigureABSide.Count == 0); 688if (pathFigureABSide.Count > 0) 708Debug.Assert(pathFigureDCSide.Count == 0); 803for (int i = 0, j = dcPoints.Count - 1; i < j; i++, j--) 868Debug.Assert(points.Count > 0); 870context.BeginFigure(points[points.Count - 1], //start point 896Debug.Assert(abPoints.Count > 0 && dcPoints.Count > 0); 920if (abPoints.Count == 0 || dcPoints.Count == 0) 933for (int i = startIndex; i < points.Count; ) 938if (polyLinePoints.Count > 0) 947Debug.Assert(i + 2 < points.Count); 948if (i + 2 < points.Count) 973if (polyLinePoints.Count > 0)
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (7)
400for (int i = 0; i < hitTestEdgeList.Count; i++) 535if (pointList.Count >= 2) 540else if (pointList.Count == 1) 946if (pointList.Count >= 2) 951else if (pointList.Count == 1) 1029for (int i=0, count = edges.Count; i < count; i++) 1177for (int i = 0, count = edges.Count; i < count; i++)
src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (7)
1058for (int i = 0; i < _others.Count; i++) 1127Debug.Assert(_others.Count > 0); 1128int j = _others.Count-1; 1150if (_others.Count == 1) 1210return _others.Count + 1; 1293for (int i = 0; i < others.Count; i++) 1448return ((List<Entry>)_head._key).Count;
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (2)
447buffer = _targetBuffer[_targetBuffer.Count - 1]; 459_targetBuffer[_targetBuffer.Count - 1] = buffer;
System\Windows\Automation\Peers\AutomationPeer.cs (14)
552int cnt = children.Count; 1258result = new IRawElementProviderSimple[controlledPeers.Count]; 1260for (int i = 0; i < controlledPeers.Count; i++) 1470if (_children != null && _children.Count > 0) 1490int count = _children.Count; 1516if (_children != null && _children.Count > 0) 1518peer = _children[_children.Count - 1]; 1543&& _index + 1 < parent._children.Count 1566&& _index < parent._children.Count 1650iterationParent = (_parent._children == null || _parent._children.Count == caller._children.Count) 1764int count = children.Count; 1904for(int count = oldChildren.Count, i = 0; i < count; i++) 1916for(int count = _children.Count, i = 0; i < count; i++)
System\Windows\BinaryFormat\BinaryFormatWriter.cs (4)
247list.Count, 254new ArrayInfo(2, list.Count), 282list.Count, 287new ArrayInfo(2, list.Count),
System\Windows\dataobject.cs (2)
1254List<string> distinct = new(formats.Count); 1256for (int i = 0; i < formats.Count; i++)
System\Windows\FreezableCollection.cs (10)
152for (int i = _collection.Count - 1; i >= 0; i--) 159Debug.Assert(_collection.Count == 0); 351return _collection.Count; 368ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 478ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 489int count = _collection.Count; 709return _collection.Count; 794int count = source._collection.Count; 889int count = _collection.Count; 1010if (_index > -2 && _index < _list._collection.Count - 1)
System\Windows\Ink\IncrementalHitTester.cs (11)
95int count = _strokeInfos.Count; 181for (int i = 0; i < _strokeInfos.Count && localRemoved.Count > 0; ) 203if (_strokes.Count != _strokeInfos.Count) 209for (int i = 0; i < _strokeInfos.Count; i++) 231for (int x = 0; x < _strokeInfos.Count; x++) 252for (int x = 0; x < _strokeInfos.Count; x++) 262Debug.Assert(_strokeInfos.Count == _strokes.Count); 263for (int x = 0; x < _strokeInfos.Count; x++) 530for (int x = 0; x < this.StrokeInfos.Count; x++) 558System.Diagnostics.Debug.Assert(strokeHitEventArgCollection.Count != 0); 559for (int x = 0; x < strokeHitEventArgCollection.Count; x++)
System\Windows\Ink\Stroke.cs (5)
251Debug.Assert(bezierPoints != null && bezierPoints.Count > 0); 255new StylusPointCollection(_stylusPoints.Description, bezierPoints.Count); 265if (bezierPoints.Count == 1) 296for (int x = 1; x < bezierPoints.Count - 1; x++) 342bezierPoints[bezierPoints.Count - 1],
System\Windows\Input\AccessKeyManager.cs (4)
91return (targets != null && targets.Count > 0); 238for (int i = 0; i < targets.Count; i++) 277return (chosenIndex == targets.Count - 1) ? ProcessKeyResult.LastMatch : ProcessKeyResult.MoreMatches; 381for (int i = 0; i < possibleElements.Count; i++)
System\Windows\Input\Command\CanExecuteChangedEventManager.cs (3)
111removeList = (toRemove != null && toRemove.Count == list.Count); 299if (list.Count == 0)
System\Windows\Input\Command\CommandBindingCollection.cs (1)
282return _innerCBList?.Count ?? 0;
System\Windows\Input\Command\CommandManager.cs (2)
600for (int i = 0; i < list.Count; ++i) 607while (++i < list.Count && list[i].Item1 == classType)
System\Windows\Input\Command\InputBindingCollection.cs (3)
173if (index >= 0 && index < _innerBindingList.Count) 311if (index >= 0 && index < _innerBindingList.Count) 338return (_innerBindingList != null ? _innerBindingList.Count : 0);
System\Windows\Input\Command\InputGestureCollection.cs (1)
351return (_innerGestureList != null ? _innerGestureList.Count : 0 );
System\Windows\Input\ManipulationDevice.cs (3)
136for (int i = _manipulators.Count - 1; i >= 0; i--) 174if (_manipulators == null || _manipulators.Count == 0) 443Debug.Assert(_manipulators == null || _manipulators.Count == 0);
System\Windows\Input\ManipulationInertiaStartingEventArgs.cs (2)
207if (_inertiaParameters != null && _inertiaParameters.Count > 0) 243for (int i = 0, count = _inertiaParameters.Count; i < count; i++)
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (4)
177get { return _strokeInfoList.Count > 0; } 181get { return _strokeInfoList.Count == 1; } 876while (_strokeInfoList.Count > 0) 1016for (int i=0; i < _strokeInfoList.Count; i++)
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (5)
87if (points.Count == 0) 97((List<StylusPoint>)this.Items).Capacity = points.Count; 98for (int x = 0; x < points.Count; x++) 122if (stylusPoints.Count == 0) 127((List<StylusPoint>)this.Items).Capacity = stylusPoints.Count;
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (2)
51if (infos.Count < RequiredCountOfProperties || 68for (int x = RequiredCountOfProperties; x < infos.Count; x++)
System\Windows\Input\Stylus\Common\TabletDeviceCollection.cs (1)
35return TabletDevices.Count;
System\Windows\Input\Stylus\Pointer\PointerInteractionEngine.cs (1)
184UnsafeNativeMethods.SetInteractionConfigurationInteractionContext(_interactionContext, (uint)configuration.Count, configuration.ToArray());
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (2)
79for (i = 0; i < _plugInCollectionList.Count; i++) 87while (i < _plugInCollectionList.Count)
System\Windows\Input\Stylus\Pointer\PointerTabletDeviceInfo.cs (1)
268SupportedButtonPropertyIndex = supportedProperties.Count;
System\Windows\Input\Stylus\Wisp\PenContext.cs (3)
234return _stylusDevicesInRange != null && _stylusDevicesInRange.Count > 0; 358if (_stylusDevicesInRange.Count == 0) 376for(int i=0; i < _stylusDevicesInRange.Count; i++)
System\Windows\Input\Stylus\Wisp\PenContexts.cs (2)
277for (i=0; i < _plugInCollectionList.Count; i++) 285while (i < _plugInCollectionList.Count)
System\Windows\Input\Stylus\Wisp\PenThreadPool.cs (2)
91while (ignoredThreads.Count < MAX_PENTHREAD_RETRIES) 95for (int i = _penThreadWeakRefList.Count - 1; i >= 0; i--)
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (12)
1018if (penContextRefs.Count < MaxContextPerThread) 1027_pimcContexts = new IPimcContext3[penContextRefs.Count]; 1028_penContexts = new WeakReference[penContextRefs.Count]; 1029_handles = new IntPtr[penContextRefs.Count]; 1030_wispContextKeys = new UInt32[penContextRefs.Count]; 1032for (i=0; i < penContextRefs.Count; i++) 1081_pimcContexts = new IPimcContext3[penContextRefs.Count]; 1082_penContexts = new WeakReference[penContextRefs.Count]; 1083_handles = new IntPtr[penContextRefs.Count]; 1084_wispContextKeys = new UInt32[penContextRefs.Count]; 1086for (i=0; i < penContextRefs.Count; i++) 1166if (_workerOperation.Count > 0)
System\Windows\Input\Stylus\Wisp\WispLogic.cs (4)
1595int stagingItemCount = storedStagingItems.Count; 1665int count = touchDevice.StoredStagingAreaItems.Count; 3434int numDeferredTablets = _tabletDeviceCollection.DeferredTablets.Count; 3443&& _tabletDeviceCollection.DeferredTablets.Count == numDeferredTablets)
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (1)
659int c = Count + _deferredTablets.Count;
System\Windows\Input\TouchDevice.cs (9)
429int count = (_activeDevices != null) ? _activeDevices.Count : 0; 465int count = _activeDevices != null ? _activeDevices.Count : 0; 703if (_activeDevices.Count == 1) 807int count = _activeDevices != null ? _activeDevices.Count : 0; 1143int count = _activeDevices.Count; 1156if ((_activeDevices != null) && (_activeDevices.Count > 0)) 1172int count = _activeDevices.Count; 1218int count = _activeDevices.Count; 1238int count = _activeDevices.Count;
System\Windows\Media\Animation\Clock.cs (3)
1417if (_childIndex == parentChildren.Count - 1) 4277for (int childIndex = 0; childIndex < children.Count; childIndex++) 4301for (int index = 0; index < children.Count; index++)
System\Windows\Media\Animation\ClockGroup.cs (7)
131for (int index = 0; index < _children.Count; index++) 290for (int c = 0; c < _children.Count; c++) 311for (int c = 0; c < _children.Count; c++) 350for (int childIndex = 0; childIndex < _children.Count; childIndex++) 436for (int c = 0; c < _children.Count; c++) 499return (_rootChildren.Count > 0); 550for (int childIndex = 0; childIndex < _children.Count; childIndex++)
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (2)
743for (int j = 0; j < unspecifiedBlocks.Count; j++) 876for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (2)
742for (int j = 0; j < unspecifiedBlocks.Count; j++) 875for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ColorKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\DoubleKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (2)
742for (int j = 0; j < unspecifiedBlocks.Count; j++) 875for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\MatrixKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (2)
742for (int j = 0; j < unspecifiedBlocks.Count; j++) 875for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (2)
836for (int j = 0; j < unspecifiedBlocks.Count; j++) 969for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Point3DKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\PointKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (2)
836for (int j = 0; j < unspecifiedBlocks.Count; j++) 969for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\QuaternionKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\RectKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (2)
836for (int j = 0; j < unspecifiedBlocks.Count; j++) 969for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\SizeKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (2)
742for (int j = 0; j < unspecifiedBlocks.Count; j++) 875for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (2)
836for (int j = 0; j < unspecifiedBlocks.Count; j++) 969for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Vector3DKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (2)
835for (int j = 0; j < unspecifiedBlocks.Count; j++) 968for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\VectorKeyFrameCollection.cs (9)
97int count = sourceCollection._keyFrames.Count; 118int count = sourceCollection._keyFrames.Count; 139int count = sourceCollection._keyFrames.Count; 160int count = sourceCollection._keyFrames.Count; 179for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 214return _keyFrames.Count; 292return _keyFrames.Count - 1; 302if (_keyFrames.Count > 0) 304for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\ParallelTimeline.cs (1)
100for (int childIndex = 0; childIndex < children.Count; childIndex++)
System\Windows\Media\Animation\TimelineClockCollection.cs (1)
35return childList.Count;
System\Windows\Media\Animation\WeakRefEnumerator.cs (2)
107_readIndex = _writeIndex = _list.Count; 132while (_readIndex < _list.Count)
System\Windows\Media\Effects\ShaderEffect.cs (14)
209for (int i = PS_2_0_FLOAT_REGISTER_LIMIT; i < _floatRegisters.Count; i++) 223for (int i = PS_2_0_SAMPLER_LIMIT; i < _samplerData.Count; i++) 474if (list.Count <= position) 476int numToAdd = position - list.Count + 1; 501if (_samplerData.Count <= position) 503int numToAdd = position - _samplerData.Count + 1; 623for (int i = 0; i < _floatRegisters.Count; i++) 640for (int i = 0; i < _intRegisters.Count; i++) 657for (int i = 0; i < _boolRegisters.Count; i++) 677int count = _samplerData.Count; 700for (int i = 0; i < _samplerData.Count; i++) 736for (int i = 0; i < list.Count; i++) 758int numSamplers = _samplerData.Count; 795int numSamplers = _samplerData.Count;
System\Windows\Media\Imaging\BitmapMetadata.cs (9)
193count = (UInt32)_metadataBlocks.Count; 207if (index >= _metadataBlocks.Count) 331if (index >= _metadataBlocks.Count) 359if (_fixedSize && _metadataBlocks.Count>0) 382if (index >= _metadataBlocks.Count) 410if (index >= _metadataBlocks.Count) 509if (_index >= _metadataBlocks.Count || celt == 0) 541if (newIndex > _metadataBlocks.Count) 543_index = (uint)_metadataBlocks.Count;
System\Windows\Media\Visual.cs (1)
4687if (UIElement.DpiScaleXValues.Count == 0)
System\Windows\Media3D\Matrix3DStack.cs (5)
41_stack.RemoveAt(_stack.Count - 1); 51if (_stack.Count > 0) 69return _stack.Count; 77return (_stack.Count == 0); 85return _stack[_stack.Count - 1];
System\Windows\Media3D\RayHitTestParameters.cs (1)
121for(int i = 0, count = results.Count; i < count; i++)
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
371list.RemoveRange(count, list.Count - count);
PresentationFramework (825)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (1)
717List<ContentLocatorBase> tempLocators = new List<ContentLocatorBase>(locatorsToReturn.Count * locatorParts.Count);
MS\Internal\Annotations\AnnotationMap.cs (2)
44if (list.Count == 0) 97if (result.Count == 0)
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (2)
429if (adorners.Count > 0) 431for (index = adorners.Count; index > 0; index--)
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (13)
83if (_segments.Count == 0) 242for (int i = 0; i < _segments.Count; i++) 351while ((ind < _segments.Count) && (!rangeSegment.IsNull)) 442if (ind == _segments.Count) ind--; 454for (int i = 0; i < _segments.Count; i++) 478for (int i = _segments.Count - 1; i >= 0; i--) 500for (int i = 0; i < _segments.Count; i++) 670for (int i = 0; i < _owners.Count; i++) 700return _owners.Count; 1151if (_activeOwners.Count != 0) 1155return _owners.Count > 0 ? _owners[0] : null; 1177if (_activeOwners.Count != 0) 1181return _owners.Count > 0 ? new SolidColorBrush(_owners[0].Background) : null;
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (12)
633if (componentsRegister.Components.Count == 0) 905bool[] active = new bool[components.Count]; 906for (int i = 0; i < components.Count; i++) 915for (int i = 0; i < components.Count; i++) 970Debug.Assert((components != null) && (components.Count > 0), "invalid component registry"); 972for (int i = 0; i < components.Count; i++) 1015if (_components.Count == 0) 1026for (; i < _components.Count; i++) 1035for (; i < _components.Count; i++) 1050for (; ind < _components.Count; ind++) 1056if (ind < _components.Count) 1061for (; ind < _components.Count; ind++)
MS\Internal\Annotations\TextAnchor.cs (19)
122for (int i = 0; i < _segments.Count; i++) 170if (other._segments.Count != this._segments.Count) 173for (int i = 0; i < _segments.Count; i++) 290while (currentIndex < anchor._segments.Count && hasMore) 348if (anchor._segments.Count > 0) 392while (current < anchor._segments.Count && hasMore) 447if (!hasMore && current < anchor._segments.Count) 449anchor._segments.RemoveRange(current, anchor._segments.Count - current); 452if (anchor._segments.Count == 0) 508return _segments.Count > 0 ? _segments[0].Start : null; 519return _segments.Count > 0 ? _segments[_segments.Count - 1].End : null; 531return (_segments.Count == 1 && (object)_segments[0].Start == (object)_segments[0].End); 546for (int i = 0; i < _segments.Count; i++) 600for (int i = orderedList.Count - 1; i >= 0; i--) 612if (orderedList.Count > 1) 628for (; i < _segments.Count; i++) 639if (i < _segments.Count && newSegment.End.CompareTo(_segments[i].Start) > 0)
MS\Internal\Controls\InkCanvasSelectionAdorner.cs (3)
156int count = hatchBounds.Count; 157if (count != _elementsBounds.Count) 238int count = _elementsBounds.Count;
MS\Internal\Data\CollectionViewGroupRoot.cs (3)
335List<GroupTreeNode> list = new List<GroupTreeNode>(parentGroups.Count + 1); 347for (int index = 0; index < list.Count; ++index) 361for (int k = list.Count - 1; k >= 0; --k)
MS\Internal\Data\LiveShapingItem.cs (1)
214if (list.Count == 1)
MS\Internal\Data\LiveShapingList.cs (2)
717for (; _dpIndex < s_dpList.Count; ++_dpIndex) 732$"LiveSortingTargetProperty{s_dpList.Count}"),
MS\Internal\Data\StaticPropertyChangedEventManager.cs (2)
488Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 515if (_toRemove.Count > 0)
MS\Internal\Data\ValueChangedEventManager.cs (2)
188Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 220if (_toRemove.Count > 0)
MS\Internal\Documents\ContentHostHelper.cs (1)
110for (int i = 0; i < pageViews.Count; i++)
MS\Internal\Documents\DocumentGrid.cs (1)
2935for (int i = 0; i < args.Changes.Count; i++)
MS\Internal\Documents\FlowDocumentPaginator.cs (4)
433for (int index = 0; index < _asyncRequests.Count; index++) 610if (_backgroundPagination && _backgroundPaginationOperation == null && (!_brt.IsClean || _asyncRequests.Count > 0)) 621for (int index = 0; index < _asyncRequests.Count; index++) 786for (int index = 0; index < _asyncRequests.Count; index++)
MS\Internal\Documents\MultiPageTextView.cs (11)
153for (int i = 0, count = _pageTextViews.Count; i < count; ++i) 648for (int i = 0; i < _pageTextViews.Count; i++) 669if (_pageTextViews != null && _pageTextViews.Count > 0) 689for (int i = 0; i < _pageTextViews.Count; i++) 719for (index = 0; index < _pageTextViews.Count; index++) 1074for (i = 0; i < _pageTextViews.Count; i++) 1087double[] textViewProximities = new double[_pageTextViews.Count]; 1088for (i = 0; i < _pageTextViews.Count; i++) 1140for (i = 0; i < _pageTextViews.Count; i++) 1165for (i = 0; i < _pageTextViews.Count; i++) 1195for (int i = 0; i < _pageTextViews.Count; i++)
MS\Internal\Documents\PageCache.cs (24)
164return _cache.Count; 257if (pageNumber >= 0 && pageNumber < _cache.Count) 292if (pageNumber >= 0 && pageNumber < _cache.Count) 376if (args.Start >= _cache.Count) 389if (args.Start + args.Count < _cache.Count) 401change = DirtyRange(args.Start, _cache.Count - args.Start); 407change = AddRange(_cache.Count, args.Count - (_cache.Count - args.Start) + 1); 420if (pageCount < _cache.Count) 422change = new PageCacheChange(pageCount, _cache.Count - pageCount, PageCacheChangeType.Remove); 426_cache.RemoveRange(pageCount, _cache.Count - pageCount); 524if (args.Start + args.Count >= _cache.Count || 527adjustedCount = _cache.Count - args.Start; 624if (args.PageNumber > _cache.Count - 1) 710for (int i = 0; i < _cache.Count; i++) 739if (PageCacheChanged != null && changes != null && changes.Count > 0) 762if (start >= _cache.Count) 764count += (start - _cache.Count); 765start = _cache.Count; 789ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _cache.Count); 816ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(start, _cache.Count); 818ArgumentOutOfRangeException.ThrowIfGreaterThan(count, _cache.Count - start); 843if (_cache.Count > 0) 848PageCacheChange change = new PageCacheChange(0, _cache.Count, PageCacheChangeType.Remove);
MS\Internal\Documents\RowCache.cs (32)
89return _rowCache.Count; 242ArgumentOutOfRangeException.ThrowIfGreaterThan(index, _rowCache.Count); 276for (int i = 0; i < _rowCache.Count; i++) 303if (_rowCache.Count == 0) 317for (int i = 0; i < _rowCache.Count; i++) 345i == _rowCache.Count - 1) 367return _rowCache.Count - 1; 373return _rowCache.Count - 1; 399if (_rowCache.Count == 0) 416for (int i = startRowIndex + 1; i < _rowCache.Count; i++) 452for (int i = 0; i < _rowCache.Count; i++) 479changes.Add(new RowCacheChange(0, _rowCache.Count)); 572changes.Add(new RowCacheChange(0, _rowCache.Count)); 596if (_rowCache.Count == 0) 604RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 685for (int i = tempRows.Count - 1; i >= 0; i--) 691pivotRowIndex = _rowCache.Count; 887RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 918startRow = _rowCache.Count - 1; 924startRow = _rowCache.Count; 964if (_rowCache.Count == 0) 974RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 1011while (currentPage < startPage + count && rowIndex < _rowCache.Count) 1061if (index > _rowCache.Count) 1079for (int i = index + 1; i < _rowCache.Count; i++) 1106for (int i = 0; i < _rowCache.Count; i++) 1150int removeCount = _rowCache.Count - rowIndex; 1153if (rowIndex < _rowCache.Count) 1201List<RowCacheChange> changes = new List<RowCacheChange>(args.Changes.Count); 1202for (int i = 0; i < args.Changes.Count; i++) 1265if (_rowCache.Count <= 1) 1269if (_rowCache.Count == 0 || _rowCache[0].PageCount < _layoutColumns)
MS\Internal\Documents\TextBoxView.cs (51)
398if (_lineMetrics.Count == 0 || constraintschanged) 413_lineMetrics.Count == 1 && _lineMetrics[0].EndOffset == 0) 440Invariant.Assert(_lineMetrics.Count >= 1); 471if (_lineMetrics == null || _lineMetrics.Count == 0) 539return (_visualChildren == null) ? 0 : _visualChildren.Count; 653int startOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, startPosition.Offset); 654int endOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, endPosition.Offset); 731int nextLineIndex = Math.Max(0, Math.Min(_lineMetrics.Count - 1, lineIndex + count)); 850if (lineIndex == _lineMetrics.Count - 1) 1063int lastValidOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 1075int newLastValidOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 1138int max = _lineMetrics.Count; 1140Invariant.Assert(_lineMetrics.Count >= 1); 1159if (offset == record.EndOffset && index < _lineMetrics.Count - 1) 1266ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[_lineMetrics.Count - 1].EndOffset, LogicalDirection.Forward); 1494if (_lineMetrics.Count == 0) 1603Invariant.Assert(_lineMetrics.Count >= 1); 1611if (point.Y >= _lineHeight * _lineMetrics.Count) 1613return snapToText ? _lineMetrics.Count - 1 : -1; 1620int max = _lineMetrics.Count; 1918int j = _visualChildren.Count - 1; // last non-discarded element index 1920for (int i = _visualChildren.Count - 1; i >= 0; i--) 1935if (j < _visualChildren.Count - 1) 1937_visualChildren.RemoveRange(j + 1, _visualChildren.Count - j - 1); 1950lineVisual._parentIndex = _visualChildren.Count; 1958for (int i = 0; i < _visualChildren.Count; i++) 2166firstLineIndex = Math.Max(0, Math.Min(firstLineIndex, _lineMetrics.Count - 1)); 2167lastLineIndex = Math.Max(0, Math.Min(lastLineIndex, _lineMetrics.Count - 1)); 2173lastLineIndex = _lineMetrics.Count - 1; 2193if (_lineMetrics.Count == 0) 2201lineOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 2291if (range.StartIndex > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2311if (range.StartIndex > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2350for (int i = lineIndex + 1; i < _lineMetrics.Count; i++) 2409if (endOffset > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2412endOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 2424for (int i = lastLineIndex + 1; i < _lineMetrics.Count; i++) 2517(lineIndex == _lineMetrics.Count || 2521if (lineIndex < _lineMetrics.Count && 2540if (lineIndex == _lineMetrics.Count || 2593if (endOfParagraph && lineIndex < _lineMetrics.Count) 2595int count = _lineMetrics.Count - lineIndex; 2607for (int i = 0; i < _lineMetrics.Count; i++) 2611desiredSize.Height = _lineMetrics.Count * _lineHeight; 2667int oldLastLineIndex = oldLineVisualsIndex + oldLineVisuals.Count - 1; 2690for (int i = lineIndex - oldLineVisualsIndex + lineCount; i < oldLineVisuals.Count; i++) 2734lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count) 2748lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count && 2770if (lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count) 2773count = Math.Min(count, _viewportLineVisuals.Count - start); 2884_lineMetrics[_lineMetrics.Count - 1].EndOffset >= position.Offset;
MS\Internal\Documents\TextContainerHelper.cs (2)
472int depth = Math.Min(ancestorsStart.Count, ancestorsEnd.Count);
MS\Internal\Documents\UndoManager.cs (6)
434if (!(_topUndoIndex < UndoStack.Count && PeekUndoStack() == null) // Non-null topmost stack item 435&& (UndoLimit == -1 || UndoStack.Count < UndoLimit)) 630if (_topUndoIndex < 0 || _topUndoIndex == UndoStack.Count) 716_topUndoIndex = undoStack.Count - 1; 866if (UndoStack.Count == 0 || _topUndoIndex < 0) 1104if (UndoStack.Count > 0)
MS\Internal\Globalization\BamlResourceSerializer.cs (1)
96for (int i = children.Count - 1; i >= 0; i--)
MS\Internal\Globalization\BamlTreeMap.cs (1)
604i < node.Children.Count && (comment.LocalizationComments.Length == 0 || comment.LocalizationAttributes.Length == 0);
MS\Internal\Globalization\BamlTreeNode.cs (4)
54get { return _nodeList.Count; } 105parent.Children = new List<BamlTreeNode>(children.Count); 117for (int i = 0; i < children.Count; i++) 505for (int i = 0; i < _children.Count; i++)
MS\Internal\Globalization\BamlTreeUpdater.cs (2)
60for (int i = 0; i < deferredResources.Count; i++) 298for (int i = 0; i < oldChildren.Count - 1; i++)
MS\Internal\Helper.cs (5)
757for (int i = 0; i < itemValues.Count; i++) 785for (int j = 0; j < itemValues.Count; j++) 810for (int i = 0; i < itemValues.Count; i++) 888for (int i = 0; i < itemValues.Count; i++) 1031for (int i=0; i<itemValuesList.Count; i++)
MS\Internal\Ink\ClipboardProcessor.cs (4)
140if ( strokes.Count != 0 || elements.Count != 0 ) 202if (elements != null && elements.Count != 0) 207if (elements.Count == 1 && elements[0] is InkCanvas inkCanvas) 325int elementCount = elements.Count;
MS\Internal\Ink\HighContrastHelper.cs (2)
85int count = __highContrastCallbackList.Count; 142int count = __highContrastCallbackList.Count;
MS\Internal\Ink\InkCanvasSelection.cs (2)
332if ( _selectedElements == null || _selectedElements.Count == 0 ) 341if ( _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)
59return Elements != null && Elements.Count != 0;
MS\Internal\LayoutDump.cs (3)
361if (uiElements.Count > 0) 365writer.WriteAttributeString("Count", uiElements.Count.ToString(CultureInfo.InvariantCulture)); 367for (int index = 0; index < uiElements.Count; index++)
MS\Internal\PtsHost\BreakRecordTable.cs (25)
61Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "Invalid PageNumber."); 87if (pageNumber < _breakRecords.Count) 121Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "Invalid PageNumber."); 127while (pageNumber < _breakRecords.Count) 154if (_breakRecords.Count > 0) 157InvalidateBreakRecords(0, _breakRecords.Count); 178if (_breakRecords.Count > 0) 186pageCount = _breakRecords.Count - pageStart; 208if (_breakRecords.Count > 0) 211DisposePages(0, _breakRecords.Count); 215_owner.OnPagesChanged(0, _breakRecords.Count); 228if (_breakRecords.Count > 0) 256Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "The previous BreakRecord does not exist."); 275if (pageNumber == _breakRecords.Count) 322if (pageNumber > _breakRecords.Count) 343get { return _breakRecords.Count; } 353if (_breakRecords.Count == 0) 355Invariant.Assert(_breakRecords[_breakRecords.Count - 1] != null, "Invalid BreakRecordTable entry."); 356return (_breakRecords[_breakRecords.Count - 1].BreakRecord == null); 380Invariant.Assert(start >= 0 && start < _breakRecords.Count, "Invalid starting index for BreakRecordTable invalidation."); 381Invariant.Assert(start + count <= _breakRecords.Count, "Partial invalidation of BreakRecordTable is not allowed."); 406Invariant.Assert(start >= 0 && start < _breakRecords.Count, "Invalid starting index for BreakRecordTable invalidation."); 407Invariant.Assert(start + count == _breakRecords.Count, "Partial invalidation of BreakRecordTable is not allowed."); 440while (pageStart < _breakRecords.Count) 478pageCount = _breakRecords.Count - pageStart;
MS\Internal\PtsHost\FigureParaClient.cs (3)
217for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 319if (trackRectangles.Count != 0) 777for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\FloaterParaClient.cs (3)
222for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 324if (trackRectangles.Count != 0) 786for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\FlowDocumentPage.cs (4)
333if(this.PageVisual != null && rectangles.Count > 0) 335List<Rect> transformedRectangles = new List<Rect>(rectangles.Count); 339for(int index = 0; index < rectangles.Count; index++) 384for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\Line.cs (3)
315if (inlineObjects.Count == 0) 680Debug.Assert(cchGlyphRuns > 0 && glyphRunsCollection.Count > 0); 711Invariant.Assert(runIndex < glyphRunsCollection.Count);
MS\Internal\PtsHost\PtsCache.cs (11)
183for (index = 0; index < _contextPool.Count; index++) 194if (index == _contextPool.Count) 252for (index = 0; index < _contextPool.Count; index++) 259Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the Context pool."); 271for (index = 0; index < _contextPool.Count; index++) 278Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the context pool."); 312while (index < _contextPool.Count) 374for (index = 0; index < _contextPool.Count; index++) 383Invariant.Assert(index < _contextPool.Count, "PtsContext not found in the context pool."); 394if (cleanContextPool && _contextPool.Count > 4) 398while (index < _contextPool.Count)
MS\Internal\PtsHost\PtsHelper.cs (8)
74if(floatingElementList == null || floatingElementList.Count == 0) 80for(int index = 0; index < floatingElementList.Count; index++) 98if(visualChildren.Count > floatingElementList.Count) 100visualChildren.RemoveRange(floatingElementList.Count, visualChildren.Count - floatingElementList.Count); 499if (rectangles.Count != 0) 515List<Rect> offsetRectangles = new List<Rect>(rectangleList.Count); 517for(int index = 0; index < rectangleList.Count; index++)
MS\Internal\PtsHost\PtsHost.cs (4)
1966for(int objectIndex = 0; objectIndex < attachedObjects.Count; objectIndex++) 1983cObjects = attachedObjects.Count; 2081for(int objectIndex = 0; objectIndex < attachedObjects.Count; objectIndex++) 2098cObjects = attachedObjects.Count;
MS\Internal\PtsHost\PtsPage.cs (4)
1184for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 1287if (rectangles.Count != 0) 1409if (trackRectangles.Count != 0) 1560if(_floatingElementList.Count == 0)
MS\Internal\PtsHost\SubpageParaClient.cs (3)
156for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 257if (trackRectangles.Count != 0) 696for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\TableParaClient.cs (2)
475if (rectangles.Count != 0) 481if (rectangles.Count != 0)
MS\Internal\PtsHost\TextParaClient.cs (20)
279if (rectangles.Count != 0) 288if (rectangles.Count == 0 && textDetails.u.full.cLines > 0) 302if(rectangles.Count > 0 && ThisFlowDirection != PageFlowDirection) 306for(int index = 0; index < rectangles.Count; index++) 413return (floaters != null && floaters.Count > 0) ? new ReadOnlyCollection<ParagraphResult>(floaters) : null; 450return (figures != null && figures.Count > 0) ? new ReadOnlyCollection<ParagraphResult>(figures) : null; 1265for (int i = 0; i < inlineObjects.Count; i++) 1299for (int i = 0; i < inlineObjects.Count; i++) 1550if (lines.Count != 0) 1553TextParaLineResult lastLineResult = (TextParaLineResult)lines[lines.Count - 1]; 1561return (lines.Count > 0) ? new ReadOnlyCollection<LineResult>(lines) : null; 1612if (lines.Count != 0) 1615TextParaLineResult lastLineResult = (TextParaLineResult)lines[lines.Count - 1]; 1623return (lines.Count > 0) ? new ReadOnlyCollection<LineResult>(lines) : null; 2119for (int i = 0, count = rectangles.Count; i < count; ++i) 2229for (int i = 0, count = rectangles.Count; i < count; ++i) 3886if (lineRectangles.Count != 0) 3944Invariant.Assert(rectangles.Count > 0); 4066if (lineRectangles.Count != 0) 4143Invariant.Assert(elementRectangles.Count > 0);
MS\Internal\PtsHost\TextParagraph.cs (25)
925if(textElements.Count == 0) 930return textElements.Count; 942for(int index = 0; index < textElements.Count; index++) 989if(attachedObjects.Count != 0) 1058objects = new List<InlineObject>(_inlineObjects.Count); 1059for (int i = 0; i < _inlineObjects.Count; i++) 1074if(objects == null || objects.Count == 0) 1143for (int index=0; index < _attachedObjects.Count; index++) 1179if(_attachedObjects != null && _attachedObjects.Count > 0) 1210for (int index=0; index < _attachedObjects.Count; index++) 1234for (int index=0; index < _attachedObjects.Count; index++) 1355if(HasFiguresOrFloaters() || (_inlineObjects != null && _inlineObjects.Count > 0)) 1368return _attachedObjects != null && _attachedObjects.Count > 0; 1380for(int index = 0; _attachedObjects != null && index < _attachedObjects.Count; index++) 1524ErrorHandler.Assert(objectsNew == null || (objectsNew[0].Dcp >= dcpStart && objectsNew[objectsNew.Count-1].Dcp <= dcpLim), ErrorHandler.SubmitInvalidList); 1534objectsCached = new List<T>(objectsNew.Count); 1538int end = objectsCached.Count; 1573while (idx < objectsNew.Count) 1598if (idx >= objectsNew.Count) 1606if (idxNew < objectsNew.Count) 1609objectsCached.InsertRange(end, objectsNew.GetRange(idxNew, objectsNew.Count - idxNew)); 1644while (first < objectsCached.Count && objectsCached[first].Dcp < dcpStart) 1649while (last < objectsCached.Count && objectsCached[last].Dcp < dcpStart + cchDeleted) 1665while (last < objectsCached.Count) 1671if (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)
801if (annotations.Count > _maxAnnotationsBatch) 804List<IAttachedAnnotation> leftover = new List<IAttachedAnnotation>(annotations.Count); 805leftover = annotations.GetRange(_maxAnnotationsBatch, annotations.Count - _maxAnnotationsBatch); 810annotations.RemoveRange(_maxAnnotationsBatch, annotations.Count - _maxAnnotationsBatch); 969for (int i = existingAnnotations.Count - 1; i >= 0; i--) 985if ((existingAnnotations != null) && (existingAnnotations.Count > 0)) 1284if (_annotationMap.GetAttachedAnnotations(annotation.Id).Count > 0) 1515if (list.Count == 0)
System\Windows\Automation\Peers\CalendarAutomationPeer.cs (2)
468if (providers.Count > 0) 624if (providers.Count > 0)
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (2)
255if (providers.Count > 0) 285if (providers.Count > 0)
System\Windows\Automation\Peers\DataGridItemAutomationPeer.cs (1)
390if (selectedProviders.Count > 0)
System\Windows\Automation\Peers\FlowDocumentPageViewerAutomationPeer.cs (4)
42if (Owner is IFlowDocumentViewer && children != null && children.Count > 0) 44if (children[children.Count-1] is DocumentAutomationPeer) 46children.RemoveAt(children.Count - 1); 47if (children.Count == 0)
System\Windows\Automation\Peers\GridViewAutomationPeer.cs (3)
133List<IRawElementProviderSimple> array = new List<IRawElementProviderSimple>(_owner.HeaderRowPresenter.ActualColumnHeaders.Count); 175return _owner.HeaderRowPresenter.ActualColumnHeaders.Count; 238if (columns.Count > column)
System\Windows\Automation\Peers\GridViewCellAutomationPeer.cs (2)
76return children != null && children.Count >= 1; 106if (gridview.HeaderRowPresenter != null && gridview.HeaderRowPresenter.ActualColumnHeaders.Count > Column)
System\Windows\Automation\Peers\GridViewHeaderRowPresenterAutomationPeer.cs (1)
44newList = new List<AutomationPeer>(list.Count);
System\Windows\Automation\Peers\GridViewItemAutomationPeer.cs (1)
50_dataChildren = new Hashtable(rowPresenter.ActualCells.Count);
System\Windows\Automation\Peers\GroupItemAutomationPeer.cs (2)
172if (itemsControlAP.RecentlyRealizedPeers.Count > 0 && this.AncestorsInvalid) 292for (int i=0; i<recentlyRealizedPeers.Count; i++)
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (4)
94if (_recentlyRealizedPeers != null && _recentlyRealizedPeers.Count > 0 && this.AncestorsInvalid) 590for (int i = 0; i < _list.Count; i++) 650for (i = 0; i < _list.Count; i++) 656if(i < _list.Count)
System\Windows\BroadcastEventHelper.cs (1)
266for (int i=0; i< eventRoute.Count; i++)
System\Windows\Controls\AlternationConverter.cs (3)
37if (_values.Count > 0 && o is int) 39int index = ((int)o) % _values.Count; 41index += _values.Count;
System\Windows\Controls\CustomDictionarySources.cs (1)
173return _uriList.Count;
System\Windows\Controls\DataGrid.cs (11)
432if (displayIndex >= 0 && displayIndex < DisplayIndexMap.Count) 2185for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 2241for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 3690for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 4509int count = e.RemovedInfos.Count; 4517count = e.AddedInfos.Count; 7252for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7263for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7305for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7735if (_pendingInfos != null && _pendingInfos.Count > 0 && (columnCount = _columns.Count) > 0) 7739for (int i = _pendingInfos.Count - 1; i >= 0; --i)
System\Windows\Controls\DataGridCellsPanel.cs (27)
173if (blockList.Count > 0) 175for (int i = 0, count = blockList.Count; i < count; i++) 195measureWidth += GetColumnEstimatedMeasureWidthSum(blockList[blockList.Count - 1].EndIndex + 1, parentDataGrid.Columns.Count - 1, averageColumnWidth); 468if (indexList.Count == 1) 472else if (indexList.Count > 0) 475for (int i = 1, count = indexList.Count; i < count; i++) 479if (resultList.Count == 0) 485RealizedColumnsBlock lastRealizedColumnsBlock = resultList[resultList.Count - 1]; 495if (resultList.Count == 0) 501RealizedColumnsBlock lastRealizedColumnsBlock = resultList[resultList.Count - 1]; 763if (realizedChildIndex < _realizedChildren.Count) 797if (blockIndex == blockList.Count - 1) 1003for (int count = realizedColumnDisplayIndices.Count; displayIndexListIterator < count; displayIndexListIterator++) 1042int blockCount = blockList.Count; 1170UIElement realizedChild = _realizedChildren.Count > 0 ? _realizedChildren[0] : null; 1191if (realizedIndex < _realizedChildren.Count) 1333blockList != null && blockList.Count > 0, 1336RealizedColumnsBlock lastBlock = blockList[blockList.Count - 1]; 1337RealizedColumnsBlock lastDisplayIndexBlock = displayIndexBlockList[displayIndexBlockList.Count - 1]; 1370if (displayIndexBlockList != null && displayIndexBlockList.Count > 0) 1398for (int j = 0, additionalChildrenCount = additionalChildIndices.Count; 1425for (int i = 0, count = additionalChildIndices.Count; i < count; i++) 1544for (int i = 0, count = blockList.Count; i < count; i++) 1564RealizedColumnsBlock lastBlock = blockList[blockList.Count - 1]; 1574if (blockList.Count == 0) 1601if (blockIndex >= blockList.Count) 1647for (int j=0; j<blockList.Count; ++j)
System\Windows\Controls\DataGridColumnCollection.cs (15)
227Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated"); 431for (int i = 0; i < DisplayIndexMap.Count; i++) 470Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call."); 562Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated"); 570for (int i = 0; i < DisplayIndexMap.Count; i++) 670for (int i = 0; i < DisplayIndexMap.Count; i++) 691for (int i = 0; i < DisplayIndexMap.Count; i++) 726Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size"); 727for (int i = 0; i < DisplayIndexMap.Count; i++) 931while (unResolvedColumns.Count > 0) 937for (int i = 0, count = unResolvedColumns.Count; i < count; i++) 960for (int i = 0, count = unResolvedColumns.Count; i < count; i++) 988for (int i = 0, count = partialResolvedColumns.Count; i < count; i++) 1001for (int i = 0, count = partialResolvedColumns.Count; i < count; i++) 1011for (int i = 0, count = unResolvedColumns.Count; i < count; i++)
System\Windows\Controls\DataGridRowClipboardEventArgs.cs (1)
68int count = ClipboardRowContent.Count;
System\Windows\Controls\DefinitionBase.cs (5)
773if (_registry.Count == 0) 789for (int i = 0, count = _registry.Count; i < count; ++i) 838for (int i = 0, count = _registry.Count; i < count; ++i) 874for (int i = 0, count = _registry.Count; i < count; ++i) 882for (int i = 0, count = _registry.Count; i < count; ++i)
System\Windows\Controls\GridViewColumnCollection.cs (5)
325for (int sourceIndex = index + 1; sourceIndex < _actualIndices.Count; sourceIndex++) 338_actualIndices.RemoveAt(_actualIndices.Count - 1); 344for (int i = iStart; i < _columns.Count; i++) 352int count = _columns.Count; 422ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _actualIndices.Count, indexName);
System\Windows\Controls\GridViewHeaderRowPresenter.cs (4)
817if (DesiredWidthList == null || column.ActualIndex >= DesiredWidthList.Count) 1340for (int i = 0; i < HeadersPositionList.Count; i++) 1357if (i != HeadersPositionList.Count - 1) 1374Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index");
System\Windows\Controls\GridViewRowPresenter.cs (1)
540if (DesiredWidthList == null || column.ActualIndex >= DesiredWidthList.Count)
System\Windows\Controls\InkCanvas.cs (1)
2107else if ( newStrokes.Count == 0 && newElements.Count == 0 )
System\Windows\Controls\ItemContainerGenerator.cs (1)
1048if (errors.Count > 0)
System\Windows\Controls\PopupControlService.cs (3)
1363if (rects.Count == 1) 1386for (int i=1, N=points.Count; i<N; ++i) 1407int N = points.Count;
System\Windows\Controls\Primitives\GridViewRowPresenterBase.cs (2)
160if (DesiredWidthList.Count > e.ActualIndex) 193int c = count - DesiredWidthList.Count;
System\Windows\Controls\Primitives\Popup.cs (1)
219if (registeredPopups.Count == 0)
System\Windows\Controls\Primitives\Selector.cs (7)
1979knownCount = knownIndices.Count; 2306if (unselected.Count > 0 || selected.Count > 0) 2785return _list.Count; 2808int j=0, n=_list.Count; 2852_set = new Dictionary<ItemInfo, ItemInfo>(_list.Count); 2853for (int i=0; i<_list.Count; ++i)
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (1)
70int generatedItemsCount = (generatedItemsCollection != null) ? generatedItemsCollection.Count : 0;
System\Windows\Controls\Primitives\ToolBarPanel.cs (1)
58for (int i = 0; i < _generatedItemsCollection.Count; i++)
System\Windows\Controls\SelectionChangedEventArgs.cs (4)
52_removedItems = new object[unselectedInfos.Count]; 53for (int i=0; i<unselectedInfos.Count; ++i) 58_addedItems = new object[selectedInfos.Count]; 59for (int i=0; i<selectedInfos.Count; ++i)
System\Windows\Controls\TextAdaptor.cs (3)
537if (visibleTextSegments.Count > 0) 539ranges = new ITextRangeProvider[visibleTextSegments.Count]; 540for (int i = 0; i < visibleTextSegments.Count; i++)
System\Windows\Controls\TextBlock.cs (4)
1234int subsequentLinesInitialSize = (_subsequentLines == null) ? 1 : _subsequentLines.Count; 1821Debug.Assert(lineBounds.Count > 0); 3509return (_subsequentLines == null) ? 1 : _subsequentLines.Count + 1; 3741int subsequentLineCount = _subsequentLines.Count;
System\Windows\Controls\TextRangeAdaptor.cs (3)
2092if (peers.Count > 0) 2094elements = new IRawElementProviderSimple[peers.Count]; 2095for (int i = 0; i < peers.Count; i++)
System\Windows\Controls\TextSearch.cs (5)
203if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 266if (_charsEntered.Count > 0) 268string lastChar = _charsEntered[_charsEntered.Count - 1]; 271_charsEntered.RemoveAt(_charsEntered.Count - 1);
System\Windows\Controls\ToolBarTray.cs (20)
352for (bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 360for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 372for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 419for (bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 430for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 568if (toolBarIndex + 1 == band.Count) // If toolBar was the last item in the band 602if (toolBarIndex < band.Count - 1) // Swap toolbars 614if (toolBarIndex + 2 == band.Count) // If toolBar becomes the last item in the band 638if (hittestBand >= 0 && hittestBand < _bands.Count) 645for (int i = 0; i < oldBand.Count; i++) 777for (i = 0; i < newBand.Count; i++) 812for (int i = 0; i < _bands.Count; i++) 819return _bands.Count; 840for (int bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 843for (int toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 862for (int bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 865for (int toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 871totalNumber += band.Count; 881for (int i = 0; i < _bands.Count; i++) 918for (int i = 0; i < band.Count; i++)
System\Windows\Controls\VirtualizedCellInfoCollection.cs (34)
156int numRegions = _regions.Count; 183int numRegions = _regions.Count; 203int numRegions = _regions.Count; 242int numRegions = _regions.Count; 311int numRegions = _regions.Count; 402int numRegions = _regions.Count; 772int numRegions = _regions.Count; 794int numRegions = _regions.Count; 837int numRegions = _regions.Count; 841for (int c = 0; c < addList.Count; c++) 857if (addList.Count > 0) 865for (int c = 0; c < addList.Count; c++) 878int numToAdd = addList.Count; 897if ((removeList != null) && (removeList.Count > 0)) 909for (int i = 0; i < _regions.Count; i++) 932i += remainder.Count; // Skip the remainder 991int numKeptRegions = keepRegions.Count; 1023int numKeptRegions = keepRegions.Count; 1079int numKeptRegions = slideRegions.Count; 1095int numMovedRegions = movedRegions.Count; 1107int numKeptRegions = slideRegions.Count; 1164int numKeptRegions = keepRegions.Count; 1211int numKeptRegions = keepRegions.Count; 1270int numKeptRegions = slideRegions.Count; 1285int numMovedRegions = movedRegions.Count; 1297int numKeptRegions = slideRegions.Count; 1352int numRegions = collection._regions.Count; 1371int numRegions = c1._regions.Count; 1379numRegions = orig2._regions.Count; 1399if (_regions.Count == 1) 1421if (removeList.Count > 0) 1507int numRegions = _regions.Count; 1533int numRegions = _regions.Count; 1583int numRegions = regions.Count;
System\Windows\Controls\VirtualizingStackPanel.cs (25)
4516for (int i = 0, n = offsetList.Count; i < n; ++i) 4528object[] args = new object[offsetList.Count + 7]; 4536for (int i=0; i<offsetList.Count; ++i) 4549viewport.X = offsetList[offsetList.Count-1]; 4553viewport.Y = offsetList[offsetList.Count-1]; 4562if (index < 0 || offsetList.Count <= 1) 5672int count = childOffsetList.Count; 5696object[] args = new object[offsetList.Count + 2]; 5699for (int i = 0; i < offsetList.Count; ++i) 9223Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match"); 9244if (realizedChildIndex < _realizedChildren.Count) 9272UIElement realizedChild = _realizedChildren.Count > 0 ? _realizedChildren[0] : null; 9283if (realizedIndex < _realizedChildren.Count) 10939for (int i=0; i<previouslyMeasuredOffsets.Count; i++) 12089for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12102for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12485for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12544for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12556for (int i=0; i<s_TargetToTraceListMap.Count; ++i) 12596for (; _flushIndex < _traceList.Count; ++_flushIndex) 12609_flushIndex = _traceList.Count; 12812int n = children.Count; 12891writer.Write(_realizedChildren.Count); 12892for (int i=0; i<_realizedChildren.Count; ++i) 12903writer.Write(_effectiveOffsets.Count);
System\Windows\Data\BindingExpression.cs (1)
2360if (result != null && result.Count == 0)
System\Windows\Data\BindingExpressionBase.cs (9)
2289if (toAdd != null && toAdd.Count > 0) 2308if (toRemove != null && toRemove.Count > 0) 2317if (notifyDataErrors.Count == 0) 2326if (previousErrors == null || previousErrors.Count == 0) 2331else if (errors == null || errors.Count == 0) 2341for (int i=errors.Count-1; i>=0; --i) 2346for (j=toRemove.Count-1; j>=0; --j) 2456for (int k = 0; k < tempList.Count; ++k) 2472return tempList.Count > 0 ?
System\Windows\Data\BindingGroup.cs (3)
1099if (toAdd != null && toAdd.Count > 0) 1114if (toRemove != null && toRemove.Count > 0) 1122if (itemErrors.Count == 0)
System\Windows\Data\CollectionView.cs (8)
1807Debug.Assert(changeLog != null && changeLog.Count > 0, "don't defer when there's no work"); 1817_engine.ChangeCost(_databindOperation, changeLog.Count); 1821_databindOperation = _engine.Marshal(new DispatcherOperationCallback(ProcessInvoke), null, changeLog.Count); 1841for ( ; currentIndex < changeLog.Count && !mustDeferProcessing; currentIndex++) 1851if (mustDeferProcessing && currentIndex < changeLog.Count) 1892if (_changeLog.Count == 0 && CheckAccess()) 1911null, _changeLog.Count); 1937if (unprocessedChanges != null && unprocessedChanges.Count > 0)
System\Windows\Data\ListCollectionView.cs (1)
3094double dirtyDensity = ((double)list.SortDirtyItems.Count) / (list.Count + 1);
System\Windows\Diagnostics\BindingDiagnostics.cs (1)
107if (s_pendingEvents.Count < MaxPendingEvents)
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (3)
154if (!_dictionariesFromUri.TryGetValue(uri, out list) || list.Count == 0) 159List<ResourceDictionary> result = new List<ResourceDictionary>(list.Count); 263if (list.Count == 0)
System\windows\Documents\CaretElement.cs (1)
462for (int i = 0; i < textSegments.Count; i++)
System\Windows\Documents\DocumentSequenceTextContainer.cs (3)
733if (lastBlock != null && cdbScan != lastBlock && !(lastBlock.ChildContainer is NullTextContainer) && rangeArray.Count != 0) 751if (!(cdbScan.ChildContainer is NullTextContainer) && rangeArray.Count != 0) 778if (rangeArray.Count > 0 && (!(cdbScan == null || cdbScan.ChildContainer is NullTextContainer)))
System\Windows\Documents\FixedDSBuilder.cs (2)
68_visitedArray = new BitArray(fixedNodes.Count); 200for (int i = startIndex+1; i < _fixedNodes.Count; i++)
System\Windows\Documents\FixedElement.cs (1)
341for(int i = 0, n = _children.Count; i < n; i++)
System\Windows\Documents\FixedFlowMap.cs (4)
130Debug.Assert(fp >= 0 && fp < _flowOrder.Count); 168for (int i = index; i < _flowOrder.Count; i++) 310return _flowOrder.Count; 363for (int i = newFlow.Fp + 1, n = _flowOrder.Count; i < n; i++)
System\Windows\Documents\FixedSOMContainer.cs (5)
114if (This.FixedNodes.Count == 0 || compared.FixedNodes.Count == 0) 121FixedNode thisObjLastNode = This.FixedNodes[This.FixedNodes.Count - 1]; 124FixedNode otherObjLastNode = compared.FixedNodes[compared.FixedNodes.Count - 1]; 149int i=_semanticBoxes.Count-1;
System\Windows\Documents\FixedSOMFixedBlock.cs (7)
39if (this.SemanticBoxes.Count > 1) 41FixedSOMTextRun run = this.SemanticBoxes[this.SemanticBoxes.Count - 2] as FixedSOMTextRun; 66return (_semanticBoxes.Count == 1 && (_semanticBoxes[0] is FixedSOMImage)); 82if (_semanticBoxes.Count == 0) 126for (int i=_semanticBoxes.Count - 1; i>=0 && run==null; i--) 157for (int i=0; i<SemanticBoxes.Count; i++) 238if (_semanticBoxes.Count == 1)
System\Windows\Documents\FixedSOMLineCollection.cs (3)
80for (int i=0; i < ranges.Count; i++) 114int endIndex = lines.Count; 146while (i<lines.Count && lines[i].Line <= parallelHighEnd)
System\Windows\Documents\FixedSOMLineRanges.cs (3)
16for (int i = 0; i < Start.Count; ) 51int endIndex = Start.Count - 1; 108get { return Start.Count; }
System\Windows\Documents\FixedSOMPage.cs (2)
50for (int i=0; i<_semanticBoxes.Count; i++) 61for (int j=0; j<groupBoxes.Count; j++)
System\Windows\Documents\FixedSOMPageConstructor.cs (24)
574Debug.Assert (fixedBlock.SemanticBoxes.Count > 0); 575if (fixedBlock.SemanticBoxes.Count == 0) 590FixedSOMTextRun lastLine = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count - 1] as FixedSOMTextRun; 610compareLine = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count-1] as FixedSOMTextRun; 681FixedSOMElement element = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count - 1] as FixedSOMElement; 756if (horizontal.Count < 2 || vertical.Count < 2) 763for (int h = 0; h < horizontal.Count; h++) 781while (v < vertical.Count && vertical[v].Line < hStart) 785for (; v < vertical.Count && vertical[v].Line < hEnd; v++) 822for (h2 = h + 1; h2 < horizontal.Count && horizontal[h2].Line < vBottom + minLineSeparation; h2++) 859if (_fixedSOMPage.SemanticBoxes.Count < 2) 868prevBoxCount = _fixedSOMPage.SemanticBoxes.Count; 871for (int i = 0; i < boxes.Count; i++) 877for (int j = i + 1; j < boxes.Count; j++) 896for (int j = i + 1; j < boxes.Count; j++) 910} while (_fixedSOMPage.SemanticBoxes.Count > 1 && _fixedSOMPage.SemanticBoxes.Count != prevBoxCount); 1046for (int i=0; i<tables.Count-1; i++) 1048for (int j=i+1; j<tables.Count; j++) 1076for (int i = 0; i < _fixedSOMPage.SemanticBoxes.Count;) 1101for (int i=0; i<cell.SemanticBoxes.Count;) 1128if (container.SemanticBoxes.Count > 0) 1141for (int i=1; i<container.SemanticBoxes.Count; i++)
System\Windows\Documents\FixedSOMTable.cs (9)
53for (int i = 0; i < _semanticBoxes.Count; i++) 62int colCount = row.SemanticBoxes.Count; 161if (this.SemanticBoxes.Count == 1) 165return (row.SemanticBoxes.Count == 1); 177for (int i=0; i<this.SemanticBoxes.Count;) 197int nRows = this.SemanticBoxes.Count; 211deleteCol = deleteCol && idx < row.SemanticBoxes.Count; 220if (idx + 1 < row.SemanticBoxes.Count) 268if (idx + 1 < row.SemanticBoxes.Count && row.SemanticBoxes[idx + 1].BoundingRect.Left == nextCol)
System\Windows\Documents\FixedSOMTableRow.cs (1)
52for (int i = 0; i < _semanticBoxes.Count; i++)
System\Windows\Documents\FixedTextBuilder.cs (16)
159DocumentsTrace.FixedTextOM.Builder.Trace($"AppendVirtualPage {_pageStructures.Count}"); 161FixedPageStructure pageStructure = new FixedPageStructure(_pageStructures.Count); 948fixedNodes.Count); 1278if (relUri == null && _hyperlinks.Count > 0) 1319for (int i=0; i<_hyperlinks.Count; i++) 1343for (int i = 0; i < _hyperlinks.Count; i++) 1477FixedSOMTextRun lastRun = _textRuns[_textRuns.Count - 1]; 1502if (_fixedNodes.Count == 0 || _fixedNodes[_fixedNodes.Count - 1] != element.FixedNode) 1551_pageStructure.SetFlowBoundary(_flowNodes[0], _flowNodes[_flowNodes.Count-1]); 1632if (_textRuns.Count > 0) 1636for (int i=0; i<_textRuns.Count; i++) 1650run.LineIndex = _lineResults.Count; 1651if (_nodesInLine.Count == 0 || _nodesInLine[_nodesInLine.Count - 1] != run.FixedNode) 1751if (_nodesInLine.Count > 0)
System\Windows\Documents\Glyphs.cs (1)
325Debug.Assert(parsedGlyphs.Count == glyphCount);
System\Windows\Documents\Highlights.cs (1)
369if (ranges.Count > 0)
System\Windows\Documents\MsSpellCheckLib\SpellChecker\SpellChecker.cs (1)
429int cacheSize = (hasErrorsCache != null) ? hasErrorsCache.Count : 0;
System\windows\Documents\TextEditorDragDrop.cs (1)
611for (int i = 0; i < selection.TextSegments.Count; i++)
System\Windows\Documents\TextRange.cs (2)
376Invariant.Assert(_textSegments.Count > 0, "_textSegments.Count must be > 0"); 1620for (int i = 0; i < _textSegments.Count; i++)
System\Windows\Documents\TextRangeBase.cs (11)
82for (int i = 0; i < thisRange._TextSegments.Count; i++) 395for (int i = 0; i < thisRange._TextSegments.Count; i++) 464for (int i = 0; i < thisRange._TextSegments.Count; i++) 1191Invariant.Assert(thisRange._TextSegments != null && thisRange._TextSegments.Count > 0, "expecting nonempty _TextSegments array for Start position"); 1199Invariant.Assert(thisRange._TextSegments != null && thisRange._TextSegments.Count > 0, "expecting nonempty _TextSegments array for End position"); 1200return thisRange._TextSegments[thisRange._TextSegments.Count - 1].End; 1210(thisRange._TextSegments.Count == 1 && 1216return (thisRange._TextSegments.Count == 1 && 1266for (int i = 0; i < thisRange._TextSegments.Count; i++) 1919ITextPointer end = thisRange._TextSegments[thisRange._TextSegments.Count - 1].End; 2039ITextPointer finalEnd = thisRange._TextSegments[thisRange._TextSegments.Count - 1].End;
System\Windows\Documents\TextRangeEditTables.cs (3)
405for (int i = 0; i < textSegments.Count; i++ ) 422end = textSegments[textSegments.Count - 1].End; 985for (int i = 0; i < textSegments.Count; i++)
System\Windows\Documents\TextRangeSerialization.cs (2)
275if (ignoreList.Count > 0) 346for (int i = 0; i < textSegments.Count; i++)
System\windows\Documents\TextSelection.cs (3)
416movingPosition = thisSelection.TextSegments[thisSelection.TextSegments.Count - 1].Start; 1882else if (thisSelection.TextSegments.Count < 2) 1902else if (movingPosition.CompareTo(thisSelection.TextSegments[thisSelection.TextSegments.Count-1].Start) == 0)
System\windows\Documents\TextSelectionHighlightLayer.cs (4)
85segmentCount = textSegments.Count; 113segmentCount = textSegments.Count; 308Invariant.Assert(textRange._TextSegments.Count > 0); 309return textRange._TextSegments[0].Start.CompareTo(textRange._TextSegments[textRange._TextSegments.Count - 1].End) == 0;
System\Windows\Documents\TextStore.cs (12)
1361CompositionEventRecord previousRecord = (this.CompositionEventList.Count == 0) ? null : this.CompositionEventList[this.CompositionEventList.Count - 1]; 3503if (this.CompositionEventList.Count == 0 || 3614IMECompositionTracer.Trace(this, IMECompositionTraceOp.BRaiseCompositionEvents, CompositionEventList.Count); 3623for (int i = 0; i < this.CompositionEventList.Count; i++) 4743for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 4756for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 4966for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 5025for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 5037for (int i=0; i<s_TargetToTraceListMap.Count; ++i) 5077for (; _flushIndex < _traceList.Count; ++_flushIndex) 5090_flushIndex = _traceList.Count;
System\Windows\Documents\WinRTSpellerInteropExtensions.cs (6)
89if (allTokens.Count > 0) 91var substToken = GetSpellCheckCleanSubstitutionToken(spellChecker, text, allTokens[allTokens.Count - 1], missingFragment); 94allTokens[allTokens.Count - 1] = new SpellerSegment(text, substToken.Value, spellChecker, owner); 126if (allTokens.Count > 0) 128var substToken = GetSpellCheckCleanSubstitutionToken(spellChecker, text, allTokens[allTokens.Count - 1], missingFragment); 131allTokens[allTokens.Count - 1] = new SpellerSegment(text, substToken.Value, spellChecker, owner);
System\Windows\Documents\WpfPayload.cs (3)
434for (int imageIndex = 0; imageIndex < _images.Count; imageIndex++) 505for (int i = 0; i < _images.Count; i++) 521imagePartUriString = GetImageName(_images.Count, imageContentType);
System\Windows\FrameworkContextData.cs (3)
59int last = _currentWalkers.Count - 1; 73if (_currentWalkers.Count > 0) 75int last = _currentWalkers.Count - 1;
System\Windows\Ink\Events.cs (1)
311if (results.Count == 0)
System\Windows\Input\KeyboardNavigation.cs (5)
3473public int Count { get { return _list.Count; } } 3481if (_list.Count == _list.Capacity) 3493for (int i=0; i<_list.Count; ++i) 3520for (int i=0; i<_list.Count; ++i) 3548int n = _list.Count;
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (3)
60get { return (_resources != null && _resources.Count > 0); } 67Debug.Assert(StaticResources[StaticResources.Count - 1] is StaticResource); 68return StaticResources[StaticResources.Count - 1] as StaticResource;
System\Windows\Markup\Baml2006\Baml2006ReaderContext.cs (2)
52if (KeyList != null && KeyList.Count > 0) 54return KeyList[KeyList.Count - 1];
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (12)
315if (stringId >= 0 && stringId < _bamlString.Count) 344if (assemblyId == _bamlAssembly.Count) 349else if (assemblyId > _bamlAssembly.Count) 368if (typeId == _bamlType.Count) 376else if (typeId > _bamlType.Count) 395if (propertyId == _bamlProperty.Count) 400else if (propertyId > _bamlProperty.Count) 414if (stringId == _bamlString.Count) 418else if (stringId > _bamlString.Count) 566if (assemblyId >= 0 && assemblyId < _bamlAssembly.Count) 590if (typeId >= 0 && typeId < _bamlType.Count) 619if (propertyId >= 0 && propertyId < _bamlProperty.Count)
System\Windows\Markup\BamlReader.cs (4)
486if (_currentStaticResourceRecordIndex == _currentStaticResourceRecords.Count) 1379BamlKeyInfo keyInfo = _deferKeys[_deferKeys.Count-1]; 2308if (_deferKeys.Count > 0) 2746for (int i=0; i<xmlnsList.Count; i++)
System\Windows\Markup\BamlRecordReader.cs (5)
1879object[] staticResourceValues = ParserContext.StaticResourcesStack[ParserContext.StaticResourcesStack.Count-1]; 1958object[] staticResourceValues = ParserContext.StaticResourcesStack[ParserContext.StaticResourcesStack.Count-1]; 4291if (_stackDataFactoryCache.Count == 0) 4298d = _stackDataFactoryCache[_stackDataFactoryCache.Count-1]; 4299_stackDataFactoryCache.RemoveAt(_stackDataFactoryCache.Count-1);
System\Windows\Markup\BamlRecordWriter.cs (6)
1176bamlPropertyWithStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1); 1586if (staticResourceRecordList.Count > 0) 1589for (int j=0; j<staticResourceRecordList.Count; j++) 1593for (int k=0; k<srRecords.Count; k++) 1677valueDeferRecord = _staticResourceRecordList[_staticResourceRecordList.Count-1]; 1692bamlStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1);
System\Windows\Markup\ParserContext.cs (1)
620get { 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)
3268for (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)
101return _journalEntryList.Count; 330_journalEntryList.RemoveRange(_currentEntryIndex, _journalEntryList.Count - _currentEntryIndex);
System\Windows\ResourcesChangeInfo.cs (3)
203get { return _key != null || (_newDictionaries != null && _newDictionaries.Count > 0); } 246for (int i=0; i<_oldDictionaries.Count; i++) 257for (int i=0; i<_newDictionaries.Count; i++)
System\Windows\Shell\JumpList.cs (20)
337&& JumpItems.Count == 0 497successList = new List<JumpItem>(JumpItems.Count); 500rejectedList = new List<_RejectedJumpItemPair>(JumpItems.Count); 549if (list.Count > 0 && list[0].JumpItem.CustomCategory == jumpItem.CustomCategory) 592if (categoryList.Count > 0) 645if (rejectedList.Count > 0 && rejectedHandler != null) 647var items = new List<JumpItem>(rejectedList.Count); 648var reasons = new List<JumpItemRejectionReason>(rejectedList.Count); 659if (removedList.Count > 0 && removedHandler != null) 661var items = new List<JumpItem>(removedList.Count); 671if (items.Count > 0) 683if (removedList.Count == 0) 798Debug.Assert(jumpItems.Count != 0); 822for (int i = jumpItems.Count; --i >= 0;) 851if (linksOnlyList.Count > 0) 854Debug.Assert(jumpItems.Count != linksOnlyList.Count); 1103if (_jumpItems.Count > 0) 1105var reasons = new List<JumpItemRejectionReason>(_jumpItems.Count); 1106for (int i = 0; i < _jumpItems.Count; ++i)
System\Windows\StaticResourceExtension.cs (1)
244for(int i=0; i<ambientList.Count; i++)
System\Windows\StyleHelper.cs (14)
2149Debug.Assert(templatedChildren.Count > 0, 2218int[] childIndices = new int[templateChain.Count]; 2225for (int i=0; i< templateChain.Count; i++) 2256for (int i=0; i< templateChain.Count; i++) 2520for (int i = 0; i < actionsList.Count; i++) 3459if ((oldStyleTables != null && oldStyleTables.Count > 0) || 3460(newStyleTables != null && newStyleTables.Count > 0)) 3521if (dictionaries != null && dictionaries.Count > 0 && !fo.ShouldLookupImplicitStyles) 3523for (int i=0; i<dictionaries.Count; i++) 4348for( int i = 0; i < triggerList.Count; i++ ) 4392if ((styledChildren != null) && (childIndex <= styledChildren.Count)) 4799for (int i = 0; i < actionList.Count; i++) 5278for( int i = 0; i < triggerList.Count; i++ ) 5430if (styledChildren == null || childIndex > styledChildren.Count)
System\Windows\SystemResources.cs (1)
1220int count = keys.Count;
System\Windows\TemplateContent.cs (2)
261for (int i = 0; i < sharedProperties.Count; i++) 327for (int i = sharedProperties.Count - 1; i >= 0; i--)
System\Windows\TemplateNameScope.cs (1)
162Debug.Assert(_affectedChildren.Count == childIndex);
System\Windows\ThemeDictionaryExtension.cs (3)
122for (int i = 0; i < _themeDictionaryInfos.Count; i++) 197for (int i = 0; i < _themeDictionaryInfos.Count; i++) 233for (int i = 0; i < _themeDictionaryInfos.Count; i++)
System\Windows\TriggerActionCollection.cs (3)
53return _rawList.Count; 75for (int i = _rawList.Count - 1; i >= 0; i--) 267for( int i = 0; i < _rawList.Count; i++ )
System\Windows\Window.cs (1)
3628for (int i = 0; i < _threadWindowHandles.Count; i++)
PresentationFramework.Aero (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
330Debug.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)
330Debug.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)
330Debug.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)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
330Debug.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)
330Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationUI (1)
MS\Internal\Documents\Application\TransactionalPackage.cs (1)
445PackagePart[] result = new PackagePart[_proxiedParts.Count];
ReachFramework (37)
AlphaFlattener\Flattener.cs (15)
293int count = commands.Count; 612if ((gj == null) || (pj.underlay == null) || (pj.underlay.Count == 0)) 617for (int n = pj.underlay.Count - 1; n >= 0; n --) 630if ((gi != null) && (gi.Pen == null) && (pi.overlap.Count == 1) && pj.FullyCovers(pi)) 670if ((pi.underlay != null) && (pi.underlay.Count != 0)) 672qi = commands[pi.underlay[pi.underlay.Count - 1]]; 737for (int k = 0; k < pi.underlay.Count; k++) 762int len = pi.underlay.Count; 796oldUnderlay[i] = new List<int>(l.Count); 798for (int j = 0; j < l.Count; j++) 843for (int j = 0; j < pi.overlap.Count; j++) 863if ((pi.overlap != null) && (pi.overlap.Count != 0)) 871if ((pj.underlay[pj.underlay.Count - 1] == i) && pj.FullyCovers(pi) && !pi.FullyCovers(pj)) 996for (int i = 0; i < transparentCluster.Count; i++) 1049for (int i = 0; i < transparentCluster.Count; i++)
AlphaFlattener\Optimizer.cs (6)
146bool[] addedPrimitives = new bool[commands.Count]; 178for (int clusterIndex = 0; clusterIndex < transparentCluster.Count; clusterIndex++) 287for (int i = 0; i < c.m_primitives.Count; i++) 409for (int j = 0; j < transparentCluster.Count; j++) 445for (int i = 0; i < transparentCluster.Count; i++) 446for (int j = i + 1; j < transparentCluster.Count; j++)
AlphaFlattener\PrimitiveList.cs (4)
116Console.Write(LeftPad(info.underlay.Count, 3)); 121Console.Write(' ' + LeftPad(info.overlap.Count, 3)); 248int index = _commands.Count; 309int pos = list.Count;
AlphaFlattener\PrimitiveRenderer.cs (2)
330for (int s = start; s < _overlapping.Count; s++) 348while (start < _overlapping.Count)
Packaging\XpsFixedDocumentReaderWriter.cs (1)
987IXpsFixedPageReader pageReader = new XpsFixedPageReaderWriter(CurrentXpsManager, this, pagePart, null, _pageCache.Count+1);
Packaging\XpsFixedDocumentSequenceReaderWriter.cs (1)
626IXpsFixedDocumentReader fixedDocument = new XpsFixedDocumentReaderWriter(CurrentXpsManager, null, documentPart, _documentCache.Count+1);
Packaging\XpsFixedPageReaderWriter.cs (1)
2072if ( _currentChildren!= null && _currentChildren.Count > 0)
Serialization\DrawingContextFlattener.cs (7)
138Debug.Assert(_fullTransform.Count == _fullClip.Count); 140int lastIndex = _fullTransform.Count - 1; 153if (_fullTransform.Count == 0) 159return _fullTransform[_fullTransform.Count - 1]; 171if (_fullClip.Count == 0) 177return _fullClip[_fullClip.Count - 1];
Replay (6)
Replay.cs (6)
45if (rest.Count == 1) 49else if (rest.Count > 1) 117Console.WriteLine($"Compilation Events: {compilerCalls.Count}"); 155while (tasks.Count < maxParallel && index < compilerCalls.Count) 170} while (index < compilerCalls.Count);
Roslyn.Test.PdbUtilities (2)
EditAndContinue\EditAndContinueTest.cs (1)
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)
62Assert.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)
207if (includeFilter.Count == 0)
Program.cs (1)
345if (list.Count == 0)
TestRunner.cs (6)
93while (i < running.Count) 136while (running.Count < max && waiting.Count > 0) 144ConsoleUtil.Write($" {running.Count,2} running, {waiting.Count,2} queued, {completed.Count,2} completed"); 151if (running.Count > 0) 155} while (running.Count > 0);
Sample (1)
Program.cs (1)
110schemas.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)
38totalEntries = 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)
243for (int i = 0; i < typeArgumentList.Count; i++) 259else if (typeArgumentList.Count > 0) 261for (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)
844if (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)
489if (parameters.Count > 0)
System.ComponentModel.Composition.Registration (3)
System\ComponentModel\Composition\Registration\PartBuilder.cs (3)
322if (_interfaceExports.Count != 0) 446if (_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)
562if (_interfaceExports.Count != 0) 733if (_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)
104List<string> list = new List<string>(_list.Count); 120List<object?> list = new List<object?>(_list.Count); 137public int Count => _list.Count; 273for (int i = 0; i < _list.Count; i++)
System\Diagnostics\Metrics\InstrumentAdvice.cs (1)
61for (int i = 1; i < values.Count; i++)
System\Diagnostics\Metrics\Meter.cs (1)
601if (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)
161Debug.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 (5)
System\IO\Compression\ZipArchive.cs (5)
717entriesToWrite = new(_entries.Count); 779bool archiveEpilogueRequiresUpdate = _entries.Count == 0; 810|| _entries.Count >= ZipHelper.Mask16Bit 821Zip64EndOfCentralDirectoryRecord.WriteBlock(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory); 834ZipEndOfCentralDirectoryBlock.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)
777for (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 (9)
System\Linq\AppendPrepend.SpeedOpt.cs (1)
266_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)
211private int CountForDebugger => _source.Count;
System\Linq\Select.SpeedOpt.cs (4)
402int count = _source.Count; 429if ((uint)index < (uint)_source.Count) 441if (_source.Count != 0) 453int len = _source.Count;
System.Linq.AsyncEnumerable (1)
System\Linq\ToAsyncEnumerable.cs (1)
47for (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)
205rawValues.EnsureCapacity(rawValues.Count + count); 478if (parsedValues.Count == 0) 915if (parsedValues.Count == 0 && addWhenInvalid && info.ParsedAndInvalidValues is null) 1224valueStore 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)
927_associatedHttp2ConnectionCount -= _availableHttp2Connections.Count; 935_associatedHttp3ConnectionCount -= _availableHttp3Connections.Count; 952Debug.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)
147int availableConnectionCount = _availableHttp3Connections?.Count ?? 0; 219int availableHttp3ConnectionCount = _availableHttp3Connections?.Count ?? 0; 377Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0)); 397Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0), 398$"Expected _associatedHttp3ConnectionCount={_associatedHttp3ConnectionCount} > _availableHttp3Connections.Count={(_availableHttp3Connections?.Count ?? 0)}"); 420Debug.Assert((_availableHttp3Connections?.Count ?? 0) == 0, $"With {(_availableHttp3Connections?.Count ?? 0)} available HTTP3 connections, we shouldn't have a waiter."); 541Debug.Assert(_associatedHttp3ConnectionCount >= _availableHttp3Connections.Count); 571while (freeIndex < list.Count && list[freeIndex].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 579if (freeIndex < list.Count) 587while (current < list.Count) 591while (current < list.Count && !list[current].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 598if (current < list.Count) 609removed = list.Count - freeIndex;
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
600if (_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 (18)
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\SmtpFailedRecipientsException.cs (2)
50innerExceptions.Count > 0 ? innerExceptions[0].FailedRecipient : null, 51innerExceptions.Count > 0 ? innerExceptions[0] : null)
System\Net\Mail\SmtpTransport.cs (13)
215if (_failedRecipientExceptions.Count > 0) 217if (_failedRecipientExceptions.Count == 1) 223exception = new SmtpFailedRecipientsException(_failedRecipientExceptions, _failedRecipientExceptions.Count == recipients.Count); 226if (_failedRecipientExceptions.Count == recipients.Count) 351if (thisPtr._failedRecipientExceptions.Count == thisPtr._toCollection.Count) 379if (_failedRecipientExceptions.Count > 1) 381InvokeCallback(new SmtpFailedRecipientsException(_failedRecipientExceptions, _failedRecipientExceptions.Count == _toCollection.Count)); 383else if (_failedRecipientExceptions.Count == 1) 402if (thisPtr._failedRecipientExceptions.Count > 1) 404thisPtr.InvokeCallback(new SmtpFailedRecipientsException(thisPtr._failedRecipientExceptions, thisPtr._failedRecipientExceptions.Count == thisPtr._toCollection.Count)); 406else if (thisPtr._failedRecipientExceptions.Count == 1) 425if (_failedRecipientExceptions.Count == 1) 429else if (_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)
866for (int i = 0; i < domainAttribute.Count; i++)
System.Net.Quic (8)
System\Net\Quic\Internal\MsQuicConfiguration.Cache.cs (6)
77if (CertificateThumbprints.Count != other.CertificateThumbprints.Count) 82for (int i = 0; i < CertificateThumbprints.Count; i++) 90if (ApplicationProtocols.Count != other.ApplicationProtocols.Count) 95for (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)
177bool hasAlpn = sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0; 273if (sslAuthenticationOptions.IsServer && sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0) 398if (sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0) 740for (int i = 0; i < protocolList.Count; i++)
System\Net\Security\SslStream.Protocol.cs (3)
492if (filteredCerts != null && filteredCerts.Count != 0) 494NetEventSource.Log.CertsAfterFiltering(filteredCerts.Count, this); 513for (int i = 0; i < filteredCerts.Count; ++i)
System\Net\Security\SslStreamCertificateContext.Linux.cs (2)
265Debug.Assert(_ocspUrls.Count > 0); 307for (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)
4338if (s_EventSources.Count % 64 == 63) // on every block of 64, fill up the block before continuing 4340int i = s_EventSources.Count; // Work from the top down. 4355newIndex = 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\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)
4597if (list.Count == list.Capacity) 5093Debug.Assert(tasks.Count > 0, "Expected at least one task"); 5096var mres = new SetOnCountdownMres(tasks.Count); 6188Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6286return taskList.Count == 0 ? 6460Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6773if (taskList.Count == 0) 7520if (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\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (3)
356if (toExplore == null || toExplore.Count == 0) 359currentPath = toExplore[toExplore.Count - 1]; 360toExplore.RemoveAt(toExplore.Count - 1);
src\System\Attribute.CoreCLR.cs (2)
48Attribute[] array = CreateAttributeArrayHelper(type, attributeList.Count); 152Attribute[] array = CreateAttributeArrayHelper(type, attributeList.Count);
src\System\GC.CoreCLR.cs (3)
605int count = s_notifications.Count; 660if (s_notifications.Count == 1) 771for (int i = 0; i < s_notifications.Count; ++i)
src\System\Reflection\Emit\DynamicILGenerator.cs (10)
976if (token < 0 || token > m_tokens.Count) 986return m_tokens.Count - 1 | (int)MetadataTokenType.MemberRef; 1024return m_tokens.Count - 1 | (int)MetadataTokenType.MethodDef; 1029return m_tokens.Count - 1 | (int)MetadataTokenType.MethodDef; 1034return m_tokens.Count - 1 | (int)MetadataTokenType.MethodDef; 1039return m_tokens.Count - 1 | (int)MetadataTokenType.FieldDef; 1044return m_tokens.Count - 1 | (int)MetadataTokenType.FieldDef; 1049return m_tokens.Count - 1 | (int)MetadataTokenType.TypeDef; 1054return m_tokens.Count - 1 | (int)MetadataTokenType.String; 1059return 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)
243for (int i = 0; i < typeArgumentList.Count; i++) 259else if (typeArgumentList.Count > 0) 261for (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)
55if (_current >= _formats.Count || celt <= 0) 86if (_current + celt >= _formats.Count)
Windows\Win32\System\Com\ComPointerList.cs (1)
18public int Count => _pointers.Count;
System.Private.Xml (141)
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\XmlReflectionImporter.cs (2)
906for (int i = 0; i < members.Count; i++) 1220if (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)
285Type[] args = new Type[_fields.Count]; 356int 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]; 741if (_exceptionStack.Count < 1) 746ExceptionBlock 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)
16LocalVariablesEncoder 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++) 940List<FieldInfo> fields = new List<FieldInfo>(_fieldDefinitions.Count); 1046List<PropertyInfo> candidates = new List<PropertyInfo>(_propertyDefinitions.Count); 1072if (candidates.Count == 0) 1080if (candidates.Count == 1) 1308for (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)
362bw.Write(typeNames.Count); 508typeIndex = types.Count;
System.Resources.Writer (2)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
362bw.Write(typeNames.Count); 508typeIndex = types.Count;
System.Runtime.Caching (1)
System\Runtime\Caching\MemoryCache.cs (1)
431if (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)
321for (int i = 0; i < _instanceClaims.Count; i++) 326for (int j = 0; j < _externalClaims!.Count; j++) 471for (int i = 0; i < _instanceClaims.Count; i++) 833if (_instanceClaims.Count > 0) 880writer.Write(_instanceClaims.Count);
System\Security\Claims\ClaimsPrincipal.cs (7)
381for (int i = 0; i < _identities.Count; i++) 407for (int i = 0; i < _identities.Count; i++) 435for (int i = 0; i < _identities.Count; i++) 487for (int i = 0; i < _identities.Count; i++) 522if (_identities.Count > 0) 538writer.Write(_identities.Count); 562if (_identities.Count > 0)
System.Security.Cryptography (32)
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (3)
53for (int index = 0; index < _list.Count; index++) 79int indexOfNewItem = _list.Count; 112return _list.Count;
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
317if (serializedBags.Count == 0) 327List<Pkcs12SafeBag> bags = new List<Pkcs12SafeBag>(serializedBags.Count); 329for (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)
454if (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)
873if (extensionAsns.Count > 0)
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (1)
367if (_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)
348if (signatures.Count < 1)
System.Security.Cryptography.Pkcs (11)
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (3)
53for (int index = 0; index < _list.Count; index++) 79int indexOfNewItem = _list.Count; 112return _list.Count;
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
317if (serializedBags.Count == 0) 327List<Pkcs12SafeBag> bags = new List<Pkcs12SafeBag>(serializedBags.Count); 329for (int i = 0; i < serializedBags.Count; i++)
System\Security\Cryptography\Pkcs\CmsRecipientCollection.cs (3)
41if (index < 0 || index >= _recipients.Count) 52return _recipients.Count; 63int indexOfNewItem = _recipients.Count;
System\Security\Cryptography\Pkcs\Pkcs12Info.cs (2)
117if (authSafeData.Count == 0) 123Pkcs12SafeContents[] contentsArray = new Pkcs12SafeContents[authSafeData.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 (30)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (5)
104for (int i = 0; i < nodes.Count; i++) 117var adjacencyRow = new bool[Math.Max(nodes.Count, count)]; 125index = nodes.Count; 147var sortedNodes = new T[nodes.Count]; 156for (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++) 364DebugViewItem[] properties = new DebugViewItem[_node.List.Count]; 366for (int i = 0; i < _node.List.Count; i++) 402return $"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++) 171if (list.Count - index < count)
System\Text\Json\Schema\JsonSchemaExporter.cs (5)
113List<JsonSchema>? anyOf = new(derivedTypes.Count); 136state.PushSchemaNode(anyOf.Count.ToString(CultureInfo.InvariantCulture)); 149if (anyOf.Count == 0) 413public int CurrentDepth => _currentPath.Count; 430_currentPath.RemoveAt(_currentPath.Count - 1);
System\Text\Json\Serialization\ConfigurationList.cs (1)
49public 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\Value\EnumConverter.cs (1)
656Debug.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\WriteStack.cs (1)
283Debug.Assert(CompletedAsyncDisposables?.Count > 0);
System.Text.Json.SourceGeneration (8)
JsonSourceGenerator.Parser.cs (3)
116Debug.Assert(rootSerializableTypes.Count > 0); 203Debug.Assert(typeDeclarations?.Count > 0); 1005AddPropertyWithConflictResolution(propertySpec, memberInfo, propertyIndex: properties.Count, ref state);
src\libraries\System.Text.Json\Common\JsonHelpers.cs (5)
104for (int i = 0; i < nodes.Count; i++) 117var adjacencyRow = new bool[Math.Max(nodes.Count, count)]; 125index = nodes.Count; 147var sortedNodes = new T[nodes.Count]; 156for (int i = 0; i < adjacency.Count; i++)
System.Text.RegularExpressions (116)
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; 1645for (int i = 0; i < rangelist.Count; i++) 1682if (rangelist.Count > 1) 1694if (i == rangelist.Count || last == LastChar) 1727rangelist.RemoveRange(j, rangelist.Count - j); 1737if (rangelist.Count == 2) 1750else if (rangelist.Count == 1) 1778rangelist.Count == 1 && rangelist[0].First == 0 && rangelist[0].Last == LastChar) 1794rangelist.Count == 2 && rangelist[0].First == 0 && rangelist[0].Last + 2 == rangelist[1].First && rangelist[1].Last == LastChar)
System\Text\RegularExpressions\RegexCompiler.cs (2)
849int setsToUse = Math.Min(sets.Count, MaxSets); 6193int index = list.Count;
System\Text\RegularExpressions\RegexFindOptimizations.cs (11)
172Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 209fixedDistanceSets.Count == 1 && 221if (fixedDistanceSets.Count > MaxSetsToUse) 223fixedDistanceSets.RemoveRange(MaxSetsToUse, fixedDistanceSets.Count - MaxSetsToUse); 228FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].Distance == 0) ? 231_asciiLookups = new uint[fixedDistanceSets.Count][]; 314if (fixedDistanceSets.Count >= 2) 324for (int i = 0; i < fixedDistanceSets.Count + 1; i++) 326char[]? chars = i < fixedDistanceSets.Count ? fixedDistanceSets[i].Chars : null; 737for (int i = 1; i < sets.Count; i++) 765for (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 }); 1118for (; endingIndex < children.Count; endingIndex++) 1178while (i < children.Count) 1200children.RemoveRange(j, children.Count - j); 1216Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1231for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1251for (; endingIndex < children.Count; endingIndex++) 1550for (i = 0, j = 0; i < children.Count; i++, j++) 1564for (int k = 0; k < atChildren.Count; k++) 1631while (next < children.Count) 1785if (nextSave < children.Count) 1787children.RemoveRange(nextSave, children.Count - nextSave); 2221if (currentIndex + 1 == peers.Count) 2777return children.Count; 2857sb.Append(new string(' ', stack.Count * 2)).Append(curNode.Describe()).AppendLine(); 2861if (stack.Count == 0) 2866curChild = stack[stack.Count - 1]; 2867stack.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; 1645for (int i = 0; i < rangelist.Count; i++) 1682if (rangelist.Count > 1) 1694if (i == rangelist.Count || last == LastChar) 1727rangelist.RemoveRange(j, rangelist.Count - j); 1737if (rangelist.Count == 2) 1750else if (rangelist.Count == 1) 1778rangelist.Count == 1 && rangelist[0].First == 0 && rangelist[0].Last == LastChar) 1794rangelist.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)
172Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 209fixedDistanceSets.Count == 1 && 221if (fixedDistanceSets.Count > MaxSetsToUse) 223fixedDistanceSets.RemoveRange(MaxSetsToUse, fixedDistanceSets.Count - MaxSetsToUse); 228FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].Distance == 0) ? 231_asciiLookups = new uint[fixedDistanceSets.Count][]; 314if (fixedDistanceSets.Count >= 2) 324for (int i = 0; i < fixedDistanceSets.Count + 1; i++) 326char[]? 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 }); 1118for (; endingIndex < children.Count; endingIndex++) 1178while (i < children.Count) 1200children.RemoveRange(j, children.Count - j); 1216Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1231for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1251for (; endingIndex < children.Count; endingIndex++) 1550for (i = 0, j = 0; i < children.Count; i++, j++) 1564for (int k = 0; k < atChildren.Count; k++) 1631while (next < children.Count) 1785if (nextSave < children.Count) 1787children.RemoveRange(nextSave, children.Count - nextSave); 2221if (currentIndex + 1 == peers.Count) 2777return children.Count; 2857sb.Append(new string(' ', stack.Count * 2)).Append(curNode.Describe()).AppendLine(); 2861if (stack.Count == 0) 2866curChild = stack[stack.Count - 1]; 2867stack.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)
2525if (_tempSendAsyncTaskList != null && _tempSendAsyncTaskList.Count > 0)
Blocks\BatchBlock.cs (11)
804while (reserved.Count < _batchSize) 819Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch."); 822if (reserved.Count > 0) 852if (shouldProceedToConsume && (allowFewerThanBatchSize || reserved.Count == _batchSize)) 918while (reserved.Count < itemCountNeededToCompleteBatch) 931Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch."); 934if (reserved.Count > 0) 988for (int i = 0; i < reserved.Count; i++) 1016if (_boundingState != null) _boundingState.CurrentCount += reserved.Count; 1040for (int i = 0; i < reserved.Count; i++) 1092for (int i = 0; i < reserved.Count; i++)
Blocks\BatchedJoinBlock.cs (2)
556internal int Count { get { return _messages.Count; } } 637$"{Common.GetNameForDebugger(this)} InputCount = {_messages.Count}";
Blocks\TransformManyBlock.cs (1)
407itemCount = itemCopy.Count;
Blocks\TransformManyBlock.IAsyncEnumerable.cs (1)
164itemCount = 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)
346countReceived = tmpList.Count; 426for (int i = 0; i < itemsAsList.Count; i++)
System.Windows.Controls.Ribbon (35)
Microsoft\Windows\Automation\Peers\RibbonAutomationPeer.cs (2)
183if (ribbonTabs != null && ribbonTabs.Count > 0) 189for (int i=0; i<ribbonTabs.Count; i++)
Microsoft\Windows\Automation\Peers\RibbonGalleryAutomationPeer.cs (1)
183if (selectedProviders.Count != 0)
Microsoft\Windows\Controls\KeyTipService.cs (9)
846if (_currentActiveKeyTipElements.Count > 0) 993activeKeyTipElements.Count == 0) 1000int currentActiveCount = _currentActiveKeyTipElements.Count; 1001int newActiveCount = activeKeyTipElements.Count; 1508current._cachedKeyTipControls.Count > 0) 1511int count = current._cachedKeyTipControls.Count; 1627for (int i = 0; i < handlerList.Count; i++) 1648for (int i = 0; i < handlerList.Count; i++) 1673for (int i = 0; i < handlerList.Count; i++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupItemsPanel.cs (5)
61double starLayoutCombinationCount = _starLayoutCombinations.Count; 170if (starChildIndices.Count > 0) 181int starLayoutIndex = _starLayoutCombinations.Count - 1; 272int starLayoutCombinationCount = _starLayoutCombinations.Count; 344if (columnStarChildren != null && columnStarChildren.Count > 0 && starLayoutIndex >= 0)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupsPanel.cs (3)
439int elementCount = starInfoList.Count; 475Debug.Assert(index >= 0 && index < starInfoList.Count); 502Debug.Assert(distributionCount > 0 && distributionCount <= starInfoList.Count);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonMenuItemsPanel.cs (2)
177if (InvalidateRegisteredLayoutProvidersList.Count > 0) 179for (int i = 0; i < InvalidateRegisteredLayoutProvidersList.Count; i++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (4)
181for (int i = 0; i < generatedItems.Count; i++) 306Debug.Assert(GeneratedChildren.Count > InternalChildren.Count); 307int numItemsExpectedInOverflowPanel = GeneratedChildren.Count - InternalChildren.Count; 325for (int k = InternalChildren.Count; k < GeneratedChildren.Count; k++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (2)
507int sizeCount = elementSizes.Count; 562int sizeCount = desiredPaddings.Count;
Microsoft\Windows\Controls\TextSearchInternal.cs (7)
119if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 260if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 324if (_charsEntered.Count > 0) 326string lastChar = _charsEntered[_charsEntered.Count - 1]; 329_charsEntered.RemoveAt(_charsEntered.Count - 1);
System.Windows.Forms (247)
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)
620_accelCount = (short)mnemonicList.Count;
System\Windows\Forms\Application.ThreadContext.cs (8)
139if (_parkingWindows.Count == 0) 148Debug.Assert(_parkingWindows.Count == 1, "parkingWindows count can not be > 1 for legacy OS/target framework versions"); 216if (_messageFilters.Count > 0 && filter is IMessageModifyAndFilter) 353if (_parkingWindows.Count != 0) 366for (int i = 0; i < _parkingWindows.Count; i++) 865if (_messageFilters.Count > 0) 877if (_messageFilterSnapshot is not null && _messageFilterSnapshot.Count != 0) 880int 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)
5384holders.Add(new ControlTabOrderHolder(holders.Count, tabIndex, ctl)); 5389int[] indexes = new int[holders.Count]; 5390for (int i = 0; i < holders.Count; i++) 5412holders.Add(new ControlTabOrderHolder(holders.Count, c.TabIndex, c)); 5418Control[] controls = new Control[holders.Count]; 5419for (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) 2223if (newItems.Count > 0) 5562s += $", Items.Count: {_listViewItems.Count}"; 5563if (_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)
64ListViewItem[] cloned = new ListViewItem[_owner._savedSelectedItems.Count]; 65for (int i = 0; i < _owner._savedSelectedItems.Count; i++) 101return _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)
1528int length = _annualBoldDates.Count; 1560for (int i = 0; i < _boldDates.Count; i++) 1579int length = _monthlyBoldDates.Count; 1898=> _annualBoldDates.Count > 0; 1901=> _boldDates.Count > 0; 1916=> _monthlyBoldDates.Count > 0;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (4)
2173for (int i = 1; i < components.Length && tabClasses.Count > 0; i++) 2182for (int j = tabClasses.Count - 1; j >= 0; j--) 3911int count = buttonList.Count; 3985for (int j = 0; j < buttonList.Count; j++)
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)
728if (index == -1 || _tabPages.Count == 0) 801public int TabCount => _tabPages?.Count ?? 0; 1040for (int i = 0; i < _tabPages.Count; i++) 1069if (_tabPages.Count > 0) 1588if (index < _tabPages.Count)
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
674if (_associatedToolTips.Count == 1)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (3)
1072if (ActiveDropDowns.Count == 0) 1943int count = ActiveDropDowns.Count; 1955for (int i = 0; i < dropDowns.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (4)
236if (_inputFilterQueue is not null && _inputFilterQueue.Count > 0) 326int countDropDowns = _inputFilterQueue?.Count ?? 0; 373int countDropDowns = _inputFilterQueue?.Count ?? 0; 464if (!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)
3494for (int i = ownedForms.Count - 1; i >= 0; i--) 4809for (int i = ownedForms.Count - 1; i >= 0; i--) 4837for (int i = ownedForms.Count - 1; i >= 0; i--) 6632for (int i = ownedForms.Count - 1; i >= 0; i--) 6701for (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 (144)
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)
800if (exceptions.Count > 0) 1139List<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) 573return _behaviorStack.Count > 0 ? _behaviorStack[0] : g?.Behavior;
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (1)
236if (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)
1435if (dragControls.Count > 0)
System\Windows\Forms\Design\DataGridViewDesigner.cs (1)
686for (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; 151for (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\TabControlDesigner.cs (1)
509for (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)
1837if (dragComponents.Count == 1) 1849transDesc = 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)
661if (dragComponents.Count == 1) 673transDesc = string.Format(copy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, dragComponents.Count);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
2697if (dragComponents.Count == 1) 2709transDesc = string.Format(copy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, dragComponents.Count);
System.Windows.Forms.Design.Tests (1)
System\Windows\Forms\Design\MaskDescriptorTemplateTests.cs (1)
64descriptors.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 (4)
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 (11)
BindingNavigatorTests.cs (1)
98for (int i = 0; i < items.Count; i++)
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\BinaryFormatUtilitiesTests.cs (1)
481result!.Count.Should().Be(1);
System\Windows\Forms\BindingSourceTests.cs (1)
736public int Count => _innerList.Count;
System\Windows\Forms\ComboBoxTests.cs (1)
2583Assert.Equal(3, ownerDrawComboBox.MeasureItemEventArgs.Count);
System\Windows\Forms\NativeWindowTests.cs (1)
376Assert.Equal(2, window1.Messages.Count);
System\Windows\Forms\SendKeysTests.cs (1)
18Assert.Equal(4, form.KeyEvents.Count);
System\Windows\Forms\TabPageTests.cs (2)
5113Assert.Equal(2, associatedToolTips.Count); 5201Assert.Equal(2, associatedToolTips.Count);
System\Windows\Forms\TreeNodeTests.cs (1)
4617Assert.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)
395(addedManipulatorList == null || addedManipulatorList.Count == 0) && 420if (addedManipulatorList != null && addedManipulatorList.Count > 0) 438if ((addedManipulatorList != null && addedManipulatorList.Count > 0) || 471if (addedManipulatorList != null && addedManipulatorList.Count > 0)
System.Xaml (77)
System\Xaml\Context\NameFixupGraph.cs (5)
210if (token.NeededNames.Count == 0) 360while (markupExtensionTokens.Count > 0) 364while (i < markupExtensionTokens.Count) 375for (int j = dependencies.Count - 1; j >= 0; j--) 409for (int j = dependencies.Count - 1; j >= 0; j--)
System\Xaml\Context\ObjectWriterContext.cs (3)
177return (valueList.Count == 0) ? null : valueList[0]; 183return (valueList.Count == 0) ? null : valueList[0]; 407if (stopAfterFirst && retList.Count > 0)
System\Xaml\Context\ServiceProviderContext.cs (1)
296if (token.CanAssignDirectly && token.NeededNames.Count != 1)
System\Xaml\Context\XamlContext.cs (1)
282typeArgs = new XamlType[typeNames.Count];
System\Xaml\InfosetObjects\XamlObjectWriter.cs (7)
1240object[] argInstances = new object[rawArgs.Count]; 1241IList<XamlType> paramTypes = meType.GetPositionalParameters(rawArgs.Count); 1246string msg = string.Format(TypeConverterHelper.InvariantEnglishUS, SR.NoSuchConstructor, rawArgs.Count, meType.Name); 1253if (i >= rawArgs.Count) 1963keyToken.Target.TemporaryCollectionIndex = pendingCollection.Count; 1969valueToken.Target.TemporaryCollectionIndex = pendingCollection.Count; 2490Debug.Assert(token.NeededNames.Count == 0 || nameResolutionIsComplete);
System\Xaml\Parser\GenericTypeNameParser.cs (1)
303if (frame.TypeArgs.Count != 1)
System\Xaml\Parser\NodeStreamSorter.cs (4)
41if (_seenStack.Count == 0) 53if(_seenStack.Count <=_startObjectDepth) 564if (_moveList.Count == 0) 569for (int i = 0; i < _moveList.Count; i++)
System\Xaml\Parser\XamlPullParser.cs (2)
578for (int i = 0; i < savedPrefixDefinitions.Count; i++) 764for (int i = 0; i < _savedPrefixDefinitions.Count; i++)
System\Xaml\Parser\XamlScanner.cs (5)
590if (list.Count > 0) 603for (int i = 0; i < attrList.Count; i++) 734for (int i = _attributes.Count - 1; i >= 0; i--) 742if (_attributes.Count == 0) 823if (_nextAttribute >= _attributes.Count)
System\Xaml\Schema\Reflector.cs (1)
339if (cads.Count == 0)
System\Xaml\Schema\TypeReflector.cs (7)
672if (candidates.Count > 0) 677else if (setters is null || setters.Count == 0 678|| (getters is not null && getters.Count > 0 && UnderlyingType.IsVisible && getters[0].IsPublic && !setters[0].IsPublic)) 713if ((setters is null || setters.Count == 0) && (getters is null || getters.Count == 0)) 728if (adders is null || adders.Count == 0) 1206for (int i = 0; i < listOfNulls.Count; i++)
System\Xaml\Schema\XamlNamespace.cs (2)
172get => (_assemblyNamespaces is not null) ? _assemblyNamespaces.Count : 0; 180Debug.Assert(_assemblyNamespaces.Count == 1);
System\Xaml\XamlMember.cs (1)
573if (doPropertyNames is null || doPropertyNames.Count == 0)
System\Xaml\XamlNodeList.cs (2)
65return new ReaderMultiIndexDelegate(_writer.SchemaContext, Index, _nodeList.Count, _hasLineInfo); 121get { return _nodeList.Count; }
System\Xaml\XamlObjectReader.cs (25)
268return (children.Count == 1) && (children[0] is ValueMarkupInfo); 276if (children.Count != 1) 305if (Children.Count > 1) { return false; } 308if (Children.Count == 0 || Children[0] is ValueMarkupInfo) { return true; } 535if (itemsInfo is not null && itemsInfo.Children.Count != 0) 563if (itemsInfo is not null && itemsInfo.Children.Count != 0) 672if (memberInfo.Children.Count == 1) 674if (memberInfo.Children[0] is ObjectMarkupInfo objectInfo && objectInfo.Properties.Count == 1 && memberType == objectInfo.XamlNode.XamlType) 678if (objectInfo.Properties[0] is MemberMarkupInfo itemsMemberInfo && itemsMemberInfo.Children.Count > 0) 746if (itemInfo.Properties is not null && itemInfo.Properties.Count == 1) 755if (memberInfo.Children.Count == 1) 1073for (i = 0; i < Properties.Count; i++) 1093for (int i = 0; i < properties.Count; ) 1206if (propertyInfo is not null && propertyInfo.Children.Count != 0) 1648if (constructorParameters.Length != ctorArgProps.Count) { continue; } 1677if (constructorArguments.Count == ctorArgProps.Count) 1700if (ctorArgProps.Count == 0) 1841if (items.Children.Count != 0) 2091if (propertyInfo.Children.Count == 1) 2104return propertyInfo.Children.Count == 1 && 2134if (propertyInfo.Children.Count == 1) 2915objectPosition = nodes.Count; 3087result = _entries.Count; 3129for (int i = 0; i < _entries.Count; ++i) 3135for (int i = 0; i < _entries.Count; ++i)
System\Xaml\XamlSchemaContext.cs (1)
1459for (int i = 0; i < Count; i++)
System\Xaml\XamlType.cs (1)
829contentWrappers = new List<XamlType>(wrapperTypes.Count);
System\Xaml\XamlTypeName.cs (1)
147return _typeArguments is not null && _typeArguments.Count > 0;
System\Xaml\XamlXmlWriter.cs (7)
1934int numOfParameters = writer.ppStateInfo.NodesList.Count; 1940if (constructorParameters.Length != ctorArgProps.Count) 2077writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2096Debug.Assert(writer.ppStateInfo.NodesList.Count != 0); 2097writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2114writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2143writer.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)
847var certificatesDescription = list.Count switch 851_ => $"{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)
847var certificatesDescription = list.Count switch 851_ => $"{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)
847var certificatesDescription = list.Count switch 851_ => $"{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)
847var certificatesDescription = list.Count switch 851_ => $"{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)
847var certificatesDescription = list.Count switch 851_ => $"{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)
TestDiscoveryWorker (1)
Program.cs (1)
41if (extra.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)
235for (int index = eventCreateParams.Count - 1; index >= 0; index--) 288for (int index = eventCreateParams.Count - 1; index >= 0; index--) 401for (int index = eventCreateParams.Count - 1; index >= 0; index--) 419if (eventCreateParams.Count == 0) 435for (int index = eventCreateParams.Count - 1; index >= 0; index--) 458if (eventCreateParams.Count == 0)
VBCSCompiler (6)
src\Compilers\Server\VBCSCompiler\AnalyzerConsistencyChecker.cs (1)
114for (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)
324for (int i = _internalList.Count - 1; i >= 0; i--) 369for (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;