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
9334 references to Count
aspire (144)
Backchannel\AppHostConnectionHelper.cs (4)
33if (connections.Count == 0) 37if (connections.Count == 0) 65if (inScopeConnections.Count == 1) 71if (inScopeConnections.Count > 1)
Backchannel\AppHostConnectionResolver.cs (5)
59if (connections.Count == 0) 123if (connections.Count == 0) 135if (inScopeConnections.Count == 1) 140else if (inScopeConnections.Count > 1) 149else if (outOfScopeConnections.Count > 0)
Backchannel\AuxiliaryBackchannelMonitor.cs (4)
65if (connections.Count == 0) 89if (inScopeConnections.Count == 1) 219connectTasks.EnsureCapacity(newFiles.Count); 263if (connectTasks.Count > 0)
Backchannel\ResourceSnapshotMapper.cs (2)
164if (exactMatches.Count > 0) 172if (displayNameMatches.Count == 1)
Caching\DiskCache.cs (1)
207for (var i = 0; i < list.Count; i++)
Certificates\CertificateGeneration\CertificateManager.cs (2)
1032var certificatesDescription = list.Count switch 1036_ => $"{list.Count} certificates",
Certificates\CertificateGeneration\UnixCertificateManager.cs (3)
137if (nssDbs.Count > 0) 304if (nssDbs.Count > 0) 505if (nssDbs.Count > 0)
Certificates\NativeCertificateToolRunner.cs (2)
55HasCertificates = validCerts.Count > 0, 189return dnsNames.Count > 0 ? dnsNames.ToArray() : null;
Commands\AddCommand.cs (2)
436if (rootChoices.Count == 0) 442if (rootChoices.Count == 1)
Commands\AgentInitCommand.cs (3)
170if (userChoices.Count == 0) 197if (skillApplicators.Count > 0) 217if (mcpApplicators.Count > 0)
Commands\AgentMcpCommand.cs (1)
171_logger.LogDebug("Returning {ToolCount} tools", tools.Count);
Commands\ConfigCommand.cs (1)
283if (unconfiguredFeatures.Count > 0)
Commands\ExecCommand.cs (2)
314while (i < allTokens.Count) 332if (!isFlag && i + 1 < allTokens.Count)
Commands\ExportCommand.cs (1)
145if (snapshots.Count == 0)
Commands\GroupedHelpWriter.cs (4)
130if (ungroupedCommands.Count > 0) 144if (visibleOptions.Count > 0) 300return sorted.Count > 1 302: sorted.Count > 0 ? sorted[0] : option.Name;
Commands\LogsCommand.cs (1)
182if (snapshots.Count == 0)
Commands\McpToolsCommand.cs (1)
73if (resourcesWithTools.Count == 0)
Commands\NewCommand.cs (1)
395if (rootChoices.Count == 0)
Commands\PsCommand.cs (2)
113if (connections.Count == 0) 202if (appHosts.Count == 0)
Commands\RunCommand.cs (3)
307if (discoveredEndpoints.Count > 0) 315for (var i = 0; i < discoveredEndpoints.Count; i++) 334return rows.Count > 0 ? new Rows(rows) : Text.Empty;
Commands\Sdk\SdkDumpCommand.cs (14)
147_logger.LogDebug("Building AppHost server for capability scanning with {Count} integrations", integrations.Count); 195if (packageVersions.Count > 0) 280if (capabilities.Diagnostics.Count > 0) 308var flagStr = flags.Count > 0 ? string.Format(CultureInfo.InvariantCulture, " [{0}]", string.Join(", ", flags)) : ""; 314if (capabilities.DtoTypes.Count > 0) 338if (capabilities.EnumTypes.Count > 0) 378sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " Handle Types: {0}", capabilities.HandleTypes.Count)); 379sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " DTO Types: {0}", capabilities.DtoTypes.Count)); 380sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " Enum Types: {0}", capabilities.EnumTypes.Count)); 381sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " Capabilities: {0}", capabilities.Capabilities.Count)); 389if (capabilities.Diagnostics.Count > 0) 423var flagStr = flags.Count > 0 ? string.Format(CultureInfo.InvariantCulture, " ({0})", string.Join(", ", flags)) : ""; 434if (capabilities.DtoTypes.Count > 0) 462if (capabilities.EnumTypes.Count > 0)
Commands\SecretListCommand.cs (1)
71if (secrets.Count == 0)
Commands\SettingsSchemaBuilder.cs (1)
171if (dictInterfaces.Count > 0)
Commands\TelemetryCommandHelpers.cs (1)
195if (matchingReplicas.Count > 0)
Commands\TelemetryTracesCommand.cs (5)
340if (spans.Count == 0) 349var totalDuration = rootSpans.Count > 0 ? rootSpans.Max(s => s.Duration) : spans.Max(s => s.Duration); 353_interactionService.DisplayMarkupLine($"[bold]Duration:[/] {TelemetryCommandHelpers.FormatDuration(totalDuration)} [bold]Spans:[/] {spans.Count}"); 425for (var i = 0; i < children.Count; i++) 427DisplaySpanNode(children[i], childrenByParent, childIndent, i == children.Count - 1, ref lastResource);
Configuration\ConfigurationService.cs (1)
286for (int i = objectPath.Count - 1; i >= 0; i--)
Interaction\ConsoleInteractionService.cs (1)
213if (choicesList.Count == 0)
Mcp\Docs\DocsIndexService.cs (5)
159_logger.LogInformation("Loaded {Count} documents from cache in {ElapsedTime:ss\\.fff} seconds.", _indexedDocuments.Count, cacheElapsedTime); 182_logger.LogInformation("Indexed {Count} documents from aspire.dev in {ElapsedTime:ss\\.fff} seconds.", _indexedDocuments.Count, elapsedTime); 194if (_indexedDocuments is null or { Count: 0 }) 214if (_indexedDocuments is null or { Count: 0 } || string.IsNullOrWhiteSpace(query)) 259if (_indexedDocuments is null or { Count: 0 })
Mcp\Docs\LlmsTxtParser.cs (6)
86if (docBoundaries.Count is 0) 91var documents = new List<LlmsDocument>(docBoundaries.Count); 93for (var i = 0; i < docBoundaries.Count; i++) 98var endIndex = i + 1 < docBoundaries.Count 307for (var i = 0; i < sectionStarts.Count; i++) 313for (var j = i + 1; j < sectionStarts.Count; j++)
Mcp\McpResourceToolRefreshService.cs (1)
92_logger.LogDebug("Resources with MCP tools received: {Count}", resourcesWithTools.Count);
Mcp\Tools\ListConsoleLogsTool.cs (1)
74var totalLogsCount = entries.Count == 0 ? 0 : entries.Last().LineNumber;
Mcp\Tools\ListResourcesTool.cs (1)
77if (snapshots.Count == 0)
Mcp\Tools\SelectAppHostTool.cs (1)
90if (availableAppHosts.Count > 0)
NuGet\BundleNuGetService.cs (2)
70if (packageList.Count == 0) 129_logger.LogDebug("Restoring {Count} packages", packageList.Count);
Projects\DotNetBasedAppHostServerProject.cs (2)
226if (otherPackages.Count > 0) 375if (channelSources.Count > 0)
Projects\GuestAppHostProject.cs (2)
1088if (updates.Count == 0 && newSdkVersion is null) 1202_logger.LogDebug("Generating {CodeGenerator} code via RPC for {Count} packages", codeGenerator, integrationsList.Count);
Projects\LanguageService.cs (1)
82if (languages.Count == 1)
Projects\PrebuiltAppHostServer.cs (8)
113if (projectRefs.Count > 0) 128else if (packageRefs.Count > 0) 169_logger.LogDebug("Restoring {Count} integration packages via bundled NuGet", packageRefs.Count); 240packageRefs.Count, projectRefs.Count); 297if (packageRefs.Count > 0) 312if (projectRefs.Count > 0) 400return sources.Count > 0 ? sources : null;
Projects\ProjectLocator.cs (9)
272if (appHostProjects.Count == 0) 282else if (appHostProjects.Count == 1) 361logger.LogDebug("Found {ProjectFileCount} project files.", results.BuildableAppHost.Count); 365if (results.BuildableAppHost.Count == 0 && results.UnbuildableSuspectedAppHostProjects.Count == 0) 374else if (results.BuildableAppHost.Count == 0 && results.UnbuildableSuspectedAppHostProjects.Count > 0) 378else if (results.BuildableAppHost.Count == 1) 382else if (results.BuildableAppHost.Count > 1)
Projects\ProjectUpdater.cs (6)
53if (updateStepsByProject.Count > 1) 1029if (addedPatterns.Count > 0 || removedPatterns.Count > 0) 1119public bool HasChanges => AddedFeeds.Count > 0 || RemovedFeeds.Count > 0 || MappingChanges.Count > 0;
Projects\SolutionLocator.cs (2)
30logger.LogDebug("Found {Count} solution file(s) in {Directory}", solutionFiles.Count, startDirectory.FullName); 32if (solutionFiles.Count == 1)
src\Shared\CircularBuffer.cs (8)
48public int Count => _buffer.Count; 108if (shiftLength > 0 || internalIndex == _buffer.Count - 1) 114else if (internalIndex < _end && _end < _buffer.Count - 1) 135if (internalIndex > _buffer.Count) 137internalIndex = internalIndex % _buffer.Count; 144if (_end != _buffer.Count) 209if (_end != _buffer.Count) 266return (_start + index) % _buffer.Count;
src\Shared\ColorGenerator.cs (1)
83_currentIndex = ++_currentIndex % _colors.Count;
src\Shared\ConsoleLogs\AnsiParser.cs (4)
497if (classes.Count == 0 && styles.Count == 0) 504if (classes.Count > 0) 509if (styles.Count > 0)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (6)
399if (spans.Count == 0) 685return GetLimitFromEndWithSummary(values, values.Count, limit, itemName, pluralItemName, convertToDto, estimateTokenSize); 700Debug.Assert(totalValues >= values.Count, "Total values should be large or equal to the values passed into the method."); 702var trimmedItems = values.Count <= limit 711for (var i = dtos.Count - 1; i >= 0; i--) 728return (dtos, GetLimitSummary(totalValues, dtos.Count, itemName, pluralItemName));
src\Shared\DashboardUrls.cs (1)
284return parts.Count > 0 ? "?" + string.Join("&", parts) : "";
src\Shared\DurationFormatter.cs (3)
83for (var i = 0; i < s_unitSteps.Count; i++) 86var result = i < s_unitSteps.Count - 1 && step.Threshold > ticks; 90return (step, i < s_unitSteps.Count - 1 ? s_unitSteps[i + 1] : step);
Utils\ConfigurationHelper.cs (1)
167if (colonKeys.Count == 0)
Utils\ConsoleActivityLogger.cs (1)
244if (_durationRecords is { Count: > 0 })
Utils\EnvironmentChecker\DevCertsCheck.cs (1)
182if (oldTrustedVersions.Count > 0)
Utils\MarkdownToSpectreConverter.cs (2)
219var placeholder = $"__SPECTRE_MARKUP_{spectreMarkups.Count}__"; 228for (int i = 0; i < spectreMarkups.Count; i++)
aspire-managed (5)
NuGet\Commands\RestoreCommand.cs (1)
321Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "Using {0} package sources:", packageSources.Count));
NuGet\Commands\SearchCommand.cs (4)
127Console.Error.WriteLine(string.Format(CultureInfo.InvariantCulture, "Searching {0} source(s) for '{1}'", packageSources.Count, query)); 207if (packageSources.Count == 0) 224if (packageSources.Count == 0) 286TotalHits = packages.Count
Aspire.Azure.AI.Inference (1)
ChatCompletionsClientSettings.cs (1)
117if (deploymentKeys.Count > 1)
Aspire.Azure.Messaging.EventHubs (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Azure.Messaging.ServiceBus (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Azure.Messaging.WebPubSub (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Azure.Storage.Queues (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Cli.Tests (43)
Commands\AddCommandTests.cs (2)
688Assert.Equal(2, displayedChoices!.Count); 1003Assert.True(promptedPackages.Count > 0);
Commands\DescribeCommandTests.cs (3)
222Assert.Equal(3, parsedLines.Count); 285Assert.Equal(2, jsonLines.Count); 329Assert.Equal(2, resourceLines.Count);
Commands\ExtensionInternalCommandTests.cs (1)
135Assert.Equal(2, searchResult.AllProjectFileCandidates.Count);
Commands\LogsCommandTests.cs (3)
305Assert.Equal(3, parsedLines.Count); 542Assert.Equal(3, logLines.Count); 565Assert.Equal(3, logLines.Count);
Commands\McpIconHelperTests.cs (1)
23Assert.Equal(5, icons.Count);
Commands\PsCommandTests.cs (1)
260Assert.Equal(2, appHost.Resources.Count);
Commands\PublishCommandPromptingIntegrationTests.cs (2)
305Assert.Equal(3, promptBackchannel.ReceivedPrompts.Count); 323Assert.Equal(3, promptBackchannel.CompletedPrompts.Count);
Commands\RootCommandTests.cs (1)
439Assert.True(missingGroup.Count == 0,
Commands\TelemetryLogsCommandTests.cs (2)
77Assert.Equal(2, logLines.Count); 112Assert.Equal(2, logLines.Count);
Commands\TelemetrySpansCommandTests.cs (2)
77Assert.Equal(2, spanLines.Count); 112Assert.Equal(2, spanLines.Count);
Configuration\AspireConfigFileTests.cs (1)
304Assert.Equal(2, refs.Count);
Configuration\IntegrationReferenceTests.cs (3)
48Assert.Equal(3, refs.Count); 53Assert.Equal(2, packageRefs.Count); 116Assert.Equal(2, refs.Count);
Mcp\Docs\LlmsTxtParserTests.cs (1)
581Assert.True(h3Sections.Count > 0, "Should have H3 subsections");
Packaging\PackagingServiceTests.cs (5)
778outputHelper.WriteLine($"Template packages returned: {packageList.Count}"); 831outputHelper.WriteLine($"Integration packages returned: {packageList.Count}"); 837Assert.Equal(2, packageList.Count); 883outputHelper.WriteLine($"Template packages returned: {packageList.Count}"); 890Assert.Equal(2, packageList.Count);
Projects\ExtensionGuestLauncherTests.cs (1)
93Assert.Equal(2, capturedEnv.Count);
Projects\GuestAppHostProjectTests.cs (1)
150Assert.Equal(2, refs.Count);
Projects\PrebuiltAppHostServerTests.cs (1)
26Assert.Equal(2, packageElements.Count);
Projects\ProjectLocatorTests.cs (2)
467Assert.Equal(2, foundFiles.Count); 528Assert.Equal(2, foundFiles.Count);
Secrets\SecretsStoreTests.cs (1)
81Assert.Equal(3, secrets.Count);
TestServices\TestAuxiliaryBackchannelMonitor.cs (2)
42if (connections.Count == 0) 66if (inScopeConnections.Count == 1)
Utils\DevCertsCheckFixRecommendationTests.cs (1)
105Assert.Equal(2, results.Count);
Utils\DevCertsCheckTests.cs (1)
144Assert.Equal(2, results.Count);
Utils\OutputCollectorTests.cs (5)
44Assert.Equal(threadCount * linesPerThread, lines.Count); 50Assert.Equal(threadCount * linesPerThread / 2, stdoutLines.Count); 51Assert.Equal(threadCount * linesPerThread / 2, stderrLines.Count); 72Assert.Equal(2, newSnapshot.Count); 103Assert.Equal(100, finalLines.Count);
Aspire.Components.Common.TestUtilities (2)
ActivityNotifier.cs (1)
25if (activityList.Count == count)
ConformanceTests.cs (1)
164Assert.Equal(2, registeredNames.Count);
Aspire.Confluent.Kafka.Tests (16)
Aspire8MetricsTests.cs (16)
64collectorNetworkTx.WaitForMeasurementsAsync(statistics.Count), 65collectorNetworkTransmitted.WaitForMeasurementsAsync(statistics.Count), 66collectorNetworkRx.WaitForMeasurementsAsync(statistics.Count), 67collectorNetworkReceived.WaitForMeasurementsAsync(statistics.Count), 68collectorMessageTx.WaitForMeasurementsAsync(statistics.Count), 69collectorMessageTransmitted.WaitForMeasurementsAsync(statistics.Count), 70collectorMessageRx.WaitForMeasurementsAsync(statistics.Count), 71collectorMessageReceived.WaitForMeasurementsAsync(statistics.Count) 179collectorNetworkTx.WaitForMeasurementsAsync(statistics.Count), 180collectorNetworkTransmitted.WaitForMeasurementsAsync(statistics.Count), 181collectorNetworkRx.WaitForMeasurementsAsync(statistics.Count), 182collectorNetworkReceived.WaitForMeasurementsAsync(statistics.Count), 183collectorMessageTx.WaitForMeasurementsAsync(statistics.Count), 184collectorMessageTransmitted.WaitForMeasurementsAsync(statistics.Count), 185collectorMessageRx.WaitForMeasurementsAsync(statistics.Count), 186collectorMessageReceived.WaitForMeasurementsAsync(statistics.Count)
Aspire.Dashboard (181)
Api\TelemetryApiService.cs (16)
81var totalCount = spans.Count; 84if (spans.Count > effectiveLimit) 86spans = spans.Skip(spans.Count - effectiveLimit).ToList(); 95ReturnedCount = spans.Count 143var totalCount = traces.Count; 146if (traces.Count > effectiveLimit) 148traces = traces.Skip(traces.Count - effectiveLimit).ToList(); 160ReturnedCount = traces.Count 192TotalCount = spans.Count, 193ReturnedCount = spans.Count 256var totalCount = logs.Count; 259if (logs.Count > effectiveLimit) 261logs = logs.Skip(logs.Count - effectiveLimit).ToList(); 270ReturnedCount = logs.Count 302if (resourceKeys is { Count: > 0 } && !resourceKeys.Any(k => k is null) && 380if (resourceKeys is { Count: > 0 } && !resourceKeys.Any(k => k is null) &&
Components\Controls\Chart\ChartBase.cs (2)
175for (var i = 0; i < currentTrace.Values.Count; i++) 420for (var i = 0; i < xValues.Count; i++)
Components\Controls\Chart\ChartContainer.razor.cs (2)
102if (_instrument.Dimensions.Count > _renderedDimensionsCount) 105_renderedDimensionsCount = _instrument.Dimensions.Count;
Components\Controls\Chart\MetricTable.razor.cs (7)
80for (var i = 0; i < metricView.Count; i++) 124for (var i = 0; i < xValues.Count; i++) 161for (var traceIndex = 0; traceIndex < traces.Count; traceIndex++) 217Debug.Assert(exemplars.Count == newMetrics.Sum(m => m.Value.Exemplars.Count), $"Expected {exemplars.Count} exemplars but got {newMetrics.Sum(m => m.Value.Exemplars.Count)} exemplars.");
Components\Controls\Chart\PlotlyChart.razor.cs (4)
121for (var i = 0; i <= xValues.Count; i++) 124var end = i < xValues.Count ? xValues[i] : (DateTimeOffset?)null; 130if (groupExemplars.Count > MaxExemplarsPerTick) 132var step = (double)groupExemplars.Count / MaxExemplarsPerTick;
Components\Controls\ResourceDetails.razor.cs (2)
163_isUrlsExpanded = GetUrls().Count > 0; 363if (valueMaskedValues.Count == 1)
Components\Controls\StructuredLogDetails.razor.cs (2)
165var insertStart = destination.Count; 166for (var i = source.Count - 1; i >= 0; i--)
Components\Dialogs\FilterDialog.razor.cs (1)
57if (customFields.Count > 0)
Components\Dialogs\GenAIVisualizerDialog.razor.cs (5)
71public bool NoNextGenAISpan => _currentSpanContextIndex >= _contextSpans.Count - 1; 111var newData = (hasUpdatedTrace || newContextSpans.Count > _contextSpans.Count); 267if (OverviewActiveView is OverviewViewKind.Tools && Content.ToolDefinitions.Count == 0) 271else if (OverviewActiveView is OverviewViewKind.Evaluations && Content.Evaluations.Count == 0)
Components\Dialogs\InteractionsInputDialog.razor.cs (2)
90if (_inputDialogInputViewModels.Count > 0 && _elementRefs.TryGetValue(_inputDialogInputViewModels[0], out var firstInputElement)) 114for (var i = 0; i < Content.Inputs.Count; i++)
Components\Dialogs\ManageDataDialog.razor.cs (2)
453return row.TelemetryData.Count > 0; 529if (consoleLogResourcesToFilter.Count > 0)
Components\Pages\ConsoleLogs.razor.cs (3)
598Logger.LogDebug("Subscribing to {ResourceCount} resources for 'All' view.", availableResources.Count); 600if (availableResources.Count == 0) 1010return actualResources.Count == 1 ? actualResources[0] : null;
Components\Pages\Metrics.razor.cs (5)
172return apps.Count == 1 ? apps[0] : null; 187if (_resourceViewModels.Count != 1) 335if (PageViewModel.Instruments is null || instruments.Count != PageViewModel.Instruments.Count) 359new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsInstrumentsCount, new AspireTelemetryProperty((PageViewModel.Instruments?.Count ?? -1).ToString(CultureInfo.InvariantCulture), AspireTelemetryPropertyType.Metric)),
Components\Pages\Resources.razor.cs (8)
486_totalItemsCount = orderedResources.Count; 487_totalItemsFooter.UpdateDisplayedCount(query.Count); 489return ValueTask.FromResult(GridItemsProviderResult.From(query, orderedResources.Count)); 787if (displayedUrls.Count == 0) 792if (displayedUrls.Count == 1) 800if (displayedUrls.Count > maxShownUrls) 802tooltipBuilder.Append(CultureInfo.CurrentCulture, $" + {displayedUrls.Count - maxShownUrls}"); 968return escapedFilters.Count == 0 ? null : string.Join(" ", escapedFilters);
Components\Pages\StructuredLogs.razor.cs (1)
530if (filters.Count > 0)
Components\Pages\TraceDetail.razor.cs (2)
471return _spanWaterfallViewModels.Any(vm => vm.Depth > RootSpanDepth && !vm.IsCollapsed && vm.Children.Count > 0); 484if (viewModel.Depth > RootSpanDepth && viewModel.Children.Count > 0 && !viewModel.IsCollapsed)
Components\Pages\Traces.razor.cs (1)
325if (filters.Count > 0)
Configuration\ValidateDashboardOptions.cs (2)
83for (var i = 0; i < options.Otlp.AllowedCertificates.Count; i++) 191return errorMessages.Count > 0
DashboardWebApplication.cs (7)
67if (_frontendEndPointAccessor.Count == 0) 80if (_frontendEndPointAccessor.Count == 0) 84else if (_frontendEndPointAccessor.Count > 1) 362if (_frontendEndPointAccessor.Count > 0) 607var protocol = notNullProtocols.Count == 0 744if (options.Otlp.AllowedCertificates is { Count: > 0 } allowList) 828if (claimActions.Count > 0)
Mcp\AspireResourceMcpTools.cs (1)
117var totalLogsCount = entries.Count == 0 ? 0 : entries.Last().LineNumber;
Mcp\AspireTelemetryMcpTools.cs (2)
68if (optOutResources.Count > 0) 119if (optOutResources.Count > 0)
Model\Assistant\AIContextProvider.cs (6)
54if (_contextsStack.Count == 0) 59return _contextsStack[_contextsStack.Count - 1]; 91if (index == _contextsStack.Count - 1) 142else if (index == _contextsStack.Count - 1) 164return _contextsStack.Count; 176return _contextChangedSubscriptions.Count;
Model\Assistant\AssistantChatDataContext.cs (2)
275var totalLogsCount = entries.Count == 0 ? 0 : entries.Last().LineNumber; 319if (telemetryResources.Count == 0)
Model\Assistant\AssistantChatViewModel.cs (7)
361else if (response.Models == null || response.Models.Count == 0) 391if (models.Count >= 2 && models.FirstOrDefault(m => m.Family == FollowUpQuestionsModel) is { } followUpQuestionsModel) 745addInitialPrompts = (inProgressFollowUpPrompts.Count >= 2 && _chatState.FollowUpPrompts.Count == 0); 785for (var i = 0; i < inProgressFollowUpPrompts.Count / FollowUpPromptsPageSize; i++) 850AddUserPrompt(vm, promptText, _chatState.VisibleChatMessages.Count == 0); 862AddUserPrompt(chatViewModel, chatViewModel.PromptText, _chatState.VisibleChatMessages.Count == 0);
Model\Assistant\ChatViewModel.cs (1)
38public int ChatMessageCount => _chatMessages.Count;
Model\Assistant\FollowUpPromptViewModel.cs (2)
36for (var i = inProgressFollowUpPrompts.Count; i < completedItems.Count; i++)
Model\Assistant\Prompts\IceBreakersBuilder.cs (7)
66if (context.Prompts.Count < 3) 88if (context.Prompts.Count < 3) 125if (context.Prompts.Count < 3) 157if (context.Prompts.Count < 3) 189if (context.Prompts.Count < 3) 233if (context.Prompts.Count < 3) 279if (context.Prompts.Count < 3)
Model\ConsoleLogsFetcher.cs (1)
79if (logEntries.Count > 0)
Model\ConsoleLogsManager.cs (1)
91if (_subscriptions.Count == 0)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (4)
175Index = viewModel.Items.Count, 195if (messageViewModels.Count == 0) 324if (viewModel.Items.Count > 0) 345if (viewModel.Items.Count > 0)
Model\Interaction\InputViewModel.cs (1)
51if (string.IsNullOrEmpty(input.Placeholder) && string.IsNullOrEmpty(input.Value) && optionsVM.Count > 0 && !input.AllowCustomChoice)
Model\KnownPropertyLookup.cs (1)
79for (var i = 0; i < knownProperties.Count; i++)
Model\Otlp\ResourcesSelectHelpers.cs (5)
21if (instanceIdMatches.Count == 1) 25else if (instanceIdMatches.Count == 0) 30if (replicaSetMatches.Count == 1) 34else if (replicaSetMatches.Count == 0) 89if (replicas.Count == 1)
Model\ResourceMenuBuilder.cs (5)
182if (urls.Count == 0) 189if (urls.Count > 5) 291if (menuCommands.Count == 0) 309if (highlightedMenuCommands.Count + otherMenuCommands.Count > 5)
Model\ResourceOutgoingPeerResolver.cs (1)
270if (_subscriptions.Count == 0 || _watchContainersTokenSource.IsCancellationRequested)
Model\ResourceViewModel.cs (1)
190if (resourcesWithDisplayName.Count == 1)
Model\TelemetryExportService.cs (11)
92if (resourceDetailsResources.Count > 0) 104if (structuredLogResources.Count > 0) 110if (traceResources.Count > 0) 116if (metricsResources.Count > 0) 162if (logs.Items.Count == 0) 178if (tracesResponse.PagedResult.Items.Count == 0) 194if (instrumentSummaries.Count == 0) 218if (instrumentsData.Count == 0) 404Events = span.Events.Count > 0 ? span.Events.Select(ConvertSpanEvent).ToArray() : null, 405Links = span.Links.Count > 0 ? span.Links.Select(ConvertSpanLink).ToArray() : null, 447if (logs is null || logs.Count == 0)
Model\ThemeManager.cs (1)
141if (_subscriptions.Count == 0)
Otlp\Model\MetricValues\MetricValueBase.cs (1)
14public bool HasExemplars => _exemplars != null && _exemplars.Count > 0;
Otlp\Model\OtlpHelpers.cs (2)
226if (values.Count < readLimit) 237for (var i = 0; i < values.Count; i++)
Otlp\Storage\TelemetryRepository.cs (17)
428if (resources.Count == 0) 439if (resources?.Count > 0) 549if (resources?.Count > 0) 576if (resources?.Count > 0) 597if (resources.Count == 0) 612if (resources?.Count > 0) 626if (filters.Count > 0) 686for (var i = 0; i < resources.Count; i++) 791if (resources is null || resources.Count == 0) 835if (resources is null || resources.Count == 0) 1405if (currentSpanLinks.Count > 0) 1408sb.AppendLine(CultureInfo.InvariantCulture, $"There are {currentSpanLinks.Count} orphaned span links."); 1469if (events.Count >= context.Options.MaxSpanEventCount) 1480if (resources.Count == 0) 1484else if (resources.Count == 1) 1508if (instruments.Count == 0) 1512else if (instruments.Count == 1)
Otlp\Storage\TelemetryRepository.Watchers.cs (4)
215if (_spanWatchers is null || _spanWatchers.Count == 0) 243if (logs.Count == 0) 252if (_logWatchers is null || _logWatchers.Count == 0) 270if (watcher.Filters.Count > 0 && !MatchesFilters(log, watcher.Filters))
src\Shared\CircularBuffer.cs (8)
48public int Count => _buffer.Count; 108if (shiftLength > 0 || internalIndex == _buffer.Count - 1) 114else if (internalIndex < _end && _end < _buffer.Count - 1) 135if (internalIndex > _buffer.Count) 137internalIndex = internalIndex % _buffer.Count; 144if (_end != _buffer.Count) 209if (_end != _buffer.Count) 266return (_start + index) % _buffer.Count;
src\Shared\ColorGenerator.cs (1)
83_currentIndex = ++_currentIndex % _colors.Count;
src\Shared\ConsoleLogs\AnsiParser.cs (4)
497if (classes.Count == 0 && styles.Count == 0) 504if (classes.Count > 0) 509if (styles.Count > 0)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (6)
399if (spans.Count == 0) 685return GetLimitFromEndWithSummary(values, values.Count, limit, itemName, pluralItemName, convertToDto, estimateTokenSize); 700Debug.Assert(totalValues >= values.Count, "Total values should be large or equal to the values passed into the method."); 702var trimmedItems = values.Count <= limit 711for (var i = dtos.Count - 1; i >= 0; i--) 728return (dtos, GetLimitSummary(totalValues, dtos.Count, itemName, pluralItemName));
src\Shared\DashboardUrls.cs (1)
284return parts.Count > 0 ? "?" + string.Join("&", parts) : "";
src\Shared\DurationFormatter.cs (3)
83for (var i = 0; i < s_unitSteps.Count; i++) 86var result = i < s_unitSteps.Count - 1 && step.Threshold > ticks; 90return (step, i < s_unitSteps.Count - 1 ? s_unitSteps[i + 1] : step);
Aspire.Dashboard.Components.Tests (11)
Controls\GenAIVisualizerDialogTests.cs (1)
115Assert.Equal(5, instance.Content.Items.Count);
Controls\ResourceDetailsTests.cs (3)
396Assert.Equal(5, envVars.Count); 432Assert.Equal(5, volumes.Count); 468Assert.Equal(5, healthReports.Count);
Pages\MetricsTests.cs (2)
222cut.WaitForState(() => cut.Instance.PageViewModel.Instruments?.Count == 1); 267cut.WaitForState(() => cut.Instance.PageViewModel.Instruments?.Count == 3);
Pages\ResourcesTests.cs (4)
442Assert.Equal(2, filteredResources.Count); 474Assert.Equal(2, filteredResources.Count); 509Assert.Equal(2, filteredResources.Count); 544Assert.Equal(2, filteredResources.Count);
Pages\TraceDetailsTests.cs (1)
532for (var i = 0; i < expandContainers.Count; i++)
Aspire.Dashboard.Tests (41)
Integration\ServerRetryHelper.cs (3)
58while (ports.Count < portCount) 65if (ports.Count != ports.Distinct().Count()) 115logger.LogInformation("Found {count} unavailable endpoints.", unavailableEndpoints.Count);
Mcp\McpIconHelperTests.cs (1)
24Assert.Equal(5, icons.Count);
Model\AIAssistant\AIHelpersTests.cs (3)
108var (items, message) = SharedAIHelpers.GetLimitFromEndWithSummary(values, totalValues: values.Count, limit: 20, "test item", "test items", s => s, s => ((string)s).Length); 111Assert.Equal(10, items.Count); 129Assert.Equal(10, items.Count);
Model\GenAIMessageParsingHelperTests.cs (7)
26Assert.Equal(expectedCount, items.Count); 77Assert.Equal(expectedMessageCount, chatMessages.Count); 106Assert.Equal(3, chatMessages.Count); 120Assert.Equal(2, items.Count); 164Assert.Equal(2, items.Count); 272Assert.Equal(2, items.Count); 303Assert.Equal(7, items.Count);
Model\GenAIVisualizerDialogViewModelTests.cs (2)
1446Assert.Equal(2, vm.ToolDefinitions.Count); 2038Assert.Equal(2, vm.Evaluations.Count);
Model\ResourceSourceViewModelTests.cs (3)
62Assert.Equal(expected.ContentAfterValue.Count, actual.ContentAfterValue.Count); 63for (var i = 0; i < expected.ContentAfterValue.Count; i++)
Model\TelemetryImportServiceTests.cs (1)
152Assert.Equal(2, resources.Count);
TelemetryApiServiceTests.cs (4)
57if (receivedItems.Count >= 5) 64Assert.Equal(5, receivedItems.Count); 104if (receivedItems.Count >= 5) 111Assert.Equal(5, receivedItems.Count);
TelemetryRepositoryTests\MetricsTests.cs (1)
392Assert.Equal(5, instrumentData.Dimensions.Count);
TelemetryRepositoryTests\TelemetryRepositoryTests.cs (14)
397if (receivedSpans.Count == 1) 401if (receivedSpans.Count >= 2) 435Assert.Equal(2, receivedSpans.Count); 515if (receivedLogs.Count == 1) 519if (receivedLogs.Count >= 2) 553Assert.Equal(2, receivedLogs.Count); 668if (receivedSpans.Count == expectedSpans) 680Assert.Equal(expectedSpans, receivedSpans.Count); 795if (receivedLogs.Count == 1) 800if (receivedLogs.Count >= 2) 835Assert.Equal(2, receivedLogs.Count); 886if (receivedLogs.Count == 1) 891if (receivedLogs.Count >= 3) 927Assert.Equal(3, receivedLogs.Count);
TelemetryRepositoryTests\TraceTests.cs (2)
853Assert.Equal(5, trace.FirstSpan.Events.Count); 957Assert.Equal(MaxTraceCount * 2, repository.SpanLinks.Count);
Aspire.Hosting (84)
ApplicationModel\Docker\DockerfileBuilder.cs (1)
110if (_globalArgs.Count > 0)
ApplicationModel\ExecutionConfigurationGathererContext.cs (2)
44List<(object Unprocessed, string Value, bool IsSensitive)> resolvedArguments = new(Arguments.Count); 94Exception = exceptions.Count == 0 ? null : new AggregateException("One or more errors occurred while resolving resource configuration.", exceptions)
ApplicationModel\ReferenceExpression.cs (4)
400var index = _valueProviders.Count; 428var index = _valueProviders.Count; 573var index = _valueProviders.Count; 604var index = _valueProviders.Count;
ApplicationModel\ResourceCollection.cs (1)
20public int Count => _resources.Count;
ApplicationModel\ResourceCommandService.cs (5)
107if (failures.Count == 0 && cancellations.Count == 0) 111else if (failures.Count == 0 && cancellations.Count > 0) 119var errorMessage = $"{failures.Count} command executions failed.";
ApplicationModel\ResourceLoggerService.cs (2)
86if (scopes.Count == 0) 90else if (scopes.Count == 1)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
687if (resourcesToLog.Count == 0)
Dashboard\DashboardServiceData.cs (1)
198for (var i = 0; i < inputDtos.Count; i++)
Dashboard\ResourceServiceOptions.cs (1)
56return errorMessages is { Count: > 0 }
Dcp\DcpExecutor.cs (9)
852if (needAddressAllocated.Count == 0) 858var initialServiceCount = needAddressAllocated.Count; 890if (needAddressAllocated.Count == 0) 914AspireEventSource.Instance.DcpServiceAddressAllocationStop(initialServiceCount - needAddressAllocated.Count); 1743if (er.DcpResource.TryGetAnnotationAsObjectList<string>(CustomResource.ResourceProjectArgsAnnotation, out var projectArgs) && projectArgs.Count > 0) 1861if (executableArgs.Count > 0) 1927if (launchProfileArgs.Count > 0 && appHostArgs.Any()) 2141if (cr.ServicesProduced.Count > 0) 2264if (customBundleFiles.Count > 0)
Dcp\DcpKubernetesClient.cs (1)
172if (_parameters.Count > 0)
Dcp\ResourceSnapshotBuilder.cs (2)
336if (effectiveSource is null or { Count: 0 }) 341var environment = ImmutableArray.CreateBuilder<EnvironmentVariableSnapshot>(effectiveSource.Count);
Devcontainers\DevcontainerSettingsWriter.cs (1)
190if (portsToLog.Count > 0)
DeveloperCertificateService.cs (3)
110if (bestCerts.Count > 0 && 111(trustedCerts.Count == 0 || trustedCerts[0].Thumbprint != bestCerts[0].Thumbprint)) 122if (trustedCerts.Count == 0)
Eventing\DistributedApplicationEventing.cs (1)
30var pendingSubscriptionCallbacks = new List<Task>(subscriptions.Count);
IInteractionService.cs (1)
408public int Count => _inputs.Count;
Lifecycle\RequiredCommandValidationLifecycleHook.cs (1)
38if (requiredCommands.Count == 0)
Orchestrator\ApplicationOrchestrator.cs (2)
379_logger.LogTrace("{UrlCount} URLs after callback '{CallbackIndex}' for resource '{ResourceName}'.", urlsCallbackContext.Urls.Count, index, resource.Name); 385_logger.LogTrace("{UrlCount} URLs after calling '{CallbackIndex}' callback(s) for resource '{ResourceName}'.", urls.Count, index, resource.Name);
Orchestrator\ParameterProcessor.cs (2)
57if (interactionService.IsAvailable && _unresolvedParameters.Count > 0) 523for (var i = resourceInputs.Count - 1; i >= 0; i--)
Pipelines\DistributedApplicationPipeline.cs (26)
269public bool HasSteps => _steps.Count > 0; 369if (allSteps.Count == 0) 528if (callbacks.Count > 0) 602var stepCompletions = new Dictionary<string, TaskCompletionSource>(steps.Count, StringComparer.Ordinal); 614if (step.DependsOnSteps.Count > 0) 630var message = failedDeps.Count > 0 631? $"Step '{step.Name}' cannot run because {(failedDeps.Count == 1 ? "dependency" : "dependencies")} {string.Join(", ", failedDeps.Select(d => $"'{d}'"))} failed" 696var allStepTasks = new Task[steps.Count]; 697for (var i = 0; i < steps.Count; i++) 717if (failures.Count > 1) 729var message = failedStepNames.Count > 0 786var visitStates = new Dictionary<string, VisitState>(steps.Count, StringComparer.Ordinal); 878sb.AppendLine(CultureInfo.InvariantCulture, $"Total steps defined: {allSteps.Count}"); 895for (var i = 0; i < executionOrder.Count; i++) 920if (step.DependsOnSteps.Count > 0) 946if (step.Tags.Count > 0) 979step.DependsOnSteps.Count == 0 && 984if (orphanedSteps.Count > 0) 1012if (targetStep.DependsOnSteps.Count > 0) 1026if (stepsForTarget.Count == 0) 1033sb.AppendLine(CultureInfo.InvariantCulture, $" Total steps: {stepsForTarget.Count}"); 1046if (stepsAtLevel.Count == 1) 1129if (step.DependsOnSteps.Count == 0) 1194if (_steps.Count == 0) 1200sb.AppendLine(CultureInfo.InvariantCulture, $"Pipeline with {_steps.Count} step(s):"); 1206if (step.DependsOnSteps.Count > 0)
Pipelines\PipelineStep.cs (2)
102var dependsOnSteps = DependsOnSteps.Count > 0 ? string.Join(',', DependsOnSteps.Select(s => $@"""{s}""")) : "None"; 103var requiredBySteps = RequiredBySteps.Count > 0 ? string.Join(',', RequiredBySteps.Select(s => $@"""{s}""")) : "None";
Publishing\ManifestPublishingContext.cs (2)
606if (bindMounts.Count > 0) 632if (volumes.Count > 0)
Publishing\ResourceContainerImageManager.cs (2)
595if (platforms.Count == 0) 637if (rids.Count == 0)
src\Shared\CircularBuffer.cs (8)
48public int Count => _buffer.Count; 108if (shiftLength > 0 || internalIndex == _buffer.Count - 1) 114else if (internalIndex < _end && _end < _buffer.Count - 1) 135if (internalIndex > _buffer.Count) 137internalIndex = internalIndex % _buffer.Count; 144if (_end != _buffer.Count) 209if (_end != _buffer.Count) 266return (_start + index) % _buffer.Count;
src\Shared\CommandLineArgsParser.cs (1)
16var args = result.Count > 1 ? result.Skip(1).ToArray() : Array.Empty<string>();
src\Shared\CustomResourceSnapshotExtensions.cs (1)
42for (var i = 0; i < existingProperties.Count; i++)
VersionChecking\PackageFetcher.cs (1)
68_logger.LogDebug("Found {PackageCount} packages.", packages.Count);
Aspire.Hosting.Analyzers (1)
Infrastructure\BoundedCacheWithFactory.cs (1)
32for (var i = 0; i < _weakReferencedEntries.Count; i++)
Aspire.Hosting.Azure (16)
AzurePublishingContext.cs (2)
307var (message, state) = computeEnvironments.Count switch 310_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.", CompletionState.Completed)
AzureResourcePreparer.cs (1)
28if (azureResources.Count == 0)
Provisioning\Internal\BaseProvisioningContextProvider.cs (4)
213if (tenantList.Count > 0) 262if (subscriptionList.Count > 0) 297if (resourceGroupList.Count > 0) 331if (locationList.Count > 0)
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (6)
138await step.SucceedAsync($"Found {tenantOptions!.Count} available tenant(s)", cancellationToken).ConfigureAwait(false); 153if (tenantOptions?.Count > 0) 237await step.SucceedAsync($"Found {subscriptionOptions!.Count} available subscription(s)", cancellationToken).ConfigureAwait(false); 252if (subscriptionOptions?.Count > 0) 336await step.SucceedAsync($"Found {resourceGroupOptions.Count} resource group(s)", cancellationToken).ConfigureAwait(false); 431await step.SucceedAsync($"Found {locationOptions!.Count} region(s)", cancellationToken).ConfigureAwait(false);
Provisioning\Provisioners\AzureProvisioner.cs (2)
34if (azureResources.Count == 0) 60for (var i = 0; i < childResources.Count; i++)
src\Shared\CustomResourceSnapshotExtensions.cs (1)
42for (var i = 0; i < existingProperties.Count; i++)
Aspire.Hosting.Azure.AppContainers (5)
BaseContainerAppContext.cs (1)
472if (Args.Count > 0)
ContainerAppContext.cs (3)
251if (endpointsByTargetPort.Count > 5) 275if (_httpIngress is null && _additionalPorts.Count == 0) 291else if (_additionalPorts.Count > 0)
ContainerAppEnvironmentContext.cs (1)
46if (_hasLoggedHttpsUpgrade || _upgradedEndpoints.Count == 0)
Aspire.Hosting.Azure.AppService (3)
AzureAppServiceEnvironmentResource.cs (1)
197if (errors.Count > 0)
AzureAppServiceWebsiteContext.cs (2)
117if (targetPortEndpoints.Count > 1) 478if (Args.Count > 0)
Aspire.Hosting.Azure.ContainerRegistry (1)
AzureContainerRegistryExtensions.cs (1)
209var taskIndex = autoNamedTasks.Count;
Aspire.Hosting.Azure.CosmosDB (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubResource.cs (1)
107if (hub.ConsumerGroups.Count >= 0)
Aspire.Hosting.Azure.Functions (4)
AzureFunctionsProjectResourceExtensions.cs (3)
269if (commandLineArgs is { Count: > 0 } && 272indexOfPort + 1 < commandLineArgs.Count && 278useHttps = commandLineArgs is { Count: > 0 } &&
src\Shared\CommandLineArgsParser.cs (1)
16var args = result.Count > 1 ? result.Skip(1).ToArray() : Array.Empty<string>();
Aspire.Hosting.Azure.Kusto.Tests (2)
AddAzureKustoTests.cs (1)
261Assert.Equal(2, mountAnnotations.Count);
KustoFunctionalTests.cs (1)
161if (results.Count == 0)
Aspire.Hosting.Azure.Network (3)
AzureNatGatewayExtensions.cs (1)
107if (azureResource.PublicIPAddresses.Count > 0)
AzureVirtualNetworkExtensions.cs (2)
130if (azureResource.Subnets.Count > 0) 496var resolvedPriority = priority ?? (nsgResource.SecurityRules.Count == 0
Aspire.Hosting.Azure.Storage (3)
AzureStorageExtensions.cs (3)
96if (azureResource.BlobContainers.Count > 0 || azureResource.DataLakeFileSystems.Count > 0) 121if (azureResource.Queues.Count > 0)
Aspire.Hosting.Azure.Tests (9)
AzureContainerRegistryTests.cs (2)
144Assert.True(pipelineStepAnnotations.Count >= 2); 229Assert.True(configAnnotations.Count >= 2);
AzureEventHubsExtensionsTests.cs (1)
244Assert.Equal(2, endpoints.Count);
AzurePrivateEndpointExtensionsTests.cs (1)
204Assert.Equal(2, dnsZones.Count);
AzureVirtualNetworkExtensionsTests.cs (5)
264Assert.Equal(3, rules.Count); 328Assert.Equal(2, rules.Count); 358Assert.Equal(3, rules.Count); 424Assert.Equal(4, rules.Count); 484Assert.Equal(4, rules.Count);
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubExtensions.cs (1)
118for (var i = 0; i < hubResource.EventHandlers.Count; i++)
Aspire.Hosting.CodeGeneration.Go (2)
AtsGoCodeGenerator.cs (2)
225if (parameters.Count == 0 && IsListOrDictPropertyGetter(method.ReturnType)) 288if (parameters.Count == 0 && IsListOrDictPropertyGetter(capability.ReturnType))
Aspire.Hosting.CodeGeneration.Java (1)
AtsJavaCodeGenerator.cs (1)
268if (parameters.Count == 0 && IsListOrDictPropertyGetter(capability.ReturnType))
Aspire.Hosting.CodeGeneration.Python (3)
AtsPythonCodeGenerator.cs (3)
237if (parameters.Count == 0 && IsListOrDictPropertyGetter(capability.ReturnType)) 524if (parameters.Count == 0) 530for (var index = 0; index < parameters.Count; index++)
Aspire.Hosting.CodeGeneration.Rust (1)
AtsRustCodeGenerator.cs (1)
314if (parameters.Count == 0 && IsListOrDictPropertyGetter(capability.ReturnType))
Aspire.Hosting.CodeGeneration.TypeScript (12)
AtsTypeScriptCodeGenerator.cs (12)
520if (optionalParams.Count > 0) 753if (optionalParams.Count == 0) 943if (getters.Count > 0 || setters.Count > 0) 976var hasOptionals = optionalParams.Count > 0; 1197var hasOptionals = optionalParams.Count > 0; 1281if (entryPoints.Count > 0) 1407var paramsString = paramList.Count > 0 ? string.Join(", ", paramList) : ""; 2050var hasOptionals = optionalParams.Count > 0; 2141var hasOptionals = optionalParams.Count > 0; 2226var hasOptionals = optionalParams.Count > 0; 2432var hasOptionals = optionalParams.Count > 0;
Aspire.Hosting.CodeGeneration.TypeScript.Tests (3)
AtsTypeScriptCodeGeneratorTests.cs (3)
138if (contextCapabilities.Count == 0) 1451Assert.True(expandedTypeIds.Count >= 3, $"Expected at least 3 expanded types but found {expandedTypeIds.Count}");
Aspire.Hosting.Containers.Tests (3)
WithDockerfileTests.cs (3)
781Assert.Equal(2, steps.Count); 943Assert.Equal(2, steps.Count); 983Assert.Equal(2, steps.Count);
Aspire.Hosting.DevTunnels (4)
DevTunnelCli.cs (1)
452if (values is null || values.Count == 0)
DevTunnelResourceBuilderExtensions.cs (3)
182if (unmodeledPorts.Count > 0) 184logger.LogInformation("Deleting {Count} unmodeled ports from dev tunnel '{TunnelId}': {Ports}", unmodeledPorts.Count, tunnelResource.TunnelId, string.Join(", ", unmodeledPorts.Select(p => p.PortNumber))); 805if (labels is null || labels.Count == 0)
Aspire.Hosting.Docker (3)
DockerComposeServiceResource.cs (3)
251if (args.Count > 0) 315if (Volumes.Count == 0) 332if (externalEndpointMappings.Count == 0)
Aspire.Hosting.Integration.Analyzers (2)
AspireExportAnalyzer.cs (1)
634if (reasons.Count == 0)
src\Aspire.Hosting.Analyzers\Infrastructure\BoundedCacheWithFactory.cs (1)
32for (var i = 0; i < _weakReferencedEntries.Count; i++)
Aspire.Hosting.JavaScript (3)
JavaScriptHostingExtensions.cs (3)
184if (packageManager.PackageFilesPatterns.Count > 0) 416if (packageManager.PackageFilesPatterns.Count > 0) 557if (cfgIndex >= 0 && cfgIndex + 1 < ctx.Arguments.Count)
Aspire.Hosting.JavaScript.Tests (6)
AddViteAppTests.cs (4)
254Assert.True(configIndex >= 0 && configIndex + 1 < args.Count); 330Assert.True(configIndex + 1 < args.Count); 390Assert.True(configIndex + 1 < args.Count); 553Assert.True(configIndex + 1 < args.Count);
PackageInstallationTests.cs (2)
36Assert.Equal(2, nodeResources.Count); 38Assert.Equal(2, installerResources.Count);
Aspire.Hosting.Kubernetes (4)
Extensions\ResourceExtensions.cs (4)
194if (context.Volumes.Count == 0) 260if (context.Volumes.Count == 0) 327if (context.Commands.Count == 0) 377if (context.Probes.Count == 0)
Aspire.Hosting.Maui (4)
Utilities\MauiEnvironmentHelper.cs (4)
175if (deletedFiles.Count > 0) 177logger.LogDebug("Pruned {Count} stale Android environment targets file(s): {Files}", deletedFiles.Count, string.Join(", ", deletedFiles)); 330if (deletedFiles.Count > 0) 332logger.LogDebug("Pruned {Count} stale iOS environment targets file(s): {Files}", deletedFiles.Count, string.Join(", ", deletedFiles));
Aspire.Hosting.Python.Tests (6)
AddPythonAppTests.cs (6)
514Assert.Equal(3, commandArguments.Count); 1037Assert.Equal(2, commandArguments.Count); 1091Assert.Equal(5, commandArguments.Count); 1115Assert.Equal(3, commandArguments.Count); 1137Assert.Equal(2, commandArguments.Count); 1169Assert.Equal(4, commandArguments.Count);
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
162if (containerAnnotations.Count == 1
Aspire.Hosting.RemoteHost (11)
Ats\CapabilityDispatcher.cs (1)
92_logger.LogDebug("Scanning {AssemblyCount} assemblies for capabilities...", assemblyList.Count);
AtsCapabilityScanner.cs (6)
854if (collisionGroups.Count == 0) 891for (var i = 1; i < capIds.Count; i++) 1442if (parameters.Count > 0) 1664if (genericArgs.Count == 0) 1675for (var i = 0; i < genericArgs.Count; i++) 1696for (var i = 0; i < genericArgs.Count - 1; i++)
AtsContextFactory.cs (4)
49result.Capabilities.Count, result.HandleTypes.Count, result.DtoTypes.Count, result.EnumTypes.Count);
Aspire.Hosting.Testing.Tests (3)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
113return table.Count == 0;
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (2)
22if (logs.Count >= targetLogCount) 39if (logs.Count >= targetLogCount)
Aspire.Hosting.Tests (90)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (4)
306Assert.Equal(2, logs.Count); 355Assert.Equal(2, logs.Count); 391if (logs.Count >= 2) 405Assert.Equal(2, logs.Count);
Backchannel\BackchannelLoggerProviderTests.cs (3)
23Assert.Equal(3, snapshot.Count); 49Assert.Equal(1000, snapshot.Count); 73Assert.Equal(2, snapshot2.Count);
ContainerRegistryResourceTests.cs (4)
294Assert.Equal(3, registries.Count); 548Assert.Equal(2, registryTargetAnnotations.Count); 677Assert.Equal(2, registryTargetAnnotations.Count); 790Assert.Equal(2, registryTargetAnnotations.Count);
Dashboard\DashboardLifecycleHookTests.cs (4)
332Assert.Equal(4, args.Count); 412Assert.Equal(4, args.Count); 481Assert.Equal(4, args.Count); 548Assert.Equal(4, args.Count);
Dcp\DcpExecutorTests.cs (17)
91Assert.Equal(2, executables.Count); 254Assert.Equal(2, executables.Count); 590Assert.Equal(replicaCount, executables.Count); 903Assert.Equal(3, exes.Count); 948Assert.Equal(3, exes.Count); 1723return dcpExes.Count == 2; 1725Assert.True(haveExes, $"Expected two running but instead got {dcpExes.Count}"); 1806Assert.Equal(2, dcpExes.Count); 2160Assert.Equal(2 + (aliases?.Length ?? 0), network.Aliases.Count); 2380return dcpExes.Count == 1; 2382Assert.True(haveExes, $"Expected one executable but instead got {dcpExes.Count}"); 2429return dcpExes.Count == 1; 2431Assert.True(haveExes, $"Expected one executable but instead got {dcpExes.Count}"); 2484return dcpExes.Count == 1; 2486Assert.True(haveExes, $"Expected one executable but instead got {dcpExes.Count}"); 2533return dcpExes.Count == 1; 2535Assert.True(haveExes, $"Expected one executable but instead got {dcpExes.Count}");
DistributedApplicationTests.cs (7)
795Assert.Equal(2, redisContainer.Spec.Args.Count); 922Assert.Equal(expectedDefaultBundleFiles.Count, item.Spec?.PemCertificates?.OverwriteBundlePaths?.Count ?? 0); 1652Assert.Equal(2, redisContainer.Spec.Ports!.Count); 1668Assert.Equal(2, otherRedisContainer.Spec.Ports!.Count); 1725Assert.Equal(2, redisContainer.Spec.Ports!.Count); 1742Assert.Equal(2, otherRedisContainer.Spec.Ports!.Count);
ExecutionConfigurationGathererTests.cs (2)
39Assert.Equal(2, context.Arguments.Count); 62Assert.Equal(2, context.Arguments.Count);
InteractionServiceTests.cs (1)
140Assert.Equal(2, interactionService.GetCurrentInteractions().Count);
Orchestrator\ParameterProcessorTests.cs (1)
767Assert.Equal(2, parameters.Count);
Pipelines\DistributedApplicationPipelineTests.cs (14)
92Assert.Equal(3, executedSteps.Count); 197Assert.Equal(3, executedSteps.Count); 251Assert.Equal(5, executionOrder.Count); 296Assert.Equal(2, executedSteps.Count); 337Assert.Equal(2, executedSteps.Count); 497Assert.Equal(5, executedSteps.Count); 918Assert.Equal(4, executionOrder.Count); 1298Assert.Equal(3, capturedSteps.Count); 1376Assert.Equal(expectedFilteredLevels.Length, capturedLogs.Count); 1397Assert.Equal(2, step.Tags.Count); 1428Assert.Equal(12, capturedSteps.Count); // Updated to account for all default steps including process-parameters, push, push-prereq 1521Assert.Equal(2, foundSteps.Count); 1902Assert.Equal(5, executedSteps.Count); 2026Assert.Equal(4, executedSteps.Count);
ProjectResourceTests.cs (1)
800Assert.Equal(2, steps.Count);
RequiredCommandAnnotationTests.cs (1)
111Assert.Equal(2, annotations.Count);
ResourceCommandServiceTests.cs (1)
143Assert.Equal(2, resolvedResourceNames.Count);
ResourceExtensionsTests.cs (1)
364Assert.Equal(2, annotations.Count);
ResourceLoggerServiceTests.cs (1)
298Assert.Equal(6, sortedLogs.Count);
ResourceNotificationTests.cs (4)
103if (values.Count == 2) 156if (values.Count == 3) 498if (values.Count == 2) 525Assert.Equal(2, values.Count);
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
StableConnectionStringBuilderTests.cs (1)
297Assert.Equal(3, keys.Count);
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (2)
22if (logs.Count >= targetLogCount) 39if (logs.Count >= targetLogCount)
Utils\LoggerNotificationExtensions.cs (1)
113return table.Count == 0;
Utils\StringComparersTests.cs (2)
56if (extraComparers.Count + extraComparisons.Count != 0)
WithCertificateAuthorityCollection.cs (1)
33Assert.Equal(2, annotation.CertificateAuthorityCollections.Count);
WithHttpCommandTests.cs (1)
163Assert.True(commands.Count >= 5);
WithIconNameTests.cs (1)
92Assert.Equal(2, iconAnnotations.Count);
WithUrlsTests.cs (12)
485testOutputHelper.WriteLine($"Captured snapshot #{urlSnapshots.Count}: State={notification.Snapshot.State}, URLs: {FormatUrls(notification.Snapshot.Urls)}"); 503testOutputHelper.WriteLine($"Total snapshots captured: {urlSnapshots.Count}"); 504for (var i = 0; i < urlSnapshots.Count; i++) 511Assert.True(initialized is not null, $"Expected 'initialized' snapshot (1 URL) but none found. Captured {urlSnapshots.Count} snapshots."); 514Assert.True(endpointsAllocated is not null, $"Expected 'endpointsAllocated' snapshot (2 URLs, some inactive) but none found. Captured {urlSnapshots.Count} snapshots."); 517Assert.True(running is not null, $"Expected 'running' snapshot (2 URLs, all active) but none found. Captured {urlSnapshots.Count} snapshots."); 603testOutputHelper.WriteLine($"Captured snapshot #{urlSnapshots.Count}: State={notification.Snapshot.State}, URLs: {FormatUrls(notification.Snapshot.Urls)}"); 621testOutputHelper.WriteLine($"Total snapshots captured: {urlSnapshots.Count}"); 622for (var i = 0; i < urlSnapshots.Count; i++) 629Assert.True(initialized is not null, $"Expected 'initialized' snapshot (1 URL) but none found. Captured {urlSnapshots.Count} snapshots."); 632Assert.True(endpointsAllocated is not null, $"Expected 'endpointsAllocated' snapshot (2 URLs, some inactive) but none found. Captured {urlSnapshots.Count} snapshots."); 635Assert.True(running is not null, $"Expected 'running' snapshot (2 URLs, all active) but none found. Captured {urlSnapshots.Count} snapshots.");
Aspire.Hosting.Yarp (3)
ConfigurationBuilder\YarpConfigurationBuilder.cs (1)
16var routeId = $"route{_parent.Resource.Routes.Count}";
YarpJsonConfigGeneratorBuilder.cs (2)
52if (_clusterConfigs.Count > 0 || _routeConfigs.Count > 0)
Aspire.Microsoft.Azure.Cosmos (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration (3)
src\Shared\StableConnectionStringBuilder.cs (3)
250for (var i = 0; i < _segments.Count; i++) 272if (idx < _segments.Count) 285if (_segments.Count > 0 && _segments[^1] != ConnectionStringSegment.SemiColon)
Aspire.Playground.Tests (4)
AppHostTests.cs (3)
55for (int i = 0; i < testEndpoints.WaitForTexts.Count; i++) 72if (testEndpoints.WaitForResources?.Count > 0) 88if (endpoints.Count == 0)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
113return table.Count == 0;
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
DistributedCacheConformanceTests.cs (1)
68Assert.Equal(3, activityList.Count);
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
OutputCacheConformanceTests.cs (1)
68Assert.Equal(3, activityList.Count);
BasketService (1)
BasketService.cs (1)
61_logger.LogInformation("Checking out {Count} item(s) for BuyerId: {BuyerId}.", order.Items.Count, buyerId);
BicepSample.ApiService (3)
Program.cs (3)
42totalEntries = entries.Count, 61totalEntries = entries.Count, 92totalEntries = entries.Count,
CatalogDb (3)
CatalogDbInitializer.cs (3)
89logger.LogInformation("Seeding {CatalogBrandCount} catalog brands", brands.Count); 99logger.LogInformation("Seeding {CatalogTypeCount} catalog item types", types.Count); 109logger.LogInformation("Seeding {CatalogItemCount} catalog items", items.Count);
CatalogService (1)
CatalogApi.cs (1)
27itemsOnPage.Count < pageSize,
Client.ClientBase.IntegrationTests (4)
ChannelBaseTests.4.0.0.cs (2)
195Assert.True(eventsCalled.Count == 0, 199Assert.True(proxyEventsCalled.Count == 0,
ClientBaseTests.4.0.0.cs (2)
668Assert.True(eventsCalled.Count == 0, 672Assert.True(proxyEventsCalled.Count == 0,
ConfigurationSchemaGenerator (9)
ConfigSchemaEmitter.cs (7)
60for (var i = 0; i < categories.Count; i++) 78if (spec.ConfigurationTypes.Count > 0) 80if (spec.ConfigurationTypes.Count != spec.ConfigurationPaths?.Count) 85for (var i = 0; i < spec.ConfigurationPaths.Count; i++) 710var result = new string[exclusionPaths.Count]; 711for (var i = 0; i < exclusionPaths.Count; i++)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (2)
720if (invalidParameters?.Count > 0) 724else if (missingParameters?.Count > 0)
CosmosEndToEnd.ApiService (1)
Program.cs (1)
45totalEntries = entries.Count,
crossgen2 (2)
Program.cs (2)
416if (!composite && inputModules.Count != 1) 616System.Diagnostics.Debug.Assert(inputModules.Count == 1);
CSharpSyntaxGenerator (54)
AbstractFileWriter.cs (1)
380while ((field.Kinds is null || field.Kinds.Count == 0) && IsOverride(field))
Grammar\GrammarGenerator.cs (10)
30if (type is Node && type.Children.Count > 0) 42if (type.Children.First() is Field firstField && firstField.Kinds.Count > 0) 45if (type.Children.Count >= 2 && type.Children.Last() is Field lastField && lastField.Kinds.Count == firstField.Kinds.Count) 48for (int i = 0; i < originalFirstFieldKinds.Count; i++) 57for (int i = 0; i < originalFirstFieldKinds.Count; i++) 76.Where(r => !rules.TryGetValue(r, out var productions) || productions.Count == 0).ToArray(); 349=> field.Kinds.Count == 0 351: Choice(field.Kinds.Select(k => HandleTokenName(k.Name)), parenthesize: field.Kinds.Count >= 2);
SignatureWriter.cs (5)
52for (int i = 0, n = nodes.Count; i < n; i++) 67for (int i = 0, n = nd.Fields.Count; i < n; i++) 88for (int i = 0, n = nodeFields.Count; i < n; i++) 94for (int i = 0, n = valueFields.Count; i < n; i++) 106if (kinds.Count > 1)
SourceWriter.cs (37)
62if (node.Kinds.Count <= 1) 80return experimentalKindCount == node.Kinds.Count - 1 ? experimentalUrl : null; 313if (nodeFields.Count == 0) 317else if (nodeFields.Count == 1) 330for (int i = 0, n = nodeFields.Count; i < n; i++) 373WriteLine($"this.SlotCount = {nodeFields.Count};"); 487node.Kinds.Count > 1 ? "this.Kind" : "", 523if (nodeFields.Count == 0) 595if (nd.Kinds.Count >= 2) 618if (field.Type == "SyntaxToken" && field.Kinds != null && field.Kinds.Count > 0) 626if (field.Kinds.Count == 1 && !IsOptional(field)) 663valueFields.Count + nodeFields.Count <= 3) 727nd.Kinds.Count > 1 ? "SyntaxKind kind" : "", 744nd.Kinds.Count == 1 ? $"SyntaxKind.{nd.Kinds[0].Name}" : "kind", 842if (baseNodeFields.Count > 0) 943for (int i = 0, n = nodeFields.Count; i < n; i++) 1206node.Kinds.Count > 1 ? "this.Kind()" : "", 1405if (node.Fields.Count == 0) 1465&& ((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)); 1489if (nd.Kinds.Count > 1 && includeKind) 1537if (nd.Kinds.Count >= 2) 1558if (fieldKinds != null && fieldKinds.Count > 0) 1566if (kinds.Count == 1) 1591nd.Kinds.Count > 1 ? "kind" : "", 1625nd.Kinds.Count > 1 ? "SyntaxKind kind" : "", 1650if (field.Kinds.Count == 1) 1671if (field.Type == "SyntaxToken" && CanBeAutoCreated(nd, field) && field.Kinds.Count > 1) 1679for (int k = 0; k < field.Kinds.Count; k++) 1718nd.Kinds.Count > 1 ? "SyntaxKind kind" : "", 1725nd.Kinds.Count > 1 ? "kind" : "", 1808nd.Kinds.Count > 1 ? "SyntaxKind kind" : "", 1833nd.Kinds.Count > 1 ? "kind" : "", 1872return field.Type == "SyntaxToken" && field.Kinds != null && field.Kinds.Count == 1 && field.Kinds[0].Name == "IdentifierToken";
TestWriter.cs (1)
113if (node.Kinds.Count > 1)
DatabaseMigration.ApiService (1)
Program.cs (1)
44totalEntries = entries.Count,
dotnet (66)
_generated\114\WorkloadHistoryJsonSerializerContext.ListString.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\154\SlnfJsonSerializerContext.ListString.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\183\SdkVulnerabilityCacheJsonContext.ListSdkCveCacheSummary.g.cs (1)
57for (int i = 0; i < value.Count; i++)
BuildServer\VBCSCompilerServer.cs (1)
56if (errors?.Count > 0)
Commands\BuildServer\Shutdown\BuildServerShutdownCommand.cs (2)
55if (tasks.Count == 0) 62while (tasks.Count > 0)
Commands\New\PostActions\DotnetSlnPostActionProcessor.cs (2)
31if (slnFiles.Count > 0) 39if (slnxFiles.Count > 0)
Commands\Pack\PackCommand.cs (2)
95if (args.Count != 1) 142if (args.Count > 0 && Path.GetExtension(args[0]).Equals(".nuspec", StringComparison.OrdinalIgnoreCase))
Commands\Reference\FileBasedAppReferenceEditor.cs (2)
133return matchingDirectives.Count; 151return matchingDirectives.Count;
Commands\Reference\List\ReferenceListCommand.cs (1)
71if (references.Count == 0)
Commands\Run\RunCommandSelector.cs (5)
454if (devices is null || devices.Count == 0) 473for (int i = 0; i < devices.Count; i++) 507if (devices.Count == 1) 533for (int i = 0; i < devices.Count; i++) 558List<(string Display, DeviceItem Device)> choices = new(devices.Count);
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.Help.cs (2)
196if (groupedModules.Count > 0) 238if (optionRows.Count > 0)
Commands\Test\MTP\Models.cs (1)
104return _index < _group.Modules.Count;
Commands\Test\MTP\MSBuildUtility.cs (2)
189if (!deviceSelection.TestTfmsInParallel && allGroups.Count > 1) 204return (allModules.Count > 0
Commands\Test\MTP\Terminal\AnsiTerminal.cs (2)
264if (_currentFrame.RenderedLines == null || _currentFrame.RenderedLines.Count == 0) 269AppendLine($"{AnsiCodes.CSI}{_currentFrame.RenderedLines.Count + 2}{AnsiCodes.MoveUpToLineStart}");
Commands\Test\MTP\Terminal\AnsiTerminalTestProgressFrame.cs (4)
210if (previousFrame.RenderedLines != null && previousFrame.RenderedLines.Count > 0) 214terminal.MoveCursorUp(previousFrame.RenderedLines.Count + 2); 232if (previousFrame.RenderedLines != null && previousFrame.RenderedLines.Count > i) 331if (previousFrame.RenderedLines != null && i < previousFrame.RenderedLines.Count)
Commands\Test\MTP\Terminal\TerminalTestReporter.cs (10)
354if (!_options.ShowAssembly && assemblies.Count == 1) 365if (_options.ShowAssembly && assemblies.Count > 1) 507if (_options.ShowAssembly && assemblies.Count > 1) 538IReadOnlyList<(string DisplayName, int Attempts)> tests = assemblies.Count == 1 582if (_options.ShowAssembly && assemblies.Count > 1) 614IReadOnlyList<(string DisplayName, TimeSpan Duration)> tests = assemblies.Count == 1 648if (_handshakeFailures.Count == 0) 1381terminal.Append(string.Format(CultureInfo.CurrentCulture, CliCommandStrings.DiscoveredTestsInAssembly, discoveredTestNames.Count)); 1412if (assemblies.Count <= 1) 1418terminal.AppendLine(string.Format(CultureInfo.CurrentCulture, CliCommandStrings.TestDiscoverySummary, totalTests, assemblies.Count));
Commands\Test\MTP\Terminal\TestNodeResultsState.cs (3)
58bool tooManyItems = sortedDetails.Count > maxCount; 68? GetFullTestsCountText(sortedDetails.Count) 70: GetMoreTestsCountText(sortedDetails.Count - itemsToTake);
Commands\Test\MTP\TestModulesFilterHandler.cs (2)
53if (_testModulePaths.Count == 0) 80var testApplications = new List<ParallelizableTestModuleGroupWithSequentialInnerModules>(_testModulePaths.Count);
Commands\Test\MTP\TestResultsDirectoryResolver.cs (1)
60if (perModuleLayoutModules.Count == 0)
Commands\Tool\Update\ToolUpdateCommand.cs (2)
75if (options.Count != 1) 105if (options.Count > 1)
Commands\Workload\History\WorkloadHistoryCommand.cs (1)
47if (displayRecords.Count == 0)
Commands\Workload\Install\FileBasedInstaller.cs (4)
453if (featureBandsToRemove.Count == referencingFeatureBands.Count) 493if (featureBandsToRemove.Count == referencingFeatureBands.Count)
Commands\Workload\InstallingWorkloadCommand.cs (2)
63if (workloadHistoryRecords.Count == 0) 70if (_fromHistorySpecified < 1 || _fromHistorySpecified > displayRecords.Count)
Commands\Workload\Restore\WorkloadRestoreCommand.cs (1)
141if (projectFiles.Count == 0)
Commands\Workload\WorkloadHistoryDisplay.cs (1)
58if (displayRecords.Count > 0)
LoggerUtility.cs (1)
51if (binaryLoggers.Count > 0)
NugetPackageDownloader\NuGetPackageDownloader.cs (1)
527if (defaultSources.Count == 0)
Parser.cs (1)
433if (options.Count <= 0)
PrintableTable.cs (2)
94if (_columns.Count != widths.Length) 104if (_columns.Count != widths.Length)
SdkVulnerability\SdkVulnerabilityChecker.cs (2)
48if (releaseList.Count == 0) 60for (int i = 0; i < releaseList.Count; i++)
src\sdk\src\Common\SdkVulnerabilityCacheReader.cs (1)
77public bool HasVulnerabilities => Cves is not null && Cves.Count > 0;
ToolManifest\ToolManifestEditor.cs (1)
238if (deserializedManifest.Tools != null && deserializedManifest.Tools.Count > 0)
ToolPackage\ToolPackageInstance.cs (1)
191if (availableFrameworks.Count > 0)
dotnet-aot (10)
_generated\72\SlnfJsonSerializerContext.ListString.g.cs (1)
57for (int i = 0; i < value.Count; i++)
src\sdk\src\Cli\dotnet\LoggerUtility.cs (1)
51if (binaryLoggers.Count > 0)
src\sdk\src\Cli\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (1)
527if (defaultSources.Count == 0)
src\sdk\src\Cli\dotnet\Parser.cs (1)
433if (options.Count <= 0)
src\sdk\src\Cli\dotnet\PrintableTable.cs (2)
94if (_columns.Count != widths.Length) 104if (_columns.Count != widths.Length)
src\sdk\src\Cli\dotnet\SdkVulnerability\SdkVulnerabilityChecker.cs (2)
48if (releaseList.Count == 0) 60for (int i = 0; i < releaseList.Count; i++)
src\sdk\src\Cli\dotnet\ToolManifest\ToolManifestEditor.cs (1)
238if (deserializedManifest.Tools != null && deserializedManifest.Tools.Count > 0)
src\sdk\src\Cli\Microsoft.TemplateEngine.Cli\SymbolExtensions.cs (1)
18&& cliOption.CompletionSources.Count == 0) // and options that have completions
dotnet-dev-certs (8)
_generated\2\DevCertsJsonSerializerContext.ListCertificateReport.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\3\DevCertsJsonSerializerContext.ListString.g.cs (1)
57for (int i = 0; i < value.Count; i++)
Program.cs (1)
333if (trustedCertificates.Count == 0)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (2)
1035var certificatesDescription = list.Count switch 1039_ => $"{list.Count} certificates",
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
138if (nssDbs.Count > 0) 305if (nssDbs.Count > 0) 506if (nssDbs.Count > 0)
dotnet-format (3)
Analyzers\AnalyzerFormatter.cs (1)
249var hasDiagnostics = result.Diagnostics.Any(kvp => kvp.Value.Count > 0);
Workspaces\MSBuildWorkspaceFinder.cs (2)
103if (files.Count > 1) 108return files.Count == 1
dotnet-Microsoft.XmlSerializer.Generator (4)
Sgen.cs (4)
176if (errs.Count > 0) 228if (typeNames == null || typeNames.Count == 0) 250types = new Type[typeNames.Count]; 316if (importedTypes.Count > 0)
dotnet-sourcelink (1)
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)
255if (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) 768if (_targetFrameworks.Count >= 1 && TargetFrameworkHelper.IsSupportedFramework(this.TargetFramework, out var frameworkInfo) && frameworkInfo.IsDnx) 860await safeLogger.WriteMessageAsync($"Package reference count: {packageDependencies.Count}", logToUI: false).ConfigureAwait(false); 948await 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-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-user-jwts (12)
_generated\0\BindingExtensions.g.cs (1)
88Array.Resize(ref instance, originalCount + temp1.Count);
Commands\CreateCommand.cs (1)
145if (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\aspnetcore\src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (2)
34if (projects.Count > 1) 39if (projects.Count == 0)
dotnet-user-secrets (2)
src\aspnetcore\src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (2)
34if (projects.Count > 1) 39if (projects.Count == 0)
dotnet-watch (2)
Program.cs (2)
212if (projects.Count > 1) 218if (projects.Count == 0)
Extensibility.WebSockets.IntegrationTests (5)
WebSocketTests.4.1.0.cs (5)
99Assert.True(clientReceiver.ServerLog.Count > 0, 167Assert.True(clientReceiver.ServerLog.Count > 0, 239Assert.True(clientReceiver.ServerLog.Count > 0, 340Assert.True(clientReceiver.ServerLog.Count > 0, 412Assert.True(clientReceiver.ServerLog.Count > 0,
GenerateAnalyzerNuspec (1)
Program.cs (1)
120if (allTargets.Count == 0)
GenerateDocumentationAndConfigFiles (47)
Program.cs (1)
382if (fileNamesWithValidationFailures.Count > 0)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
86for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 99if (result == 0 && usedFieldsAndValues.Count > 0) 103for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 154for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\roslyn\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++)
HelixTestTasks (2)
GroupWorkItems.cs (2)
88if (smallItems.Count > 0) 90int numBatches = Math.Min(BatchSize, smallItems.Count);
ILAssembler (18)
EntityRegistry.cs (2)
591((IHasHandle)entity).SetHandle(MetadataTokens.EntityHandle(table, entities.Count)); 674if (entity.Count < rowNumber - 1)
GrammarVisitor.cs (15)
212if (_vtableFixups.Count > 0 || exports.Count > 0 || _mappedFieldDataReferenceFixups.Count > 0) 278if (_vtableFixups.Count == 0) 281var builder = ImmutableArray.CreateBuilder<VTableExportPEBuilder.VTableFixupInfo>(_vtableFixups.Count); 283for (int entryIndex = 0; entryIndex < _vtableFixups.Count; entryIndex++) 325method.DebugInfo.SequencePoints.Count > 0) 388if (debugInfo.SequencePoints.Count == 0) 426if (sequencePoints.Count == 0) 3164var switchEncoder = _currentMethod!.Definition.MethodBody.Switch(labels.Count); 3232for (int i = _currentMethod!.LocalsScopes.Count - 1; i >= 0 ; i--) 3638var localsScope = currentMethod.LocalsScopes.Count != 0 ? currentMethod.LocalsScopes[currentMethod.LocalsScopes.Count - 1] : new(); 3652localsScope.Add(loc.Name, currentMethod.AllLocals.Count); 3829if (index < 0 || index >= currentMethod.Definition.Parameters.Count) 4585int numLocalsScopes = _currentMethod!.LocalsScopes.Count; 4587_currentMethod.LocalsScopes.RemoveRange(numLocalsScopes, _currentMethod.LocalsScopes.Count - numLocalsScopes);
NamedElementList.cs (1)
37public int Count => _elements.Count;
ilc (6)
RdXmlRootProvider.cs (6)
166if (parameter.Count != method.Signature.Length) 186if (instArgs.Count != method.Instantiation.Length) 189if (instArgs.Count > 0) 195if (parameter.Count > 0 && !SignatureMatches(method, parameter)) 204string parameterString = parameter.Count > 0 ? "(" + string.Join(", ", parameter) + ")" : null; 205string instantiationString = instArgs.Count > 0 ? "<" + string.Join(", ", instArgs) + ">" : null;
ILCompiler.Compiler (168)
Compiler\Dataflow\GenericArgumentDataFlow.cs (1)
57if (reflectionMarker.Dependencies.Count > 0)
Compiler\Dataflow\ValueNode.cs (3)
42if (otherList.Count != Count) 45for (int i = 0; i < Count; i++)
Compiler\DependencyAnalysis\ArrayOfEmbeddedDataNode.cs (3)
51for (int i = 0; i < _nestedNodesList.Count; i++) 54if ((i + 1) < _nestedNodesList.Count) 91return _nestedNodesList.Count == 0;
Compiler\DependencyAnalysis\DataflowAnalyzedMethodNode.cs (2)
51for (int i = firstNode; i < markedNodes.Count; i++) 79public override bool HasDynamicDependencies => _runtimeDependencies.Count > 0;
Compiler\DependencyAnalysis\ExternalReferencesTableNode.cs (1)
57index = (uint)_insertedSymbols.Count;
Compiler\DependencyAnalysis\GvmDispatchCellInfoSectionNode.cs (4)
41node.InitializeOffset(checked(cells.Count * node.Size)); 45if (cells.Count == 0) 53for (int firstCell = 0; firstCell < cells.Count;) 57while (nextCell < cells.Count && cells[nextCell].TargetMethod == targetMethod)
Compiler\DependencyAnalysis\InterfaceDispatchCellInfoSectionNode.cs (4)
41node.InitializeOffset(checked(cells.Count * node.Size)); 45if (cells.Count == 0) 53for (int firstCell = 0; firstCell < cells.Count;) 57while (nextCell < cells.Count && cells[nextCell].TargetMethod == targetMethod)
Compiler\DependencyAnalysis\InterfaceDispatchMapNode.cs (3)
328builder.EmitShort(defaultEntryCountReservation, (short)checked((ushort)defaultImplementations.Count)); 329builder.EmitShort(staticEntryCountReservation, (short)checked((ushort)staticImplementations.Count)); 330builder.EmitShort(defaultStaticEntryCountReservation, (short)checked((ushort)staticDefaultImplementations.Count));
Compiler\DependencyAnalysis\ModuleInitializerListNode.cs (2)
93while (sortedModules.Count != modulesWithCctor.Count)
Compiler\DependencyAnalysis\NativeLayoutVertexNode.cs (2)
611DependencyListEntry[] dependencies = new DependencyListEntry[_vertices.Count]; 612for (int i = 0; i < _vertices.Count; i++)
Compiler\DependencyAnalysis\NodeFactory.NativeLayout.cs (6)
252if (other.Vertices.Count != Vertices.Count) 255for (int i = 0; i < Vertices.Count; i++) 286if (x.Count != y.Count) 289for (int i = 0; i < x.Count; i++)
Compiler\DependencyAnalysis\SealedVTableNode.cs (4)
56return _sealedVTableEntries.Count; 75for (int i = 0; i < _sealedVTableEntries.Count; i++) 89for (int i = 0; i < _sealedVTableEntries.Count; i++) 275for (int i = 0; i < _sealedVTableEntries.Count; i++)
Compiler\DependencyAnalysis\StackTraceDocumentsNode.cs (4)
40index = _documents.Count; 73int position = _documents.Count * sizeof(int); 74for (int i = 0; i < _documents.Count; i++) 80for (int i = 0; i < _documents.Count; i++)
Compiler\DependencyAnalysis\StackTraceMethodMappingNode.cs (1)
85objData.EmitInt(mapping.Count);
Compiler\ExportsFileWriter.cs (1)
61if (_exportSymbols.Length != 0 || _methods.Count != 0)
Compiler\ILScanner.cs (4)
96Logger.LogMessage($"Scanning {methodsToCompile.Count} methods..."); 627for (int i = 0; i < baseVtable.Count; i++) 903if (threadStaticNodes.Count > 0) 906for (int i = 0; i < threadStaticNodes.Count; i++)
Compiler\Logging\DocumentationSignatureParser.cs (17)
60Debug.Assert(results.Count <= 1); 61return results.Count == 0 ? null : (TypeDesc)results[0]; 93return results.Count > 0; 98Debug.Assert(results.Count == 0); 168Debug.Assert(results.Count <= 1); 169if (results.Count != 0) 281if (results.Count == 1) 284Debug.Assert(results.Count == 0); 294Debug.Assert(results.Count == 0); 305for (int i = 0; i < results.Count; i++) 396Debug.Assert(results.Count == 0); 419arity = typeArguments.Count; 424Debug.Assert(typeArguments != null && typeArguments.Count != 0); 707if (methodParameters.Length != expectedParameters.Count) 710for (int i = 0; i < expectedParameters.Count; i++) 721if (propertyParameters.Length != expectedParameters.Count) 724for (int i = 0; i < expectedParameters.Count; i++)
Compiler\MetadataManager.cs (1)
130for (int i = 1; i < _dehydratableData.Count; i++)
Compiler\MstatObjectDumper.cs (1)
188deduplicatedMethods.LoadConstantI4(d.Value.Count);
Compiler\ObjectWriter\CodeView\CodeViewSymbolsBuilder.cs (6)
250if (codes.Count > 0) 254recordWriter.Write((uint)(codes.Count / 2)); 256recordWriter.Write((uint)(3 * sizeof(uint) + codes.Count * sizeof(uint))); 272if (codes.Count > 0) 275recordWriter.Write((uint)(codes.Count / 2)); 276recordWriter.Write((uint)(12 + 4 * codes.Count));
Compiler\ObjectWriter\Dwarf\DwarfBuilder.cs (10)
187_dwarfTypeOffsets = new uint[_dwarfTypes.Count]; 279uint typeIndex = (uint)_dwarfTypes.Count; 305return (uint)_dwarfTypes.Count; 316uint typeIndex = (uint)_dwarfTypes.Count; 379return (uint)_dwarfTypes.Count; 385return (uint)_dwarfTypes.Count; 397return (uint)_dwarfTypes.Count; 407return (uint)_memberFunctionTypeInfos.Count; 423return (uint)_memberFunctions.Count; 486fileNameIndex = _fileNames.Count;
Compiler\ObjectWriter\MachObjectWriter.Aot.cs (2)
72_compactUnwindStream = new MemoryStream(32 * _compactUnwindCodes.Count); 74_compactUnwindStream.SetLength(32 * _compactUnwindCodes.Count);
Compiler\UserDefinedTypeDescriptor.cs (9)
414ElementCount = (ulong)fieldsDescriptors.Count, 419for (int i = 0; i < fieldsDescriptors.Count; ++i) 724DataFieldDescriptor[] fields = new DataFieldDescriptor[fieldsDescs.Count]; 725for (int i = 0; i < fieldsDescs.Count; ++i) 730StaticDataFieldDescriptor[] statics = new StaticDataFieldDescriptor[staticsDescs.Count]; 731for (int i = 0; i < staticsDescs.Count; ++i) 741FieldsCount = fieldsDescs.Count, 756if (staticFields != null && (staticFields.Count > 0)) 762FieldsCount = staticFields.Count
IL\ILImporter.Scanner.cs (3)
825int numDependenciesBeforeTargetDetermination = _dependencies.Count; 1048while (_dependencies.Count > numDependenciesBeforeTargetDetermination) 1049_dependencies.RemoveAt(_dependencies.Count - 1);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.Validation.cs (7)
114if (t_typeLoadCheckInProgressStack.Count >= MaximumTypeLoadCheckStackDepth) 123for (int typeCheckDepth = t_typeLoadCheckInProgressStack.Count - 1; typeCheckDepth >= 0; typeCheckDepth--) 162for (int typeCheckDepth = t_typeLoadCheckInProgressStack.Count - 1; typeCheckDepth > typeLoadCheckInProgressStackOffset; typeCheckDepth--) 184Debug.Assert(EmptyList.Count == 0); 185var typeLoadabilityCheck = t_typeLoadCheckInProgressStack[t_typeLoadCheckInProgressStack.Count - 1]; 186t_typeLoadCheckInProgressStack.RemoveAt(t_typeLoadCheckInProgressStack.Count - 1); 192Debug.Assert(typeLoadabilityCheck.OtherTypesToMarkAsSuccessfullyLoaded.Count == 0);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\GVMDependenciesNode.cs (1)
88for (int i = firstNode; i < markedNodes.Count; i++)
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\Graph.Cycles.cs (3)
343int idx = alreadySeen.Count - 1; 368while (idx < alreadySeen.Count) 384alreadySeen.RemoveAt(alreadySeen.Count - 1); // Pop
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\Graph.Vertex.cs (1)
41for (int i = 0; i < _edges.Count; i++)
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.cs (3)
30while (typesToProcess.Count > 0) 32var processType = typesToProcess[typesToProcess.Count - 1]; 33typesToProcess.RemoveAt(typesToProcess.Count - 1);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.ForEach.cs (1)
136_overflow.RemoveAt(_overflow.Count - 1);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\ModuleCycleInfo.cs (3)
172for (int i = 0; i < seenTypes.Count; i++) 176for (int j = i + 1; j < seenTypes.Count; j++) 191seenTypes.RemoveAt(seenTypes.Count - 1);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (14)
135_sectionNumberToComdatAuxRecord[_sections.Count] = auxRecord; 148_symbolNameToIndex.Add(symbolName, (uint)_symbols.Count); 232_symbolNameToIndex.Add(symbolName, (uint)_symbols.Count); 245_symbolNameToIndex.Add(symbolName, (uint)_symbols.Count); 283if (relocationList.Count > 0) 285if (relocationList.Count <= ushort.MaxValue) 287sectionHeader.NumberOfRelocations = (ushort)relocationList.Count; 294coffRelocations.Add(new CoffRelocation { VirtualAddress = (uint)(relocationList.Count + 1) }); 385NumberOfSections = (uint)_sections.Count, 386NumberOfSymbols = (uint)_symbols.Count, 390uint dataOffset = (uint)(coffHeader.Size + _sections.Count * CoffSectionHeader.Size); 408section.Header.PointerToRelocations = section.Relocations.Count > 0 ? dataOffset : 0; 409dataOffset += (uint)(section.Relocations.Count * CoffRelocation.Size); 455if (section.Relocations.Count > 0)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (18)
164_symbolNameToIndex[sectionNameUtf8] = (uint)_symbols.Count; 326_localSymbolCount = (uint)_symbols.Count; 401if (relocationList.Count > 0) 404var relocationStream = new MemoryStream(8 * relocationList.Count); 428if (relocationList.Count > 0) 431var relocationStream = new MemoryStream(24 * relocationList.Count); 457if (relocationList.Count > 0) 460var relocationStream = new MemoryStream(8 * relocationList.Count); 495if (relocationList.Count > 0) 498var relocationStream = new MemoryStream(24 * relocationList.Count); 531if (relocationList.Count > 0) 534var relocationStream = new MemoryStream(24 * relocationList.Count); 567if (relocationList.Count > 0) 570var relocationStream = new MemoryStream(24 * relocationList.Count); 739currentOffset += (ulong)(_symbols.Count * ElfSymbol.GetSize<TSize>()); 743currentOffset += (ulong)(_symbols.Count * sizeof(uint)); 883Size = (ulong)(_symbols.Count * ElfSymbol.GetSize<TSize>()), 903Size = (ulong)(_symbols.Count * sizeof(uint)),
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\MachObjectWriter.cs (9)
195uint loadCommandsSize = (uint)(MachSegment64Header.HeaderSize + _sections.Count * MachSection.HeaderSize); 234NumberOfSections = (uint)_sections.Count, 250uint stringTableOffset = symbolTableOffset + ((uint)_symbolTable.Count * 16u); 254NumberOfSymbols = (uint)_symbolTable.Count, 538uint symbolIndex = (uint)_symbolTable.Count; 664long anchorOffset = anchors.Count > 0 ? anchors[^1].Offset : 0; 694(anchorIndex + 1 < anchors.Count && anchors[anchorIndex + 1].Offset <= offset)) 698int upper = anchors.Count - 1; 1099public uint NumberOfRelocationEntries => relocationCollection is null ? 0u : (uint)relocationCollection.Count;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (3)
111sectionIndex = _sectionIndexToData.Count; 242return _sectionIndexToRelocations[sectionIndex].Count > 0; 606if (checksumRelocations.Count > 0)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\OutputInfoBuilder.cs (1)
176bool result = (index >= 0 && index < _symbols.Count && OutputItem.Comparer.Instance.Compare(_symbols[index], item) == 0);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (8)
452numberOfSections = (ushort)_sections.Count; 637sectionWriter.WriteLittleEndian(exports.Count); 639sectionWriter.WriteLittleEndian(exports.Count); 665for (int i = 0; i < exports.Count; i++) 684Debug.Assert(writer.SectionIndex == _sections.Count - 1, "The .reloc section must be the last section we emit."); 692int entriesSize = entries.Count * 2; 808for (int i = 0; i < _sections.Count; i++) 823for (int i = 0; i < _sections.Count; i++)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (2)
101while (_position < value && _bufferIndex < _sectionData._buffers.Count) 139while (_position < _sectionData._length && _bufferIndex < _sectionData._buffers.Count)
ILCompiler.DependencyAnalysisFramework (7)
DependencyAnalyzer.cs (6)
57T node = _nodes[_nodes.Count - 1]; 58_nodes.RemoveAt(_nodes.Count - 1); 62public int Count => _nodes.Count; 72int index = _randomizer.Next(_nodes.Count); 97_next = analyzer._dynamicDependencyInterestingList.Count; 285for (int i = 0; i < _markedNodesWithDynamicDependencies.Count; i++)
src\runtime\src\coreclr\tools\Common\Sorting\ListAccessor.cs (1)
30return dataStructure.Count;
ILCompiler.MetadataTransform (93)
Internal\Metadata\NativeFormat\Writer\MdBinaryWriterGen.cs (64)
275writer.WriteUnsigned((uint)values.Count); 297writer.WriteUnsigned((uint)values.Count); 319writer.WriteUnsigned((uint)values.Count); 341writer.WriteUnsigned((uint)values.Count); 363writer.WriteUnsigned((uint)values.Count); 385writer.WriteUnsigned((uint)values.Count); 407writer.WriteUnsigned((uint)values.Count); 429writer.WriteUnsigned((uint)values.Count); 451writer.WriteUnsigned((uint)values.Count); 473writer.WriteUnsigned((uint)values.Count); 495writer.WriteUnsigned((uint)values.Count); 517writer.WriteUnsigned((uint)values.Count); 539writer.WriteUnsigned((uint)values.Count); 561writer.WriteUnsigned((uint)values.Count); 583writer.WriteUnsigned((uint)values.Count); 605writer.WriteUnsigned((uint)values.Count); 627writer.WriteUnsigned((uint)values.Count); 649writer.WriteUnsigned((uint)values.Count); 671writer.WriteUnsigned((uint)values.Count); 693writer.WriteUnsigned((uint)values.Count); 715writer.WriteUnsigned((uint)values.Count); 737writer.WriteUnsigned((uint)values.Count); 759writer.WriteUnsigned((uint)values.Count); 781writer.WriteUnsigned((uint)values.Count); 803writer.WriteUnsigned((uint)values.Count); 825writer.WriteUnsigned((uint)values.Count); 847writer.WriteUnsigned((uint)values.Count); 869writer.WriteUnsigned((uint)values.Count); 891writer.WriteUnsigned((uint)values.Count); 913writer.WriteUnsigned((uint)values.Count); 935writer.WriteUnsigned((uint)values.Count); 957writer.WriteUnsigned((uint)values.Count); 979writer.WriteUnsigned((uint)values.Count); 1001writer.WriteUnsigned((uint)values.Count); 1023writer.WriteUnsigned((uint)values.Count); 1045writer.WriteUnsigned((uint)values.Count); 1067writer.WriteUnsigned((uint)values.Count); 1089writer.WriteUnsigned((uint)values.Count); 1111writer.WriteUnsigned((uint)values.Count); 1133writer.WriteUnsigned((uint)values.Count); 1155writer.WriteUnsigned((uint)values.Count); 1177writer.WriteUnsigned((uint)values.Count); 1199writer.WriteUnsigned((uint)values.Count); 1221writer.WriteUnsigned((uint)values.Count); 1243writer.WriteUnsigned((uint)values.Count); 1265writer.WriteUnsigned((uint)values.Count); 1287writer.WriteUnsigned((uint)values.Count); 1309writer.WriteUnsigned((uint)values.Count); 1331writer.WriteUnsigned((uint)values.Count); 1353writer.WriteUnsigned((uint)values.Count); 1375writer.WriteUnsigned((uint)values.Count); 1397writer.WriteUnsigned((uint)values.Count); 1419writer.WriteUnsigned((uint)values.Count); 1441writer.WriteUnsigned((uint)values.Count); 1463writer.WriteUnsigned((uint)values.Count); 1485writer.WriteUnsigned((uint)values.Count); 1507writer.WriteUnsigned((uint)values.Count); 1529writer.WriteUnsigned((uint)values.Count); 1551writer.WriteUnsigned((uint)values.Count); 1573writer.WriteUnsigned((uint)values.Count); 1595writer.WriteUnsigned((uint)values.Count); 1617writer.WriteUnsigned((uint)values.Count); 1639writer.WriteUnsigned((uint)values.Count); 1661writer.WriteUnsigned((uint)values.Count);
Internal\Metadata\NativeFormat\Writer\NativeFormatWriterGen.cs (13)
2172for (int i = 0; i < FixedArguments.Count; i++) 2176for (int i = 0; i < NamedArguments.Count; i++) 2294for (int i = 0; i < MethodSemantics.Count; i++) 2298for (int i = 0; i < CustomAttributes.Count; i++) 2390for (int i = 0; i < CustomAttributes.Count; i++) 2645for (int i = 0; i < Constraints.Count; i++) 2822for (int i = 0; i < Parameters.Count; i++) 2826for (int i = 0; i < GenericParameters.Count; i++) 3058for (int i = 0; i < Parameters.Count; i++) 3062for (int i = 0; i < VarArgParameters.Count; i++) 3762for (int i = 0; i < MethodSemantics.Count; i++) 3767for (int i = 0; i < CustomAttributes.Count; i++) 3883for (int i = 0; i < Parameters.Count; i++)
Internal\Metadata\NativeFormat\Writer\NativeMetadataWriter.cs (2)
241var result = new List<DstT>(dst.Count); 981return values.Count == 0 ? "" : "[" + string.Join(" | ", values) + "] ";
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.cs (14)
81Vertex vertex = _items[_items.Count - 1]; 82_items.RemoveAt(_items.Count - 1); 699public int ElementsCount => _elements.Count; 723writer.WriteUnsigned((uint)_elements.Count); 731if (other == null || other._elements.Count != _elements.Count) 734for (int i = 0; i < _elements.Count; i++) 1680Vertex first = (index < _entries.Count ? _entries[index] : null); 1681Vertex second = (index + 1 < _entries.Count ? _entries[index + 1] : null); 1773while (index >= _entries.Count) 1782for (int i = 0; i < _entries.Count; i += BlockSize) 1806writer.WriteUnsigned(((uint)_entries.Count << 2) | _entryIndexSize); 1949uint bucketsEstimate = (uint)(_Entries.Count / _nFillFactor); 1972int nEntries = _Entries.Count;
ILCompiler.ReadyToRun (168)
Compiler\DependencyAnalysis\ArrayOfEmbeddedDataNode.cs (3)
56for (int i = 0; i < _nestedNodesList.Count; i++) 59if ((i + 1) < _nestedNodesList.Count) 98return _nestedNodesList.Count == 0;
Compiler\DependencyAnalysis\ReadyToRun\AttributePresenceFilterNode.cs (1)
316int countOfEntries = customAttributeEntries.Count;
Compiler\DependencyAnalysis\ReadyToRun\ExceptionInfoLookupTableNode.cs (2)
124for (int index = 0; index < _methodNodes.Count; index++) 154return _methodNodes.Count == 0;
Compiler\DependencyAnalysis\ReadyToRun\GCRefMapNode.cs (4)
37public bool IsEmpty => _methods.Count == 0; 55if (_methods.Count == 0 || relocsOnly) 70int offsetCount = _methods.Count / GCREFMAP_LOOKUP_STRIDE; 82for (int methodIndex = 0; methodIndex < _methods.Count; methodIndex++)
Compiler\DependencyAnalysis\ReadyToRun\InstrumentationDataTableNode.cs (2)
125computedInt = _imports.Count << 1; 169computedInt = _imports.Count << 1;
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (2)
323public int ManifestAssemblyMvidTableSize => GuidByteSize * _manifestAssemblyMvids.Count; 330for (int i = 0; i < _manifestAssemblyMvids.Count; i++)
Compiler\DependencyAnalysis\ReadyToRun\MethodEntryPointTableNode.cs (2)
62while (ridToEntryPoint.Count <= rid) 79for (int rid = 0; rid < ridToEntryPoint.Count; rid++)
Compiler\DependencyAnalysis\ReadyToRun\MethodWithGCInfo.cs (3)
197for (int i = 1; i < fixupCells.Count; i++) 212if (j < fixupCells.Count) 214fixupCells.RemoveRange(j, fixupCells.Count - j);
Compiler\DependencyAnalysis\ReadyToRun\RuntimeFunctionsTableNode.cs (2)
211Debug.Assert((mapping.Count == 0), "HotColdMap is null, but mapping is not empty"); 221if (_methodNodes.Count > 0)
Compiler\FileLayoutOptimizer.cs (12)
100methodColdCodeNode.CustomSort = sortOrder + sortedMethodsList.Count; 199for (int i = 0; i < methods.Count - 1; i++) 201int j = rand.Next(i, methods.Count); 209var nameMap = new Dictionary<string, MethodWithGCInfo>(methods.Count); 210var order = new Dictionary<MethodWithGCInfo, int>(methods.Count); 212for (int i = 0; i < methods.Count; i++) 300outputMethods.Capacity = methodsToPlace.Count; 318Debug.Assert(outputMethods.Count == methodsToPlace.Count); 328var graphNodes = new List<CallGraphNode>(methodsToPlace.Count); 365Debug.Assert(components.SelectMany(l => l).OrderBy(i => i).SequenceEqual(Enumerable.Range(0, methodsToPlace.Count))); 367List<MethodWithGCInfo> result = new List<MethodWithGCInfo>(methodsToPlace.Count);
Compiler\PettisHansenSort\PettisHansen.cs (7)
18DisjointSetForest unionFind = new DisjointSetForest(graph.Count); 19var phNodes = new List<int>[graph.Count]; 21var phEdges = new Dictionary<int, long>[graph.Count]; 166.Where(n => n.Count != 0) 167.OrderByDescending(n => n.Count) 171Debug.Assert(components.SelectMany(l => l).OrderBy(i => i).SequenceEqual(Enumerable.Range(0, graph.Count))); 175foreach (List<int> component in components.SkipWhile(l => l.Count != 1))
Compiler\ProfileDataManager.cs (4)
224if (entities.Count <= 0) 240Count = entities.Count, 251if (elems.Count > 0) 302while (result.Count < sampleSize)
Compiler\ReadyToRunCodegenCompilation.cs (1)
729Logger.Writer.WriteLine($"Processing {obj.Count} dependencies");
Compiler\ReadyToRunStandaloneMethodMetadata.cs (1)
225result = MetadataTokens.TypeReferenceHandle(_alternateTypeRefStream.Count);
IBC\IBCProfileParser.cs (1)
58TokenList.Count == 0)
JitInterface\CorInfoImpl.ReadyToRun.cs (1)
643if (compExactlyDependsOnList != null && compExactlyDependsOnList.Count > 0)
ObjectWriter\MapFileBuilder.cs (1)
125statsIndex = nodeTypeStats.Count;
ObjectWriter\ProfileFileBuilder.cs (2)
89writer.WriteLine("ENTRIES TOTAL | {0,10} | {1,10} | {2,10:F2}", _callInfo.Count, callCount, callCount * percentFactor); 93int unresolvedPairCount = _callInfo.Count - resolvedPairCount;
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.Validation.cs (7)
114if (t_typeLoadCheckInProgressStack.Count >= MaximumTypeLoadCheckStackDepth) 123for (int typeCheckDepth = t_typeLoadCheckInProgressStack.Count - 1; typeCheckDepth >= 0; typeCheckDepth--) 162for (int typeCheckDepth = t_typeLoadCheckInProgressStack.Count - 1; typeCheckDepth > typeLoadCheckInProgressStackOffset; typeCheckDepth--) 184Debug.Assert(EmptyList.Count == 0); 185var typeLoadabilityCheck = t_typeLoadCheckInProgressStack[t_typeLoadCheckInProgressStack.Count - 1]; 186t_typeLoadCheckInProgressStack.RemoveAt(t_typeLoadCheckInProgressStack.Count - 1); 192Debug.Assert(typeLoadabilityCheck.OtherTypesToMarkAsSuccessfullyLoaded.Count == 0);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\GVMDependenciesNode.cs (1)
88for (int i = firstNode; i < markedNodes.Count; i++)
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\Graph.Cycles.cs (3)
343int idx = alreadySeen.Count - 1; 368while (idx < alreadySeen.Count) 384alreadySeen.RemoveAt(alreadySeen.Count - 1); // Pop
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\Graph.Vertex.cs (1)
41for (int i = 0; i < _edges.Count; i++)
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.cs (3)
30while (typesToProcess.Count > 0) 32var processType = typesToProcess[typesToProcess.Count - 1]; 33typesToProcess.RemoveAt(typesToProcess.Count - 1);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.ForEach.cs (1)
136_overflow.RemoveAt(_overflow.Count - 1);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\ModuleCycleInfo.cs (3)
172for (int i = 0; i < seenTypes.Count; i++) 176for (int j = i + 1; j < seenTypes.Count; j++) 191seenTypes.RemoveAt(seenTypes.Count - 1);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (14)
135_sectionNumberToComdatAuxRecord[_sections.Count] = auxRecord; 148_symbolNameToIndex.Add(symbolName, (uint)_symbols.Count); 232_symbolNameToIndex.Add(symbolName, (uint)_symbols.Count); 245_symbolNameToIndex.Add(symbolName, (uint)_symbols.Count); 283if (relocationList.Count > 0) 285if (relocationList.Count <= ushort.MaxValue) 287sectionHeader.NumberOfRelocations = (ushort)relocationList.Count; 294coffRelocations.Add(new CoffRelocation { VirtualAddress = (uint)(relocationList.Count + 1) }); 385NumberOfSections = (uint)_sections.Count, 386NumberOfSymbols = (uint)_symbols.Count, 390uint dataOffset = (uint)(coffHeader.Size + _sections.Count * CoffSectionHeader.Size); 408section.Header.PointerToRelocations = section.Relocations.Count > 0 ? dataOffset : 0; 409dataOffset += (uint)(section.Relocations.Count * CoffRelocation.Size); 455if (section.Relocations.Count > 0)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (18)
164_symbolNameToIndex[sectionNameUtf8] = (uint)_symbols.Count; 326_localSymbolCount = (uint)_symbols.Count; 401if (relocationList.Count > 0) 404var relocationStream = new MemoryStream(8 * relocationList.Count); 428if (relocationList.Count > 0) 431var relocationStream = new MemoryStream(24 * relocationList.Count); 457if (relocationList.Count > 0) 460var relocationStream = new MemoryStream(8 * relocationList.Count); 495if (relocationList.Count > 0) 498var relocationStream = new MemoryStream(24 * relocationList.Count); 531if (relocationList.Count > 0) 534var relocationStream = new MemoryStream(24 * relocationList.Count); 567if (relocationList.Count > 0) 570var relocationStream = new MemoryStream(24 * relocationList.Count); 739currentOffset += (ulong)(_symbols.Count * ElfSymbol.GetSize<TSize>()); 743currentOffset += (ulong)(_symbols.Count * sizeof(uint)); 883Size = (ulong)(_symbols.Count * ElfSymbol.GetSize<TSize>()), 903Size = (ulong)(_symbols.Count * sizeof(uint)),
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\MachObjectWriter.cs (9)
195uint loadCommandsSize = (uint)(MachSegment64Header.HeaderSize + _sections.Count * MachSection.HeaderSize); 234NumberOfSections = (uint)_sections.Count, 250uint stringTableOffset = symbolTableOffset + ((uint)_symbolTable.Count * 16u); 254NumberOfSymbols = (uint)_symbolTable.Count, 538uint symbolIndex = (uint)_symbolTable.Count; 664long anchorOffset = anchors.Count > 0 ? anchors[^1].Offset : 0; 694(anchorIndex + 1 < anchors.Count && anchors[anchorIndex + 1].Offset <= offset)) 698int upper = anchors.Count - 1; 1099public uint NumberOfRelocationEntries => relocationCollection is null ? 0u : (uint)relocationCollection.Count;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (3)
111sectionIndex = _sectionIndexToData.Count; 242return _sectionIndexToRelocations[sectionIndex].Count > 0; 606if (checksumRelocations.Count > 0)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\OutputInfoBuilder.cs (1)
176bool result = (index >= 0 && index < _symbols.Count && OutputItem.Comparer.Instance.Compare(_symbols[index], item) == 0);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (8)
452numberOfSections = (ushort)_sections.Count; 637sectionWriter.WriteLittleEndian(exports.Count); 639sectionWriter.WriteLittleEndian(exports.Count); 665for (int i = 0; i < exports.Count; i++) 684Debug.Assert(writer.SectionIndex == _sections.Count - 1, "The .reloc section must be the last section we emit."); 692int entriesSize = entries.Count * 2; 808for (int i = 0; i < _sections.Count; i++) 823for (int i = 0; i < _sections.Count; i++)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (2)
101while (_position < value && _bufferIndex < _sectionData._buffers.Count) 139while (_position < _sectionData._length && _bufferIndex < _sectionData._buffers.Count)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmDataSection.cs (5)
31size += (int)DwarfHelper.SizeOfULEB128((ulong)_segments.Count); 65Span<byte> countBuffer = stackalloc byte[(int)DwarfHelper.SizeOfULEB128((ulong)_segments.Count)]; 66int countSize = DwarfHelper.WriteULEB128(countBuffer, (ulong)_segments.Count); 70for (int i = 0; i < _segments.Count; i++) 74if ((i + 1) < _segments.Count)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmSections.cs (2)
14public int Count => _sections.Count; 24Debug.Assert(_sections.Count == sectionIndex);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (14)
626int entriesSize = entries.Count * 2; 650if (_pendingBaseRelocs.Count > 0) 889if (blobs.Count == 0 && relocs.Count > 0) 897int[] blobShrink = new int[blobs.Count]; 908for (int b = 0; b < blobs.Count; b++) 913bool hasRelocs = relocCursor < relocs.Count && relocs[relocCursor].Offset >= blob.Start && relocs[relocCursor].Offset < blob.End; 931while (relocCursor < relocs.Count && relocs[relocCursor].Offset < blob.End) 936if (relocCursor + 1 < relocs.Count && relocs[relocCursor + 1].Offset < blob.End) 989Debug.Assert(newBlobs.Count == blobs.Count); 990for (int i = 0; i < newBlobs.Count; i++) 1189if (relocs.Count == 0) 1213for (int i = 0; i < relocs.Count; i++)
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.cs (14)
81Vertex vertex = _items[_items.Count - 1]; 82_items.RemoveAt(_items.Count - 1); 699public int ElementsCount => _elements.Count; 723writer.WriteUnsigned((uint)_elements.Count); 731if (other == null || other._elements.Count != _elements.Count) 734for (int i = 0; i < _elements.Count; i++) 1680Vertex first = (index < _entries.Count ? _entries[index] : null); 1681Vertex second = (index + 1 < _entries.Count ? _entries[index + 1] : null); 1773while (index >= _entries.Count) 1782for (int i = 0; i < _entries.Count; i += BlockSize) 1806writer.WriteUnsigned(((uint)_entries.Count << 2) | _entryIndexSize); 1949uint bucketsEstimate = (uint)(_Entries.Count / _nFillFactor); 1972int nEntries = _Entries.Count;
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (1)
756handle = (IntPtr)(handleMultiplier * _handleToObject.Count + handleBase);
src\runtime\src\coreclr\tools\Common\JitInterface\SwiftPhysicalLowering.cs (4)
119for (int i = 0; i < consolidatedIntervals.Count - 1; i++) 227if (loweredTypes.Count > 4) 235numLoweredElements = loweredTypes.Count 238for (int i = 0; i < loweredTypes.Count; i++)
TypeSystem\Mutable\MutableModule.cs (3)
73result = MetadataTokens.ModuleReferenceHandle(_moduleRefStrings.Count); 191var perMetadataTypeCache = new PerMetadataFormCache<T>(_module, handleFunc, _perMetadata.Count); 239return _readers[_readers.Count - 1];
ILCompiler.RyuJit (21)
Compiler\RyuJitCompilation.cs (1)
163Logger.LogMessage($"Compiling {methodsToCompile.Count} methods...");
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\FileLayoutOptimizer.cs (8)
199for (int i = 0; i < methods.Count - 1; i++) 201int j = rand.Next(i, methods.Count); 209var nameMap = new Dictionary<string, MethodWithGCInfo>(methods.Count); 210var order = new Dictionary<MethodWithGCInfo, int>(methods.Count); 212for (int i = 0; i < methods.Count; i++) 328var graphNodes = new List<CallGraphNode>(methodsToPlace.Count); 365Debug.Assert(components.SelectMany(l => l).OrderBy(i => i).SequenceEqual(Enumerable.Range(0, methodsToPlace.Count))); 367List<MethodWithGCInfo> result = new List<MethodWithGCInfo>(methodsToPlace.Count);
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\PettisHansen.cs (7)
18DisjointSetForest unionFind = new DisjointSetForest(graph.Count); 19var phNodes = new List<int>[graph.Count]; 21var phEdges = new Dictionary<int, long>[graph.Count]; 166.Where(n => n.Count != 0) 167.OrderByDescending(n => n.Count) 171Debug.Assert(components.SelectMany(l => l).OrderBy(i => i).SequenceEqual(Enumerable.Range(0, graph.Count))); 175foreach (List<int> component in components.SkipWhile(l => l.Count != 1))
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (1)
756handle = (IntPtr)(handleMultiplier * _handleToObject.Count + handleBase);
src\runtime\src\coreclr\tools\Common\JitInterface\SwiftPhysicalLowering.cs (4)
119for (int i = 0; i < consolidatedIntervals.Count - 1; i++) 227if (loweredTypes.Count > 4) 235numLoweredElements = loweredTypes.Count 238for (int i = 0; i < loweredTypes.Count; i++)
ILCompiler.TypeSystem (6)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\FieldLayoutIntervalCalculator.cs (3)
114if (addTrailingEmptyInterval && nestedIntervals.Count > 0) 116int trailingRegionStart = nestedIntervals[nestedIntervals.Count - 1].EndSentinel; 217if (intervalIndex + 1 == fieldLayoutInterval.Count)
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaSignatureParser.cs (3)
446EmbeddedSignatureData[] embeddedSignatureDataArray = (_embeddedSignatureDataList == null || _embeddedSignatureDataList.Count == 0 || skipEmbeddedSignatureData) ? null : _embeddedSignatureDataList.ToArray(); 494EmbeddedSignatureData[] embeddedSignatureDataArray = (_embeddedSignatureDataList == null || _embeddedSignatureDataList.Count == 0) ? null : _embeddedSignatureDataList.ToArray(); 514embeddedSigData = _embeddedSignatureDataList.Count == 0 ? null : _embeddedSignatureDataList.ToArray();
illink (51)
ILLink.CodeFixProvider (4)
SynchronizeUnsafeContractCodeFixProvider.cs (4)
126if (GetEditableDeclarations(baseSymbol, context.Document.Project.Solution, context.CancellationToken) is not { Count: > 0 } declarations 135if (baseDeclarations.Count == 0) 283if (seen.Add(chain[chain.Count - 1])) 284contracts.Add(chain[chain.Count - 1]);
Infrastructure.Common (3)
xunit\ConditionAttribute.cs (1)
96if (falseConditions.Count == 0)
xunit\WcfTestDiscoverer.cs (2)
46if (issueSkipList.Count > 0) 75if (skipReasons.Count > 0)
Keycloak.Web (1)
WeatherApiClient.cs (1)
11if (forecasts?.Count >= maxItems)
Microsoft.Analyzers.Extra (2)
LegacyLoggingFixer.cs (2)
180var matchParams = invocationArgList.Count == methodSymbol.Parameters.Length; 183for (int i = 0; i < invocationArgList.Count; i++)
Microsoft.Analyzers.Extra.Tests (3)
RoslynTestUtils.cs (3)
355if (actions.Count == 0 || numberOfActionsInPreviousIteration == actions.Count) 369numberOfActionsInPreviousIteration = actions.Count;
Microsoft.Analyzers.Local (4)
ApiLifecycleAnalyzer.cs (2)
123if (missingContraintsForSymbol.Count > 0) 131if (missingBaseForSymbol.Count > 0)
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++)
RoslynTestUtils.cs (3)
356if (actions.Count == 0 || numberOfActionsInPreviousIteration == actions.Count) 370numberOfActionsInPreviousIteration = actions.Count;
Microsoft.AspNetCore.Analyzers (1)
CompilationFeatureDetector.cs (1)
31for (var i = 0; i < configureMethods.Count; i++)
Microsoft.AspNetCore.Antiforgery (8)
Internal\DefaultAntiforgeryTokenGenerator.cs (1)
232for (var i = 0; i < identitiesList.Count; i++)
Internal\DefaultClaimUidExtractor.cs (7)
39for (var i = 0; i < identitiesList.Count; i++) 86for (var i = 0; i < identitiesList.Count; i++) 94if (allClaims.Count == 0) 102var identifierParameters = new List<string>(allClaims.Count * 3); 103for (var i = 0; i < allClaims.Count; i++) 120for (var i = 0; i < parameters.Count; i++) 136for (var i = 0; i < parameters.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\aspnetcore\src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
35for (var i = 0; i < _weakReferencedEntries.Count; i++)
Microsoft.AspNetCore.Authentication.Abstractions (1)
TokenExtensions.cs (1)
47if (tokenNames.Count > 0)
Microsoft.AspNetCore.Authentication.Cookies (1)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
330if (keyValuePairs.Count > 0)
Microsoft.AspNetCore.Authentication.DeviceBoundSessions (4)
_generated\6\DeviceBoundSessionJsonContext.ListSessionCredential.g.cs (1)
60for (int i = 0; i < value.Count; i++)
_generated\7\DeviceBoundSessionJsonContext.ListSessionScopeRule.g.cs (1)
60for (int i = 0; i < value.Count; i++)
_generated\8\DeviceBoundSessionJsonContext.ListString.g.cs (1)
57for (int i = 0; i < value.Count; i++)
DeviceBoundSessionChallengeProtector.cs (1)
204if (allClaims.Count == 0)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerHandler.cs (1)
184Exception = (validationFailures.Count == 1) ? validationFailures[0] : new AggregateException(validationFailures)
Microsoft.AspNetCore.Authentication.Twitter (1)
_generated\3\TwitterJsonContext.ListTwitterError.g.cs (1)
59for (int i = 0; i < value.Count; i++)
Microsoft.AspNetCore.Authentication.WsFederation (2)
WsFederationHandler.cs (2)
303if (validationFailures == null || validationFailures.Count == 0) 307else if (validationFailures.Count == 1)
Microsoft.AspNetCore.Components (35)
CascadingValueSource.cs (2)
101var subscribersCount = subscribers.Count; 181if (subscribersForDispatcher.Count == 0)
NavigationManager.cs (3)
419var handlerCount = _locationChangingHandlers.Count; 580var isFirstHandler = _locationChangingHandlers.Count == 0; 596if (_locationChangingHandlers.Remove(locationChangingHandler) && _locationChangingHandlers.Count == 0)
PersistentState\ComponentStatePersistenceManager.cs (2)
181for (var i = _registeredCallbacks.Count - 1; i >= 0; i--) 222for (var i = _registeredCallbacks.Count - 1; i >= 0; i--)
PersistentState\PersistentServicesRegistry.cs (1)
54if (_subscriptions.Count != 0)
Reflection\MemberAssignment.cs (1)
58var count = list.Count;
RenderTree\Renderer.cs (7)
400Debug.Assert(_pendingTasks is null || _pendingTasks.Count == 0); 409while (_pendingTasks?.Count > 0) 1095if (exceptions?.Count > 1) 1099else if (exceptions?.Count == 1) 1318if (asyncDisposables?.Count >= 1) 1344if (exceptions?.Count > 1) 1348else if (exceptions?.Count == 1)
Sections\SectionRegistry.cs (3)
51if (index == providers.Count) 102if (providers.Count != 0 && providers[^1] == provider) 160=> providers.Count != 0
src\aspnetcore\src\Http\Routing\src\ParameterPolicyActivator.cs (3)
121if (matchingConstructors.Count == 0) 129if (matchingConstructors.Count == 1) 161Debug.Assert(constructors.Count > 0);
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternFactory.cs (2)
504for (var i = 0; i < parameters.Count; i++) 628&& (parameterConstraints?.Count ?? 0) == 0)
src\aspnetcore\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\aspnetcore\src\Http\Routing\src\RouteConstraintBuilder.cs (1)
58if (kvp.Value.Count == 1)
src\aspnetcore\src\Http\Routing\src\Tree\TreeEnumerator.cs (2)
48if (next.IsCatchAll && next.Matches.Count > 0) 58if (next.Matches.Count > 0)
Microsoft.AspNetCore.Components.AI (6)
Components\MessageList.cs (1)
111if (_turnRenderers.Count == 0 && EmptyContent is not null)
Components\MessageListContext.cs (1)
26for (var i = _registrations.Count - 1; i >= 0; i--)
Engine\UIAgent.cs (1)
146UIAgentLog.StreamComplete(_logger, assistantUpdates.Count);
Pipeline\BlockMappingPipeline.cs (3)
48for (var i = _activeStack.Count - 1; i >= 0; i--) 80for (var i = 0; i < _handlers.Count; i++) 129BlockMappingPipelineLog.Finalizing(_logger, _activeStack.Count);
Microsoft.AspNetCore.Components.Analyzers (6)
ComponentParameterAnalyzer.cs (2)
64if (properties.Count == 0) 124if (captureUnmatchedValuesParameters.Count > 1)
ForLoopIteratorInClosureAnalyzer.cs (1)
157if (analyzerState.AllForVariables.Count == 0)
StateHasChangedAnalyzer.cs (3)
111if (stateCalls.Count == 0) 118if (awaitExpressions.Count == 0) 129var lastAwaitStart = awaitExpressions[awaitExpressions.Count - 1].SpanStart;
Microsoft.AspNetCore.Components.Endpoints (14)
Assets\ResourcePreloader.cs (1)
50for (var i = 0; i < assets.Count; i ++)
Builder\RazorComponentEndpointDataSource.cs (1)
140var resourceCollection = endpoints.Count > 0 ? endpoints[^1].Metadata.GetMetadata<ResourceAssetCollection>() : null;
CacheView\CacheViewService.cs (1)
328if (payload is null || payload.Nodes.Count == 0)
CacheView\MemoryCacheViewStore.cs (1)
50if (payload.Nodes.Count > 0)
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (2)
232for (var i = 0; i < constructorParameters.Count; i++) 257for (var i = 0; i < properties.Count; i++)
FormMapping\Metadata\FormDataMetadataFactory.cs (1)
280for (var i = 0; i < _context.CurrentTypes.Count; i++)
Forms\ClientValidationCache.cs (2)
97if (path.Count == 0) 103for (var i = 0; i < path.Count - 1; i++)
Rendering\CacheViewTextWriter.cs (1)
132var nodes = new List<RenderTreeNode>(_entries.Count);
Rendering\EndpointHtmlRenderer.Prerendering.cs (2)
169else if (_nonStreamingPendingTasks.Count > 0) 201while (_nonStreamingPendingTasks.Count > 0)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (1)
265for (var i = 0; i < nodes.Count; i++)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
330if (keyValuePairs.Count > 0)
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
297return (_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 (7)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (1)
265for (var i = 0; i < nodes.Count; i++)
src\aspnetcore\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.Testing (2)
Infrastructure\ServerFactory.cs (1)
221if (exceptions.Count > 1)
Infrastructure\TracingSession.cs (1)
136if (savedFiles.Count > 0)
Microsoft.AspNetCore.Components.Testing.Generators (2)
ServiceOverrideAnalyzer.cs (1)
116if (candidates.Count == 0)
StartupHookGenerator.cs (1)
183if (distinct.Count > 0)
Microsoft.AspNetCore.Components.Web (3)
_generated\8\WebRendererSerializerContext.ListString.g.cs (1)
57for (int i = 0; i < value.Count; i++)
Forms\Mapping\FormMappingContext.cs (1)
134for (var i = 0; i < _pendingErrors.Count; i++)
Forms\ValidationSummary.cs (1)
111var hasErrors = messages.Count > 0;
Microsoft.AspNetCore.Components.WebAssembly (3)
Hosting\WebAssemblyHostConfiguration.cs (2)
50for (var i = _providers.Count - 1; i >= 0; i--) 64if (_providers.Count == 0)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (1)
265for (var i = 0; i < nodes.Count; i++)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
TargetPickerUi.cs (2)
310if (matchingTabs.Count == 1) 316else if (matchingTabs.Count == 0)
Microsoft.AspNetCore.Components.WebView (1)
src\aspnetcore\src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
207for (var i = 0; i < patterns.Count; i++)
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.DataProtection.MicroBenchmarks (1)
src\aspnetcore\src\Shared\BenchmarkRunner\Program.cs (1)
79if (index >= 0 && index < argsList.Count - 1)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (5)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (2)
1035var certificatesDescription = list.Count switch 1039_ => $"{list.Count} certificates",
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
138if (nssDbs.Count > 0) 305if (nssDbs.Count > 0) 506if (nssDbs.Count > 0)
Microsoft.AspNetCore.Diagnostics (1)
src\aspnetcore\src\Shared\Metrics\MetricsExtensions.cs (1)
39for (var i = 0; i < list.Count; i++)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckOptions.cs (1)
53if (missingHealthStatus.Count > 0)
Microsoft.AspNetCore.Grpc.JsonTranscoding (13)
Internal\JsonTranscodingRouteAdapter.cs (6)
62while (i < tempSegments.Count) 107routeValueFormatTemplateParts.Add($"{{{variableParts.Count}}}"); 125routeValueFormatTemplateParts.Add($"{{{variableParts.Count}}}"); 130while (i < tempSegments.Count - 1) 132tempSegments.RemoveAt(tempSegments.Count - 1); 146var values = new object?[variableParts.Count];
src\aspnetcore\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\aspnetcore\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\aspnetcore\src\Shared\Metrics\MetricsExtensions.cs (1)
39for (var i = 0; i < list.Count; i++)
src\aspnetcore\src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
207for (var i = 0; i < patterns.Count; i++)
WebHostBuilder.cs (1)
255if (exceptions.Count > 0)
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.Connections (7)
Internal\HttpConnectionContext.cs (1)
326if (_userRefreshedCallbacks is { Count: > 0 })
src\aspnetcore\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)
442if (transportExceptions.Count > 0)
Microsoft.AspNetCore.Http.Extensions (15)
RequestDelegateFactory.cs (12)
378var responseWritingMethodCall = factoryContext.ParamCheckExpressions.Count > 0 ? 981var localVariables = new ParameterExpression[factoryContext.ExtraLocals.Count + 1]; 982var checkParamAndCallMethod = new Expression[factoryContext.ParamCheckExpressions.Count + 1]; 984for (var i = 0; i < factoryContext.ExtraLocals.Count; i++) 989for (var i = 0; i < factoryContext.ParamCheckExpressions.Count; i++) 994localVariables[factoryContext.ExtraLocals.Count] = WasParamCheckFailureExpr; 1012checkParamAndCallMethod[factoryContext.ParamCheckExpressions.Count] = checkWasParamCheckFailureWithFilters; 1028checkParamAndCallMethod[factoryContext.ParamCheckExpressions.Count] = checkWasParamCheckFailure; 1267if (factoryContext.ParameterBinders.Count > 0) 1315if (factoryContext.ParameterBinders.Count > 0) 1472if (factoryContext.ParameterBinders.Count > 0) 2066var boundValueExpr = Expression.ArrayIndex(BoundValuesArrayExpr, Expression.Constant(factoryContext.ParameterBinders.Count - 1));
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (2)
232for (var i = 0; i < constructorParameters.Count; i++) 257for (var i = 0; i < properties.Count; i++)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (1)
280for (var i = 0; i < _context.CurrentTypes.Count; i++)
Microsoft.AspNetCore.Http.Features (2)
CookieOptions.cs (2)
46if (options._extensions?.Count > 0) 124if (_extensions?.Count > 0)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
RequestDelegateGenerator.cs (1)
35.Where(endpoint => endpoint.Diagnostics.Count == 0)
RequestDelegateGeneratorSuppressor.cs (1)
76if (endpoint.Diagnostics.Count == 0)
src\aspnetcore\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)
319else if (potentialImplicitBodyParameters.Count > 0)
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)
147if (logContext.InternalParameters.Count > 0 && !options.CombineLogs) 239if (logContext.InternalParameters.Count > 0) 349if (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.HttpOverrides (2)
DualIPNetworkList.cs (2)
32int ICollection<IPNetwork>.Count => _system.Count; 33int ICollection<AspNetIPNetwork>.Count => _aspnet.Count;
Microsoft.AspNetCore.InternalTesting (1)
Tracing\EventSourceValidator.cs (1)
99if (errors.Count > 0)
Microsoft.AspNetCore.JsonPatch (3)
JsonPatchDocument.cs (1)
202var allOps = new List<Operation>(Operations?.Count ?? 0);
JsonPatchDocumentOfT.cs (2)
638var allOps = new List<Operation>(Operations?.Count ?? 0); 667if (segments.Count == 0)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (3)
JsonPatchDocument.cs (1)
205var allOps = new List<Operation>(Operations?.Count ?? 0);
JsonPatchDocumentOfT.cs (2)
641var allOps = new List<Operation>(Operations?.Count ?? 0); 679if (segments.Count == 0)
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.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\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
330if (keyValuePairs.Count > 0)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
DataAnnotationsModelValidator.cs (1)
120if (validationResults.Count == 0)
Microsoft.AspNetCore.Mvc.Razor (1)
RazorView.cs (1)
221if (renderedLayouts.Count > 0 &&
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 (2)
CacheTagHelper.cs (1)
261for (var i = 0; i < Buffer.Pages.Count; i++)
TagHelperOutputExtensions.cs (1)
246if (listOfClasses.Count > 0)
Microsoft.AspNetCore.Mvc.ViewFeatures (13)
AttributeDictionary.cs (1)
57public int Count => _items == null ? 0 : _items.Count;
Buffers\MemoryPoolViewBufferScope.cs (4)
49if (_available != null && _available.Count > 0) 51segment = _available[_available.Count - 1]; 52_available.RemoveAt(_available.Count - 1); 105for (var i = 0; i < _leased.Count; i++)
Buffers\PagedBufferedTextWriter.cs (1)
53var count = pages.Count;
Buffers\PagedCharBuffer.cs (4)
29var fullPages = pages.Count - 1; 105for (var i = pages.Count - 1; i > 0; i--) 120CurrentPage = pages.Count > 0 ? pages[0] : null; 154var count = pages.Count;
Buffers\ViewBuffer.cs (1)
53return _multiplePages.Count;
Filters\SaveTempDataPropertyFilterBase.cs (1)
112if (errorMessages.Count > 0)
ValidationHelpers.cs (1)
64if (entries.Count < modelStateDictionary.Count)
Microsoft.AspNetCore.OpenApi (13)
Services\OpenApiDocumentService.cs (7)
67var schemaTransformers = _options.SchemaTransformers.Count > 0 68? new IOpenApiSchemaTransformer[_options.SchemaTransformers.Count] 70var operationTransformers = _options.OperationTransformers.Count > 0 ? 71new IOpenApiOperationTransformer[_options.OperationTransformers.Count] 115for (var i = 0; i < _options.DocumentTransformers.Count; i++) 124for (var i = 0; i < _options.SchemaTransformers.Count; i++) 137for (var i = 0; i < _options.OperationTransformers.Count; i++)
src\aspnetcore\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.SourceGenerators (9)
XmlCommentGenerator.Emitter.cs (9)
796if (comment.Examples is null || comment.Examples.Count == 0) 803for (var i = 0; i < comment.Examples.Count; i++) 807if (i < comment.Examples.Count - 1) 815if (comment.Parameters is null || comment.Parameters.Count == 0) 822for (var i = 0; i < comment.Parameters.Count; i++) 834if (i < comment.Parameters.Count - 1) 842if (comment.Responses is null || comment.Responses.Count == 0) 849for (var i = 0; i < comment.Responses.Count; i++) 856if (i < comment.Responses.Count - 1)
Microsoft.AspNetCore.OutputCaching (3)
DefaultOutputCachePolicyProvider.cs (1)
26if (_options.BasePolicies is not null && _options.BasePolicies.Count > 0)
OutputCachePolicyBuilder.cs (2)
295if (_policies.Count != 1 || _policies[0] != DefaultPolicy.Instance) 322var policies = _policies.Count switch
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++) 112for (var i = 0; i < (_buffer?.Count ?? 0); i++) 135for (var i = 0; i < (_buffer?.Count ?? 0); i++) 196for (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.Utilities.Shared (5)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\ListExtensions.cs (3)
31=> list?.Count > 0 36=> list.Count > 0; 53ArgHelper.ThrowIfDestinationTooShort(destination, list.Count);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledList`1.cs (1)
36=> _list?.Count ?? 0;
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledList`1.Enumerator.cs (1)
34if (_list is { } list && _index < list.Count)
Microsoft.AspNetCore.Rewrite (5)
BackReferenceCollection.cs (2)
32if (index < _backReferences.Count) 38throw new ArgumentOutOfRangeException(null, $"Cannot access back reference at index {index}. Only {_backReferences.Count} back references were captured.");
IISUrlRewrite\ConditionCollection.cs (3)
26public int Count => _conditions.Count; 32if (index < _conditions.Count) 36throw new ArgumentOutOfRangeException(null, $"Cannot access condition at index {index}. Only {_conditions.Count} conditions were captured.");
Microsoft.AspNetCore.Routing (68)
CompositeEndpointDataSource.cs (1)
126if (_changeTokenRegistrations is { Count: > 0 })
DefaultLinkGenerator.cs (7)
81if (endpoints.Count == 0) 104if (endpoints.Count == 0) 133if (endpoints.Count == 0) 166if (endpoints.Count == 0) 187if (endpoints.Count == 0) 208for (var i = 0; i < endpoints.Count; i++) 244for (var i = 0; i < endpoints.Count; i++)
DefaultLinkParser.cs (5)
51if (endpoints.Count == 0) 56for (var i = 0; i < endpoints.Count; i++) 75if (endpoints.Count == 0) 105if (constraintsForParameter.Count > 0) 132for (var i = 0; i < kvp.Value.Count; i++)
Matching\DfaMatcherBuilder.cs (10)
72var work = new List<DfaBuilderWorkerWorkItem>(_endpoints.Count); 79for (var i = 0; i < _endpoints.Count; i++) 178_workCount = work.Count; 204for (var j = 0; j < parents.Count; j++) 213if (nextWorkCount < nextWork.Count) 239if (nextParents.Count > 0) 257for (var i = 0; i < parents.Count; i++) 650if (node.Matches?.Count > 0) 879if (node.Matches == null || node.Matches.Count == 0) 908for (var j = 0; j < work.Count; j++)
Matching\DfaNode.cs (1)
120builder.Append(Matches?.Count ?? 0);
Matching\HttpMethodMatcherPolicy.cs (2)
333if (destinations?.Count == 1) 343if (corsPreflightDestinations?.Count > 0)
Matching\NegotiationMatcherPolicy.cs (2)
327var result = new double[values.Count]; 328for (var i = 0; i < values.Count; i++)
ParameterPolicyActivator.cs (3)
121if (matchingConstructors.Count == 0) 129if (matchingConstructors.Count == 1) 161Debug.Assert(constructors.Count > 0);
Patterns\DefaultRoutePatternTransformer.cs (2)
220for (var i = 0; i < segments.Count; i++) 234for (var k = 0; k < parameters.Count; k++)
Patterns\RoutePatternFactory.cs (2)
504for (var i = 0; i < parameters.Count; i++) 628&& (parameterConstraints?.Count ?? 0) == 0)
Patterns\RoutePatternParser.cs (8)
319for (var i = 0; i < segments.Count; i++) 327(i != segments.Count - 1 || j != segment.Parts.Count - 1)) 341for (var i = 0; i < parts.Count; i++) 344if (part is RoutePatternParameterPart parameter && parameter.IsCatchAll && parts.Count > 1) 353for (var i = 0; i < parts.Count; i++) 357if (part is RoutePatternParameterPart parameter && parameter.IsOptional && parts.Count > 1) 360if (i == parts.Count - 1) 411for (var i = 0; i < parts.Count; i++)
RouteCollection.cs (2)
40get { return _routes.Count; } 129for (var i = 0; i < routes.Count; i++)
RouteConstraintBuilder.cs (1)
58if (kvp.Value.Count == 1)
RouteEndpointDataSource.cs (6)
97var endpoints = new RouteEndpoint[_routeEntries.Count]; 98for (int i = 0; i < _routeEntries.Count; i++) 108var endpoints = new RouteEndpoint[_routeEntries.Count]; 109for (var i = 0; i < _routeEntries.Count; i++) 121if (_routeEntries.Count is not 1) 123throw new InvalidOperationException($"There are {_routeEntries.Count} endpoints defined! This can only be called for a single endpoint.");
RouteGroupBuilder.cs (2)
63return _routeGroupBuilder._dataSources.Count switch 71public override IChangeToken GetChangeToken() => _routeGroupBuilder._dataSources.Count switch
Template\RoutePrecedence.cs (2)
151if (segment.Parts.Count > 1) 217if (segment.Parts.Count > 1)
Template\RouteTemplate.cs (3)
42for (var j = 0; j < segment.Parts.Count; j++) 68for (var i = 0; i < segments.Count; i++) 71for (var j = 0; j < segment.Parts.Count; j++)
Template\TemplateSegment.cs (1)
43public bool IsSimple => Parts.Count == 1;
Tree\LinkGenerationDecisionTree.cs (2)
70if (_root.Matches.Count > 0 || _root.Criteria.Count > 0 || _conventionalEntries.Count > 0) 164for (var i = 0; i < _conventionalEntries.Count; i++)
Tree\TreeEnumerator.cs (2)
48if (next.IsCatchAll && next.Matches.Count > 0) 58if (next.Matches.Count > 0)
Tree\UrlMatchingTree.cs (1)
98Debug.Assert(segment.Parts.Count == 1);
UriBuildingContext.cs (2)
88for (var i = 0; i < buffer.Count; i++) 178if (_path.Length != 0 || _buffer.Count != 0)
ValidationEndpointFilterFactory.cs (1)
53if (validatableParameters is null || validatableParameters.Count == 0)
Microsoft.AspNetCore.Routing.Abstractions (4)
RouteData.cs (4)
143var count = _routers?.Count; 259for (var i = routers.Count - 1; i >= 0; i--) 277for (; i < snapshotRouters.Count && i < routers.Count; i++) 288for (i = routers.Count - 1; i >= snapshotRouters.Count; i--)
Microsoft.AspNetCore.Server.HttpSys (4)
RequestProcessing\RequestContext.FeatureCollection.cs (2)
683for (var i = actions.Count - 1; i >= 0; i--) 774for (var i = actions.Count - 1; i >= 0; i--)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.IIS (5)
Core\IISHttpContext.FeatureCollection.cs (3)
65for (var i = 0; i < MaybeExtra.Count; i++) 84for (var i = 0; i < MaybeExtra.Count; i++) 99for (var i = 0; i < MaybeExtra.Count; i++)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Core (39)
Internal\Http\Http1OutputProducer.cs (1)
542Debug.Assert(_completedSegments == null || _completedSegments.Count == 0);
Internal\Http\HttpProtocol.Generated.cs (3)
137for (var i = 0; i < MaybeExtra.Count; i++) 156for (var i = 0; i < MaybeExtra.Count; i++) 171for (var i = 0; i < MaybeExtra.Count; i++)
Internal\Http2\Http2FrameWriter.cs (1)
912var settingsSize = settings.Count * Http2FrameReader.SettingSize;
Internal\Infrastructure\KestrelEventSource.cs (2)
266for (var i = _options.Count - 1; i >= 0; i--) 363for (var i = _options.Count - 1; i >= 0; i--)
Internal\Infrastructure\KestrelMetrics.cs (1)
137for (var i = 0; i < customTags.Count; i++)
Internal\Infrastructure\TransportManager.cs (6)
37if (_transportFactories.Count == 0) 66if (_multiplexedTransportFactories.Count == 0) 126var tasks = new Task[transportsToStop.Count]; 128for (int i = 0; i < transportsToStop.Count; i++) 148for (int i = 0; i < transportsToStop.Count; i++) 155for (int i = 0; i < transportsToStop.Count; i++)
Internal\KestrelServerImpl.cs (9)
63if (_transportFactories.Count == 0 && _multiplexedTransportFactories.Count == 0) 176if (hasHttp3 && _multiplexedTransportFactories.Count == 0 && !(hasHttp1 || hasHttp2)) 183var addAltSvcHeader = !options.DisableAltSvcHeader && _multiplexedTransportFactories.Count > 0; 192if (_transportFactories.Count == 0) 206if (hasHttp3 && _multiplexedTransportFactories.Count > 0) 352if (endpointsToStop.Count > 0) 366var configsToStop = new List<EndpointConfig>(endpointsToStop.Count); 380if (endpointsToStart.Count > 0)
Internal\ServerAddressesCollection.cs (1)
33return _addresses.Count;
KestrelConfigurationLoader.cs (1)
404if (matchingBoundEndpoints.Count > 0)
KestrelServerOptions.cs (3)
79int resultCount = CodeBackedListenOptions.Count + ConfigurationBackedListenOptions.Count; 87ConfigurationBackedListenOptions.CopyTo(result, CodeBackedListenOptions.Count);
ListenOptions.cs (2)
197for (var i = _middleware.Count - 1; i >= 0; i--) 213for (int i = _multiplexedMiddleware.Count - 1; i >= 0; i--)
LocalhostListenOptions.cs (1)
70if (exceptions.Count == 2)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (2)
1035var certificatesDescription = list.Count switch 1039_ => $"{list.Count} certificates",
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
138if (nssDbs.Count > 0) 305if (nssDbs.Count > 0) 506if (nssDbs.Count > 0)
src\aspnetcore\src\Shared\Metrics\MetricsExtensions.cs (1)
39for (var i = 0; i < list.Count; i++)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (5)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
79for (var i = 0; i < MaybeExtra.Count; i++) 98for (var i = 0; i < MaybeExtra.Count; i++) 113for (var i = 0; i < MaybeExtra.Count; i++)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (11)
Internal\QuicConnectionListener.cs (2)
48if (tlsConnectionCallbackOptions.ApplicationProtocols.Count == 0) 112if (serverAuthenticationOptions.ApplicationProtocols == null || serverAuthenticationOptions.ApplicationProtocols.Count == 0)
QuicTransportFactory.cs (1)
48if (tlsConnectionOptions.ApplicationProtocols == null || tlsConnectionOptions.ApplicationProtocols.Count == 0)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
79for (var i = 0; i < MaybeExtra.Count; i++) 98for (var i = 0; i < MaybeExtra.Count; i++) 113for (var i = 0; i < MaybeExtra.Count; i++)
src\aspnetcore\src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (3)
66for (var i = 0; i < MaybeExtra.Count; i++) 85for (var i = 0; i < MaybeExtra.Count; i++) 100for (var i = 0; i < MaybeExtra.Count; i++)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (2)
120if (_blockAccessExceptions.Count > 0) 139if (_blockAccessExceptions.Count > 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (3)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
79for (var i = 0; i < MaybeExtra.Count; i++) 98for (var i = 0; i < MaybeExtra.Count; i++) 113for (var i = 0; i < MaybeExtra.Count; i++)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (1)
HubClientProxyGenerator.Emitter.cs (1)
140var registrations = new System.IDisposable[{typeSpec.Methods.Count}];");
Microsoft.AspNetCore.SignalR.Common (6)
src\aspnetcore\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.Core (3)
HubOptionsSetup.cs (1)
68options.SupportedProtocols = new List<string>(_defaultProtocols.Count);
Internal\DefaultHubDispatcher.cs (2)
52var count = hubFilters?.Count ?? 0; 395var serverStreamLength = descriptor.StreamingParameters?.Count ?? 0;
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (6)
src\aspnetcore\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\aspnetcore\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\aspnetcore\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\aspnetcore\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.StaticAssets (3)
_generated\9\StaticAssetsManifestJsonContext.ListStaticAssetDescriptor.g.cs (1)
57for (int i = 0; i < value.Count; i++)
Development\StaticAssetDevelopmentRuntimeHandler.cs (2)
108for (var i = 0; i < descriptors.Count; i++) 384if (propertiesList.Count < descriptor.Properties.Count)
Microsoft.AspNetCore.Watch.BrowserRefresh (1)
src\sdk\src\Dotnet.Watch\Web.Middleware\BlazorWasmHotReloadMiddleware.cs (1)
76if (Updates.Count == 0)
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.Build (196)
_generated\3\TasksDetailsJsonContext.ListTaskDetailInfo.g.cs (1)
57for (int i = 0; i < value.Count; i++)
BackEnd\BuildManager\BuildManager.cs (2)
1391if (submissionDetailParts.Count > 0) 1428if (nodeDetails.Count > 0)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (7)
253TraceEngine($"CFB: Cleaning up build. Requests Count {_requests.Count} Status {_status}"); 259var deactivateExceptions = new List<Exception>(_requests.Count); 266var requestsToWait = new List<BuildRequestEntry>(_requests.Count); 316if (deactivateExceptions.Count > 0) 623if (requestsToIssue.Count != 0) 831if (completedEntries.Count > 0) 1346Assumed.True((requestsToIssue == null) || (requestsToIssue.Count == 0), "Entry shouldn't be ready if we also issued requests.");
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (2)
322for (int i = 0; i < _requestsToIssue.Count; i++) 327if (_requestsToIssue.Count == 0)
BackEnd\Components\Caching\ResultsCache.cs (2)
187if (request.Targets.Count == 0) 203if (request.Targets.Count > 0)
BackEnd\Components\Communications\LogMessagePacket.cs (3)
202BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count); 234BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count); 273BinaryWriterExtensions.Write7BitEncodedInt(writer, list.Count);
BackEnd\Components\Communications\NodeManager.cs (3)
102if (nodes.Count < numberOfNodesToCreate && (nodeAffinity == NodeAffinity.Any || nodeAffinity == NodeAffinity.OutOfProc)) 104nodes.AddRange(AttemptCreateNode(_outOfProcNodeProvider!, configuration, numberOfNodesToCreate - nodes.Count)); 108if (nodes.Count > 0)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (6)
120bool[] shouldReuseNode = DetermineNodesForReuse(contextsToShutDown.Count, enableReuse); 122Task[] waitForExitTasks = waitForExit && contextsToShutDown.Count > 0 ? new Task[contextsToShutDown.Count] : null; 580CommunicationsUtilities.Trace($"Filtering {processes.Count} candidate processes by NodeMode {expectedNodeMode} for process name '{expectedProcessName}'"); 582List<Process> filtered = new(capacity: processes.Count); 623CommunicationsUtilities.Trace($"Filtered to {filtered.Count} processes matching NodeMode {expectedNodeMode}");
BackEnd\Components\Logging\LoggingService.cs (1)
1088if (_loggers.Count > 0)
BackEnd\Components\Logging\LoggingServiceLogMethods.cs (3)
435outputFilePaths: outputFilePaths.Count > 0 ? outputFilePaths : null, 440if (listOfLoggers.Count != 0) 449if (loggerDescriptions.Count > 0)
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
851if (projectCacheDescriptors.Count == 0) 884Task[] tasks = new Task[projectCacheDescriptors.Count];
BackEnd\Components\RequestBuilder\BatchingEngine.cs (5)
170if ((buckets == null) || (buckets.Count == 0)) 174var bucket = new ItemBucket(null, null, lookup, buckets.Count); 320buckets.EnsureCapacity(buckets.Count + items.Count); 344matchingBucket = new ItemBucket(itemNames, itemMetadataValues, lookup, buckets.Count); 367for (int i = 0; i < buckets.Count;)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (5)
88if (keepMetadataEvaluated.Count > 0) 97if (removeMetadataEvaluated.Count > 0) 106if (matchOnMetadataEvaluated.Count > 0) 223if (LogTaskInputs && !LoggingContext.LoggingService.OnlyLogCriticalEvents && itemsToAdd?.Count > 0) 273if (LogTaskInputs && !LoggingContext.LoggingService.OnlyLogCriticalEvents && itemsToRemove.Count > 0)
BackEnd\Components\RequestBuilder\Lookup.cs (3)
563totalAdds += adds.Count; 572totalRemoves += removes.Count; 905for (int i = 0; i < result.Count; i++)
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
765bool pushedTargets = (targetsToPush.Count > 0);
BackEnd\Components\RequestBuilder\TargetEntry.cs (2)
433int numberOfBuckets = buckets.Count; 651if (batchingBuckets.Count == 1)
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (14)
168if (targetOutputItemSpecs.Count == 0) 190if (itemVectorsReferencedOnlyInTargetOutputs.Count == 0) 205Assumed.Positive(itemVectorsReferencedInBothTargetInputsAndOutputs.Count, "The target must have inputs."); 229((itemVectorsReferencedOnlyInTargetOutputs?.Count > 0))) 273if (result == DependencyAnalysisResult.FullBuild && _dependencyAnalysisDetail.Count > 0) 548if (discreteTargetInputItemSpecs.Count > 0) 553if (inputs.Count == 0) 558if (outputs.Count == 0) 633if (upToDateInputItems.Count == outputItems.Count) 635for (int i = 0; i < upToDateInputItems.Count; i++) 713Assumed.LessThanOrEqual(numberOfInputItemVectorsWithAllChangedItems, itemVectorsReferencedInBothTargetInputsAndOutputs.Count, "The number of vectors containing all changed items cannot exceed the number of correlated vectors."); 716if (numberOfInputItemVectorsWithAllChangedItems == itemVectorsReferencedInBothTargetInputsAndOutputs.Count) 748if (inputs.Count == 0) 753if (outputs.Count == 0)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (3)
343if (buckets.Count > 1) 351for (int i = 0; i < buckets.Count; i++) 798if (undeclaredProjects?.Count > 0)
BackEnd\Components\Scheduler\Scheduler.cs (9)
782if (_schedulingData.UnscheduledRequestsCount > 0 || responses.Count == 0) 840Assumed.Positive(responses.Count, "We failed to request a node to be created."); 843TraceScheduler($"Requests scheduled: {nodesFreeToDoWorkPriorToScheduling - idleNodes.Count} Unassigned Requests: {_schedulingData.UnscheduledRequestsCount} Blocked Requests: {_schedulingData.BlockedRequestsCount} Unblockable Requests: {_schedulingData.ReadyRequestsCount} Free Nodes: {idleNodes.Count}/{_availableNodes.Count} Responses: {responses.Count}"); 1770TraceScheduler($"Received request {request.GlobalRequestId} (node request {request.NodeRequestId}) with parent {request.ParentGlobalRequestId} from node {nodeForResults} for project {_configCache![request.ConfigurationId].ProjectFullPath} with targets {(request.Targets.Count == 0 ? "default" : string.Join(";", request.Targets))}"); 2081request.Targets.Count == 0 2356if (firstTargetsSet.Count != secondTargetsList.Count) 2663for (int i = 0; i < childRequests.Count; i++) 2666WriteRecursiveSummary(loggingService, context, submissionId, childRequest, level + 1, useConfigurations, i == childRequests.Count - 1); 2795if (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)
82MSBuildEventSource.Log.SdkResolverLoadAllResolversStop(resolvers.Count); 304MSBuildEventSource.Log.SdkResolverLoadResolversStop(manifest.DisplayName ?? string.Empty, resolvers.Count);
BackEnd\Components\SdkResolution\SdkResolverService.cs (2)
196if (matchingResolversManifests.Count != 0) 251if (resolvers.Count == 1) // Check if only one resolver was used
BackEnd\Shared\BuildRequestConfiguration.cs (4)
811bool hasInitialTargets = request.Targets.Count == 0 ? false : true; 814_projectInitialTargets.Count + 815(hasInitialTargets ? _projectDefaultTargets.Count : request.Targets.Count));
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (1)
111if (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)
83for (int i = editorConfigFiles.Count - 1; i >= 0; i--)
Collections\ItemDictionary.cs (8)
83count += list.Count; 186if (itemTypeBucket.Value == null || itemTypeBucket.Value.Count == 0) 279for (int i = 0; i < list.Count; i++) 287if (list.Count == 0) 331int count = list.Count; 334for (int i = count; i < list.Count; i++) 361List<T> listWithRemoves = new(list.Count); 371if (listWithRemoves.Count > 0)
Collections\LookasideStringInterner.cs (1)
87index = _strings.Count; // This will be the index of the string we are about to add.
Collections\MultiDictionary.cs (3)
208return list.Count; 289for (int i = 0; i < list.Count; i++) 293if (list.Count == 2)
Collections\WeakValueDictionary.cs (1)
223return remove.Count;
Construction\ProjectElementContainer.cs (1)
810public int Count => RealizedElements.Count;
Construction\Solution\SolutionFile.cs (1)
906HashSet<string> projectPaths = new HashSet<string>(_projectsInOrder.Count, _pathComparer);
Construction\Solution\SolutionProjectGenerator.cs (1)
798var projectInstances = new List<ProjectInstance>(projectsInOrder.Count + 1);
Definition\Project.cs (3)
2291var imports = new List<ResolvedImport>(_data.ImportClosure.Count - 1 /* outer project */); 2314var imports = new List<ResolvedImport>(_data.ImportClosureWithDuplicates.Count - 1 /* outer project */); 3419if (items.Count != 1)
Definition\ProjectCollection.cs (1)
2149if (projectList.Count == 0)
Definition\ProjectItem.cs (2)
344for (int i = _inheritedItemDefinitions.Count - 1; i >= 0; i--) 1057int inheritedItemDefinitionsCount = (source._inheritedItemDefinitions == null) ? 0 : source._inheritedItemDefinitions.Count;
Definition\Toolset.cs (3)
465if (orderedSubToolsetList.Count > 0) 467return orderedSubToolsetList[orderedSubToolsetList.Count - 1]; 820int 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 (13)
715List<string> initialTargets = new List<string>(_initialTargetsList.Count); 838var targetElementsCount = _targetElements.Count; 839if (_data.DefaultTargets.Count == 0 && targetElementsCount > 0) 1048for (int i = 0; i < temp.Count; i++) 1053_data.DefaultTargets ??= new List<string>(temp.Count); 1653var pathsToSearch = new string[fallbackSearchPathMatch.SearchPaths.Count + 1]; 1749if (allProjects.Count == 0 && 1936if (projects?.Count > 0) 1949if (additionalProjects?.Count > 0) 2440if (imports?.Count > 0) 2796if (_itemGlobElements is null || _itemGlobElements.Count == 0) 2802if (globResults.Count == 0) 2818for (int i = globResults.Count - 1; i >= 0; i--)
Evaluation\Expander.ItemExpander.cs (7)
120for (int i = 0; i < captures.Count; i++) 209if (i < captures.Count - 1) 389if (entries == null || entries.Count == 0) 394result = new List<T>(entries.Count); 500ProjectErrorUtilities.VerifyThrowInvalidProject(captures.Count > 0, elementLocation, "InvalidFunctionPropertyExpression"); 605for (int i = 0; i < entries.Count; i++) 628if (i < entries.Count - 1)
Evaluation\Expander.ItemExpander.Transforms.cs (4)
87=> output.Add(new TransformEntry(input.Count.ToString(CultureInfo.InvariantCulture), item: null)); 325Dictionary<string, string> directoryNameTable = new Dictionary<string, string>(input.Count, StringComparer.OrdinalIgnoreCase); 485HashSet<string> seenItems = new HashSet<string>(input.Count, comparer); 508for (int i = input.Count - 1; i >= 0; i--)
Evaluation\GlobResultBuilder.cs (3)
118includeGlobFragmentsList ??= new List<ItemSpecFragment>(includeItemspec.Fragments.Count); 123if (includeGlobFragmentsList == null || includeGlobFragmentsList.Count == 0) 128string[] includeGlobStrings = new string[includeGlobFragmentsList.Count];
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)
305if (itemSpec.Fragments.Count != 1)
Graph\GraphBuilder.cs (4)
288if (Solution.SolutionParserWarnings.Count != 0 || Solution.SolutionParserErrorCodes.Count != 0) 377if (solutionDependenciesForProject.Count > 0) 658for (var i = projectsInCycle.Count - 1; i >= 0; i--)
Graph\ParallelWorkSet.cs (2)
61if (_exceptions.Count > 0) 155if (_exceptions.Count > 0)
Graph\ProjectGraph.cs (1)
616Assumed.Equal(toposort.Count, graphNodes.Count, "sorted node count must be equal to total node count");
Graph\ProjectInterpretation.cs (2)
515int outerCount = outerBuildTargets?.Count ?? 0; 516int innerCount = nonOuterBuildTargets?.Count ?? 0;
Instance\ImmutableProjectCollections\LazyStringValuedList.cs (3)
37public int Count => EnsureListInitialized().Count; 56ErrorUtilities.VerifyCollectionCopyToArguments(array, arrayIndex, items.Count); 66for (int i = 0; i < itemList.Count; ++i)
Instance\ProjectInstance.cs (6)
837_properties = new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 838_globalProperties = new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 840new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 842new PropertyDictionary<ProjectPropertyInstance>(filter.PropertyFilters.Count); 3059if (sp.SolutionParserComments.Count > 0) 3507inheritedItemDefinitions = new List<ProjectItemDefinitionInstance>(item.InheritedItemDefinitions.Count);
Instance\ProjectItemInstance.cs (1)
622if (metadataList.Count != 0 && items.Count != 0)
Logging\BaseConsoleLogger.cs (1)
460if (properties.Count == 0)
Logging\BinaryLogger\BinaryLogger.cs (2)
942if (allConfigurationsIdentical && distinctParameterSets.Count > 1) 944for (int i = 1; i < extractedFilePaths.Count; i++)
Logging\BinaryLogger\BuildEventArgsReader.cs (4)
487if (id >= 0 && id < nameValueListRecords.Count) 512$"NameValueList record number {_recordNumber} is invalid: index {id} is not within {nameValueListRecords.Count}."); 1773if (index >= 0 && index < this.stringRecords.Count) 1782$"String record number {_recordNumber} is invalid: string index {index} is not within {stringRecords.Count}.");
Logging\BinaryLogger\BuildEventArgsWriter.cs (6)
967count = reusableItemsList.Count; 1067if (reusableProjectItemList.Count > 0) 1214if (nameValueListBuffer.Count == 0) 1255Write(nameValueIndexListBuffer.Count); 1256for (int i = 0; i < nameValueListBuffer.Count; i++) 1280for (int i = 0; i < nameValueList.Count; i++)
Logging\ParallelLogger\ParallelConsoleLogger.cs (7)
366if (warningList.Count == 0 && errorList.Count == 0) 383if (warningList.Count > 0) 392if (errorList.Count > 0) 411if (warningList.Count == 0 && errorList.Count == 0) 762if (propertyList.Count == 0)
Logging\ParallelLogger\ParallelLoggerHelpers.cs (1)
153string[] stackTrace = new string[projectStackTrace.Count];
src\9f0d3f3da306d8cf\IEnumerableExtensions.cs (1)
337return source.Count == 0;
src\msbuild\src\Shared\PropertyParser.cs (2)
146if (finalPropertiesList.Count > 0) 151finalPropertiesList[finalPropertiesList.Count - 1].Value.Add(propertyValue);
src\msbuild\src\Shared\TaskHostBuildResponse.cs (2)
60result = new List<IDictionary<string, ITaskItem[]>>(_targetOutputsPerProject.Count); 130int count = _targetOutputsPerProject?.Count ?? 0;
TelemetryInfra\TasksDetailsTelemetry.cs (2)
51["TaskCount"] = topTasks.Count.ToString(CultureInfo.InvariantCulture), 52["TotalTaskCount"] = allTasks.Count.ToString(CultureInfo.InvariantCulture),
Microsoft.Build.Framework (18)
BinaryTranslator.cs (3)
1138int count = list.Count; 1177int count = list.Count; 1195int count = list.Count;
BuildEnvironmentHelper.cs (2)
335if (instances.Count == 0) 340if (instances.Count > 1)
InterningReadTranslator.cs (1)
78_pathIdsToString.EnsureCapacity(_strings.Count);
InterningWriteTranslator.cs (1)
110index = _strings.Count;
LoggersRegisteredEventArgs.cs (1)
78if (withPaths.Count == 0)
Sdk\SdkResolver.cs (1)
112return s_registeredResolvers.Count == 0
TaskParameterEventArgs.cs (2)
249writer.Write7BitEncodedInt(reusableMetadataList.Count); 250if (reusableMetadataList.Count == 0)
Telemetry\TelemetryDataUtils.cs (1)
399if (list.Count > 0)
Utilities\CollectionHelpers.cs (3)
24List<T> inputsWithoutNulls = new List<T>(inputs.Count); 35return (inputsWithoutNulls.Count == inputs.Count) ? inputs : inputsWithoutNulls;
Utilities\FileMatcher.cs (2)
921if (files?.Count > 0) 2574if (searchesToExclude?.Count == 0)
Utilities\TaskFactoryUtilities.cs (1)
115if (directories.Count == 0)
Microsoft.Build.NuGetSdkResolver (2)
RestoreRunnerEx.cs (2)
55var frameworks = new List<TargetFrameworkInformation>(TargetFrameworks.Count); 56var originalTargetFrameworks = new List<string>(TargetFrameworks.Count);
Microsoft.Build.Tasks.CodeAnalysis (4)
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (2)
230var items = new ITaskItem[commandLineArgs.Count]; 231for (var i = 0; i < commandLineArgs.Count; i++)
src\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs (2)
604if (links.Count > 0) 609if (references.Count > 0)
Microsoft.Build.Tasks.Core (84)
AssemblyDependency\AssemblyInformation.cs (1)
577if (arguments.Count == 1)
AssemblyDependency\AssemblyResolution.cs (2)
228var resolvers = new Resolver[parentReferenceDirectories.Count]; 229for (int i = 0; i < parentReferenceDirectories.Count; i++)
AssemblyDependency\Reference.cs (1)
797return !IsResolved && _errors.Count > 0;
AssemblyDependency\ReferenceTable.cs (8)
1331if (parentReferenceFolders.Count > 0 && (assemblyName == null || !_externallyResolvedPrimaryReferences.Contains(assemblyName.Name))) 1793if (newEntries.Count > 0) 1856while (comparisonIndex < assemblyReferences.Count) 1956var idealRemappingsList = new List<DependentAssembly>(assemblyNamesList.Count); 2247if (kvp.Value.Count == 1) 2751if (relatedFileExtensions.Count > 0 || satellites.Count > 0 || serializationAssemblyFiles.Count > 0 || scatterFiles.Length > 0 || hasValidWinMDImplementationFile)
AssemblyDependency\ResolveAssemblyReference.cs (10)
1282bool logWarning = idealAssemblyRemappingsIdentities.Any(i => i.assemblyName.FullName.Equals(fusionName) && i.reference.GetConflictVictims().Count == 0); 1336for (int i = 0; i < idealAssemblyRemappings.Count; i++) 1344for (int j = 0; j < idealRemapping.BindingRedirects.Count; j++) 1407if (idealAssemblyRemappings.Count > 0 && foundAtLeastOneValidBindingRedirect) 1602bool hadProblems = reference.GetErrors().Count > 0; 2477for (int i = 0; i < inclusionListErrors.Count; ++i) 2668bool shouldRerunClosure = autoUnifiedRemappedAssemblies?.Count > 0 || excludedReferencesExist; 3187for (int i = 0; i < idealAssemblyRemappings.Count; i++) 3196if (conflictVictims == null || 0 == conflictVictims.Count) 3201for (int j = 0; j < idealRemapping.BindingRedirects.Count; j++)
BootstrapperUtil\BootstrapperBuilder.cs (9)
244string[] componentFiles = new string[componentFilesCopied.Count]; 317if (productDependency.Count == 1) 339if (missingDependecies.Count == 1) 685if (foundDependencies.Count > 0) 692else if (allDependencies.Count > 0) 747if (p.Dependencies.Count == 0) 768if (buildQueue.Count > 0 && productsToRemove.Count == 0) 778if (productsInLoop.Length > 0 && (buildQueue.Count == 0 || productsToRemove.Count == 0)) 795p.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)
43internal int Count => _list.Count;
BootstrapperUtil\ProductCollection.cs (1)
65public int Count => _list.Count;
BootstrapperUtil\xmlvalidationresults.cs (2)
57public bool ValidationPassed => _validationErrors.Count == 0 && _validationWarnings.Count == 0;
Copy.cs (1)
675for (int partitionIndex = 0; partitionIndex < partition.Count && !_cancellationTokenSource.IsCancellationRequested; partitionIndex++)
GenerateResource.cs (15)
585for (int i = 0; i < inputFiles.Count; ++i) 725if (inputsToProcess.Count == 0) 729if (cachedOutputFiles.Count > 0) 744int maxCount = Math.Min(inputsToProcess.Count, outputsToProcess.Count); 873if (cachedOutputFiles.Count > 0) 875OutputResources = new ITaskItem[outputResources.Length + cachedOutputFiles.Count]; 886for (int i = 0; i < portableLibraryCacheInfo.Count; i++) 1757if (inputsToProcess.Count == 0) 2513for (int i = 0; i < _inFiles.Count; ++i) 2795Assumed.Equal(_readers.Count, 1, $"We have no readers, or we have multiple readers & are ignoring subsequent ones. Num readers: {_readers.Count}"); 2803Assumed.Equal(_readers.Count, 1, $"We have no readers, or we have multiple readers & are ignoring subsequent ones. Num readers: {_readers.Count}"); 3116_logger.LogMessageFromResources(MessageImportance.Low, "GenerateResource.ReadResourceMessage", reader.resources.Count, filename);
ManifestUtil\AssemblyReferenceCollection.cs (1)
69public int Count => _list.Count;
ManifestUtil\CompatibleFrameworkCollection.cs (1)
37public int Count => _list.Count;
ManifestUtil\DeployManifest.cs (1)
643get => _compatibleFrameworks.Count > 0 ? _compatibleFrameworks.ToArray() : null;
ManifestUtil\FileAssociationCollection.cs (1)
37public int Count => _list.Count;
ManifestUtil\FileReferenceCollection.cs (1)
69public int Count => _list.Count;
MSBuild.cs (7)
372if (projectsToBuildInParallel.Count > 0) 482var projectDirectory = new string[projects.Count]; 483var projectNames = new string[projects.Count]; 484var toolsVersions = new string[projects.Count]; 485var projectProperties = new Dictionary<string, string>[projects.Count]; 486var undefinePropertiesPerProject = new IList<string>[projects.Count]; 605for (int i = 0; i < projects.Count; i++)
RedistList.cs (3)
118for (int i = 0; i < assemblyList.Count; ++i) 600int errorsBeforeReadCall = allowListErrors.Count; 621if (allowListErrors.Count == errorsBeforeReadCall)
ResolveManifestFiles.cs (1)
693for (int i = 0; i < manifestEntryPointList.Count; i++)
ResolveProjectBase.cs (1)
196_projectReferences = new ITaskItem[updatedProjectReferenceList.Count];
ResolveSDKReference.cs (6)
422if (listOfIncompatibleReferences.Count > 0) 451if (listOfIncompatibleReferences.Count > 0) 504if (dependentSDKs.Count > 0) 617else if (reference.ResolutionErrors == null || reference.ResolutionErrors.Count == 0) 932if (!treatErrorsAsWarnings && ResolutionErrors.Count > 0) 1414if (appxLocationComponents.Count > 0)
src\msbuild\src\Shared\PropertyParser.cs (2)
146if (finalPropertiesList.Count > 0) 151finalPropertiesList[finalPropertiesList.Count - 1].Value.Add(propertyValue);
WriteCodeFragment.cs (4)
242if (index > orderedParameters.Count || index < 1) 259for (int i = 0; i < orderedParameters.Count; i++) 512if (candidates.Count == 1) 516else if (candidates.Count > 1)
XmlPeek.cs (1)
162Result = new ITaskItem[peekValues.Count];
Microsoft.Build.Tasks.Git (4)
GitDataReader\GitIgnore.Matcher.cs (1)
199for (var i = groups.Count - 1; i >= 0; i--)
GitDataReader\GitRefTableReader.Diagnostics.cs (3)
25=> $"Type: '{Type}', Position: {Position}, UnalignedSize: {UnalignedSize}, Records: {RefRecords.Count + IndexRecords.Count}, RestartOffsets: {RestartOffsets.Count}";
Microsoft.Build.Utilities.Core (3)
ToolLocationHelper.cs (3)
1393if (availablePlatformVersions?.Count > 0) 2950if (sdkDiskRoots.Count == 0) 2977if (sdkDiskRoots.Count == 0 && diskRoots?.Length > 0)
Microsoft.CodeAnalysis (104)
CommandLine\AnalyzerConfigSet.cs (9)
75if (x.Count != y.Count) 80for (int i = 0; i < x.Count; i++) 200int globalConfigOptionsCount = sectionKey.Count; 214sectionKey.RemoveRange(globalConfigOptionsCount, sectionKey.Count - globalConfigOptionsCount); 252if (sectionKey.Count > 0 && configSection == sectionKey[sectionKeyIndex]) 262if (sectionKeyIndex == sectionKey.Count) 270analyzerConfigIndex < _analyzerConfigs.Length && sectionKeyIndex < sectionKey.Count; 287if (sectionKeyIndex == sectionKey.Count)
CommandLine\CommonCompiler.cs (2)
1168var analyzerOptionsBuilder = hasAnalyzerConfigs ? ArrayBuilder<AnalyzerConfigOptionsResult>.GetInstance(generatedSyntaxTrees.Count) : null; 1169var 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)
171return results.Count == 0 ? null : results[0]; 259return results.Count == 0 ? null : results[0]; 745return results.Count > 0; 759return results.Count > 0; 847if (results.Count == 0) 899if (results.Count == 0) 926if (contexts.Count == 0) 970for (int i = 0; i < results.Count; i++) 1064arity = typeArguments.Count; 1076if (arity != 0 && typeArguments != null && typeArguments.Count != 0) 1079for (int i = 0; i < results.Count; i++) 1186for (int i = 0, n = containers.Count; i < n; i++) 1226for (int i = 0, n = containers.Count; i < n; i++) 1268for (int i = 0, n = containers.Count; i < n; i++) 1295for (int i = 0, n = containers.Count; i < n; i++) 1362for (int i = 0, n = containers.Count; i < n; i++) 1414for (int i = 0, n = containers.Count; i < n; i++) 1430for (int i = 0, n = containers.Count; i < n; i++) 1446if (symbolParameters.Length != expectedParameters.Count) 1451for (int i = 0; i < expectedParameters.Count; i++) 1634if (destination.Count + source.Count > destination.Capacity) 1636destination.Capacity = destination.Count + source.Count; 1639for (int i = 0, n = source.Count; i < n; i++)
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
1000if (_deferredCustomAttributes.Count == 0)
MetadataReader\MetadataHelpers.cs (6)
874Debug.Assert(typesInLastChildNamespace.Count != 0); 892Debug.Assert(typesInLastChildNamespace.Count != 0); 909var names = new Dictionary<string, int>(nestedNamespaces.Count, nameComparer); 911for (int i = nestedNamespaces.Count - 1; i >= 0; i--) 916if (names.Count != nestedNamespaces.Count) // nothing to merge otherwise 918for (int i = 1; i < nestedNamespaces.Count; i++)
MetadataReader\PEModule.cs (6)
1698if (attrInfos is null || attrInfos.Count == 0) 1703var result = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1738if (attrInfos is null || attrInfos.Count == 0) 1743var whenTrue = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1744var whenFalse = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1783var result = ArrayBuilder<string>.GetInstance(attrInfos.Count);
PEWriter\MetadataWriter.cs (7)
567index = (ushort)result.Count; 685_fileRefIndex.Add(key, _fileRefList.Count); 848_fileRefIndex.Add(key, index = _fileRefList.Count); 2452metadata.SetCapacity(TableIndex.File, _fileRefList.Count); 2617if (methodImplList.Count == 0) 2629metadata.SetCapacity(TableIndex.MethodImpl, methodImplList.Count); 4284int index = _firstRowId + _rows.Count;
PEWriter\MetadataWriter.DynamicAnalysis.cs (3)
210documentRowId = _documentTable.Count + 1; 333writer.WriteInt32(_documentTable.Count); 334writer.WriteInt32(_methodTable.Count);
PEWriter\NativeResourceWriter.cs (5)
247uint n = (uint)directory.Entries.Count; 266k += 16 + 8 * (uint)subDir.Entries.Count; 332k += 16 + 8 * (uint)subDir.Entries.Count; 340uint n = (uint)directory.Entries.Count; 347size += 16 + 8 * (uint)subDir.Entries.Count;
ReferenceManager\CommonReferenceManager.Binding.cs (2)
823Debug.Assert(candidateReferenceBinding.Length == candidateReferencedSymbols.Count); 824int referencesCount = candidateReferencedSymbols.Count;
ReferenceManager\CommonReferenceManager.State.cs (1)
523for (int i = 1; i < assemblyReference.Value.Count; i++)
RuleSet\RuleSetProcessor.cs (1)
82Debug.Assert(nodeList.Count == 1, "Multiple top-level nodes!");
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
Syntax\GreenNode.cs (2)
931switch (list.Count) 943var array = new ArrayElement<GreenNode>[list.Count];
Syntax\SeparatedSyntaxList.cs (3)
430if (nodesToInsertWithSeparators.Count > 0 || (insertionIndex > 0 && nodesWithSeps[insertionIndex - 1].IsNode)) 546if (newNodeList.Count == 0) 553if (newNodeList.Count > 1)
Syntax\SyntaxDiffer.cs (7)
575if (_changes.Count > 0) 577var last = _changes[_changes.Count - 1]; 581_changes[_changes.Count - 1] = new ChangeRecord( 596if (_changes.Count > 0) 598var last = _changes[_changes.Count - 1]; 604_changes[_changes.Count - 1] = new ChangeRecord( 741var textChanges = new List<ChangeRangeWithText>(changeRecords.Count);
Syntax\SyntaxList`1.cs (2)
270if (list.Count == 0) 346if (items.Count == 0)
Syntax\SyntaxNodeOrTokenList.cs (1)
348if (items.Count == 0)
Syntax\SyntaxTokenList.cs (2)
362if (items.Count == 0) 370if (list.Count == 0)
Text\SourceText.cs (1)
923var textChanges = new List<TextChange>(ranges.Count);
TreeDumper.cs (3)
94for (int i = 0; i < children.Count; ++i) 99_sb.Append(i == children.Count - 1 ? '\u2514' : '\u251C'); 104DoDumpCompact(child, indent + (i == children.Count - 1 ? " " : "\u2502 "));
Microsoft.CodeAnalysis.Analyzers (53)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (2)
187return invalidFileDiagnostics.Count == 0; 403if (invalidReleaseTrackingDiagnostics?.Count > 0)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (4)
233if (conditionalAccessMembers.Count == 0) 237else if (conditionalAccessMembers.Count == 1) 243var currentExpression = conditionalAccessMembers.Count > 2 247for (var i = 2; i < conditionalAccessMembers.Count - 1; i++)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (1)
132using var _1 = ArrayBuilder<TextChange>.GetInstance(fixInfos.Count, out var textChanges);
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
86for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 99if (result == 0 && usedFieldsAndValues.Count > 0) 103for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 154for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\roslyn\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++)
Microsoft.CodeAnalysis.AnalyzerUtilities (39)
src\2e2796bccd1466f6\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (1)
198if (taintedValues.Count == 1)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\Extensions\ListExtensions.cs (2)
27for (int i = 0; i < list.Count; i++) 46list.RemoveRange(list.Count - builder.Count, builder.Count);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
431Debug.Assert(_pendingArgumentsToPostProcess.Count == 0);
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\roslyn\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 (34)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\roslyn\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\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
145.Where(nameAttributes => nameAttributes.Count == 1) 158if (paramNameAttributesForNode.Count != 1)
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
95if (paramNodeIndex + 1 < paramNodeSiblings.Count)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
159for (var i = removalList.Count - 1; i >= 0; i--)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
84for (var i = classTypes.Count - 1; i >= 0; i--) 89for (var j = 0; j < classTypes.Count; j++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
86for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 99if (result == 0 && usedFieldsAndValues.Count > 0) 103for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 154for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\roslyn\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++)
Microsoft.CodeAnalysis.CSharp (21)
CommandLine\CSharpCommandLineParser.cs (6)
184if (sourceFiles.Count > 0) 683int before = sourceFiles.Count; 685if (sourceFiles.Count > before) 1493if (embeddedFiles.Count > 0 && !emitPdb) 1581InteractiveMode = interactiveMode || IsScriptCommandLineParser && sourceFiles.Count == 0, 1999commandLineReferences.RemoveRange(commandLineReferences.Count - pathCount, pathCount);
CommandLine\CSharpCompiler.cs (1)
196Debug.Assert(fileDiagnostics.Count == 0);
Declarations\DeclarationTable.Builder.cs (6)
70if (_addedLazyRootDeclarations.Count == 0) 75var lastDeclaration = _addedLazyRootDeclarations[_addedLazyRootDeclarations.Count - 1]; 76if (_addedLazyRootDeclarations.Count == 1) 93_addedLazyRootDeclarations.RemoveAt(_addedLazyRootDeclarations.Count - 1); 110if (_removedLazyRootDeclarations.Count == 0) 115if (_removedLazyRootDeclarations.Count == 1)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (5)
298for (int cnt = proxiedLabels.Count; i <= cnt; i++) 348for (int cnt = proxiedLabels.Count; i <= cnt; i++) 541var handlers = ArrayBuilder<SyntheticBoundNodeFactory.SyntheticSwitchSection>.GetInstance(handlersList.Count); 542for (int i = 0, l = handlersList.Count; i < l; i++) 631_F.Literal(currentAwaitCatchFrame.handlers.Count + 1));
Symbols\ReferenceManager.cs (3)
132for (int i = 0; i < referencedAssemblySymbols.Count; i++) 472if (newSymbols.Count > 0) 543Debug.Assert(newSymbols.Count > 0);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
886finalTrivia.RemoveAt(finalTrivia.Count - 1);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
105var insertionIndex = finalLeadingTrivia.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
31return attributeNodes.Count == 0
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
227if (members.Count > 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
30if (members.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
327if (types.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
180for (var i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.CSharp.Features (18)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
356Debug.Assert(annotatedNodesOrTokens.Count == 1, "Only a single variable declarator should have been annotated.");
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
50return result.Count == 0 ? null : result;
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (4)
75if (triviaList.Count > 0) 85if (list.Count == 0) 88if (triviaList.Count == 0) 103if (list.Count == node.Declaration.Variables.Count)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
133Contract.ThrowIfFalse(keyValuePair.Value.Count > 0);
Formatting\CSharpNamespaceDeclarationNewDocumentFormattingProvider.cs (1)
38if (namespaces.Count != 1)
GenerateType\CSharpGenerateTypeService.cs (5)
592if (namespaceContainers.Count + indexDone > containers.Count || 598indexDone += namespaceContainers.Count; 599if (indexDone == containers.Count) 607for (var i = 0; i < namespaceContainers.Count; ++i)
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
104if (spans.Count > 0)
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
141constructor.Parameters is [.., { IsParams: true }] && namedParameters.Count == 0;
src\roslyn\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.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Performance\CSharpUseSearchValues.Fixer.cs (1)
118values.Count <= 128 && // Arbitrary limit to avoid emitting huge literals
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
763var baseTypeList = itypes?.Count > 0 ? SyntaxFactory.BaseList([.. itypes]) : null; 779if (itypes?.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
886finalTrivia.RemoveAt(finalTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
31return attributeNodes.Count == 0
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
227if (members.Count > 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
30if (members.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
327if (types.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
180for (var i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.Extensions.Package (2)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
Microsoft.CodeAnalysis.Features (51)
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (1)
54if (otherProjects.Count > projectsToShow)
BraceMatching\AbstractBraceMatcher.cs (1)
38if (braceTokens.Count == 2 &&
ChangeSignature\ParameterConfiguration.cs (2)
32if (parametersList.Count > 0 && isExtensionMethod) 43parametersList.RemoveAt(parametersList.Count - 1);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
132if (attributeRemoveFixes.Count > 0)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
476if (refLocationsInSolution.Length != refLocationsInOtherDocuments.Count)
Completion\CompletionService_GetCompletions.cs (1)
433for (var i = 0; i < sameNamedItems.Count; i++)
Completion\Providers\SymbolCompletionItem.cs (2)
150if (idList.Count > 0) 172for (var i = 0; i < ids.Count;)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (4)
131if (_listStack.Count == 0) 150if (_listStack.Count == 0) 160_listStack.RemoveAt(_listStack.Count - 1); 236for (var i = 0; i < _listStack.Count; i++)
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (3)
173Debug.Assert(lines.Count >= 1); 240for (var i = 1; i < lines.Count; i++) 330Debug.Assert(lines.Count >= 1);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (15)
1561if (oldAncestors.Count > 0 || newAncestors.Count > 0) 1569Debug.Assert(oldAncestors.Count == newAncestors.Count); 1768if (exceptionHandlingAncestors.Count == 0) 1776for (var i = exceptionHandlingAncestors.Count - 1; i >= 0; i--) 2033if (areSimilar != null && matchCount < Math.Min(oldNodes.Count, newNodes.Count)) 2043if (matchCount < newNodes.Count) 2051var oldNodeCount = (oldNodes != null) ? oldNodes.Count : 0; 2053for (var i = 0; i < newNodes.Count; i++) 2089for (var newIndex = 0; newIndex < newNodes.Count; newIndex++) 2098while (oldIndex < oldNodes.Count) 2111if (oldIndex == oldNodes.Count) 2175for (var i = startIndex; i < oldNodes.Count; i++)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (2)
87if (embeddedContext.Items.Count == 0) 134if (context.Items.Count > 0)
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (3)
83LeadingTrivia = CreateTriviaListFromTo(list, index + 1, list.Count - 1) 89for (var i = 0; i < list.Count; i++) 97return list.Count - 1;
ExtractMethod\MethodExtractor.Analyzer.cs (2)
82if (failedVariables.Count > 0) 90Contract.ThrowIfFalse(unused.Count == 0);
GenerateType\AbstractGenerateTypeService.cs (2)
189var arity = arguments.Count; 198var argument = i < arguments.Count ? arguments[i] : null;
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
89if (listOfParametersOrdinals.Count < 2)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
856if (partsList.Count > 0)
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
99var isEmpty = filteredList.Count == 0;
SignatureHelp\SignatureHelpItems.cs (1)
78if (selectedItem.HasValue && items.Count != distinctItems.Count)
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
134var nodeWithTrivia = node.ReplaceTokens(allTokens.Skip(1).Take(allTokens.Count - 2),
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
145.Where(nameAttributes => nameAttributes.Count == 1) 158if (paramNameAttributesForNode.Count != 1)
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
95if (paramNodeIndex + 1 < paramNodeSiblings.Count)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
159for (var i = removalList.Count - 1; i >= 0; i--)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
84for (var i = classTypes.Count - 1; i >= 0; i--) 89for (var j = 0; j < classTypes.Count; j++)
Microsoft.CodeAnalysis.NetAnalyzers (13)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\DoNotPassDisposablesIntoUnawaitedTasks.cs (1)
138if (descendants.OfType<IUsingOperation>().ToList() is { Count: > 0 } usingBlocks)
Microsoft.NetCore.Analyzers\Performance\UseConcreteTypeAnalyzer.Collector.cs (2)
487var oldCount = values.Count; 490if (values.Count > oldCount)
Microsoft.NetCore.Analyzers\Runtime\LoggerMessageDefineAnalyzer.cs (1)
239if (!argsPassedDirectly && paramsCount != formatter.ValueNames.Count)
Microsoft.NetCore.Analyzers\Runtime\LogValuesFormatter.cs (4)
47sb.Append(ValueNames.Count.ToString(CultureInfo.InvariantCulture)); 150if (index < 0 || index > ValueNames.Count) 157if (ValueNames.Count > index) 168for (var index = 0; index != ValueNames.Count; ++index)
src\40daf5e1cab76dff\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (1)
196if (taintedValues.Count == 1)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
33for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\Extensions\ListExtensions.cs (2)
26for (int i = 0; i < list.Count; i++) 45list.RemoveRange(list.Count - builder.Count, builder.Count);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
428Debug.Assert(_pendingArgumentsToPostProcess.Count == 0);
Microsoft.CodeAnalysis.Razor.Compiler (59)
CSharp\DefaultUtf8WriteLiteralFeature.cs (2)
127if (unresolvedEntries is { Count: > 0 } && compilation is CSharpCompilation csharpCompilation) 160for (var i = 0; i < entries.Count; i++)
Language\Components\ComponentGenericTypePass.cs (1)
308if (missing.Count > 0)
Language\Components\ComponentLoweringPass.cs (2)
170if (nonGenericCandidates.Count == 1 && genericCandidates.Count >= 1)
Language\Components\ComponentMarkupBlockPass.cs (7)
48while (trees.Count > 0) 51var reference = trees[trees.Count - 1]; 54trees.RemoveAt(trees.Count - 1); 75if (trees.Count == 0 || !ReferenceEquals(trees[trees.Count - 1].Node, candidate)) 85trees.RemoveAt(trees.Count - 1); 272for (var i = 0; i < _trees.Count; i++)
Language\Components\ComponentNodeWriter.cs (15)
134if (parameters.Count > 0) 139for (var i = 0; i < parameters.Count; i++) 150if (i < parameters.Count - 1) 434p.Add(new TypeInferenceMethodParameter(new(p.Count), typeName, new(p.Count), usedForTypeInference: true, attribute)); 439p.Add(new TypeInferenceMethodParameter(new(p.Count), typeName, new(p.Count), usedForTypeInference: false, splat)); 444p.Add(new TypeInferenceMethodParameter(new(p.Count), typeName, new(p.Count), usedForTypeInference: false, renderMode)); 455p.Add(new TypeInferenceMethodParameter(new(p.Count), typeName, new(p.Count), usedForTypeInference: false, childContent)); 460p.Add(new TypeInferenceMethodParameter(new(p.Count), "object", new(p.Count), usedForTypeInference: false, capture)); 466p.Add(new TypeInferenceMethodParameter(new(p.Count), capture.TypeName, new(p.Count), usedForTypeInference: false, capture));
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (4)
95for (var j = importedUsings.Count - 1; j >= 0; j--) 425for (var i = 0; i < addTagHelperChunkGenerator.Diagnostics.Count; i++) 464for (var i = 0; i < removeTagHelperChunkGenerator.Diagnostics.Count; i++) 503for (var i = 0; i < tagHelperPrefixChunkGenerator.Diagnostics.Count; i++)
Language\DefaultRazorTagHelperContextDiscoveryPhase.cs (3)
111=> _directiveContributions is { Count: > 0 } 554if (_namespaceToComponentsMap.Count == 0 && _componentsWithoutNamespace is null or { Count: 0 }) 563if (_componentsWithoutNamespace is { Count: > 0 } componentsWithoutNamespace)
Language\DocumentClassifierPassBase.cs (1)
90for (var i = 0; i < children.Count; i++)
Language\Intermediate\DefaultRazorIntermediateNodeBuilder.cs (1)
86if (_depth >= _stack.Count)
Language\Legacy\AddTagHelperChunkGenerator.cs (1)
77if (Diagnostics.Count > 0)
Language\Legacy\RemoveTagHelperChunkGenerator.cs (1)
77if (Diagnostics.Count > 0)
Language\Legacy\RoslynCSharpTokenizer.cs (5)
99Debug.Assert(_resultCache.Count > 0); 104_resultCache.RemoveAt(_resultCache.Count - 1); 735if (_resultCache.Count > 0 && _resultCache[^1].position == nextResult.Token.FullSpan.Start) 759Debug.Assert(_resultCache.Count > 0); 764for (var i = _resultCache.Count - 1; i >= 0; i--)
Language\Legacy\TagHelperPrefixDirectiveChunkGenerator.cs (1)
58if (Diagnostics.Count > 0)
Language\Legacy\Tokenizer.cs (4)
195Debug.Assert(CurrentErrors.Count == 0); 220var errors = CurrentErrors.Count == 0 ? Array.Empty<RazorDiagnostic>() : new RazorDiagnostic[CurrentErrors.Count]; 221for (var i = 0; i < CurrentErrors.Count; i++)
Language\RazorSyntaxTree.cs (1)
60if (rootDiagnostics.Count > 0)
Language\TagHelperCollection.Builder.cs (2)
42public int Count => _items.Count; 121if (_items.Count == 0)
Language\TagHelperObjectBuilderCollection`2.cs (5)
24=> _builders?.Count ?? 0; 60if (_builders is not { Count: > 0 } builders) 64else if (builders.Count == 1) 69using var result = new PooledArrayBuilder<TObject>(capacity: builders.Count); 70using var set = new PooledHashSet<TObject>(capacity: builders.Count);
Language\VirtualRazorProjectFileSystem.cs (1)
166for (var i = 0; i < parentDirectory.Directories.Count; i++)
Mvc.Version2_X\InstrumentationPass.cs (1)
25for (var i = 0; i < walker.Items.Count; i++)
Mvc\PageDirective.cs (1)
68if (tokens.Count > 0)
Microsoft.CodeAnalysis.ResxSourceGenerator (35)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (3)
311for (var i = this.chunks.Count; i <= nextIndex; i++) 341for (var i = trimIndex; i < chunks.Count; i++) 344chunks.RemoveRange(trimIndex, chunks.Count - trimIndex);
Microsoft.CodeAnalysis.Scripting (2)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (1)
296for (int i = 0; i < members.Count; i++)
Hosting\SynchronizedList.cs (1)
42return _list.Count;
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\VisualBasicCommandLineArguments.vb (1)
74If Me.DefaultCoreLibraryReference IsNot Nothing AndAlso resolved.Count > 0 Then
Microsoft.CodeAnalysis.Workspaces (73)
CodeCleanup\AbstractCodeCleanerService.cs (1)
433if (annotations.Count != 1)
Differencing\Match.cs (2)
168var count1 = s1.Count; 169var count2 = s2.Count;
Editing\SymbolEditor.cs (2)
156if (symbols.Count == 1) 160else if (symbols.Count > 1)
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (1)
741if (baseTypeNameParts.Count > 0 &&
FindSymbols\SymbolTree\SymbolTreeInfo.cs (1)
444for (var i = 0; i < orderedKeys1.Count; i++)
Log\StatisticResult.cs (4)
16if (values.Count == 0) 25for (var i = 0; i < values.Count; i++) 34var mean = (double)total / values.Count; 39return new StatisticResult(max, min, mean, range, mode, values.Count);
Rename\ConflictEngine\ConflictingIdentifierTracker.cs (1)
81if (currentIdentifiers.Count == 0)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
227for (var i = 0; i < conflictResolution.RelatedLocations.Count; i++)
Shared\Extensions\INamespaceSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 54return names1.Count - names2.Count;
Shared\TestHooks\AsynchronousOperationListener.cs (1)
140while (i < _diagnosticTokenList.Count)
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (1)
145if (tasks.Count == 0)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
86for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 99if (result == 0 && usedFieldsAndValues.Count > 0) 103for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 154for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\roslyn\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++)
Workspace\ProjectSystem\ProjectSystemProject.cs (7)
560var hasAnalyzerChanges = _analyzersAddedInBatch.Count > 0 || _analyzersRemovedInBatch.Count > 0; 687if (metadataReferencesAddedInBatch.Count > 0) 745if (analyzersRemovedInBatch.Count == 0 && analyzersAddedInBatch.Count == 0) 765Contract.ThrowIfTrue(analyzersRemoved.Count == 0 && analyzersAdded.Count == 0, "Should only be called when there is work to do");
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
529else if (distinctProjectsForOutputPath.Count == 1)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
30if (referencedProjectIds.Count == 0)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
171var addDiscriminator = idsAndFileInfos.Count > 1;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
MSBuild\Logging\DiagnosticLog.cs (2)
18public int Count => _items.Count; 20public bool IsEmpty => _items.Count == 0;
MSBuild\ProjectFile\ProjectFile.cs (1)
162if (items.Count == 1)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
901var partCount = resolvedParts.Count;
Microsoft.CSharp (49)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (1)
369Debug.Assert(argNames.Count <= argCount - discard);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComInvokeBinder.cs (1)
182return vars.Count > 0 ? Expression.Block(vars, expression) : expression;
Microsoft\CSharp\RuntimeBinder\ComInterop\VarEnumSelector.cs (4)
173if (compatibleComTypes.Count <= 1) 179for (int i = 0; i < compatibleComTypes.Count; i++) 182if (i == (compatibleComTypes.Count - 1)) 284if (compatibleComTypes.Count == 1)
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (1)
913Debug.Assert(expressions.Count == arrinit.DimensionSizes[0]);
Microsoft\CSharp\RuntimeBinder\Semantics\Binding\Better.cs (3)
494Debug.Assert(list.Count != 0); 517for (int i = 1; i < list.Count; i++) 540if (i < list.Count)
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (15)
839iuciBestSrc = prguci.Count - 1; 846iuciBestSrc = prguci.Count - 1; 850Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count - 1); 855iuciBestSrc = prguci.Count - 1; 866iuciBestDst = prguci.Count - 1; 873iuciBestDst = prguci.Count - 1; 877Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count - 1); 882iuciBestDst = prguci.Count - 1; 897Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 898Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 905for (int iuci = 0; iuci < prguci.Count; iuci++) 1085Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 1086Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 1531return list == null || list.Count == 0; 1539T[] array = new T[list.Count];
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (4)
304for (int i = 0; i < src.prgexpr.Count; i++) 318if (_methList.Count == 1) 470if (i < pArguments.prgexpr.Count) 1011if (_pArguments.prgexpr == null || _pArguments.prgexpr.Count == 0)
Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs (1)
113if (paramNames[i] != named.Name || i == paramNames.Count - 1 && i != args.carg - 1)
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (1)
1601if (_pExactBounds[iParam].Count >= 2)
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (14)
413if (binopSignatures.Count == 1) 421for (index = 1; index < binopSignatures.Count; index++) 449for (index = 0; index < binopSignatures.Count; index++) 541Debug.Assert(binopSignatures.Count > 0); 542bestBinopSignature = binopSignatures.Count - 1; 544else if (binopSignatures.Count == 0) 567Debug.Assert(bestBinopSignature < binopSignatures.Count); 1213int nBestSignature = pSignatures.Count - 1; 1229if (pSignatures.Count == 0) 1236if (pSignatures.Count != 1) 1239for (int iuofs = 1; iuofs < pSignatures.Count; iuofs++) 1265for (int iuofs = 0; iuofs < pSignatures.Count; iuofs++) 1280nBestSignature = pSignatures.Count - 1; 1284Debug.Assert(nBestSignature < pSignatures.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (1)
48if (iv >= prgptvs.Count)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (3)
159for (int i = inheritance.Count - 1; i >= 0; --i) 601for (int i = 0; i < declarationChain.Count; i++) 641Debug.Assert(i + 1 < declarationChain.Count);
Microsoft.Data.Analysis (43)
DataFrame.cs (6)
771if (idColumnList.Count == 0) 776if (valueColumns != null && valueColumnList.Count == 0) 786if (valueColumns == null && valueColumnList.Count == 0) 840return _rowCollection.Count * valueColumnList.Count; 864var outputCols = new List<DataFrameColumn>(idColumnList.Count); 906int idColumnCount = idColumnList.Count;
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.Diagnostics.DataContractReader (5)
ContractDescriptorTarget.cs (5)
186int initialDescriptorCount = _descriptors.Count; 190loopDescriptorCount = _descriptors.Count; 192for (int i = _pendingSubDescriptors.Count - 1; i >= 0; i--) 204} while (_descriptors.Count > loopDescriptorCount); 206if (_descriptors.Count == initialDescriptorCount && !forceBuild)
Microsoft.Diagnostics.DataContractReader.Contracts (12)
Contracts\CallingConvention\CallingConvention_1.cs (1)
727public int Length => _bytes?.Count ?? 0;
Contracts\GCInfo\GCInfoDecoder.cs (8)
767for (int i = 0; i < _interruptibleRanges.Count; i++) 799int transitionBitOffset = bitOffset + couldBeLiveSlots.Count; 803for (int i = 0; i < couldBeLiveSlots.Count; i++) 817uint currentState = finalState ^ (uint)(transitions.Count % 2); 897for (int i = 0; i < _interruptibleRanges.Count; i++) 983for (int i = 0; i < _interruptibleRanges.Count; i++) 1221Debug.Assert(slotIndex < _slots.Count); 1251for (int i = 0; i < _safePoints.Count; i++)
Contracts\GCInfo\X86\GCInfo.cs (1)
883if (activeCallSite.PtrArgs.Count > 0)
Contracts\GCInfo\X86\GCTransition.cs (1)
274if (PtrArgs.Count > 0)
EcmaMetadataUtils.cs (1)
241for (int level = 1; level < nameChain.Count; level++)
Microsoft.Diagnostics.DataContractReader.DataGenerator (1)
Parser.cs (1)
169if (result.Count == 0)
Microsoft.Diagnostics.DataContractReader.Legacy (119)
ClrDataMethodInstance.cs (8)
255for (int i = 0; i < map.Count; i++) 258bool lastValue = i == map.Count - 1; 354for (int i = 0; i < map.Count; i++) 362uint nativeEndOffset = i == map.Count - 1 ? 0 : map[i + 1].NativeOffset; 448for (int i = 0; i < map.Count; i++) 452bool lastValue = i == map.Count - 1; 473*mapNeeded = (uint)map.Count; 476if (map.Count == 0)
ClrDataValue.cs (3)
336: checked((uint)GetFields(flags, fromType).Count); 866for (int i = 0; i < types.Count; i++) 868bool inherited = i != types.Count - 1;
Dbi\DacDbiImpl.cs (35)
2377Debug.Assert(cdacFrames!.Count == dacFrames.Count, $"Internal frame count mismatch - cDAC: {cdacFrames!.Count}, DAC: {dacFrames.Count}"); 2378int n = Math.Min(cdacFrames!.Count, dacFrames.Count); 3299Debug.Assert(cdacFields!.Count == dacFields.Count, $"{label} field count mismatch - cDAC: {cdacFields!.Count}, DAC: {dacFields.Count}"); 3300int n = Math.Min(cdacFields!.Count, dacFields.Count); 3780Debug.Assert(entries.Count == legacyEntries.Count, 3781$"cDAC param count: {entries.Count}, DAC: {legacyEntries.Count}"); 3783int compareCount = Math.Min(entries.Count, legacyEntries.Count); 4031Debug.Assert(entries.Count == legacyEntries.Count, 4032$"cDAC param count: {entries.Count}, DAC: {legacyEntries.Count}"); 4034int compareCount = Math.Min(entries.Count, legacyEntries.Count); 5033Debug.Assert(segments.Count == legacySegments.Count, 5034$"cDAC: {segments.Count} segments, DAC: {legacySegments.Count} segments"); 5036int compareCount = Math.Min(segments.Count, legacySegments.Count); 6365Debug.Assert(locals.Count == legacyLocals.Count, 6366$"cDAC: {locals.Count} async locals, DAC: {legacyLocals.Count}"); 6367for (int i = 0; i < locals.Count; i++)
Dbi\DacDbiImpl.NativeCodeInfo.cs (12)
169Debug.Assert(cdac.Count == dac.Count, 170$"SeqPoint count mismatch - cDAC: {cdac.Count}, DAC: {dac.Count}"); 171int n = Math.Min(cdac.Count, dac.Count); 187Debug.Assert(cdac.Count == dac.Count, 188$"VarInfo count mismatch - cDAC: {cdac.Count}, DAC: {dac.Count}"); 189int n = Math.Min(cdac.Count, dac.Count);
Dbi\Helpers\RefWalk.cs (1)
87if (types.Count == 0)
MetaDataImportImpl.cs (33)
95while (count < cMax && e.Position < e.Tokens.Count) 138*pulCount = (uint)e.Tokens.Count; 153e.Position = (int)Math.Min(ulPos, (uint)e.Tokens.Count); 198Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumTypeDefs count mismatch: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 199for (int i = 0; i < Math.Min(tokens.Count, legacyTokens.Count); i++) 246Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumInterfaceImpls count mismatch for 0x{td:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 247for (int i = 0; i < Math.Min(tokens.Count, legacyTokens.Count); i++) 300Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumMethods count mismatch for 0x{cl:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 301for (int i = 0; i < Math.Min(tokens.Count, legacyTokens.Count); i++) 348Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumFields count mismatch for 0x{cl:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 349for (int i = 0; i < Math.Min(tokens.Count, legacyTokens.Count); i++) 409Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumGenericParams count mismatch for 0x{tk:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 410for (int i = 0; i < Math.Min(tokens.Count, legacyTokens.Count); i++)
SOSDacImpl.cs (26)
412for (int i = 0; i < modules.Count && n < count; i++) 423for (int i = 0; i < modules.Count; i++) 866for (; i < heapInfos.Count && i < count; i++) 888*pNeeded = codeHeaps is not null ? (uint)i : (uint)heapInfos.Count; 1298Debug.Assert(gcHeaps.Count == heapCount, "Expected the number of GC heaps to match the count returned by GetGCHeapCount"); 1625SOSHandleData[] sosHandles = new SOSHandleData[handles.Count]; 1626for (int i = 0; i < handles.Count; i++) 2384for (int i = 0; (i < reJitIds.Count) && (iRejitDataReverted < cRevertedRejitVersions); i++) 4593if (clauseIndex < expected.Elements.Count) 4647uint numClauses = (uint)exceptionClauses.Count; 4779int cdacCount = DebugTraverseLoaderHeapBlocks.Count; 4785Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0, 4786$"cDAC found {cdacCount} blocks, DAC matched {_debugTraverseLoaderDebugCount}, {DebugTraverseLoaderHeapBlocks.Count} unmatched"); 4955int cdacCount = DebugTraverseLoaderHeapBlocks.Count; 4961Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0, 4962$"cDAC found {cdacCount} blocks, DAC matched {_debugTraverseLoaderDebugCount}, {DebugTraverseLoaderHeapBlocks.Count} unmatched"); 6074if (mows.Count > 0) 6077*pNeeded = (uint)mows.Count; 6079if (count < (uint)mows.Count) 6082for (int i = 0; i < (int)count && i < mows.Count; i++) 6415int cdacCount = DebugTraverseLoaderHeapBlocks.Count; 6421Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0, 6422$"cDAC found {cdacCount} blocks, DAC matched {_debugTraverseLoaderDebugCount}, {DebugTraverseLoaderHeapBlocks.Count} unmatched"); 6952while (i < count && _iteratorIndex < _methods.Count) 7023Debug.Assert(countLocal == (uint)_methods.Count); 7026*pCount = (uint)_methods.Count;
TypeNameBuilder.cs (1)
546for (int i = nestedTokens.Count - 1; i >= 0; i--)
Microsoft.Diagnostics.NETCore.Client (4)
DiagnosticsClient\EventPipeSessionConfiguration.cs (1)
121if (_providers.Count == 0)
DiagnosticsServerRouter\DiagnosticsServerRouterRunner.cs (1)
126if (ex is BackendStreamTimeoutException && runningRouters.Count == 0)
HandleableCollection.cs (2)
106for (int i = 0; !handledValue && i < _handlers.Count; i++) 193for (int i = 0; !stopHandling && i < _items.Count; i++)
Microsoft.DiaSymReader (8)
Utilities\ComMemoryStream.cs (4)
60if (chunkIndex < _chunks.Count) 90if (chunkIndex < _chunks.Count) 133if (chunkIndex < _chunks.Count) 225while (chunkIndex >= _chunks.Count)
Writer\SymUnmanagedWriterImpl.cs (4)
139if (value > _documentWriters.Count) 155int index = _documentWriters.Count; 198if (documentIndex < 0 || documentIndex >= _documentWriters.Count) 649if (documentIndex < 0 || documentIndex >= _documentWriters.Count)
Microsoft.DotNet.ApiCompatibility (4)
Rules\AttributesMustMatch.cs (2)
107for (int j = 0; j < rightGroup.Attributes.Count; j++) 126for (int i = 0; i < rightGroup.Attributes.Count; i++)
Runner\ApiCompatRunner.cs (2)
48if (leftContainerList.Count == 0 || rightContainersList.Count == 0)
Microsoft.DotNet.ApiSymbolExtensions (2)
AssemblySymbolLoader.cs (2)
165IAssemblySymbol?[] assemblySymbols = new IAssemblySymbol[assembliesToReturn.Count]; 166for (int i = 0; i < assembliesToReturn.Count; i++)
Microsoft.DotNet.Build.Manifest (4)
BuildModelFactory.cs (4)
250if (models == null || models.Count == 0) 257if (models.Count == 1) 267for (int i = 0; i < models.Count; i++) 333if (differences.Count > 0)
Microsoft.DotNet.Build.Tasks.Feed (1)
src\PushToBuildStorage.cs (1)
321if (string.IsNullOrEmpty(PdbArtifactsLocalStorageDir) && buildModel.Artifacts.Pdbs.Count > 0)
Microsoft.DotNet.Build.Tasks.FileCatalog (5)
CatalogBuilder.cs (5)
86if (_entries.Count == 0) 109List<Member> members = new(_entries.Count * 2); 133var deduped = new List<Member>(members.Count); 136if (deduped.Count == 0 || 137CompareBytes(deduped[deduped.Count - 1].Identifier, member.Identifier) != 0)
Microsoft.DotNet.Build.Tasks.Installers (10)
src\RpmBuilder.cs (8)
243if (triggers.Count == 0) 258for (int tix = 0; tix < triggers.Count; tix++) 312if (_provides.Count != 0) 318if (_conflicts.Count != 0) 324if (_requires.Count != 0) 330if (_changelogLines.Count != 0) 428directoryIndex = directories.Count; 436fileClassIndex = fileClassDictionary.Count;
src\RpmHeader.cs (2)
240BinaryPrimitives.WriteInt32BigEndian(numIndexEntries, Entries.Count + 1); 356Offset = -(Entries.Count + 1) * Unsafe.SizeOf<IndexEntry>(),
Microsoft.DotNet.Build.Tasks.Packaging (1)
GetPackageDestination.cs (1)
124if (_packageDestinations.Count == 0)
Microsoft.DotNet.Cli.Definitions (6)
Commands\Tool\ToolLocationOptions.cs (1)
47if (options.Count > 1)
Help\HelpBuilder.cs (3)
373while (end.Count > 0) 375sb.Append(end[end.Count - 1]); 376end.RemoveAt(end.Count - 1);
Help\HelpBuilder.Default.cs (2)
68&& completionSources.Count > 0) 204if (optionRows.Count > 0)
Microsoft.DotNet.Cli.Telemetry (3)
_generated\17\TelemetryJsonContext.ListExceptionDetails.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\18\TelemetryJsonContext.ListTrackResponseError.g.cs (1)
57for (int i = 0; i < value.Count; i++)
Implementation\BreezePartialContent.cs (1)
46if (response?.Errors is not { Count: > 0 } errors)
Microsoft.DotNet.Cli.Utils (3)
PathUtility.cs (1)
354if (notExisting.Count > 0)
TypoCorrection.cs (2)
36numberOfSuggestions += matchByStartsWith.Count; 54numberOfSuggestions += matchByContains.Count;
Microsoft.DotNet.CMake.Sdk (2)
src\GetCMakeArtifactsFromFileApi.cs (2)
154if (targetIndex < 0 || targetIndex >= config.Targets.Count) 197if (artifacts.Count == 0)
Microsoft.DotNet.HotReload.Watch (7)
HotReload\HotReloadDotNetWatcher.cs (4)
419for (var i = 0; i < changedFiles.Count; i++) 576for (var i = 0; i < changedFiles.Count; i++) 1237if (devices.Count == 0) 1244if (devices.Count == 1)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\AbstractBrowserRefreshServer.cs (2)
216for (var i = 0; i < _activeConnections.Count; i++) 230_activeConnections.RemoveRange(j, _activeConnections.Count - j);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAssetsManifest.cs (1)
157var validContentRoots = new string?[manifest.ContentRoots.Count];
Microsoft.DotNet.StrongName (2)
Utils.cs (2)
286Debug.Assert(segment.Count > 0); 289int count = segment.Count;
Microsoft.DotNet.TemplateLocator (3)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (3)
401if (workload.Extends?.Count > 0) 472if (w.Packs != null && w.Packs.Count > 0) 737w.workload.Platforms == null || w.workload.Platforms.Count == 0 || w.workload.Platforms.Any(platform => _currentRuntimeIdentifiers.Contains(platform)));
Microsoft.DotNet.XliffTasks (1)
Model\UnstructuredDocument.cs (1)
54_nodes.Add(new UnstructuredTranslatableNode(_fragments, _fragments.Count, id, source));
Microsoft.Extensions.AI (41)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatCompletion\ChatClientBuilder.cs (1)
50for (var i = _clientFactories.Count - 1; i >= 0; i--)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatCompletion\FunctionInvokingChatClient.cs (24)
379if (responseMessages is { Count: > 0 }) 579if (anyToolsRequireApproval && approvalRequiredFunctions is null && functionCallContents is { Count: > 0 }) 588if (functionCallContents is not { Count: > 0 }) 609Debug.Assert(functionCallContents is { Count: > 0 }, "Expected to have function call contents to check for approval requiring functions."); 621for (; lastYieldedUpdateIndex < updates.Count; lastYieldedUpdateIndex++) 652for (; lastYieldedUpdateIndex < updates.Count; lastYieldedUpdateIndex++) 970if (functionCallContents is not { Count: > 0 }) 977int updateCount = updates.Count; 997for (int i = functionCallContents.Count - 1; i >= 0; i--) 1074int remainingCount = remainingTools?.Count ?? 0; 1093if (functionCalls is not { Count: > 0 }) 1170Debug.Assert(functionCallContents.Count > 0, "Expected at least one function call."); 1187FunctionCount = functionCallContents.Count, 1362trailingMessageCount = originalMessages.Count - (lastApprovalIndex + 1); 1375int insertIndex = originalMessages.Count - trailingMessageCount; 1398insertIndex += preDownstreamCallHistory.Count; 1440for (; i < messages.Count; i++) 1477if (keptContents?.Count != message.Contents.Count) 1479if (keptContents is { Count: > 0 }) 1514if (allApprovalResponses is { Count: > 0 }) 1550rejections is { Count: > 0 } ? 1671return (true, functionCallContents!.Count); 1676for (; lastApprovalCheckedFCCIndex < functionCallContents.Count; lastApprovalCheckedFCCIndex++) 1820if (notInvokedApprovals is { Count: > 0 })
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatRouting\SemanticRoutingChatClient.cs (1)
151clientIndex = clients.Count;
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Common\FunctionInvocationProcessor.cs (3)
73if (allowConcurrentInvocation && functionCallContents.Count > 1) 77from callIndex in Enumerable.Range(0, functionCallContents.Count) 85for (int callIndex = 0; callIndex < functionCallContents.Count; callIndex++)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Embeddings\EmbeddingGeneratorBuilder.cs (1)
55for (var i = _generatorFactories.Count - 1; i >= 0; i--)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Files\HostedFileClientBuilder.cs (1)
53for (var i = _clientFactories.Count - 1; i >= 0; i--)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Image\ImageGeneratorBuilder.cs (1)
52for (var i = _generatorFactories.Count - 1; i >= 0; i--)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Realtime\FunctionInvokingRealtimeClientSession.cs (2)
228return functionCallContents.Count > 0; 366var messages = new List<RealtimeClientMessage>(results.Count);
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Realtime\OpenTelemetryRealtimeClientSession.cs (4)
316if (activity is { IsAllDataRequested: true } && outputMessages is { Count: > 0 }) 406return responseMessage.Parts.Count > 0 ? responseMessage : null; 490return responseOtelMessage.Parts.Count > 0 ? responseOtelMessage : null; 658return message.Parts.Count > 0 ? message : null;
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Realtime\RealtimeClientBuilder.cs (1)
51for (var i = _clientFactories.Count - 1; i >= 0; i--)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\SpeechToText\SpeechToTextClientBuilder.cs (1)
50for (var i = _clientFactories.Count - 1; i >= 0; i--)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\TextToSpeech\TextToSpeechClientBuilder.cs (1)
50for (var i = _clientFactories.Count - 1; i >= 0; i--)
Microsoft.Extensions.AI.Abstractions (8)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Embeddings\GeneratedEmbeddings.cs (1)
56public int Count => _embeddings.Count;
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Utilities\AIJsonUtilities.Schema.Transform.cs (7)
76path?.RemoveAt(path.Count - 1); 79path?.RemoveAt(path.Count - 1); 86path?.RemoveAt(path.Count - 1); 94path?.RemoveAt(path.Count - 1); 101path?.RemoveAt(path.Count - 1); 120path?.RemoveAt(path.Count - 1); 123path?.RemoveAt(path.Count - 1);
Microsoft.Extensions.AI.Abstractions.Tests (10)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\ChatCompletion\ChatResponseUpdateExtensionsTests.cs (3)
672Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), message.Contents.Count); 675Assert.Equal(expected.Count, contents.Length); 676for (int i = 0; i < expected.Count; i++)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\SpeechToText\SpeechToTextClientTests.cs (1)
70Assert.Equal(3, updates.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (3)
124Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), response.Contents.Count); 127Assert.Equal(expected.Count, contents.Length); 128for (int i = 0; i < expected.Count; i++)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TextToSpeech\TextToSpeechClientTests.cs (1)
60Assert.Equal(3, updates.Count);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.ListBoolean.g.cs (1)
57for (int i = 0; i < value.Count; i++)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.ListSimpleRecord.g.cs (1)
57for (int i = 0; i < value.Count; i++)
Microsoft.Extensions.AI.Evaluation (1)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Evaluation\ChatMessageExtensions.cs (1)
74int lastMessageIndex = conversationHistory.Count - 1;
Microsoft.Extensions.AI.Evaluation.Safety (15)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Evaluation.Safety\ContentSafetyServicePayloadUtilities.cs (15)
444turns.RemoveRange(index: 0, count: turns.Count - 1); 531if (normalizedPerTurnContext.Count > turns.Count) 533var ignoredContextCount = normalizedPerTurnContext.Count - turns.Count; 538$"The supplied conversation contained {turns.Count} turns. " + 539$"However, context for {normalizedPerTurnContext.Count} turns were supplied as part of the context collection. " + 541$"Only the last {turns.Count} items from the context collection were used.")); 545else if (normalizedPerTurnContext.Count < turns.Count) 547int missingContextCount = turns.Count - normalizedPerTurnContext.Count; 552$"The supplied conversation contained {turns.Count} turns. " + 553$"However, context for only {normalizedPerTurnContext.Count} turns were supplied as part of the context collection. " + 555$"The supplied items in the context collection were applied to the last {normalizedPerTurnContext.Count} turns."));
Microsoft.Extensions.AI.Integration.Tests (11)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Integration.Tests\ChatClientIntegrationTests.cs (2)
147Assert.True(chunks.Count > 1); 166Assert.Equal(2, history.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Integration.Tests\ImageGeneratingChatClientIntegrationTests.cs (3)
207Assert.Equal(2, imageGenerator.GenerateCalls.Count); 262Assert.Equal(3, imageGenerator.GenerateCalls.Count); 307Assert.Equal(3, imageGenerator.GenerateCalls.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Integration.Tests\PromptBasedFunctionCallingChatClient.cs (1)
64for (var messageIndex = 0; messageIndex < chatMessagesList.Count; messageIndex++)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Integration.Tests\ReducingChatClientTests.cs (4)
54Assert.Equal(5, messages.Count); 77if (list.Count > 1) 79int totalCount = CountTokens(list[list.Count - 1]); 81for (int i = list.Count - 2; i >= 0; i--)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Integration.Tests\VerbatimMultiPartHttpHandler.cs (1)
142if (parameters[key] is List<JsonElement> list && list.Count == 1)
Microsoft.Extensions.AI.OpenAI (8)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.OpenAI\OpenAIAssistantsChatClient.cs (2)
552if (messageContents.Count > 0) 573if (toolResults?.Count > 0)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.OpenAI\OpenAIChatClient.cs (1)
280if (parts.Count == 0)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.OpenAI\OpenAIRealtimeClientSession.cs (1)
686if (contentParts.Count == 0)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.OpenAI\OpenAIResponsesChatClient.cs (3)
763new(codeTool.Inputs?.OfType<HostedFileContent>().Select(f => f.FileId).ToList() is { Count: > 0 } ids ? 1492if (elements.Count > 0) 1897if (outputContents.Count == 0)
Generated\361d1da7f942c932\OpenAIJsonContext.ListFunctionToolCallOutputElement.g.cs (1)
55for (int i = 0; i < value.Count; i++)
Microsoft.Extensions.AI.OpenAI.Tests (46)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAIChatClientTests.cs (6)
247Assert.Equal(12, updates.Count); 248for (int i = 0; i < updates.Count; i++) 1337Assert.Equal(10, updates.Count); 1338for (int i = 0; i < updates.Count; i++) 1348FunctionCallContent fcc = Assert.IsType<FunctionCallContent>(Assert.Single(updates[updates.Count - 1].Contents)); 1816Assert.Equal(4, extMessages.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAIConversionTests.cs (2)
1016Assert.Equal(11, updates.Count); 1959Assert.Equal(2, result.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAIHostedFileClientTests.cs (3)
262Assert.Equal(2, files.Count); 299Assert.Equal(2, files.Count); 787Assert.Equal(2, files.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAIResponseClientTests.cs (33)
312Assert.Equal(30, updates.Count); 314for (int i = 0; i < updates.Count; i++) 343Assert.Equal(i < updates.Count - 1 ? null : ChatFinishReason.Stop, updates[i].FinishReason); 444Assert.Equal(15, updates.Count); 446for (int i = 0; i < updates.Count; i++) 455Assert.Equal(3, reasoningUpdates.Count); 568Assert.True(reasoningContents.Count >= 1, "Should have at least one reasoning content"); 658Assert.Equal(2, handler.RequestBodies.Count); 759Assert.Equal(17, updates.Count); 761for (int i = 0; i < updates.Count; i++) 769Assert.Equal(i < updates.Count - 1 ? null : ChatFinishReason.Stop, updates[i].FinishReason); 772for (int i = 4; i < updates.Count; i++) 998Assert.Equal(5, updates.Count); 1001for (int i = 0; i < updates.Count; i++) 3122Assert.Equal(18, updates.Count); 3126for (int i = 0; i < updates.Count; i++) 3134if (i < updates.Count - 1) 3213Assert.Equal(8, updates.Count); 3217for (int i = 0; i < updates.Count; i++) 3705Assert.Equal(3, codeInterpreterCallUpdates.Count); 4204for (int i = 0; i < updates.Count; i++) 4285for (int i = 0; i < updates.Count; i++) 4422for (int i = 0; i < updates.Count; i++) 4500for (int i = 0; i < updates.Count; i++) 4578for (int i = 0; i < updates.Count; i++) 5654Assert.True(updates.Count >= 3); 5689Assert.True(updates.Count >= 2); 5724Assert.True(updates.Count >= 2); 5762Assert.True(updates.Count >= 3); 6477Assert.True(updates.Count >= 6); 6595Assert.True(updates.Count >= 8); // Should have multiple partial image updates plus generating event 6602Assert.True(partialImageUpdates.Count >= 3); 7269Assert.Equal(2, wsCallUpdates.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAISpeechToTextClientTests.cs (1)
323Assert.Equal(3, updates.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAITextToSpeechClientTests.cs (1)
316Assert.Equal(3, updates.Count);
Microsoft.Extensions.AI.Stabilization.Tests (2)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Stabilization.Tests\AIContentSerializationRegressionTests.cs (1)
31Assert.Equal(2, roundtripped.Count);
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.ListAIContent.g.cs (1)
55for (int i = 0; i < value.Count; i++)
Microsoft.Extensions.AI.Tests (44)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\..\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (3)
20Assert.Equal(expectedMessages.Count, actualMessages.Count); 21for (int i = 0; i < expectedMessages.Count; i++)
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\ChatCompletion\FunctionInvokingChatClientTests.cs (10)
668var message = new ChatMessage(ChatRole.Assistant, [new FunctionCallContent($"callId{capturedOptions.Count}", "Func1")]); 686Assert.Equal(maxIterations + 1, capturedOptions.Count); 712var message = new ChatMessage(ChatRole.Assistant, [new FunctionCallContent($"callId{capturedOptions.Count}", "Func1")]); 730Assert.Equal(maxIterations + 1, capturedOptions.Count); 757if (capturedOptions.Count == 1) 783Assert.Equal(2, capturedOptions.Count); 1154for (int i = 0; i < activities.Count - 1; i++) 1157Assert.Same(activities[activities.Count - 1], activities[i].Parent); 1329Assert.Equal(messages.Count, context.Messages.Count); 1770Assert.Equal(2, chatActivities.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\ChatCompletion\ReducingChatClientTests.cs (1)
79Assert.Equal(expectedUpdates.Length, updates.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\ChatReduction\MessageCountingChatReducerTests.cs (1)
173Assert.Equal(expectedCount, resultList.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\ChatReduction\SummarizingChatReducerTests.cs (7)
81Assert.Equal(3, resultList.Count); // System + Summary + 1 unsummarized 115Assert.Equal(5, resultList.Count); 155Assert.Equal(3, msgList.Count); // 2 messages to summarize + system prompt 163Assert.Equal(5, resultList.Count); 202Assert.Equal(4, msgList.Count); // 3 non-function messages + system prompt 216Assert.Equal(4, resultList.Count); 259Assert.Equal(targetCount + 1, resultList.Count); // Summary + target messages
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\ChatRouting\FailoverChatClientTests.cs (2)
281Assert.Equal(2, invokedOptions.Count); 1082Assert.Equal(2, updates.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\ChatRouting\OrderedFailoverChatClientTests.cs (1)
65return calls.Count < 3
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\Realtime\FunctionInvokingRealtimeClientTests.cs (7)
83Assert.Equal(2, received.Count); 124Assert.Equal(2, injectedMessages.Count); 169Assert.Equal(2, injectedMessages.Count); 209Assert.Equal(5, received.Count); 276Assert.Equal(2, injectedMessages.Count); 314Assert.Equal(2, injectedMessages.Count); 435Assert.Equal(2, injectedMessages.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.AI.Tests\Realtime\OpenTelemetryRealtimeClientTests.cs (12)
102Assert.Equal(3, activities.Count); 476Assert.Equal(2, activities.Count); 519Assert.Equal(3, activities.Count); 647Assert.Equal(3, activities.Count); 691Assert.Equal(3, activities.Count); 732Assert.Equal(2, activities.Count); 774Assert.Equal(2, activities.Count); 816Assert.Equal(3, activities.Count); 857Assert.Equal(3, activities.Count); 898Assert.Equal(3, activities.Count); 939Assert.Equal(2, activities.Count); 980Assert.Equal(2, activities.Count);
Microsoft.Extensions.AsyncState (2)
..\..\..\..\src\Libraries\Microsoft.Extensions.AsyncState\AsyncState.cs (1)
95var difference = count - features.Count;
..\..\..\..\src\Libraries\Microsoft.Extensions.AsyncState\FeaturesPooledPolicy.cs (1)
20for (int i = 0; i < obj.Count; i++)
Microsoft.Extensions.AsyncState.Tests (3)
..\..\..\..\test\Libraries\Microsoft.Extensions.AsyncState.Tests\AsyncStateTests.cs (3)
220Assert.Equal(5, l.Count); 228Assert.Equal(5, l.Count); 236Assert.Equal(5, l.Count);
Microsoft.Extensions.Caching.Abstractions (1)
CacheEntryExtensions.cs (1)
178for (int i = 0; i < postEvictionCallbacks.Count; i++)
Microsoft.Extensions.Caching.Hybrid.Tests (3)
..\..\..\..\test\Libraries\Microsoft.Extensions.Caching.Hybrid.Tests\LogCollector.cs (3)
42if (_items.Count == expectedErrorIds.Length) 62if (_items.Count > expectedErrorIds.Length) 79if (errorIds.Length == _items.Count)
Microsoft.Extensions.Caching.Memory (6)
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 (2)
495int lastIndex = _allStats.Count - 1; 512current.Index = _allStats.Count;
Microsoft.Extensions.Compliance.Testing (4)
..\..\..\..\src\Libraries\Microsoft.Extensions.Compliance.Testing\FakeRedactionCollector.cs (4)
28if (_redactorRequestedLog.Count == 0) 33return _redactorRequestedLog[_redactorRequestedLog.Count - 1]; 62if (_dataRedactedLog.Count == 0) 67return _dataRedactedLog[_dataRedactedLog.Count - 1];
Microsoft.Extensions.Configuration (4)
ConfigurationManager.cs (2)
170return $"Sections = {ConfigurationSectionDebugView.FromConfiguration(this, this).Count}"; 206public int Count => _sources.Count;
ConfigurationRoot.cs (1)
144return $"Sections = {ConfigurationSectionDebugView.FromConfiguration(this, this).Count}";
ConfigurationSection.cs (1)
125var childCount = Configuration.ConfigurationSectionDebugView.FromConfiguration(this, _root).Count;
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
904Array result = Array.CreateInstance(elementType, list.Count);
Microsoft.Extensions.Configuration.Binder.SourceGeneration (2)
ConfigurationBindingGenerator.Parser.cs (2)
799if (invalidParameters?.Count > 0) 803else if (missingParameters?.Count > 0)
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.DataIngestion (21)
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Chunkers\ElementsChunker.cs (1)
51for (int elementIndex = 0; elementIndex < elements.Count; elementIndex++)
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Chunkers\HeaderChunker.cs (1)
70if (elements.Count > 0)
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Chunkers\SectionChunker.cs (1)
77if (elements.Count > 0)
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Chunkers\SemanticSimilarityChunker.cs (9)
77if (elementDistances.Count > 0) 81if (embeddings.Count != elementDistances.Count) 86for (int i = 0; i < elementDistances.Count - 1; i++) 102for (int i = 0; i < elementDistances.Count; i++) 107if (distance > distanceThreshold || i == elementDistances.Count - 1) 120if (elementDistances.Count == 0) 124else if (elementDistances.Count == 1) 129float[] sorted = new float[elementDistances.Count]; 130for (int elementIndex = 0; elementIndex < elementDistances.Count; elementIndex++)
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Processors\ImageAlternativeTextEnricher.cs (6)
51if (batch.Count == _options.BatchSize) 67if (batch.Count == _options.BatchSize) 77if (batch?.Count > 0) 90List<AIContent> contents = new(batch.Count); 102if (response.Result.Length == contents.Count) 111_logger?.UnexpectedResultsCount(response.Result.Length, contents.Count);
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Utils\Batching.cs (2)
44if (response.Result.Length == contents.Count) 53logger?.UnexpectedResultsCount(response.Result.Length, contents.Count);
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Writers\VectorStoreWriter.cs (1)
189options: new() { Skip = keys.Count },
Microsoft.Extensions.DataIngestion.Tests (17)
..\..\..\..\test\Libraries\Microsoft.Extensions.DataIngestion.Tests\IngestionPipelineTests.cs (7)
92Assert.Equal(_sampleFiles.Count, ingestionResults.Count); 102for (int i = 0; i < retrieved.Count; i++) 126Assert.Equal(directory.EnumerateFiles("*.md").Count(), ingestionResults.Count); 136for (int i = 0; i < retrieved.Count; i++) 167for (int i = 0; i < retrieved.Count; i++) 213Assert.Equal(_sampleFiles.Count, ingestionResults.Count); 258Assert.Equal(expectedFailedActivitiesCount, failed.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.DataIngestion.Tests\Processors\ClassificationEnricherTests.cs (1)
113Assert.Equal(chunks.Count, got.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.DataIngestion.Tests\Processors\KeywordEnricherTests.cs (1)
113Assert.Equal(chunks.Count, got.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.DataIngestion.Tests\Processors\SentimentEnricherTests.cs (2)
77Assert.Equal(4, chunks.Count); 100Assert.Equal(chunks.Count, got.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.DataIngestion.Tests\Processors\SummaryEnricherTests.cs (2)
77Assert.Equal(2, chunks.Count); 97Assert.Equal(chunks.Count, got.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.DataIngestion.Tests\Writers\VectorStoreWriterTests.cs (4)
93Assert.Equal(chunks.Count, recordCount); 149Assert.Equal(chunks.Count, recordCount); 165Assert.Equal(updatedChunks.Count, records.Count);
Microsoft.Extensions.DependencyInjection (15)
DependencyInjectionEventSource.cs (3)
155int providersCount = _providers.Count; 160_survivingProvidersCount = _providers.Count; 174for (int i = _providers.Count - 1; i >= 0; i--)
ServiceLookup\CallSiteFactory.cs (5)
367callSites = new ServiceCallSite[callSitesByIndex.Count]; 899if (_items != null && _items.Count > 0) 901return _items[_items.Count - 1]; 919return 1 + (_items?.Count ?? 0); 953return _items.Count - (index + 1);
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (2)
250argument.Generator.Emit(OpCodes.Ldc_I4, argument.Factories.Count); 268argument.Generator.Emit(OpCodes.Ldc_I4, argument.Constants.Count);
ServiceLookup\ServiceProviderEngineScope.cs (5)
134for (var i = toDispose.Count - 1; i >= 0; i--) 171for (var i = toDispose.Count - 1; i >= 0; i--) 293DependencyInjectionEventSource.Log.ScopeDisposed(RootProvider.GetHashCode(), ResolvedServices.Count, _disposables?.Count ?? 0); 313if (_disposables is not { Count: > 0 } disposables) 329int count = disposables.Count;
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) 825if (targetLibrary.Runtimes != null && targetLibrary.Runtimes.Count > 0) 830if (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)
..\..\..\..\src\Libraries\Microsoft.Extensions.Diagnostics.ExceptionSummarization\HttpExceptionSummaryProvider.cs (2)
48socketErrors[socketError] = descriptions.Count; 63webStatuses[status] = descriptions.Count;
Microsoft.Extensions.Diagnostics.ExceptionSummarization.Tests (1)
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.ExceptionSummarization.Tests\ExceptionSummarizerTests.cs (1)
65var descriptionIndex = _httpDescriptions.Count;
Microsoft.Extensions.Diagnostics.HealthChecks (2)
DefaultHealthCheckService.cs (2)
297public int Count => _values.Count; 317for (var i = 0; i < values.Count; i++)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (7)
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests\CircularBufferTests.cs (1)
34var expectedBufferElements = elementsToAdd.Skip(Math.Max(0, elementsToAdd.Count - BufferSize)).ToList();
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests\Linux\Disk\FakeDiskStatsReader.cs (1)
16if (_index >= stats.Values.First().Count)
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests\Linux\LinuxCountersTests.cs (1)
111samples.Count.Should().Be(22);
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests\Linux\LinuxUtilizationProviderTests.cs (3)
90Assert.Equal(7, samples.Count); 166Assert.Equal(6, samples.Count); 286Assert.Equal(7, samples.Count);
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests\Windows\WindowsCountersTests.cs (1)
58samples.Count.Should().Be(24);
Microsoft.Extensions.Diagnostics.Testing (10)
..\..\..\..\src\Libraries\Microsoft.Extensions.Diagnostics.Testing\Logging\FakeLogCollector.cs (3)
102if (_records.Count == 0) 107return _records[_records.Count - 1]; 115public int Count => _records.Count;
..\..\..\..\src\Libraries\Microsoft.Extensions.Diagnostics.Testing\Logging\FakeLogCollector.LogEnumeration.cs (1)
135if (_index < _collector._records.Count)
..\..\..\..\src\Libraries\Microsoft.Extensions.Diagnostics.Testing\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) 307for (int i = _waiters.Count - 1; i >= 0; i--) 309if (_measurements.Count >= _waiters[i].MinCount)
Microsoft.Extensions.Diagnostics.Testing.Tests (4)
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.Testing.Tests\Metrics\MeasurementExtensionsTests.cs (4)
28Assert.Equal(2, filtered.Count); 53Assert.Equal(2, filtered.Count); 78Assert.Equal(2, filtered.Count); 106Assert.Equal(2, filtered.Count);
Microsoft.Extensions.FileProviders.Composite (2)
CompositeDirectoryContents.cs (1)
64for (int i = 0; i < _directories.Count; i++)
CompositeFileProvider.cs (1)
89return changeTokens.Count switch
Microsoft.Extensions.FileProviders.Embedded (2)
Manifest\ManifestParser.cs (2)
66for (int i = 0; i < entriesList.Count - 1; i++) 68for (int j = i + 1; j < entriesList.Count; j++)
Microsoft.Extensions.FileSystemGlobbing (5)
Internal\MatcherContext.cs (1)
65return new PatternMatchingResult(_files, _files.Count > 0);
Internal\PathSegments\WildcardPathSegment.cs (1)
63for (int containsIndex = 0; containsIndex != wildcard.Contains.Count; ++containsIndex)
Internal\PatternContexts\PatternContextLinear.cs (1)
89internal readonly bool HasStemItems => _stemItems is not null && _stemItems.Count > 0;
Internal\PatternContexts\PatternContextRagged.cs (1)
136internal readonly bool HasStemItems => _stemItems is not null && _stemItems.Count > 0;
Internal\Patterns\PatternBuilder.cs (1)
179else if (segmentsPatternEndsWith!.Count != 0)
Microsoft.Extensions.Hosting (8)
HostApplicationBuilder.cs (2)
276if (_configureHostConfigActions.Count > 0) 317if (_configureContainerActions.Count > 0)
Internal\Host.cs (6)
172if (validationFailures.Count == 1) 177if (validationFailures.Count > 1) 248if (exceptions.Count > 0) 250if (exceptions.Count == 1) 415if (exceptions.Count > 0) 417if (exceptions.Count == 1)
Microsoft.Extensions.Http (2)
Logging\HttpHeadersLogValue.cs (2)
70public int Count => Values.Count; 119for (int i = 0; i < Values.Count; i++)
Microsoft.Extensions.Http.Diagnostics (4)
..\..\..\..\src\Libraries\Microsoft.Extensions.Http.Diagnostics\Logging\Internal\Log.cs (2)
98var requestHeadersCount = record.RequestHeaders?.Count ?? 0; 99var responseHeadersCount = record.ResponseHeaders?.Count ?? 0;
..\..\..\..\src\Libraries\Microsoft.Extensions.Http.Diagnostics\Logging\Internal\LoggerMessageStateExtensions.cs (2)
26for (var i = 0; i < items.Count; i++) 45for (var i = 0; i < items.Count; i++)
Microsoft.Extensions.Http.Resilience (1)
..\..\..\..\src\Libraries\Microsoft.Extensions.Http.Resilience\Routing\Internal\WeightedGroups\WeightedGroupsRoutingStrategy.cs (1)
67if (_groups.Count == 0)
Microsoft.Extensions.Http.Resilience.Tests (4)
..\..\..\..\test\Libraries\Microsoft.Extensions.Http.Resilience.Tests\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)
2940if (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)
215var loggers = new List<LoggerInformation>(_providerRegistrations.Count); 216for (int i = 0; i < _providerRegistrations.Count; i++) 332return $"Providers = {_providerRegistrations.Count}, {_filterOptions.DebuggerToString()}";
Microsoft.Extensions.Logging.Abstractions (6)
FormattedLogValues.cs (1)
90return _formatter.ValueNames.Count + 1;
LoggerMessage.cs (1)
456int actualCount = logValuesFormatter.ValueNames.Count;
LogValuesFormatter.cs (4)
69vsb.Append(_valueNames.Count.ToString(CultureInfo.InvariantCulture)); 223if (index < 0 || index > _valueNames.Count) 228if (_valueNames.Count > index) 239for (int index = 0; index != _valueNames.Count; ++index)
Microsoft.Extensions.Logging.AzureAppServices (1)
BatchingLoggerProvider.cs (1)
106if (_currentBatch.Count > 0)
Microsoft.Extensions.Logging.Generators (15)
LoggerMessageGenerator.Emitter.cs (12)
62(lm.TypeParameters.Count == 0) && // generic methods can't use LoggerMessage.Define's static callback 63(lm.TemplateParameters.Count <= MaxLoggerMessageDefineArguments) && // more args than LoggerMessage.Define can handle 65(lm.TemplateList.Count == lm.TemplateParameters.Count); // mismatch in template to args, which LoggerMessage.Define can't handle 70for (int i = 0; i < lm.TemplateList.Count; i++) 106for (int i = parentClasses.Count - 1; i >= 0; i--) 161if (lm.TemplateParameters.Count > 0) 196{nestedIndentation}public int Count => {lm.TemplateParameters.Count + 1}; 211{nestedIndentation}for (int i = 0; i < {lm.TemplateParameters.Count + 1}; i++) 256if (index < lm.TemplateParameters.Count) 302if (lm.TemplateParameters.Count == 0) 396if (lm.TypeParameters.Count == 0)
LoggerMessageGenerator.Parser.cs (3)
619var methods = new Dictionary<string, int>(lc.Methods.Count); 638if (results.Count > 0 && semanticModel.Compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 }) 809return constraints.Count > 0 ? string.Join(", ", constraints) : null;
Microsoft.Extensions.Options (7)
OptionsFactory.cs (1)
163if (failures is { Count: > 0 })
ValidateOnStart.cs (4)
49if (exceptions.Count == 1) 55if (exceptions.Count > 1) 91if (exceptions.Count == 1) 96if (exceptions.Count > 1)
ValidateOptionsResultBuilder.cs (2)
103if (_errors?.Count > 0) 116private int ErrorsCount => _errors is null ? 0 : _errors.Count;
Microsoft.Extensions.Options.Contextual (1)
..\..\..\..\src\Libraries\Microsoft.Extensions.Options.Contextual\Internal\ContextualOptionsFactory.cs (1)
143if (failures.Count > 0)
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.Async.cs (1)
66Debug.Assert(errors is not null && errors.Count > 0);
DataAnnotationValidateOptions.cs (1)
74Debug.Assert(errors is not null && errors.Count > 0);
Microsoft.Extensions.Options.SourceGeneration (14)
Emitter.cs (6)
701int capacity = modelToValidate.MembersToValidate.Count == 0 ? 0 : modelToValidate.MembersToValidate.Max(static vm => vm.ValidationAttributes.Count); 712if (vm.ValidationAttributes.Count > 0) 764if (attr.ConstructorArguments.Count > 0) 768for (var i = 0; i < attr.ConstructorArguments.Count; i++) 770if (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 }) 547bool validationAttributeIsApplied = validationAttrs.Count > 0 || transValidatorTypeName is not null || enumerationValidatorTypeName is not null; 567if (membersToValidate.Count > 0) 583if (membersToValidate.Count > 0) 712if (membersToValidate.Count == 0 && !selfValidate)
Microsoft.Extensions.Primitives (1)
CompositeChangeToken.cs (1)
159for (int i = 0; i < disposables.Count; i++)
Microsoft.Extensions.ServiceDiscovery (3)
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery\Configuration\ConfigurationServiceEndpointProvider.cs (1)
138resolvedEndpointCount = resolved.Count;
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery\ServiceEndpointWatcherFactory.cs (1)
48if (providers is not { Count: > 0 })
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery\ServiceEndpointWatcherFactory.Log.cs (1)
19ServiceEndpointProviderListCore(logger, serviceName, providers.Count, string.Join(", ", providers.Select(static r => r.ToString())));
Microsoft.Extensions.ServiceDiscovery.Dns (14)
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\DnsServiceEndpointProvider.cs (1)
44if (endpoints.Count == 0)
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\DnsServiceEndpointProviderBase.cs (2)
88if (_lastEndpointCollection is { Count: > 0 } eps) 109if (endpoints is { Count: > 0 })
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\FallbackDnsResolver.cs (2)
72var results = new ServiceResult[srvRecords.Count]; 73for (int i = 0; i < srvRecords.Count; i++)
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\Resolver\DnsResolver.cs (7)
76var results = new List<ServiceResult>(response.Answers.Count); 157List<AddressResult> results = new List<AddressResult>(response.Answers.Count); 398Debug.Assert(response.Answers.Count > 0); 585(answers.Count + authorities.Count + additionals.Count) > 0 ? queryStartedTime.AddSeconds(ttl) : queryStartedTime; 653if (answers.Count > 0)
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\Resolver\ResolvConf.cs (2)
32if (serverList.Count == 3) 40if (serverList.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
..\..\..\..\test\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns.Tests\Resolver\LoopbackDnsServer.cs (4)
156QueryCount = (ushort)Questions.Count, 157AnswerCount = (ushort)Answers.Count, 158AuthorityCount = (ushort)Authorities.Count, 159AdditionalRecordCount = (ushort)Additionals.Count
Microsoft.Extensions.Telemetry (6)
..\..\..\..\src\Libraries\Microsoft.Extensions.Telemetry\Logging\ExtendedLogger.LegacyTagJoiner.cs (2)
53int extraTagsCount = _extraTags.Count; 81get => field + _extraTags.Count + StaticTags!.Length;
..\..\..\..\src\Libraries\Microsoft.Extensions.Telemetry\Logging\ExtendedLogger.ModernTagJoiner.cs (2)
60int extraTagsCount = _extraTags.Count; 84public int Count => _incomingTagsCount + _redactedTagsCount + _extraTags.Count + StaticTags!.Length;
..\..\..\..\src\Libraries\Microsoft.Extensions.Telemetry\Logging\ExtendedLoggerFactory.cs (2)
223var loggers = new List<LoggerInformation>(_providerRegistrations.Count); 224for (int i = 0; i < _providerRegistrations.Count; i++)
Microsoft.Extensions.Telemetry.Tests (2)
..\..\..\..\test\Libraries\Microsoft.Extensions.Telemetry.Tests\Logging\ExtendedLoggerFactoryTests.cs (2)
232Assert.Equal(7, loggerProvider.LogText.Count); // Ensure that Baggage and Tags aren't added. 428Assert.Equal(2, loggerProvider.LogText.Count); // Ensure that the additional scopes for tags and baggage aren't added.
Microsoft.Extensions.Validation.ValidationsGenerator (1)
src\aspnetcore\src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
35for (var i = 0; i < _weakReferencedEntries.Count; i++)
Microsoft.Extensions.VectorData.Abstractions (5)
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.Abstractions\ProviderServices\CollectionModel.cs (1)
173{ Count: 0 } => throw new InvalidOperationException($"The '{_recordType.Name}' type does not have any text data properties that have full text indexing enabled."),
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.Abstractions\ProviderServices\CollectionModelBuilder.cs (4)
476if (KeyProperties.Count > 1) 481if (KeyProperties.Count == 0) 486if (Options.RequiresAtLeastOneVector && VectorProperties.Count == 0) 491if (!Options.SupportsMultipleVectors && VectorProperties.Count > 1)
Microsoft.Extensions.VectorData.ConformanceTests (46)
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\DistanceFunctionTests.cs (5)
104await fixture.TestStore.WaitForDataAsync(collection, insertedRecords.Count, vectorSize: 4); 108Assert.Equal(expectedRecords.Length, results.Count); 109for (int i = 0; i < results.Count; i++) 155Assert.True(filteredResults.Count is 1 or 2); 157if (filteredResults.Count == 2)
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\FilterTests.cs (20)
492if (expected.Count == 0 && !expectZeroResults) 496else if (expectZeroResults && expected.Count != 0) 498Assert.Fail($"{nameof(expectZeroResults)} was true, but the test returned {expected.Count} results."); 501if (expected.Count == fixture.TestData.Count && !expectAllResults) 505else if (expectAllResults && expected.Count != fixture.TestData.Count) 507Assert.Fail($"{nameof(expectAllResults)} was true, but the test returned {expected.Count} results instead of the expected {fixture.TestData.Count}."); 514top: fixture.TestData.Count, 520if (actual.Count != expected.Count) 522Assert.Fail($"Expected {expected.Count} results, but got {actual.Count}"); 534top: fixture.TestData.Count, 540if (dynamicActual.Count != expected.Count) 542Assert.Fail($"Expected {expected.Count} results, but got {actual.Count}"); 723=> TestStore.WaitForDataAsync(Collection, recordCount: TestData.Count, r => r.Int > 0);
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\HybridSearchTests.cs (6)
31Assert.Equal(3, results.Count); 100Assert.Equal(3, results.Count); 122Assert.Equal(2, results1.Count); 127Assert.Equal(2, results2.Count); 206=> TestStore.WaitForDataAsync(Collection, recordCount: TestData.Count, vectorSize: 4); 256=> TestStore.WaitForDataAsync(Collection, recordCount: TestData.Count, vectorSize: 4);
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\ModelTests\BasicModelTests.cs (5)
81Assert.Equal(2, received.Count); 117Assert.True(fixture.TestData.Count < 100); 121Assert.Equal(fixture.TestData.Count, count); 225await fixture.TestStore.WaitForDataAsync(Collection, recordCount: fixture.TestData.Count + 1); 355Assert.True(fixture.TestData.Count < 100);
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\ModelTests\DynamicModelTests.cs (1)
103Assert.Equal(fixture.TestData.Count, count);
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\ModelTests\MultiVectorModelTests.cs (1)
125=> TestStore.WaitForDataAsync(Collection, recordCount: TestData.Count, vectorProperty: r => r.Vector1);
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\ModelTests\NoVectorModelTests.cs (1)
90if (results.Length == TestData.Count && results.All(r => r != null))
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\Support\VectorStoreCollectionFixtureBase.cs (2)
59if (TestData.Count > 0) 67=> TestStore.WaitForDataAsync(Collection, recordCount: TestData.Count);
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\TestSuiteImplementationTests.cs (1)
33nonImplementedBases.Count > 0,
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\TypeTests\DataTypeTests.cs (2)
265await fixture.TestStore.WaitForDataAsync(fixture.Collection, recordCount: testData.Count); 312await fixture.TestStore.WaitForDataAsync(dynamicCollection, recordCount: testData.Count);
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.ConformanceTests\TypeTests\KeyTypeTests.cs (2)
87Assert.Equal(2, results.Count); 135Assert.Equal(2, dynamicResults.Count);
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.ComplianceReports (2)
Emitter.cs (2)
55if (member.Classifications.Count > 0) 99if (p.Classifications.Count > 0)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.ContextualOptions (1)
ContextualOptionsGenerator.cs (1)
58if (list.Count > 0)
Microsoft.Gen.ContextualOptions.Generated.Tests (1)
..\..\..\..\test\Generators\Microsoft.Gen.ContextualOptions\Generated\ContextualOptionsTests.cs (1)
36Assert.Equal(2, receiver.Received.Count);
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
ContextualOptionsTests.cs (1)
36Assert.Equal(2, receiver.Received.Count);
RoslynTestUtils.cs (1)
490if (actions.Count == 0)
SyntaxContextReceiverTests.cs (1)
74Assert.Equal(2, declaration.Value.Count);
Microsoft.Gen.Logging (11)
Emitter.cs (1)
55for (int i = parentTypes.Count - 1; i >= 0; i--)
Emitter.Utils.cs (1)
137if (lm.TypeParameters.Count == 0)
LoggingMethodParameter.cs (1)
49public bool HasProperties => Properties.Count > 0;
LoggingMethodParameterExtensions.cs (1)
40if (propertyToLog.Properties.Count > 0)
LoggingProperty.cs (1)
29public bool HasProperties => Properties.Count > 0;
Parser.cs (1)
525return constraints.Count > 0 ? string.Join(", ", constraints) : null;
Parser.LogProperties.cs (2)
60if (props.Count > 0) 114if (maybeDataClasses.Count > 0)
Parser.Records.cs (3)
41if (recordDataClassAttributes.Count > 0) 82if (parameterDataClassAttributes.Count > 0) 139if (propertyDataClassAttributes.Count > 0)
Microsoft.Gen.Logging.Generated.Tests (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Logging.g.cs (1)
9454state.TagArray[0] = new("p0.P3.Count", p0?.P3?.Count);
Microsoft.Gen.Logging.Unit.Tests (1)
RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.MetadataExtractor (3)
Emitter.cs (2)
55if (member.Classifications.Count > 0) 99if (p.Classifications.Count > 0)
Parser_2.cs (1)
564if (metricMethod.AllParameters.Count < 1 ||
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.Metrics (5)
Emitter.cs (3)
114for (int i = parentTypes.Count - 1; i >= 0; i--) 192metricMethod.StrongTypeConfigs.Count != 0; 219metricMethod.StrongTypeConfigs.Count > MaxTagsWithoutEnabledCheck)
MetricFactoryEmitter.cs (1)
104var count = metricType.Methods.Count;
Parser.cs (1)
564if (metricMethod.AllParameters.Count < 1 ||
Microsoft.Gen.Metrics.Unit.Tests (1)
RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Gen.MetricsReports (1)
Parser.cs (1)
564if (metricMethod.AllParameters.Count < 1 ||
Microsoft.Gen.MetricsReports.Unit.Tests (1)
RoslynTestUtils.cs (1)
490if (actions.Count == 0)
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (1)
48if (marshalType is null || sourceGeneratedComRecognizers.Count == 0)
ComInterfaceGenerator.cs (1)
91for (int i = 0; i < interfaceInfos.Count; i++)
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)
511if (elementStatements.Count == 0) 570if (elementStatements.Count != 0)
Marshalling\MarshallerHelpers.cs (4)
156for (int node = 0; node < nodeIdToElement.Count; node++) 164while (S.Count != 0) 167T element = S[S.Count - 1]; 168S.RemoveAt(S.Count - 1);
Marshalling\MarshallingGeneratorExtensions.cs (1)
125if (rehydratedAttributes.Count > 0)
Microsoft.Maui (21)
Animations\Animation.cs (1)
197 if (childrenAnimations.Count > 0)
Animations\AnimationManager.cs (2)
54 if (_animations.Count == 0) 90 if (_animations.Count == 0)
Core\Extensions\IPickerExtension.cs (1)
20 for (int i = 0; i < returnValue.Count; i++)
Hosting\Internal\FontCollection.cs (1)
10 public int Count => _descriptors.Count;
Hosting\Internal\MauiServiceCollection.cs (1)
14 public int Count => _descriptors.Count;
Layouts\Flex.cs (6)
454 if (item == null || item.Count == 0) 463 for (int i = 0; i < item.Count; i++) 581 layout_items(item, last_layout_child, item.Count, relative_children_count, ref layout, inMeasureMode); 991 if (item.ShouldOrderChildren && item.Count > 0) 993 var indices = new int[item.Count]; 999 for (int i = 0; i < item.Count; i++)
LifecycleEvents\LifecycleEventService.cs (1)
41 _mapper.TryGetValue(eventName, out var delegates) && delegates?.Count > 0;
PropertyMapper.cs (2)
180 var updatePropertiesMappers = new List<Action<IElementHandler, IElement>>(updatePropertiesKeys.Count); 184 var cacheSize = updatePropertiesKeys.Count;
WeakEventManager.cs (4)
47 for (int i = 0; i < target.Count; i++) 67 for (int i = 0; i < toRemove.Count; i++) 74 for (int i = 0; i < toRaise.Count; i++) 128 for (int n = subscriptions.Count - 1; n >= 0; n--)
WeakList.cs (2)
17 public int Count => _list.Count; 32 for (int i = _list.Count - 1; i >= 0; i--)
Microsoft.Maui.Controls (266)
BindingExpression.cs (10)
101 for (var i = 0; i < _parts.Count - 1; i++) 133 for (var i = 0; i < _parts.Count; i++) 144 if (i < _parts.Count - 1) 458 for (int i = 0; i < chain.Count; i++) 461 if (i != chain.Count - 1 || !rootIsSource) 472 if (_ancestryChain == null || _ancestryChain.Count == 0) 474 int count = _ancestryChain.Count; 485 _ancestryChain.RemoveAt(_ancestryChain.Count - 1); 493 for (int i = 0; i < _ancestryChain.Count; i++) 549 if (index + 1 < _ancestryChain.Count)
DefinitionCollection.cs (2)
44 get { return _internalList.Count; } 88 if (index < _internalList.Count && index >= 0 && _internalList[index] != null)
Element\Element_StyleSheets.cs (1)
64 for (var i = (sheets?.Count ?? 0) - 1; i >= 0; i--)
Internals\ProfilePage.cs (1)
49 while (i < Data.Count)
Label\Label.cs (2)
405 if (!point.IsEmpty && spans.Count > 1) // More than 2 elements overlapping, deflate to see which one is actually hit. 406 for (var i = spans.Count - 1; i >= 0; i--)
Layout\Layout.cs (3)
50 public int Count => _children.Count; 158 var index = _children.Count; 174 for (int i = _children.Count - 1; i >= 0; i--)
LegacyLayouts\Grid.cs (2)
192 for (int i = row; i < row + rowSpan && i < rowDefinitions.Count; i++) 219 for (int i = col; i < col + colSpan && i < columnDefinitions.Count; i++)
LegacyLayouts\GridCalc.cs (48)
64 for (var index = 0; index < structure.Columns.Count; index++) 73 for (var index = 0; index < structure.Rows.Count; index++) 81 var request = new Size(columnWidthSum + (structure.Columns.Count - 1) * ColumnSpacing, rowHeightSum + (structure.Rows.Count - 1) * RowSpacing); 82 var minimum = new Size(nonStarColumnWidthSum + (structure.Columns.Count - 1) * ColumnSpacing, nonStarRowHeightSum + (structure.Rows.Count - 1) * RowSpacing); 124 for (var index = 0; index < _rows.Count; index++) 132 for (var index = 0; index < _columns.Count; index++) 157 for (var index = 0; index < _rows.Count; index++) 164 for (var index = 0; index < _columns.Count; index++) 178 for (var rowspan = 1; rowspan <= _rows.Count; rowspan++) 180 for (var i = 0; i < _rows.Count; i++) 211 for (var colspan = 1; colspan <= _columns.Count; colspan++) 213 for (var i = 0; i < _columns.Count; i++) 251 for (var index = 0; index < _columns.Count; index++) 258 for (var index = 0; index < _rows.Count; index++) 269 for (var index = 0; index < _columns.Count; index++) 281 for (var index = 0; index < _rows.Count; index++) 295 return new Size(columnWidthSum + (_columns.Count - 1) * columnSpacing, rowHeightSum + (_rows.Count - 1) * rowSpacing); 308 for (var index = 0; index < _columns.Count; index++) 320 for (var index = 0; index < _columns.Count; index++) 343 for (var index = 0; index < _rows.Count; index++) 354 for (var index = 0; index < _rows.Count; index++) 379 for (int n = 0; n < _columns.Count; n++) 417 for (var index = 0; index < _columns.Count; index++) 442 for (int n = 0; n < _rows.Count; n++) 479 for (var index = 0; index < _rows.Count; index++) 512 while (_columns.Count <= lastCol) 514 while (_rows.Count <= lastRow) 517 for (var index = 0; index < _columns.Count; index++) 522 for (var index = 0; index < _rows.Count; index++) 598 for (var index = 0; index < _columns.Count; index++) 608 for (var index = 0; index < _columns.Count; index++) 628 for (var index = 0; index < _rows.Count; index++) 638 for (var index = 0; index < _rows.Count; index++) 652 for (var colspan = 1; colspan <= _columns.Count; colspan++) 654 for (var i = 0; i < _columns.Count; i++) 691 for (var index = 0; index < _columns.Count; index++) 713 for (var rowspan = 1; rowspan <= _rows.Count; rowspan++) 715 for (var i = 0; i < _rows.Count; i++) 752 for (var index = 0; index < _rows.Count; index++) 772 for (var index = 0; index < _columns.Count; index++) 778 for (var index = 0; index < _rows.Count; index++) 868 double assigned = (_rows.Count - 1) * rowSpacing; 869 for (var i = 0; i < _rows.Count; i++) 880 double assigned = (_columns.Count - 1) * columnSpacing; 881 for (var i = 0; i < _columns.Count; i++)
LegacyLayouts\RelativeLayout.cs (1)
258 for (var i = 0; i < parents.Count; i++)
ListView\ListView.cs (1)
561 if (itemSource?.Count > groupIndex)
Menu\MenuBarItem.cs (3)
57 public int Count => _menus.Count; 63 var index = _menus.Count; 70 for (int i = _menus.Count - 1; i >= 0; i--)
Menu\MenuFlyout.cs (3)
33 public int Count => _menus.Count; 39 var index = _menus.Count; 52 for (int i = _menus.Count - 1; i >= 0; i--)
Menu\MenuFlyoutSubItem.cs (3)
25 public int Count => _menus.Count; 31 var index = _menus.Count; 39 for (int i = _menus.Count - 1; i >= 0; i--)
MergedStyle.cs (1)
172 for (var i = 0; i < _implicitStyles.Count; i++)
NavigationModel.cs (16)
18 if (_navTree.Count > 0) 28 if (_navTree.Count == 0) 87 if (stack.Count <= 1) 101 if (_navTree.Count <= 1) 112 if (_navTree.Count > 0 && 113 _navTree[0].Count > 0 && 128 if (_navTree.Count == 1) 130 if (_navTree[0].Count > 1) 140 if (_navTree.Last().Count == 0) 142 _navTree.RemoveAt(_navTree.Count - 1); 155 if (stack.Count <= 1) 157 stack.RemoveRange(1, stack.Count - 1); 170 if (_navTree.Count > 0) 200 if (_navTree.Count > 0 && 201 _navTree[0].Count > 0 && 216 while (!(found = currentStack.Remove(page)) && i < _navTree.Count - 1)
NavigationPage\NavigationPage.cs (1)
584 var topLevelPage = parentPages[parentPages.Count - 1];
NavigationProxy.cs (4)
203 if (_pushStack.Value.Count == 0) 252 if (list.Count == 0) 254 Page result = list[list.Count - 1]; 255 list.RemoveAt(list.Count - 1);
NavigationStepRequest.cs (2)
28 public int Count => _pages.Count; 120 for (var i = 0; i < _innerList.Count; i++)
ObservableList.cs (2)
61 index -= items.Count - 1; 63 for (var i = 0; i < items.Count; i++)
OrderedDictionary.cs (2)
133 for (var i = 0; i < _keyOrder.Count; ++i) 426 for (var i = 0; i < _odict._keyOrder.Count; ++i)
Page\Page.cs (2)
384 if (_pendingActions.Count > 0) 604 if (startingLayout.Count <= i || c.Bounds != startingLayout[i])
Platform\ModalNavigationManager\ModalNavigationManager.cs (9)
22 _platformModalPages.Count > 0 ? _platformModalPages[_platformModalPages.Count - 1] : (_window.Page ?? throw new InvalidOperationException("Current Window isn't loaded")); 25 _platformModalPages.Count > 0 ? _platformModalPages[_platformModalPages.Count - 1] : throw new InvalidOperationException("Modal Stack is Empty"); 132 for (popTo = 0; popTo < _platformModalPages.Count && popTo < _modalPages.Count; popTo++) 141 if (_platformModalPages.Count == _modalPages.Count && popTo == _platformModalPages.Count) 150 if (_platformModalPages.Count > popTo && IsModalReady) 167 var i = _platformModalPages.Count;
Profiler.cs (1)
150 _slot = Data.Count;
Shapes\GeometryHelper.cs (9)
136 for (int i = 1; i < points.Count; i++) 139 ptLast = points[points.Count - 1]; 158 for (int i = 1; i < points.Count; i++) 161 ptLast = points[points.Count - 1]; 174 for (int i = 1; i < points.Count; i++) 177 ptLast = points[points.Count - 1]; 195 for (int i = 1; i < points.Count; i++) 198 ptLast = points[points.Count - 1]; 219 for (int i = 1; i < points.Count; i++)
Shapes\PathGeometry.cs (1)
112 for (int i = 0; i < points.Count; i++)
Shell\RouteRequestBuilder.cs (10)
172 for (var i = 0; i < _matchedSegments.Count; i++) 175 if (segmentsToMatch.Count <= i || segmentsToMatch[i] != seg) 205 if (nextMatch >= _allSegments.Count) 221 var nextMatch = _matchedSegments.Count; 222 if (nextMatch >= _allSegments.Count) 233 var nextMatch = _matchedSegments.Count; 234 if (nextMatch >= _allSegments.Count) 253 int count = GlobalRouteMatches.Count; 269 public bool IsFullMatch => _matchedSegments.Count == _allSegments.Count;
Shell\Shell.cs (2)
913 for (int i = 0; i < _appearanceObservers.Count; i++) 1871 for (int i = 0; i < _flyoutBehaviorObservers.Count; i++)
Shell\ShellFlyoutItemsManager.cs (11)
30 for (var i = flyoutItems.Count; i < _lastGeneratedFlyoutItems.Count; i++) 33 for (var i = _lastGeneratedFlyoutItems.Count; i < flyoutItems.Count; i++) 36 for (var i = 0; i < _lastGeneratedFlyoutItems.Count; i++) 48 for (var j = 0; j < source.Count; j++) 176 if (_lastGeneratedFlyoutItems?.Count == result.Count) 179 for (var i = 0; i < result.Count && !hasChanged; i++) 184 if (topLevelNew.Count != topLevelPrevious.Count) 190 for (var j = 0; j > topLevelNew.Count; j++) 227 if (currentGroup.Count > 0)
Shell\ShellNavigationManager.cs (7)
111 if (navigationRequest.Request.GlobalRoutes.Count > 0 && 128 ApplyQueryAttributes(shellContent, parameters, navigationRequest.Request.GlobalRoutes.Count == 0, isRelativePopping); 161 if (navigatedToNewShellElement || navigationRequest.Request.GlobalRoutes.Count == 0) 165 if (navigationRequest.Request.GlobalRoutes.Count == 0) 175 if (navigationRequest.Request.GlobalRoutes.Count > 0 && navigationRequest.StackRequest != ShellNavigationRequest.WhatToDoWithTheStack.ReplaceIt) 183 else if (navigationRequest.Request.GlobalRoutes.Count == 0 && 569 if (routeStack.Count > 0)
Shell\ShellNavigationState.cs (1)
88 if (toKeep.Count == 0)
Shell\ShellSection.cs (48)
66 if (_navStack.Count > 1) 67 return _navStack[_navStack.Count - 1]; 116 if (_navStack.Count <= 1) 119 var page = _navStack[_navStack.Count - 1]; 133 if (_navStack.Count <= 1) 139 for (int i = 1; i < oldStack.Count; i++) 145 for (int i = 1; i < oldStack.Count; i++) 156 if (_navStack.Count <= 1) 159 var last = _navStack[_navStack.Count - 1]; 172 if (_navStack.Count <= 1) 333 for (int i = 1; i < navStackCopy.Count; i++) 336 if (i > globalRoutes.Count || routeToRemove != globalRoutes[i - 1]) 354 for (int i = 0; i < globalRoutes.Count; i++) 356 bool isLast = i == globalRoutes.Count - 1; 359 if (navIndex < _navStack.Count && Routing.GetRoute(_navStack[navIndex]) == globalRoutes[i]) 364 var page = GetOrCreateFromRoute(globalRoutes[i], queryData, services, i == globalRoutes.Count - 1, false); 370 else if (!isLast && navIndex < _navStack.Count) 384 for (int i = 0; i < globalRoutes.Count; i++) 386 bool isLast = i == globalRoutes.Count - 1; 392 if (navStack.Count == 1) 395 Page navPage = navStack.Count > i + 1 ? navStack[i + 1] : null; 419 while (navStack.Count > popCount && Navigation.ModalStack.Count > 0) 421 bool isAnimated = animate ?? IsNavigationAnimated(navStack[navStack.Count - 1]); 423 var nextModalPageToPopIndex = navStack.Count - 2; 436 if (Navigation.ModalStack.Contains(navStack[navStack.Count - 1])) 448 while (_navStack.Count > popCount) 452 if ((_navStack.Count - popCount) == 1) 454 bool isAnimated = animate ?? IsNavigationAnimated(_navStack[_navStack.Count - 1]); 459 OnRemovePage(_navStack[_navStack.Count - 2]); 477 for (int i = 0; i < globalRoutes.Count; i++) 480 for (int j = 1; j < _navStack.Count; j++) 513 if (globalRoutes == null || globalRoutes.Count == 0) 515 if (_navStack.Count == 2) 532 bool weveGoneTotalModal = currentNavStack.Count > _navStack.Count; 536 whereToStartNavigation = currentNavStack.Count - 1; 538 for (int i = whereToStartNavigation; i < globalRoutes.Count; i++) 540 bool isLast = i == globalRoutes.Count - 1; 570 for (int i = 0; i < modalPageStacks.Count; i++) 572 bool isLast = i == modalPageStacks.Count - 1; 612 for (int i = pages.Count - 1; i >= 0; i--) 614 bool isLast = i == pages.Count - 1; 773 if (_navStack.Count <= 1) 790 var page = _navStack[_navStack.Count - 1]; 814 if (_navStack.Count <= 1) 829 var page = _navStack[_navStack.Count - 1]; 845 for (int i = 1; i < oldStack.Count; i++) 970 if (_navStack.Count == 1)
Shell\ShellUriHandler.cs (33)
38 var lastPage = pages[pages.Count - 1]; 187 if (possibleRouteMatches.Count == 0) 194 else if (possibleRouteMatches.Count > 1) 196 string[] matches = new string[possibleRouteMatches.Count]; 263 if (result.Count > 0) 271 if (bestMatches.Count > 0) 295 if (globalRouteMatches.Count != 1) 314 if (possibleRoutePaths.Count == 0) 366 if (pureRoutesMatch.Count > 0) 375 if (currentLocation.Content != null && pureGlobalRoutesMatch.Count == 0) 382 if (pureGlobalRoutesMatch.Count > 0) 389 pureGlobalRoutesMatch[0].SegmentsMatched.Count - 390 pureGlobalRoutesMatch[0].GlobalRouteMatches.Count; 464 for (int i = existingGlobalRoutes.Count; i < additionalRouteMatches.Count; i++) 465 requestBuilderWithNewSegments.AddGlobalRoute(additionalRouteMatches[i], segments[i - existingGlobalRoutes.Count]); 492 for (var i = localRouteStack.Count - 1; i >= 0; i--) 507 if (paths.Count > 0) 510 while (paths.Count > 1 && walkBackCurrentStackIndex >= 0) 512 if (localRouteStack.Count <= walkBackCurrentStackIndex) 619 while (nodeLocation.Shell != null && pureGlobalRoutesMatch.Count == 0) 626 if (pureGlobalRoutesMatch.Count != 1 || pureGlobalRoutesMatch[0].GlobalRouteMatches.Count == 0) 631 for (var i = 0; i < pureGlobalRoutesMatch[0].GlobalRouteMatches.Count; i++) 655 bestMatch.GlobalRouteMatches.Count == match.GlobalRouteMatches.Count) 658 for (var i = 0; i < bestMatch.GlobalRouteMatches.Count; i++) 676 while (bestMatches.Count > 1) 679 for (int i = bestMatches.Count - 1; i >= 0; i--) 705 if (bestMatches.Count == betterMatches.Count) 1007 if (segments.Count == 0) 1035 if (segments.Count == 0)
SynchronizedList.cs (1)
46 get { return _list.Count; }
TemplatedItemsList.cs (12)
247 for (var i = 0; i < _templatedObjects.Count; i++) 558 for (int i = _templatedObjects.Count; i <= index; i++) 611 if (_templatedObjects.Count <= index || (content = _templatedObjects[index]) == null) 804 for (int i = e.NewStartingIndex; i < _templatedObjects.Count; i++) 824 for (int i = removeIndex + e.OldItems.Count; i < _templatedObjects.Count; i++) 904 for (var i = 0; i < oldItems.Count; i++) 1003 if (maxindex > _templatedObjects.Count) 1004 _templatedObjects.InsertRange(_templatedObjects.Count, Enumerable.Repeat<TItem>(null, maxindex - _templatedObjects.Count)); 1011 for (int i = e.NewStartingIndex; i < _templatedObjects.Count; i++) 1062 for (int i = removeIndex + e.OldItems.Count; i < _templatedObjects.Count; i++) 1202 for (var i = 0; i < _templatedObjects.Count; i++)
TypedBinding.cs (7)
353 for (int i = 0; i < chain.Count; i++) 356 if (i != chain.Count - 1 || !rootIsSource) 367 if (_ancestryChain == null || _ancestryChain.Count == 0) 369 int count = _ancestryChain.Count; 380 _ancestryChain.RemoveAt(_ancestryChain.Count - 1); 388 for (int i = 0; i < _ancestryChain.Count; i++) 442 if (index + 1 < _ancestryChain.Count)
VisualElement\VisualElement.cs (1)
1565 if (changedResources.Count != 0)
VisualStateManager.cs (2)
468 if (conflicts.Count > 1) 772 public int Count => _internalList.Count;
WebView\WebView.cs (1)
318 for (var i = 0; i < uniqueMatches.Count; i++)
Microsoft.Maui.Controls.BindingSourceGen (3)
BindingTransformer.cs (2)
22 var sourceIsReferenceType = newPath.Count == 0 && !BindingInvocationDescription.SourceType.IsValueType; 23 var previousPartIsReferenceType = newPath.Count > 0 && PreviousPartIsReferenceType(newPath.Last());
Setter.cs (1)
18 var tmpVariableName = $"p{patternMatchingExpressions.Count}";
Microsoft.Maui.Controls.Build.Tasks (19)
CompiledConverters\ListStringTypeConverter.cs (1)
25 yield return Create(Ldc_I4, parts.Count);
CompiledValueProviders\SetterValueProvider.cs (2)
17 ((IElementNode)node).CollectionItems.Count == 1) 53 if (items == null || items.Count <= 0)
CompiledValueProviders\StyleSheetProvider.cs (1)
24 ((IElementNode)node).CollectionItems.Count == 1)
CreateObjectVisitor.cs (3)
202 if (node.CollectionItems.Count == 1 && (vnode = node.CollectionItems.First() as ValueNode) != null && 211 else if (node.CollectionItems.Count == 1 && (vnode = node.CollectionItems.First() as ValueNode) != null && 395 var hasValue = node.CollectionItems.Count == 1 && node.CollectionItems[0] is ValueNode &&
MethodDefinitionExtensions.cs (1)
24 if (methodDef.Parameters.Count != arguments.Count)
NodeILExtensions.cs (8)
481 if (nodes.Count == 0 && context.ParentContextValues == null) 487 if (nodes.Count == 0) 510 yield return Instruction.Create(OpCodes.Ldc_I4, nodes.Count); 524 yield return Create(Ldc_I4, nodes.Count); //destinationIndex 540 if (nodes.Count > 0) 542 for (var i = 0; i < nodes.Count; i++) 591 yield return Instruction.Create(OpCodes.Ldc_I4, scopes.Count); 632 if (pushParentIl[pushParentIl.Count - 1].OpCode != Ldnull)
SetPropertiesVisitor.cs (3)
89 if (pList != null && pList.CollectionItems.Count == 1) 1154 yield return Create(Ldc_I4, handlers.Count); 1157 for (var i = 0; i < handlers.Count; i++)
Microsoft.Maui.Controls.SourceGen (2)
src\Controls\src\Xaml\XmlTypeXamlExtensions.cs (2)
56 if (lookupAssemblies.Count == 0) 69 for (var i = 0; i < lookupNames.Count; i++)
Microsoft.Maui.Controls.Xaml (13)
ApplyPropertiesVisitor.cs (1)
105 if (parentNode is ListNode pList && pList.CollectionItems.Count == 1)
CreateValuesVisitor.cs (3)
298 var array = new object[listnode.CollectionItems.Count]; 299 for (var i = 0; i < listnode.CollectionItems.Count; i++) 345 if (node.CollectionItems.Count == 1
PruneIgnoredNodesVisitor.cs (1)
31 for (var i = 0; i < prefixes.Count; i++)
RemoveDuplicateDesignNodes.cs (1)
27 for (var i = 0; i < props.Count; i++)
SimplifyOnPlatformVisitor.cs (1)
60 else if (node.CollectionItems.Count > 0) // syntax like {OnPlatform foo, iOS=bar}
SimplifyTypeExtensionVisitor.cs (1)
68 if (node.CollectionItems.Count == 1
XamlParser.cs (3)
124 if (node.CollectionItems.Count == 1 && node.CollectionItems[0] is ValueNode) 152 if (nodes.Count == 0) //Empty element 154 if (nodes.Count == 1)
XmlTypeXamlExtensions.cs (2)
56 if (lookupAssemblies.Count == 0) 69 for (var i = 0; i < lookupNames.Count; i++)
Microsoft.Maui.Essentials (6)
Email\Email.shared.cs (3)
68 if (message.To?.Count > 0) 71 if (message.Cc?.Count > 0) 74 if (message.Bcc?.Count > 0)
Share\Share.shared.cs (1)
140 if (!(request.Files?.Count > 0))
VersionTracking\VersionTracking.shared.cs (2)
337 return (trail.Count >= 2) ? trail[trail.Count - 2] : null;
Microsoft.Maui.Graphics (47)
PathF.cs (45)
85 if (_operations.Count > 0) 86 return _operations[_operations.Count - 1] == PathOperation.Close; 96 if (_points != null && _points.Count > 0) 107 for (var i = 0; i < _operations.Count; i++) 116 for (var i = 0; i < _points.Count; i++) 125 if (_points != null && _points.Count > 0) 126 return _points[_points.Count - 1]; 136 if (_points != null && _points.Count > 0) 137 return _points.Count - 1; 147 if (index < 0 || index >= _points.Count) 167 public int Count => _points.Count; 169 public int OperationCount => _operations.Count; 177 var operationsCount = _operations.Count; 185 if (_operations[_operations.Count - 1] == PathOperation.Close) 205 if (_arcAngles.Count > aIndex) 215 if (_arcAngles.Count > aIndex) 225 if (_arcClockwise.Count > aIndex) 235 if (_arcClockwise.Count > aIndex) 272 if (_operations[_operations.Count - 1] == PathOperation.Close) 276 _operations.RemoveAt(_operations.Count - 1); 289 if (_points.Count == 0) 433 for (var operationIndex = 0; operationIndex < _operations.Count; operationIndex++) 490 for (var s = 0; s < _operations.Count; s++) 539 if (pointIndex < _points.Count) 542 for (var segment = 0; segment < _operations.Count; segment++) 611 for (var segment = 0; segment < _operations.Count; segment++) 680 _points.RemoveRange(pointIndex, _points.Count - pointIndex); 681 _operations.RemoveRange(segmentIndex, _operations.Count - segmentIndex); 682 _arcAngles.RemoveRange(arcIndex, _arcAngles.Count - arcIndex); 683 _arcClockwise.RemoveRange(arcClockwiseIndex, _arcClockwise.Count - arcClockwiseIndex); 717 for (var segment = 0; segment < _operations.Count; segment++) 765 for (var segment = 0; segment < _operations.Count; segment++) 772 if (segmentIndex == _operations.Count - 1) 933 for (var i = 0; i < _points.Count; i++) 1004 for (var i = 0; i < operations.Count; i++) 1276 for (var i = 0; i < _points.Count; i++) 1297 for (var i = 0; i < _operations.Count; i++) 1304 for (var i = 0; i < _points.Count; i++) 1313 for (var i = 0; i < _arcAngles.Count; i++) 1323 for (var i = 0; i < _arcClockwise.Count; i++) 1354 for (var i = 0; i < _operations.Count; i++) 1361 for (var i = 0; i < _points.Count; i++) 1370 for (var i = 0; i < _arcAngles.Count; i++) 1380 for (var i = 0; i < _arcClockwise.Count; i++) 1463 for (var i = 0; i < _operations.Count && !foundClosed; i++)
Text\AttributedTextRunExtensions.cs (2)
159 for (int i = 0; i < runs.Count; i++) 180 for (int i = 0; i < runs.Count; i++)
Microsoft.Maui.Graphics.Skia (4)
SkiaTextLayout.cs (4)
107 var linesToDraw = lines.Count; 112 linesToDraw = (int)Math.Min(maxLines, lines.Count); 119 var startIndex = (lines.Count / 2); 162 for (int i = lines.Count - 1; i >= 0; i--)
Microsoft.ML.AutoML (6)
ColumnInference\ColumnTypeInference.cs (1)
308if (data.Count < 2)
ColumnInference\TextFileContents.cs (1)
111if (mostCommon.Count() < UniformColumnCountThreshold * columnCounts.Count)
TransformInference\TransformInference.cs (1)
456if (!concatColNames.Any() || (concatColNames.Count == 1 &&
Tuner\AutoZeroTuner.cs (2)
55if (_configs.Count == 0) 61aggregateTrainingStopManager.AddTrainingStopManager(new MaxModelStopManager(_configs.Count, null));
Tuner\SmacTuner.cs (1)
97var trialCount = _histories.Count + _candidates.Count;
Microsoft.ML.AutoML.SourceGenerator (15)
Template\EstimatorType.cs (3)
252if ((this.indentLengths.Count > 0)) 254int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 255this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Template\SearchSpace.cs (3)
269if ((this.indentLengths.Count > 0)) 271int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 272this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
Template\SweepableEstimator_T_.cs (3)
276if ((this.indentLengths.Count > 0)) 278int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; 279this.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\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 (3)
AutoFitTests.cs (1)
571if (ignoredExceptions.Count > 0)
GetNextPipelineTests.cs (1)
72Assert.Equal(maxIterations, history.Count);
TunerTests.cs (1)
99tuner.Histories.Count.Should().Be(0);
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)
187while (_open.Count > 0) 189var ent = _open[_open.Count - 1]; 201for (int i = _open.Count; --i >= 0;)
Environment\ConsoleEnvironment.cs (2)
183if (entries.Count == 0) 227bool needPrepend = entries.Count > 1;
Utilities\BinFinder.cs (6)
67_valuesSng[_counts.Count] = _valuesSng[i]; 78CountValues = _counts.Count; 145_valuesDbl[_counts.Count] = _valuesDbl[i]; 156CountValues = _counts.Count; 332Contracts.Assert(counts.Count == CountValues); 570Contracts.Assert(counts.Count == CountValues);
Utilities\Heap.cs (20)
61Contracts.Assert(_rgv.Count > 0); 83return _rgv.Count - 1; 114_rgv.RemoveRange(1, _rgv.Count - 1); 126if (_rgv.Count <= 1) 140int cv = _rgv.Count; 161int iv = _rgv.Count; 170Contracts.Assert(0 < iv && iv < _rgv.Count); 181Contracts.Assert(0 < iv && iv < _rgv.Count); 183int cv = _rgv.Count; 261Contracts.Assert(_rgv.Count > 0); 283return _rgv.Count - 1; 311Contracts.Assert(0 < index && index < _rgv.Count); 323int cv = _rgv.Count; 341if (_rgv.Count <= 1) 354int iv = _rgv.Count - 1; 383int iv = _rgv.Count; 403int ivSrc = _rgv.Count - 1; 421Contracts.Assert(0 < iv && iv < _rgv.Count); 432Contracts.Assert(0 < iv && iv < _rgv.Count); 434int cv = _rgv.Count;
Utilities\MathUtils.cs (1)
362for (int i = _logFactorialCache.Count; i <= n; i++)
Utilities\Utils.cs (7)
75return x == null ? 0 : x.Count; 190Contracts.Assert(!count.HasValue || (0 <= count && count <= src.Count)); 191Contracts.Assert(src.Count <= dst.Length); 193count = count ?? src.Count; 782invMap[c] = mapList.Count; 816invMap[c] = mapList.Count; 849invMap[col.Index] = mapList.Count;
Microsoft.ML.Core.Tests (10)
UnitTests\TestHosts.cs (1)
133Assert.True(messages.Count > 0);
UnitTests\TestVBuffer.cs (9)
475values[indices.Count] = func(iv.Key, iv.Value); 478dst = new VBuffer<TDst>(a.Length, indices.Count, values, indices.ToArray()); 877if (maxSlots.Count > 20 || len < 200 && rgen.Next(20) < 2 || dropAll) 884for (int i = 0; i < minSlots.Count; i++) 911if (dropSlotMinIndex >= minSlots.Count || logicalIndex < minSlots[dropSlotMinIndex]) 927Assert.Equal(expectedIndices.Count, expectedValues.Count); 928Assert.True(expectedIndices.Count <= a.GetValues().Length); 936expectedIndices.Count, expectedValues.ToArray(), a.IsDense ? null : expectedIndices.ToArray());
Microsoft.ML.Data (135)
Commands\SaveDataCommand.cs (2)
156Host.NotSensitive().Check(cols.Count > 0, "No valid columns to save"); 219ch.Check(cols.Count > 0, "No valid columns to save");
Commands\ScoreCommand.cs (1)
200ch.Check(cols.Count > 0, "No valid columns to save");
Data\DataViewUtils.cs (1)
1330var n = colIndices.Count;
DataLoadSave\Binary\BinarySaver.cs (15)
298_host.CheckIO(offsets[offsets.Count - 1] > offsets[offsets.Count - 2], "Bad offsets detected during write"); 302if (metadataInfos.Count == 0) 313long expectedPosition = offsets[metadataInfos.Count]; 314writer.WriteLeb128Int((ulong)metadataInfos.Count); 315expectedPosition += Utils.Leb128IntLength((ulong)metadataInfos.Count); 316for (int i = 0; i < metadataInfos.Count; ++i) 344_host.Assert(metadataInfos.Count == offsets.Count - 1); 345return offsets[metadataInfos.Count]; 442if (lookups.Count == block.BlockIndex) // Received in order. 444else if (lookups.Count < block.BlockIndex) // Received a block a little bit early. 447int deadToAdd = (int)block.BlockIndex - lookups.Count; 451ch.Assert(lookups.Count == block.BlockIndex); 492ch.CheckIO(stream.Position == lookupOffsets[c] + (16 * blockLookups[c].Count),
DataLoadSave\Binary\Codecs.cs (9)
336Writer.Write(_boundaries.Count); // Write the number of entries. 347return sizeof(int) * (1 + (long)_boundaries.Count) + _builder.Length; 703return (long)_offsets.Count * (sizeof(long) + sizeof(short)); 860Writer.Write(_counts.Count); 871int len = _lengths.Count == 0 ? 0 : _lengths[0]; 872for (int i = 1; i < _lengths.Count; ++i) 887Writer.Write(_indices.Count); 902long structureLength = sizeof(int) * (2 + (long)Utils.Size(_lengths) + _counts.Count + 1 + _indices.Count);
DataLoadSave\LegacyCompositeDataLoader.cs (6)
223tag = GenerateTag(exes.Count); 248if (index < exes.Count - 1) 251exes.RemoveRange(index + 1, exes.Count - index - 1); 489host.Assert(tagData.Count == acceptedIds.Count); 490if (tagData.Count == 0)
DataLoadSave\MultiFileSource.cs (1)
57if (concatenated != null && concatenated.Count > 0)
DataLoadSave\Text\TextLoader.cs (2)
247for (int i = 1; i < sortedRanges.Count; i++) 891ch.CheckUserArg(segsNew.Count > 0, nameof(Range.AllOther), "No index is selected as all other indexes.");
DataLoadSave\Transpose\TransposeSaver.cs (3)
164ch.Assert(offsets.Count == cols.Length + 2); 165ch.Assert(offsets[offsets.Count - 1] == stream.Position); 167for (int c = 1; c < offsets.Count; ++c)
DataView\ArrayDataViewBuilder.cs (5)
30if (_columns.Count == 0) 55if (_columns.Count > 0 && values.Length != _columns[0].Length) 191_host.Check(_columns.Count > 0, "Cannot construct data-view with neither any columns nor a specified row count"); 215_host.Assert(builder._names.Count == builder._columns.Count);
DataView\InternalSchemaDefinition.cs (2)
219Column[] dstCols = new Column[userSchemaDefinition.Count]; 221for (int i = 0; i < userSchemaDefinition.Count; ++i)
DataView\Transposer.cs (2)
172ch.Trace("{0} of {1} input columns sliced into {2} columns", slicedCount, _cols.Length, toSave.Count); 173if (toSave.Count > 0)
DataView\TypedCursor.cs (1)
274for (int i = 0; i < schemaDefinition.Count; ++i)
Deprecated\Instances\HeaderSchema.cs (4)
56Contracts.Assert(nameList.Count == indexList.Count); 58var editor = VBufferEditor.Create(ref dst, _collection.Count, nameList.Count); 60if (nameList.Count < _collection.Count)
Dirty\PredictionUtils.cs (1)
122return sepChars.Count > 0 ? sepChars.ToArray() : null;
EntryPoints\EntryPointNode.cs (3)
858_host.Assert(bindings.Count == 1); 865var arr = Array.CreateInstance(type, bindings.Count); 939if (parameterBindings == null || parameterBindings.Count > 1)
EntryPoints\InputBuilder.cs (6)
84_ectx.Assert(fields.Count == attrs.Count); 234Contracts.Assert(bindings.Count > 0); 239Contracts.Assert(bindings.Count == 1); 685_ectx.Assert(fields.Count == attrs.Count);
EntryPoints\TransformModelImpl.cs (1)
272for (int i = 0; i < mappers.Count; i++)
Evaluators\AnomalyDetectionEvaluator.cs (1)
311protected override long NumExamples { get { return _examples.Count; } }
Evaluators\BinaryClassifierEvaluator.cs (4)
373if (scores.Count > 0) 385if (weightedPrecision.Count > 0) 785for (int i = 0; i < Recall.Count; i++) 792for (int i = 0; i < WeightedRecall.Count; i++)
Evaluators\ClusteringEvaluator.cs (4)
249if (_confusionMatrix.Count > 1) 253for (int i = 0; i < _confusionMatrix.Count; i++) 348while (_numInstancesOfClass.Count <= intLabel) 354while (_confusionMatrix.Count <= intLabel)
Evaluators\EvaluatorUtils.cs (6)
881if (hidden.Count > 0) 1047ch.Assert(metricNames.Count == metricCount); 1130agg = new AggregatedMetric[metricNames.Count]; 1135weightedAgg = new AggregatedMetric[metricNames.Count]; 1211Contracts.Assert(iMetric == metricNames.Count); 1544for (int i = 0; i < metricNames.Count; i++)
Evaluators\Metrics\ConfusionMatrix.cs (1)
79_host.Assert(labelNames.Count == confusionTableCounts.Length);
Evaluators\MulticlassClassificationEvaluator.cs (1)
978for (int i = 0; i < overallList.Count; i++)
Evaluators\RankingEvaluator.cs (7)
1005int maxTrunc = Math.Min(truncationLevel, queryLabels.Count); 1014for (int l = 0; l < queryLabels.Count; l++) 1039int count = queryLabels.Count; 1061Contracts.Assert(0 <= i && i < queryLabels.Count && i < queryOutputs.Count); 1062Contracts.Assert(0 <= j && j < queryLabels.Count && j < queryOutputs.Count);
Model\Pfa\PfaContext.cs (7)
116if (_cellBlocks.Count > 0) 125if (_letSetBlocks.Count > 0) 137if (_funcBlocks.Count > 0) 165if (sets.Count == 0 || locals.Length == sets.Count) 167_letSetBlocks.Add(new VariableBlock(sets.Count == 0 ? "let" : "set", locals)); 171var lets = new List<KeyValuePair<string, JToken>>(locals.Length - sets.Count);
Training\TrainerUtils.cs (1)
443if (nameMap.Count > 0)
Transforms\ColumnBindingsBase.cs (2)
706for (int j = indices.Count - 1; j >= 0; j--) 717Contracts.Assert(indices.Count == addedColumns.Length + input.Count);
Transforms\ColumnConcatenatingTransformer.cs (2)
613Contracts.Assert(allValues.Count > 0); 615dst = new VBuffer<int>(allValues.Count, allValues.ToArray());
Transforms\Hashing.cs (1)
231InvertHashHelper[] helpers = new InvertHashHelper[invertIinfos.Count];
Transforms\NormalizeColumnDbl.cs (9)
749return new ImplVec(host, scales, offsets, (offsets != null && nz.Count < cv / 2) ? nz.ToArray() : null); 1620if (Aggregator.Min[i] != 0 && nz.Count < lim) 1636else if (nz.Count == 0) 1638else if (nz.Count < lim) 1806if (offset[i] != 0 && nz.Count < lim) 1821else if (nz.Count == 0) 1823else if (nz.Count < lim) 1890var numZeroes = checked((int)(Lim - Rem - _values.Count)); 1966var numZeroes = checked((int)(Lim - Rem - _values[i].Count));
Transforms\NormalizeColumnSng.cs (18)
553protected bool HasLeftChild(int elementIndex) => GetLeftChildIndex(elementIndex) < Elements.Count; 554protected bool HasRightChild(int elementIndex) => GetRightChildIndex(elementIndex) < Elements.Count; 570Contracts.Check(Elements.Count > 0, "Cannot peek with 0 elements"); 577Contracts.Check(Elements.Count > 0, "Cannot pop with 0 elements"); 580Elements[0] = Elements[Elements.Count - 1]; 585Elements.RemoveAt(Elements.Count - 1); 599public int Count() => Elements.Count; 638var index = Elements.Count - 1; 681var index = Elements.Count - 1; 906return new ImplVec(host, scales, offsets, (offsets != null && nz.Count < cv / 2) ? nz.ToArray() : null); 1783if (Aggregator.Min[i] != 0 && nz.Count < lim) 1799else if (nz.Count == 0) 1801else if (nz.Count < lim) 1969if (offset[i] != 0 && nz.Count < lim) 1984else if (nz.Count == 0) 1986else if (nz.Count < lim) 2053var numZeroes = checked((int)(Lim - Rem - _values.Count)); 2130var numZeroes = checked((int)(Lim - Rem - _values[i].Count));
Transforms\NormalizeUtils.cs (1)
156if (columnsToNormalize.Count == 0)
Transforms\SlotsDroppingTransformer.cs (3)
697Contracts.Assert(newCategoricalSlotRanges.Count % 2 == 0); 701if (newCategoricalSlotRanges.Count > 0) 702dst = new VBuffer<int>(newCategoricalSlotRanges.Count, newCategoricalSlotRanges.ToArray());
Utilities\StreamUtils.cs (2)
166for (var i = 0; i < matchList.Count - 1; i++) 168for (var j = i + 1; j < matchList.Count; j++)
Microsoft.ML.DataView (2)
DataViewSchema.cs (2)
432for (int i = 0; i < _items.Count; i++) 435var columns = new Column[_items.Count];
Microsoft.ML.Ensemble (6)
OutputCombiners\BaseStacking.cs (1)
135var maps = new ValueMapper<VBuffer<Single>, TOutput>[models.Count];
Selector\SubModelSelector\BaseDiverseSelector.cs (2)
90if (selectedModels.Count < modelCountToBeSelected) 98if (selectedModels.Count < modelCountToBeSelected)
Trainer\EnsembleTrainerBase.cs (3)
212if (models.Count == 0 || models[0].Metrics == null) 223var subsetModels = new FeatureSubsetModel<TOutput>[models.Count]; 224for (int i = 0; i < models.Count; i++)
Microsoft.ML.EntryPoints (2)
CrossValidationMacro.cs (1)
411var warningsIdv = warnings.Count > 0 ? AppendRowsDataView.Create(env, warnings[0].Schema, warnings.ToArray()) : null;
FeatureCombiner.cs (1)
65Contracts.Assert(concatNames.Count == featNames.Count);
Microsoft.ML.FastTree (92)
Dataset\FeatureFlock.cs (15)
341if (features.Count == 0 || !IsSplittable[0]) 354int lastFlockFeature = features[features.Count - 1]; 397for (int i = 0; i < features.Count && i < learner.MaxCategoricalSplitPointsPerNode; ++i) 521if (features.Count == 0 || !IsSplittable[0]) 534int lastFlockFeature = features[features.Count - 1]; 570if (lowPopulationFeatures.Count > 0) 577SubFeatures = lowPopulationFeatures.GetRange(1, lowPopulationFeatures.Count - 1).ToArray() 615for (int i = 0; i < virtualBins.Count && catFeatureCount < learner.MaxCategoricalSplitPointsPerNode; ++i) 717if (features.Count == 0 || !IsSplittable[0]) 730int lastFlockFeature = features[features.Count - 1]; 758if (lowPopulationFeatures.Count > 0) 760if (virtualBins.Count > 1) 761vBin = virtualBins[virtualBins.Count - 2]; 790lowPopulationFeatures.GetRange(1, lowPopulationFeatures.Count - 1).ToArray(); 837for (int i = 0; i < virtualBins.Count && catFeatureCount < learner.MaxCategoricalSplitPointsPerNode; ++i)
Dataset\RepeatIntArray.cs (1)
65_values = IntArray.New(tempValueList.Count, IntArrayType.Dense, bitsPerItem, tempValueList) as DenseIntArray;
Dataset\SparseIntArray.cs (3)
83_values = IntArray.New(tempValueList.Count, IntArrayType.Dense, bitsPerItem, tempValueList) as DenseIntArray; 134if (index <= currentIndex && (index < 0 || tempValueList.Count > 0)) 166_values = IntArray.New(tempValueList.Count, IntArrayType.Dense, bitsPerItem, tempValueList) as DenseIntArray;
FastTree.cs (56)
1028ch.Assert(features.Count > 0); 1030if (features.Count == 1) 1039int[] hotFeatureStarts = new int[features.Count + 1]; 1053int lim = features[features.Count - 1] + 1; 1056for (int i = 0; i < features.Count; ++i) 1103var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 1112ch.Assert(features.Count > 1); 1115int[] hotFeatureStarts = new int[features.Count + 1]; 1129int lim = features[features.Count - 1] + 1; 1131for (int i = 0; i < features.Count; ++i) 1177var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 1368Host.Assert(1 <= toTranspose.Count && toTranspose.Count <= 4); 1538if (pending.Count > 0) 1703maxSlots[maxSlots.Count - 1] = i; 1708Contracts.Assert(maxSlots.Count == minSlots.Count); 1950int[] hotFeatureStarts = new int[features.Count + 1]; 1955var kvEnums = new IEnumerator<KeyValuePair<int, int>>[features.Count]; 1961for (int i = 0; i < features.Count; ++i) 2008ch.Assert(kvp.Key > last || values.Count == 1 || values[values.Count - 1] > values[values.Count - 2]); 2032var denseBins = (DenseIntArray)IntArray.New(values.Count, IntArrayType.Dense, flockBits, values); 2033var bups = features.Select(fi => BinUpperBounds[fi]).ToArray(features.Count); 2141if (pending.Count > 0) 2213ch.Assert(pending.Count > 0); 2249ch.Assert(pending.Count > 0); 2263if (pending.Count > 0) 2347if (pending.Count > 0) 2357ulong[] queryIds = new ulong[_boundaries.Count - 1]; // All zeros is fine 2394while (_dense.Count < index) 2418for (int i = 0; i < _dense.Count; i++) 2440Contracts.Assert(_sparse.Count == 0 || _sparse[_sparse.Count - 1].Key < length); 2441return _sparse.Count(kvp => kvp.Value > gtValue) + (0 > gtValue ? length - _sparse.Count : 0); 2445Contracts.Assert(_dense.Count <= length); 2446return _dense.Count(v => v > gtValue) + (0 > gtValue ? length - _dense.Count : 0); 2464Contracts.Assert(_sparse.Count == 0 || _sparse[_sparse.Count - 1].Key < lim); 2493Contracts.Assert(_dense.Count <= lim); 2494for (int i = 0; i < _dense.Count; ++i) 2503for (int i = _dense.Count; i < lim; ++i) 2515Contracts.Assert(_dense.Count <= length); 2521if (_dense.Count < length) 2524editor.Values.Slice(_dense.Count, length - _dense.Count).Clear(); 2532int count = _sparse.Count; 2535for (int i = 0; i < _sparse.Count; ++i) 2563Contracts.Assert(_dense.Count <= length); 2602Contracts.Assert(_dense.Count <= length); 2603for (int i = 0; i < _dense.Count; ++i) 2611for (int i = _dense.Count; i < length; ++i) 2655return rowIndex < values._dense.Count ? values._dense[rowIndex] : 0; 2661Contracts.Assert(sp.Count == 0 || sp[last].Key > lastRow); 2663while (last < sp.Count)
Training\DocumentPartitioning.cs (1)
102.Select(thread => perChunkDocumentLists[thread][leaf].Count)
TreeEnsemble\InternalRegressionTree.cs (4)
388for (int index = 0; index < categoricalNodeIndices.Count; index++) 840Contracts.Assert(path == null || path.Count == 0); 919Contracts.Assert(path == null || path.Count == 0); 1523path.RemoveAt(path.Count - 1);
TreeEnsemble\InternalTreeEnsemble.cs (9)
32public int NumTrees => _trees.Count; 236double[] values = new double[_trees.Count]; 237for (int w = 0; w < _trees.Count; ++w) 285return GetOutput(featureBins, _trees.Count); 290if (prefix > _trees.Count || prefix < 0) 291prefix = _trees.Count; 313if (_trees.Count == 0) 319if (prefix > _trees.Count || prefix < 0) 320prefix = _trees.Count;
TreeEnsembleFeaturizer.cs (1)
324for (int j = 0; j < nodes.Count; j++)
Utils\BufferPoolManager.cs (2)
53List<Array> buffers = availableBuffers.FirstOrDefault(x => x.Value.Count > 0 && x.Key >= size && (x.Key - size) < (size * 0.2)).Value as List<Array>; 55if (buffers != null && buffers.Count > 0)
Microsoft.ML.GenAI.Core (1)
Extension\ModuleExtension.cs (1)
243if (layerSizeMap.Count > 0)
Microsoft.ML.LightGbm (3)
LightGbmTrainerBase.cs (3)
573if (curFidx > catBoundaries[catBoundaries.Count - 1]) 600catMetaData.NumCol = catBoundaries.Count - 1; 785if (labelList.Count == Utils.ArrayMaxSize)
Microsoft.ML.Maml (3)
HelpCommand.cs (3)
185if (components.Count == 0) 221if (components.Count > 0) 299if (components.Count > 0)
Microsoft.ML.Mkl.Components (6)
SymSgdClassificationTrainer.cs (6)
447if (_storage.Count == 0) 458if (_storageIndex == _storage.Count - 1) 493if (_storage.Count == 0) 549public int Count => _instanceProperties.Count; 629if (_instanceProperties.Count > (1 << 30)) 666if (_instanceIndex == _instanceProperties.Count)
Microsoft.ML.OnnxConverter (2)
OnnxUtils.cs (2)
32for (int index = 0; index < dims.Count; index++) 38if (dimsParam != null && dimsParam.Count > index && dimsParam[index])
Microsoft.ML.OnnxTransformer (2)
OnnxTransform.cs (1)
457if (shape.Count > 0)
OnnxTypeParser.cs (1)
211if ((dims.Count > 0) && (dims[0] <= 0))
Microsoft.ML.OnnxTransformerTest (6)
OnnxTransformTests.cs (6)
721for (int i = 0; i < transformedDataPoints.Count; ++i) 774for (int i = 0; i < transformedDataPoints.Count; ++i) 933Assert.Equal(dataPoints.Count(), transformedDataPoints.Count); 945for (int i = 0; i < transformedDataPoints.Count; ++i) 1097Assert.Equal(dataPoints.Count(), transformedDataPoints.Count); 1109for (int i = 0; i < transformedDataPoints.Count; ++i)
Microsoft.ML.Parquet (5)
PartitionedFileLoader.cs (1)
562if (source >= 0 && source < values.Count)
PartitionedPathParser.cs (4)
290_columns = new PartitionedFileLoader.Column[names.Count]; 291for (int i = 0; i < names.Count; i++) 311if (values.Count != _columns.Length) 313throw Contracts.Except($"The extracted value count of {values.Count} does not match the expected Column count of {_columns.Length} for path {path}");
Microsoft.ML.Predictor.Tests (2)
TestTransposer.cs (2)
130T[] vals = new T[indices.Count]; 133vecs[r] = new VBuffer<T>(slotCount, indices.Count, vals, indices.ToArray());
Microsoft.ML.Recommender (3)
SafeTrainingAndModelBuffer.cs (3)
272e => { e.SetProgress(0, i); e.SetProgress(1, nodes.Count); }); 305pch.Checkpoint(i, nodes.Count); 309ch.Check(nodes.Count > 0, "No valid instances encountered during data loading");
Microsoft.ML.ResultProcessor (5)
ResultProcessor.cs (5)
736for (int i = 0; i < lines.Count; i++) 755int i = lines.Count - 1; 762while (i < lines.Count && lines[i] != SectionBreakSeparator) 779for (; i < lines.Count; i++) 868if (tempPredictorList.Count != 0)
Microsoft.ML.Samples (4)
Dynamic\Trainers\AnomalyDetection\RandomizedPcaSample.cs (1)
51for (int i = 0; i < samples.Count; ++i)
Dynamic\Trainers\AnomalyDetection\RandomizedPcaSampleWithOptions.cs (1)
59for (int i = 0; i < samples.Count; ++i)
Dynamic\Transforms\TimeSeries\Forecasting.cs (1)
50inputColumnName, 5, 11, data.Count, 5);
Dynamic\Transforms\TimeSeries\ForecastingWithConfidenceInterval.cs (1)
50inputColumnName, 5, 11, data.Count, 5,
Microsoft.ML.StandardTrainers (7)
Optimizer\DifferentiableFunction.cs (1)
214VBuffer<float> dir = new VBuffer<float>(x.Length, values.Count, values.ToArray(), indices.ToArray());
Optimizer\Optimizer.cs (6)
249int count = _roList.Count; 328if (_roList.Count < _m) 334_m = _roList.Count; 341if (_roList.Count == _m) 363_sList[_roList.Count] = nextS; 364_yList[_roList.Count] = nextY;
Microsoft.ML.Sweeper (24)
Algorithms\Grid.cs (1)
163int iPerm = (prevParamSets.Count - 1) % _nGridPoints;
Algorithms\KdoSweeper.cs (1)
241if (numericParamIndices.Count > 0)
Algorithms\NelderMead.cs (15)
116_dim = _sweepParameters.Count; 181Contracts.Assert(_pendingSweeps.Count == 1); 231Contracts.Assert(_pendingSweeps.Count == 1); 244Contracts.Assert(_pendingSweeps.Count == 1); 263Contracts.Assert(_pendingSweeps.Count == 1); 282Contracts.Assert(_pendingSweeps.Count + _pendingSweepsNotSubmitted.Count == _dim); 283if (_pendingSweeps.Count < _dim) 338Contracts.Assert(point.Length == _sweepParameters.Count); 339for (int i = 0; i < _sweepParameters.Count; i++) 375if (result.Count != _pendingSweeps.Count) 433Contracts.Assert(parameterSet.Count == _sweepParameters.Count); 436for (int i = 0; i < _sweepParameters.Count; i++) 447Contracts.Assert(array.Length == _sweepParameters.Count); 450for (int i = 0; i < _sweepParameters.Count; i++)
AsyncSweeper.cs (2)
236while (_results.Count < _numGenerated) 244_host.Check(0 <= id && id < _results.Count, "Invalid index");
ConfigRunner.cs (3)
115var args = Utils.BuildArray(RunNums.Count + 2, 118if (i == RunNums.Count) 120if (i == RunNums.Count + 1)
SweepCommand.cs (2)
94ch.Info("Could only generate {0} sweeps.", runs.Count); 97runs.AddRange(_runner.RunConfigs(sweeps, runs.Count));
Microsoft.ML.Sweeper.Tests (5)
TestSweeper.cs (5)
155Assert.Equal(sweeps, paramSets.Count); 175Assert.Equal(sweeps, paramSets.Count); 263Assert.Equal(sweeps, paramSets.Count); 345Assert.True(paramSets.Count <= sweeps); 399Assert.True(paramSets.Count <= sweeps);
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
477w.Write(modelFilePaths.Count);
Microsoft.ML.TestFramework (18)
BaseTestBaseline.cs (11)
454Fail("Baseline sequence had {0} items, but the suffix seems to have more", suffixList.Count); 460if (suffixList.Count == 0) // Empty suffix is trivially a suffix of anything. 462Contracts.Assert(suffixList.Count == seqList.Count); 465seqList[idx++ % seqList.Count] = seq.Current; 466Log("Suffix of length {0} compared against sequence of length {1}", suffixList.Count, seqList.Count + idx); 467for (int i = 0; i < suffixList.Count; ++i) 469if (!equalFunc(suffixList[i], seqList[(idx + i) % seqList.Count])) 472suffixList.Count, suffixList.Count - i - 1);
BaseTestPredictorsMaml.cs (3)
119loaderArgIndex = args.Count; 240for (int i = 0; i < args.Count; ++i) 335return settings.Count > 0 ? string.Join(" ", settings) : null;
DataPipe\TestDataPipeBase.cs (4)
407if (savable.Count < view.Schema.Count) 547if (savable.Count < view.Schema.Count) 583if (savable.Count == 0) 598if (savable.Count < view.Schema.Count)
Microsoft.ML.Tests (4)
TrainerEstimators\MatrixFactorizationTests.cs (1)
683Assert.Equal(6000, results.Count);
Transformers\GroupUngroup.cs (2)
59Assert.Equal(2, grouped.Count); 91Assert.Equal(4, ungrouped.Count);
Transformers\ValueMappingTests.cs (1)
788for (int i = 0; i < features.Count; ++i)
Microsoft.ML.TimeSeries (53)
AdaptiveSingularSpectrumSequenceModeler.cs (3)
931if (sortedComponents.Count > 1 && polynomialTrendFound) 936for (i = 0; i < sortedComponents.Count - 1; ++i) 953for (i = 1; i < sortedComponents.Count; ++i)
ExtensionsCatalog.cs (2)
339if (causes?.Count > 0) 429host.CheckUserArg(src.Slices.Count >= 1, nameof(src.Slices), "Must has more than one item");
PolynomialUtils.cs (9)
155for (var i = 0; i < Coefficients.Count; ++i) 179var len = Coefficients.Count; 182PolynomialMultiplication(destination, 0, len, len, factor.Coefficients.Count, 0, 1, 1); 184for (var i = 0; i < Coefficients.Count; ++i) 341while (factors.Count > 1) 344var k2 = Math.Abs(factors.ElementAt(factors.Count - 1).Key); 354f1 = factors.ElementAt(factors.Count - 1); 355factors.RemoveAt(factors.Count - 1); 362ind = Math.Min(factors.Count - 1, ind);
PredictionEngine.cs (1)
209if (rows.Count == 0)
RootCauseAnalyzer.cs (12)
162children = GetTopAnomaly(anomalyTree.ChildrenNodes[dimension.DimensionKey], anomalyTree.ParentNode, pointTree.ChildrenNodes[dimension.DimensionKey].Count > 0 ? pointTree.ChildrenNodes[dimension.DimensionKey] : pointTree.Leaves, dimension.DimensionKey, !(pointTree.ChildrenNodes[dimension.DimensionKey].Count > 0)); 215if (anomalyPoints.Count == 1) 236if (ShouldSeparateAnomaly(delta, root.Delta, pointSize, causeList.Count)) 249double totalEntropy = GetEntropy(totalPoints.Count, anomalyPoints.Count); 329double meanGain = sumGain / aggDim.Count; 353if (dst.Items.Count > 1) 370for (int i = 0; i < scoreList.Count; i++) 382else if (dst.Items.Count == 1) 459if (aggNum == aggDims.Count) 463else if (aggNum == aggDims.Count - 1)
SrCnnAnomalyDetectionBase.cs (4)
178int length = backAddList.Count; 194for (int i = 0; i < magLogList.Count; ++i) 261var n = data.Count; 275for (int i = n; i < cumSumList.Count; ++i)
SrCnnEntireAnomalyDetector.cs (15)
297public int Count => _batch.Count; 301_batchSize = _batch.Count; 302if (_batch.Count < MinBatchSize) 304if (_previousBatch.Count == 0) 308_bLen = _previousBatch.Count - _batch.Count; 309_previousBatch = _previousBatch.GetRange(_batch.Count, _bLen); 314for (int i = 0; i < _batch.Count; ++i) 792if (anomalyIndex.Count > 1) 795for (int i = 0; i < anomalyIndex.Count - 1; ++i) 797while (cursor < segments.Count && anomalyIndex[i] >= segments[cursor].Item2) 802if (cursor < segments.Count && segments[cursor].Item1 <= anomalyIndex[i] && anomalyIndex[i + 1] <= segments[cursor].Item2) 917while (fitValues.Count < minPointsToFit && (start > 0 || end < data.Length - 1)) 932if (fitValues.Count > 1) 941var n = values.Count;
STL\InnerStl.cs (5)
203List<double> virtualXValues = VirtualXValuesProvider.GetXValues(_cycleSubSeries[i].Count); 213_smoothedSubseries[i].Add(model.EstimateY(_cycleSubSeries[i].Count * 1.0)); 218for (int i = 0; i < _smoothedSubseries[0].Count; i++) 222if (_smoothedSubseries[j].Count <= i) 241List<double> virtualC3XValues = VirtualXValuesProvider.GetXValues(c3.Count);
STL\MathsTools.cs (2)
19if (values == null || values.Count == 0) 23return QuickSelect(values, values.Count / 2 + 1);
Microsoft.ML.TimeSeries.Tests (14)
TimeSeriesDirectApi.cs (10)
137while (enumerator.MoveNext() && index < expectedValues.Count) 195while (enumerator.MoveNext() && index < expectedValues.Count) 909for (int i = 0; i < data.Count; ++i) 964Assert.Equal(1, (int)rootCause.Items.Count); 967Assert.Equal(1, (int)rootCause.Items[0].Path.Count); 991Assert.Equal(2, preparedCauses.Count); 993Assert.Equal(1, (int)preparedCauses[0].Items.Count); 996Assert.Equal(1, (int)preparedCauses[0].Items[0].Path.Count); 1009Assert.Equal(1, (int)preparedCauses[1].Items.Count); 1012Assert.Equal(1, (int)preparedCauses[1].Items[0].Path.Count);
TimeSeriesSimpleApiTests.cs (4)
65while (enumerator.MoveNext() && index < expectedValues.Count) 109while (enumerator.MoveNext() && index < expectedValues.Count) 160for (var i = 0; enumerator.MoveNext() && i < expectedValues.Count; i++) 218for (var i = 0; enumerator.MoveNext() && i < expectedValues.Count; i++)
Microsoft.ML.Tokenizers (82)
Model\BPETokenizer.cs (3)
527EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), ids, maxTokenCount - ids.Count, out int length, ref priorityQueue); 530if (length < split.Length || ids.Count >= maxTokenCount) 541if (EndOfSentenceToken is not null && ids.Count < maxTokenCount)
Model\CodeGenTokenizer.cs (13)
632EncodeToIdsInternal(null, textSpanToEncode.Slice(split.Offset, split.Length), ids, agenda, out int length, maxTokenCount - ids.Count); 635if (length < split.Length || ids.Count >= maxTokenCount) 643EncodeToIdsInternal(addPrefixSpace ? null : (normalizedText ?? text), textSpanToEncode, ids, agenda, out charsConsumed, maxTokenCount - ids.Count); 646if (addEndOfSentence && EndOfSentenceId.HasValue && ids.Count < maxTokenCount) 1017if (tokens.Count <= maxTokens) 1028return tokens.Count; 1039while (j < tokens.Count && tokens[j].Offset.Start.Value == tokens[tokenCount].Offset.Start.Value) 1073if (tokens.Count <= maxTokens) 1084return tokens.Count; 1087int index = tokens.Count - maxTokens; 1090while (index < tokens.Count && tokens[index].Offset.Start.Value == tokens[index - 1].Offset.Start.Value) 1095for (int i = index; i < tokens.Count; i++) 1101return tokens.Count - index;
Model\EnglishRobertaTokenizer.cs (21)
441EncodeToIdsInternal(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 444if (length < split.Length || ids.Count >= maxTokenCount) 592if (tokens.Count <= maxTokens) 603return tokens.Count; 629if (tokens.Count <= maxTokens) 640return tokens.Count; 645for (int i = tokens.Count - maxTokens; i < tokens.Count; i++) 653for (int i = tokens.Count - maxTokens; i < tokens.Count; i++) 983if (word.Count == 1) 998while (i < word.Count) 1005for (int k = i; k < word.Count; k++) 1024if (i < word.Count - 1 && word[i + 1] == second) 1045var tokens = new List<EncodedToken>(word.Count); 1150Debug.Assert(rank < _symbols.Count); 1159if ((uint)rank >= _symbols.Count) 1176idx = _symbols.Count; 1188idx = _symbols.Count; 1213return idx < _symbols.Count ? _symbols[idx].Id : UnkIndex; 1217public int Count => _symbols.Count;
Model\SentencePieceBpeModel.cs (1)
28for (int i = 0; i < modelProto.Pieces.Count; i++)
Model\SentencePieceTokenizer.cs (2)
659else if (unkId < 0 || unkId >= vocab.Count) 661throw new InvalidDataException($"The tokenizer.json model 'unk_id' ({unkId}) is out of range for a vocabulary of {vocab.Count} pieces.");
Model\SentencePieceUnigramModel.cs (23)
34if (modelProto.TrainerSpec.BosId >= modelProto.Pieces.Count || 35modelProto.TrainerSpec.EosId >= modelProto.Pieces.Count || 36modelProto.TrainerSpec.UnkId >= modelProto.Pieces.Count) 41_vocabReverse = new (string Piece, float Score, ModelProto.Types.SentencePiece.Types.Type Type)[modelProto.Pieces.Count]; 46for (int i = 0; i < modelProto.Pieces.Count; i++) 629int insertionStartPosition = tokens.Count; 646int end = tokens.Count - 1; 664while (start < tokens.Count) 691while (insertionStartPosition < tokens.Count) 852if (ids.Count >= maxTokenCount) 880if (ids.Count >= maxTokenCount) 941if (ids.Count >= maxTokenCount) 961if (ids.Count < maxTokenCount) 974if (ids.Count < maxTokenCount) 1026if (IdsIndex >= ids.Count) 1056if (ids.Count >= maxTokenCount) 1076int insertionStartPosition = ids.Count; 1101unknownTokensTracking[unknownTokensCount - 1] = (ids.Count - 1, node.StartsAt, endsAt - node.StartsAt); 1109ids.Reverse(insertionStartPosition, ids.Count - insertionStartPosition); 1115int end = ids.Count - 1; 1156while (index < ids.Count && index + addedTokensCount < maxTokenCount) 1195if (index < ids.Count) 1197ids.RemoveRange(index, ids.Count - index);
Model\TiktokenTokenizer.cs (2)
393EncodeToIds(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 396if (length < split.Length || ids.Count >= maxTokenCount)
Model\WordPieceTokenizer.cs (6)
328int initialTokensCount = tokens.Count; 372tokens.RemoveRange(initialTokensCount, tokens.Count - initialTokensCount); 420EncodeToIds(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 422if (length < split.Length || ids.Count >= maxTokenCount) 514accumulatedIds?.RemoveRange(accumulatedIds.Count - addedIds, addedIds); 521accumulatedIds?.RemoveRange(accumulatedIds.Count - addedIds, addedIds);
Utils\DoubleArrayTrie.cs (3)
66public bool IsEmpty => _units.Count == 0; 83_ranks = new uint[_units.Count]; 86for (int i = 0; i < _units.Count; ++i)
Utils\PriorityQueue.cs (8)
27int ci = _data.Count - 1; // child index; start at end 40int li = _data.Count - 1; // last index (before removal) 67public int Count => _data.Count; 72for (int i = 0; i < _data.Count; ++i) 74s += "count = " + _data.Count; 83if (_data.Count == 0) return true; 84int li = _data.Count - 1; // last index 85for (int pi = 0; pi < _data.Count; ++pi) // each parent index
Microsoft.ML.Tokenizers.Tests (21)
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (3)
66public bool IsEmpty => _units.Count == 0; 83_ranks = new uint[_units.Count]; 86for (int i = 0; i < _units.Count; ++i)
UnigramTests.cs (18)
290if (addBeginningOfSentence && writableTokens.Count > 0) 298if (addEndOfSentence && writableTokens.Count > 0) 300Assert.True(writableTokens[writableTokens.Count - 1].Id == tokenizer.EndOfSentenceId); 301Assert.True(writableTokens[writableTokens.Count - 1].Value == tokenizer.EndOfSentenceToken); 305Assert.True(writableTokens[writableTokens.Count - 1].Offset.Equals(new Range(normalized.Length, normalized.Length))); 307writableTokens.RemoveAt(writableTokens.Count - 1); 389if (ints.Count > 0) 397if (ints.Count > 0) 405if (ints.Count > 0) 408ints.RemoveAt(ints.Count - 1); 414if (ints.Count > 0) 417ints.RemoveAt(ints.Count - 1); 433if (ints.Count > 0) 437if (ints.Count > ids.Length) 439ints.RemoveAt(ints.Count - 1); 449if (ints.Count > 0) 453if (ints.Count > ids.Length) 455ints.RemoveAt(ints.Count - 1);
Microsoft.ML.TorchSharp (24)
AutoFormerV2\Attention.cs (1)
72int n = points.Count;
AutoFormerV2\AutoFormerV2Backbone.cs (2)
90for (int iLayer = 1; iLayer < depths.Count; iLayer++) 94outChannels: embedChannels[Math.Min(iLayer + 1, embedChannels.Count - 1)],
AutoFormerV2\BasicLayer.cs (2)
72for (int i = 0; i < hSlicesStartAndEnd.Count; i += 2) 74for (int j = 0; j < wSlicesStartAndEnd.Count; j += 2)
AutoFormerV2\FPN.cs (2)
93outs.Add(this.fpn_convs[i].forward(outs[outs.Count - 1])); 96for (int i = 0; i < outs.Count; i++)
AutoFormerV2\ObjectDetectionMetrics.cs (10)
69filterNum += objectLabelList.Count - objectLabelListOut[^1].Count; 70total += objectLabelList.Count; 183for (int annotaIndex = 0; annotaIndex < annotation.Count; annotaIndex++) 187for (int detectIndex = 0; detectIndex < objectLabel.Count; detectIndex++) 205bool[] annoSign = new bool[annotation.Count]; // whether a annotation bbox is used, default false 206bool[] predSign = new bool[objectLabel.Count]; // whether a predict bbox is used, default false 233for (int annoIndex = 0; annoIndex < annotations?.Count; annoIndex++) 254if (detectionList?.Count == 0) 261for (int index = 0; index < detectionList.Count; index++)
AutoFormerV2\RetinaHead.cs (1)
71for (int i = 0; i < inputs.Count; i++)
NasBert\Models\NasBertEncoder.cs (2)
124var hiddenTransferList = Enumerable.Range(0, HiddenSizePerBlock.Count) 264if (hiddenSizePerBlock.Count == 0)
NasBert\NasBertTrainer.cs (2)
273int[,] lengthArray = new int[inputTensors.Count, 1]; 274for (int i = 0; i < inputTensors.Count; i++)
TorchSharpBaseTrainer.cs (1)
261numRows = inputTensors.Count;
Utils\ImageUtils.cs (1)
74if (finalResult[0].Count > 0)
Microsoft.ML.TorchSharp.Tests (1)
ObjectDetectionTests.cs (1)
89Assert.True(logs.Count > 0);
Microsoft.ML.Transforms (83)
CountFeatureSelection.cs (1)
273if (slots.Count <= 0)
Expression\CodeGen.cs (4)
358Contracts.Assert(0 <= loc.Index && loc.Index < _cacheWith.Count); 1331int index = _cacheWith.Count; 1389Contracts.Assert(_cacheWith.Count == index + 1); 1398Contracts.Assert(_cacheWith.Count == index + 1);
Expression\LambdaBinder.cs (14)
61env.Assert(binder._rgwith.Count == 0); 150for (int i = _rgwith.Count; --i >= 0;) 1339if (candidates.Count == 0) 1377for (int i = 0; i < candidates.Count; i++) 1389if (0 < count && count < candidates.Count) 1390candidates.RemoveRange(count, candidates.Count - count); 1391_host.Assert(candidates.Count > 0); 1392_host.Assert(count == 0 || count == candidates.Count); 1403_host.Assert(0 <= icandMinBad && icandMinBad < candidates.Count); 1556for (int i = 0; i < candidates.Count; i++) 1565if (j >= candidates.Count) 1614int iwith = _rgwith.Count; 1621_host.Assert(_rgwith.Count == iwith + 1); 1624_host.Assert(_rgwith.Count == iwith);
Expression\LambdaParser.cs (10)
46if (index == lineMap.Count || IchLim < lineMap[index]) 64Contracts.Assert(ivMin <= map.Count); 65int ivLim = map.Count; 74Contracts.Assert(0 <= ivMin && ivMin <= map.Count); 75Contracts.Assert(ivMin == map.Count || value < map[ivMin]); 194Contracts.Assert(_errors == null || _errors.Count > 0); 196if (Utils.Size(_errors) > 0 && _errors[_errors.Count - 1].Token == err.Token) 378items.Add(ParseParam(items.Count)); 385if (items.Count != _types.Length) 641Contracts.Assert(list.Count >= 2);
Expression\MethodGenerator.cs (3)
152if (_locals != null && _locals.TryGetValue(key, out locals) && locals.Count > 0) 154var temp = locals[locals.Count - 1]; 155locals.RemoveAt(locals.Count - 1);
LearnerFeatureSelection.cs (2)
184var count = slots.Count; 225if (slots.Count > 0)
MissingValueHandlingTransformer.cs (4)
226if (naIndicatorCols.Count > 0) 230if (naConvCols.Count > 0) 240if (naIndicatorCols.Count > 0) 244if (dropCols.Count > 0)
MissingValueIndicatorTransformer.cs (7)
346if (indices.Count == 0) 363if (sense && indices.Count < srcLength / 2) 366int dstCount = indices.Count; 376else if (!sense && srcLength - indices.Count < srcLength / 2) 379int dstCount = srcLength - indices.Count; 401Host.Assert(iiSrc + 1 < indices.Count); 428Host.Assert(ii < indices.Count);
MissingValueReplacing.cs (3)
331StatAggregator[] statAggregators = new StatAggregator[columnsToImpute.Count]; 332for (int ii = 0; ii < columnsToImpute.Count; ii++) 357for (int ii = 0; ii < columnsToImpute.Count; ii++)
MutualInformationFeatureSelection.cs (4)
373if (slots.Count <= 0) 798Contracts.Assert(_singles.Count == 0); 817Contracts.Assert(_singles.Count == 0); 843Contracts.Assert(_doubles.Count == 0);
OneHotEncoding.cs (2)
308if (binaryCols.Count > 0) 310if (cols.Count > 0)
OneHotHashEncoding.cs (2)
358if (binaryCols.Count > 0) 360if (cols.Count > 0)
PermutationFeatureImportance.cs (9)
108evaluatedFeaturesCount = workingFeatureIndices.Count; 123if (workingFeatureIndices.Count == 0 && zeroWeightsCount == 0) 148while (initialfeatureValuesList.Count < maxSize && cursor.MoveNext()) 154valuesRowCount = initialfeatureValuesList.Count; 180if (processedCnt < workingFeatureIndices.Count - 1) 187Contracts.Assert(input.Count == 1); 191Contracts.Assert(output.Count == 1); 211processedCnt < workingFeatureIndices.Count - 1) 236if (processedCnt < workingFeatureIndices.Count - 1)
SvmLight\SvmLightLoader.cs (3)
240intermediate.FeatureKeys = new VBuffer<ReadOnlyMemory<char>>(keys.Count, keys.ToArray()); 241intermediate.FeatureValues = new VBuffer<float>(values.Count, values.ToArray()); 721env.Assert(schemaDef.Count == 1);
Text\LdaTransform.cs (1)
524int count = retTopics.Count;
Text\NgramTransform.cs (1)
617start += ngramIds[i].Count;
Text\SentimentAnalyzingTransform.cs (1)
129if (toHide.Count == 0)
Text\StopWordsRemovingTransformer.cs (2)
438VBufferUtils.Copy(list, ref dst, list.Count); 1126VBufferUtils.Copy(list, ref dst, list.Count);
Text\TextFeaturizingEstimator.cs (2)
580if (xfCols.Count > 0) 604if (srcTaggedCols.Count > 0)
Text\TextNormalizing.cs (1)
379VBufferUtils.Copy(list, ref dst, list.Count);
Text\WordBagTransform.cs (3)
488if (termCols.Count > 0) 491string[] missingDropColumns = termLoaderArgs != null && termLoaderArgs.DropUnknowns ? new string[termCols.Count] : null; 493for (int iinfo = 0; iinfo < termCols.Count; iinfo++)
Text\WordTokenizing.cs (4)
265var editor = VBufferEditor.Create(ref dst, terms.Count); 266if (terms.Count > 0) 296var editor = VBufferEditor.Create(ref dst, terms.Count); 297for (int i = 0; i < terms.Count; i++)
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
848int featureLength = featurizedImages.Count > 0 ? featurizedImages[0].Item2.Length : 0;
Microsoft.NET.Build.Containers (3)
ImageConfig.cs (1)
141int numberOfLayers = _rootFsLayers.Count;
src\sdk\src\Common\VSHostObject.cs (1)
84if (dtos is not null && dtos.Count > 0)
VSHostObject.cs (1)
76if (dtos is not null && dtos.Count > 0)
Microsoft.NET.Build.Extensions.Tasks (2)
src\sdk\src\Tasks\Common\ConflictResolution\ConflictResolver.cs (2)
123if (newUnresolvedConflicts.Count == 0) 131if (newUnresolvedConflicts.Count > 0)
Microsoft.NET.Build.Tasks (21)
_generated\3\SdkVulnerabilitySummaryContext.ListSdkCveSummary.g.cs (1)
57for (int i = 0; i < value.Count; i++)
CheckSdkVulnerabilities.cs (1)
76if (summary.Cves is { Count: > 0 })
GenerateDepsFile.cs (1)
297if (affectedRids.Count > 0)
GenerateRuntimeConfigurationFiles.cs (1)
265if (frameworks.Count == 1)
ProcessFrameworkReferences.cs (3)
220Log.LogMessage(MessageImportance.Low, $"Found {knownRuntimePacksForTargetFramework.Count} known runtime packs for target framework {TargetFrameworkIdentifier}"); 668if (matchingRuntimePacks.Count == 0) 672else if (matchingRuntimePacks.Count == 1)
ResolveAppHosts.cs (2)
97if (knownAppHostPacksForTargetFramework.Count > 1) 102if (knownAppHostPacksForTargetFramework.Count == 0)
ResolvePackageAssets.cs (5)
807Debug.Assert((_bufferedMetadata.Count % 2) == 0); 809_writer.Write(_bufferedMetadata.Count / 2); 869_writer.Write(_metadataStrings.Count); 1052if (_maxApplicableVersion != null && _potentialAnalyzers?.Count > 0) 1885index = _metadataStrings.Count;
ResolveTargetingPackAssets.cs (1)
287List<TaskItem> deduplicatedItems = new(items.Count);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (3)
401if (workload.Extends?.Count > 0) 472if (w.Packs != null && w.Packs.Count > 0) 737w.workload.Platforms == null || w.workload.Platforms.Count == 0 || w.workload.Platforms.Any(platform => _currentRuntimeIdentifiers.Contains(platform)));
src\sdk\src\Tasks\Common\ConflictResolution\ConflictResolver.cs (2)
123if (newUnresolvedConflicts.Count == 0) 131if (newUnresolvedConflicts.Count > 0)
TypeLibraryDictionaryBuilder.cs (1)
63return errorsLocal.Count == 0;
Microsoft.NET.HostModel (2)
Bundle\Manifest.cs (1)
157writer.Write(Files.Count);
MachO\BinaryFormat\Blobs\SuperBlob.cs (1)
133+ blobIndices.Count * BlobIndex.Size
Microsoft.Net.Http.Headers (5)
CacheControlHeaderValue.cs (1)
570for (var i = 0; i < nameValueList.Count; i++)
SetCookieHeaderValue.cs (4)
244if (_extensions?.Count > 0) 302if (_extensions?.Count > 0) 387if (_extensions?.Count > 0) 758if (_extensions?.Count > 0)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (3)
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAssetPathPattern.cs (3)
387if (expandedPatternSegments.Count == 0) 393for (var j = 0; j < expandedPatternSegments.Count; j++) 402var count = expandedPatternSegments.Count;
Microsoft.NET.Sdk.BlazorWebAssembly.Tool (1)
Program.cs (1)
46Parallel.For(0, s.Count, i =>
Microsoft.NET.Sdk.Publish.Tasks (13)
MsDeploy\CommonUtility.cs (2)
896if (arguments.Count > 0) 1420Dictionary<string, bool> FoundDictionary = new(optimizedValueList.Count, StringComparer.OrdinalIgnoreCase);
MsDeploy\VsMSDeployObject.cs (2)
185if (linkExtensions is not null && linkExtensions.Count != 0) 200if (matchedList.Count > 0)
src\sdk\src\Common\VSHostObject.cs (1)
84if (dtos is not null && dtos.Count > 0)
Tasks\GenerateEnvTransform.cs (1)
67if (envVariables == null || envVariables.Count == 0)
Tasks\MsDeploy\MSDeploy.cs (7)
603commandLineBuilder.AppendSwitchUnquotedIfNotNull("-replace:", arguments.Count == 0 ? null : string.Join(",", arguments.ToArray())); 618commandLineBuilder.AppendSwitchUnquotedIfNotNull("-skip:", arguments.Count == 0 ? null : string.Join(",", arguments.ToArray())); 683commandLineBuilder.AppendSwitchUnquotedIfNotNull("-declareParam:", arguments.Count == 0 ? null : string.Join(",", arguments.ToArray())); 738commandLineBuilder.AppendSwitchUnquotedIfNotNull("-setParam:", arguments.Count == 0 ? null : string.Join(",", arguments.ToArray())); 797if (arguments.Count > 0 && !string.IsNullOrEmpty(data)) 816commandLineBuilder.AppendSwitchUnquotedIfNotNull("-setParam:", arguments.Count == 0 ? null : string.Join(",", arguments.ToArray())); 904commandLineBuilder.AppendSwitchUnquotedIfNotNull(dest, arguments.Count == 0 ? null : string.Join(",", arguments.ToArray()));
Microsoft.NET.Sdk.StaticWebAssets.Tasks (27)
Compression\ResolveCompressedAssets.cs (2)
122var assetsToCompress = new ITaskItem[matchingCandidateAssets.Count * formats.Length]; 185matchingCandidateAssets.Count);
Data\StaticWebAssetPathPattern.cs (3)
387if (expandedPatternSegments.Count == 0) 393for (var j = 0; j < expandedPatternSegments.Count; j++) 402var count = expandedPatternSegments.Count;
DefineStaticWebAssetEndpoints.cs (1)
344for (var j = _resolvedRoutes.Count - 1; j >= 0; j--)
DefineStaticWebAssets.cs (3)
646if (result.GroupEntries != null && result.GroupEntries.Count > 0) 775for (var i = 0; i < definitions.Count; i++) 777for (var j = i + 1; j < definitions.Count; j++)
JSModules\ApplyJsModules.cs (1)
110while (i < unmatchedJsModules.Count)
MergeStaticWebAssets.cs (3)
40if (group.Count > 1) 42Log.LogMessage(MessageImportance.Normal, $"Merging '{group.Count}' assets for {kvp.Key}."); 51for (var i = candidates.Count - 1; i > 0; i--)
ScopedCss\ApplyCssScopes.cs (1)
122while (j < unmatchedScopedCss.Count)
UpdateExternallyDefinedStaticWebAssets.cs (1)
73for (var i = 0; i < filteredAssets.Count; i++)
Utils\Globbing\GlobNode.cs (1)
38return LiteralsDictionary?.Count > 0 || ExtensionsDictionary?.Count > 0 || ComplexGlobSegments?.Count > 0 || WildCard != null || RecursiveWildCard != null;
Utils\Globbing\PathTokenizer.cs (1)
109public int Count => segments.Count - _index;
Utils\Globbing\StaticWebAssetGlobMatcher.cs (7)
199if (complexSegmentIndex + 1 < node.ComplexGlobSegments.Count) 212for (var i = partIndex; i < parts.Count; i++) 245for (var j = i + 1; j < parts.Count; j++) 260if (remainingSpan.Length == 0 && j == parts.Count - 1) 422if (Node.ComplexGlobSegments != null && Node.ComplexGlobSegments.Count > 0) 441if (Node.ComplexGlobSegments != null && Node.ComplexGlobSegments.Count > 0) 498if (node.ComplexGlobSegments != null && node.ComplexGlobSegments.Count > 0)
Utils\Globbing\StaticWebAssetGlobMatcherBuilder.cs (3)
51if (_excludePatterns.Count > 0) 62for (var i = 0; i < patterns.Count; i++) 80for (var j = 0; j < segments.Count; j++)
Microsoft.NET.Sdk.StaticWebAssets.Tool (1)
Program.cs (1)
46Parallel.For(0, s.Count, i =>
Microsoft.NET.Sdk.WorkloadManifestReader (3)
WorkloadResolver.cs (3)
401if (workload.Extends?.Count > 0) 472if (w.Packs != null && w.Packs.Count > 0) 737w.workload.Platforms == null || w.workload.Platforms.Count == 0 || w.workload.Platforms.Any(platform => _currentRuntimeIdentifiers.Contains(platform)));
Microsoft.NET.StringTools (9)
InternableString.cs (2)
79while (_spanIndex < _string._spans.Count) 292if (_inlineSpan.IsEmpty && _spans?.Count == 1 && _spans[0].Length == Length)
SpanBasedStringBuilder.cs (7)
66while (_spanIndex < _spans.Count) 167if (_spans.Count == 0 && other.IsEmpty) 172if (_spans.Count == 0 || other.IsEmpty || Length != other.Length) 268for (int spanIdx = 0; spanIdx < _spans.Count; spanIdx++) 290for (int spanIdx = 0; spanIdx < _spans.Count; spanIdx++) 315for (int spanIdx = _spans.Count - 1; spanIdx >= 0; spanIdx--) 337for (int spanIdx = _spans.Count - 1; spanIdx >= 0; spanIdx--)
Microsoft.Private.Windows.Core (6)
System\Collections\Generic\CollectionExtensions.cs (1)
29list.RemoveRange(count, list.Count - count);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
355list.Count, 390list.Count,
System\Private\Windows\Ole\FormatEnumerator.cs (2)
61if (_current >= _formats.Count || celt <= 0) 86if (_current + celt >= _formats.Count)
Windows\Win32\System\Com\ComPointerList.cs (1)
18public int Count => _pointers.Count;
Microsoft.TemplateEngine.Cli (21)
ChoiceTemplateParameter.cs (1)
191if (parsedValues.Count > 1 && parsedValues.Any(string.IsNullOrEmpty))
PostActionProcessors\PostActionProcessorBase.cs (1)
147if (parts.Count == 0)
SymbolExtensions.cs (1)
18&& cliOption.CompletionSources.Count == 0) // and options that have completions
TabularOutput\TabularOutput.cs (17)
81TextWrapper[] header = new TextWrapper[_columns.Count]; 83for (int i = 0; i < _columns.Count; ++i) 92TextWrapper[] row = new TextWrapper[_columns.Count]; 95for (int i = 0; i < _columns.Count; ++i) 114for (int i = 0; i < _columns.Count; ++i) 117if (i != _columns.Count - 1) 129for (int i = 0; i < _columns.Count; ++i) 133if (i < _columns.Count - 1) 144if (_ordering.Count > 0) 156for (int i = 1; i < _ordering.Count; ++i) 179for (int columnIndex = 0; columnIndex < _columns.Count; ++columnIndex) 182if (columnIndex != _columns.Count - 1) 240int totalPaddingWidth = _settings.ColumnPadding * (_columns.Count - 1); 244for (int i = 0; i < _columns.Count; ++i) 257for (int i = 0; i < _columns.Count; ++i) 272for (int i = 0; i < _columns.Count; ++i) 408realMaxWidth = Math.Max(realMaxWidth, lines[lines.Count - 1].GetUnicodeLength());
TelemetryHelper.cs (1)
44if (hashedValues.Count > 0)
Microsoft.TemplateEngine.Core (26)
Expressions\Cpp\CppStyleEvaluatorDefinition.cs (3)
112if (tokens.Count > 0 && tokens[0].Family == TokenFamily.OpenBrace) 130switch (tokens[tokens.Count - 1].Family) 388for (i = 0; i < outputTokens.Count; ++i)
Expressions\ScopeBuilder.cs (3)
112if (currentLiteral.Count > 0) 193if (currentLiteral.Count > 0) 308if (currentLiteral.Count > 0)
Matching\TrieEvaluator.cs (11)
25public int OldestRequiredSequenceNumber => _activePaths.Count == 0 ? _expectedSequenceNumber : _activePaths[0].StartSequenceNumber; 37for (int i = 0; i < _activePaths.Count; ++i) 60for (int i = 0; i < _activePaths.Count; ++i) 90for (int i = 0; i < _activePaths.Count; ++i) 110else if (path.EncounteredTerminals.Count == 0) 155if (_activePaths.Count > 0) 163for (int i = 0; i < _activePaths.Count; ++i) 182for (int j = 0; j < path.EncounteredTerminals.Count; ++j) 203if (path.EncounteredTerminals.Count == 0) 216if (bestPath > -1 && bestPath < _activePaths.Count && _activePaths[bestPath].EncounteredTerminals.Contains(best)) 220if (_activePaths[bestPath].EncounteredTerminals.Count == 0)
Operations\InlineMarkupConditional.cs (2)
108IProcessorState localState = new ProcessorState(new MemoryStream(condition), new MemoryStream(), conditionBytes.Count, int.MaxValue, adjustedConfig, []); 110int len = conditionBytes.Count;
Operations\PhasedOperation.cs (5)
41existingMatchToken = tokenMap[c.Match] = tokens.Count; 56existingResetToken = tokenMap[reset] = tokens.Count; 64if (c.Next.Count > 0) 82currentTarget[currentTarget.Count - 1].Next.AddRange(children); 116_currentPhase = match.Next.Count > 0 ? match : null;
Util\TokenTrie.cs (2)
14public int Count => _tokens.Count; 36int count = _tokens.Count;
Microsoft.TemplateEngine.Edge (8)
BuiltInManagedProvider\GlobalSettingsTemplatePackageProvider.cs (2)
135if (installersThatCanInstall.Count == 0) 143if (installersThatCanInstall.Count > 1)
Constraints\SdkVersionConstraintFactory.cs (2)
96if (providers.Count == 0) 101if (providers.Count > 1)
Constraints\WorkloadConstraintFactory.cs (2)
90if (providers.Count == 0) 95if (providers.Count > 1)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (1)
275propertyIndexes[prop.Name] = result.Count;
Template\ParameterSetBuilder.cs (1)
136return invalidParams.Count == 0;
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (1)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (1)
275propertyIndexes[prop.Name] = result.Count;
Microsoft.TemplateEngine.Utils (4)
DirectedGraph.cs (1)
70return result.Count == _vertices.Count;
FileFindHelpers.cs (1)
21if (matches.Count > 0)
InMemoryFileSystem.cs (1)
729realParts.RemoveAt(realParts.Count - 1);
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (1)
275propertyIndexes[prop.Name] = result.Count;
Microsoft.TemplateSearch.Common (3)
Providers\NuGetMetadataSearchProvider.cs (1)
85_logger.LogDebug("Retrieved {0} packages matching template search criteria.", matchingTemplates.Count);
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (1)
275propertyIndexes[prop.Name] = result.Count;
TemplateDiscoveryMetadata\LegacySearchCacheReader.cs (1)
126logger.LogDebug($"Successfully read {buildingTemplateList.Count} templates.");
Microsoft.TestPlatform.AdapterUtilities (1)
ManagedNameUtilities\ManagedNameParser.cs (1)
158if (types.Count != 0)
Microsoft.TestPlatform.Build (2)
Tasks\TestTaskUtils.cs (1)
163if (dumpArgs.Count != 0)
Tasks\VSTestTask2.cs (1)
365return time.Count == 0 ? "< 1ms" : string.Join(" ", time);
Microsoft.TestPlatform.CommunicationUtilities (5)
_generated\83\TestPlatformJsonContext.ListAttachmentSet.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\84\TestPlatformJsonContext.ListTestCase.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\85\TestPlatformJsonContext.ListKeyValuePairTestPropertyObject.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\86\TestPlatformJsonContext.ListString.g.cs (1)
57for (int i = 0; i < value.Count; i++)
DataCollectionRequestHandler.cs (1)
290if (extensionAssemblies.Count > 0)
Microsoft.TestPlatform.CrossPlatEngine (45)
Client\MTP\MtpProxyDiscoveryManager.cs (2)
133if (chunk.Count > 0) 139return chunk.Count;
Client\MTP\MtpProxyExecutionManager.cs (4)
216if (_dataCollectionEventsHandler.Messages.Count > 0) 226if (_dataCollectionEventsHandler.RawMessages.Count > 0) 360if (results.Count == 0) 393if (tests is { Count: > 0 })
Client\MTP\MtpServerConnection.cs (4)
354return bytes.Count == 0 ? null : Encoding.ASCII.GetString(bytes.ToArray()); 359if (bytes.Count > 0 && bytes[bytes.Count - 1] == (byte)'\r') 361bytes.RemoveAt(bytes.Count - 1);
Client\Parallel\ParallelDiscoveryEventsHandler.cs (2)
106else if (notDiscovered.Count > 0 || partiallyDiscovered.Count > 0)
Client\Parallel\ParallelOperationManager.cs (6)
74public int OccupiedSlotCount => _activeManagers.Count; 77public int AvailableSlotCount => MaxParallelLevel - _activeManagers.Count; 102EqtTrace.Verbose($"ParallelOperationManager.StartWork: Enqueuing {workloads.Count} workloads."); 147while (_activeManagers.Count < MaxParallelLevel && _pendingWorkloads.Count > 0) 156activeCount = _activeManagers.Count; 198for (int i = 0; i < _activeManagers.Count; i++)
Client\Parallel\ParallelProxyDiscoveryManager.cs (6)
89_availableWorkloads = runnableWorkloads.Count; 102if (nonRunnableWorkloads.Count > 0) 153var notDiscoveredCount = _dataAggregator.GetSourcesWithStatus(DiscoveryStatus.NotDiscovered).Count; 154var partiallyDiscoveredCount = _dataAggregator.GetSourcesWithStatus(DiscoveryStatus.PartiallyDiscovered).Count; 155var fullyDiscoveredCount = _dataAggregator.GetSourcesWithStatus(DiscoveryStatus.FullyDiscovered).Count; 156var skippedCount = _dataAggregator.GetSourcesWithStatus(DiscoveryStatus.SkippedDiscovery).Count;
Client\Parallel\ParallelProxyExecutionManager.cs (4)
102_availableWorkloads = runnableWorkloads.Count; 112if (nonRunnableWorkloads.Count > 0) 275for (var i = 0; i < testCases.Count; i++) 280testCaseBatches = groups.Where(g => g.Count > 0).Select(g => g.ToArray()).ToList();
Client\Parallel\ParallelRunDataAggregator.cs (2)
77if (_testRunStatsList.Count > 0) 130return Exceptions == null || Exceptions.Count < 1 ? null : new AggregateException(Exceptions);
Client\ProxyExecutionManagerWithDataCollection.cs (2)
135if (DataCollectionRunEventsHandler.Messages.Count > 0) 146if (DataCollectionRunEventsHandler.RawMessages.Count > 0)
Client\ProxyOperationManagerWithDataCollection.cs (2)
114if (DataCollectionRunEventsHandler.Messages.Count > 0) 125if (DataCollectionRunEventsHandler.RawMessages.Count > 0)
Discovery\DiscoveryResultCache.cs (2)
111if (_tests.Count >= _cacheSize || (timeDelta > _cacheTimeout && _tests.Count > 0))
Execution\TestRunCache.cs (5)
241if (_inProgressTests == null || _inProgressTests.Count == 0) 318var inProgressTestsCount = _inProgressTests.Count; 320if ((_testResults.Count + inProgressTestsCount) >= _cacheSize || (timeDelta >= _cacheTimeout && inProgressTestsCount > 0)) 331if (_testResults.Count > 0 || _inProgressTests.Count > 0)
TestEngine.cs (4)
100if (testHostManagers.Count != 1) 102throw new InvalidOperationException($"Exactly 1 testhost manager must be provided when running in process, but there {testHostManagers.Count} were provided."); 441if (testHostProviders.Count > 1) 512if (testRuntimeProviders.Count == 0)
Microsoft.TestPlatform.Extensions.BlameDataCollector (6)
BlameLogger.cs (1)
142if (testCaseList.Count > 0)
NetClientHangDumper.cs (1)
32if (processTree.Count > 1)
ProcDumpDumper.cs (2)
273EqtTrace.Verbose($"ProcDumpDumper.GetDumpFiles: Found {allTargetProcessDumps.Count} dumps for the target process, removing {dumpToRemove.Name} because we always collect a dump, even if there is no crash. But the process did not crash and user did not specify CollectAlways=true."); 285return allTargetProcessDumps.Take(allTargetProcessDumps.Count - 1).Select(dump => dump.FullName).ToList();
ProcessDumpUtility.cs (1)
81if (warnOnNoDumpFiles && foundDumps.Count == 0)
WindowsHangDumper.cs (1)
43if (processTree.Count > 1)
Microsoft.TestPlatform.Filter.Source (3)
FilterExpression.cs (3)
201for (int i = 0; i < tokens.Count; i++) 209while (j < tokens.Count) 223if (j < tokens.Count && tokens[j] == ")")
Microsoft.TestPlatform.Utilities (2)
CodeCoverageDataAttachmentsHandler.cs (1)
71if (coverageReportFilePaths.Count > 1)
InferRunSettingsHelper.cs (1)
372if (legacySettingElements.Count > 0)
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (8)
VsTestConsoleWrapper.cs (8)
309sourceList.Count, 381testCaseList.Count, 458sourceList.Count, 538testCaseList.Count, 730sourceList.Count, 802testCaseList.Count, 879sourceList.Count, 959testCaseList.Count,
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.TestPlatform.Client (1)
TestPlatform.cs (1)
228if (loggersToUpdate.Count > 0)
Microsoft.VisualStudio.TestPlatform.Common (16)
DataCollection\DataCollectionManager.cs (1)
195if (enabledDataCollectorsSettings == null || enabledDataCollectorsSettings.Count == 0)
ExtensionFramework\TestPluginCache.cs (4)
219if (extensions == null || extensions.Count == 0) 373if (extensionDirectories.Count != 0) 416if (additionalExtensions.Count == extensionsList.Count && additionalExtensions.All(extensionsList.Contains))
ExtensionFramework\TestPluginDiscoverer.cs (2)
157if (types.Count == 0) 181if (types != null && types.Count != 0)
Hosting\TestRunTimeProviderManager.cs (1)
72if (sources is not null && sources.Count > 0)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FilterExpression.cs (3)
201for (int i = 0; i < tokens.Count; i++) 209while (j < tokens.Count) 223if (j < tokens.Count && tokens[j] == ")")
Utilities\SimpleJSON.cs (5)
734return aIndex < 0 || aIndex >= _list.Count ? new JSONLazyCreator(this) : _list[aIndex]; 740if (aIndex < 0 || aIndex >= _list.Count) 760get { return _list.Count; } 772if (aIndex < 0 || aIndex >= _list.Count) 817int count = _list.Count;
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (1)
HtmlLogger.cs (1)
453return time.Count == 0 ? "< 1ms" : string.Join(" ", time);
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (6)
ObjectModel\TestElementAggregation.cs (1)
68if (testLinks.Count > 0)
ObjectModel\TestEntry.cs (1)
113if (TestEntries.Count > 0)
ObjectModel\TestResultAggregation.cs (1)
67if (InnerResults.Count > 0)
TrxLogger.cs (1)
449if (errorMessages.Count > 0)
Utility\Converter.cs (2)
425if (resultFiles.Count > 0) 430if (collectorEntries.Count > 0)
Microsoft.VisualStudio.TestPlatform.ObjectModel (3)
Navigation\FullSymbolReader.cs (2)
351TPDebug.Assert(children.Count > 0); 427TPDebug.Assert(children.Count > 0);
Nuget.Frameworks\FrameworkNameProvider.cs (1)
509return result.Count > 0;
Microsoft.Web.XmlTransform (4)
XmlArgumentUtility.cs (1)
60if (arguments.Count != combinedArguments.Count) {
XmlAttributePreservationDict.cs (1)
122if (orderedAttributes.Count > 0) {
XmlTransforms.cs (2)
401if (matchsExpr.Count > 0) 538if (matchs.Count > 0)
Mono.Cecil (4)
Mono.Cecil.Metadata\Buffers.cs (1)
364 var string_offsets = new uint [sorted.Count + 1];
Mono.Cecil\MethodReferenceComparer.cs (3)
80 for (int i = 0; i < xComparisonStack.Count; i++) { 96 yComparisonStack.RemoveAt (yComparisonStack.Count - 1); 99 xComparisonStack.RemoveAt (xComparisonStack.Count - 1);
Mono.Cecil.Mdb (22)
Mono.CompilerServices.SymbolWriter\MonoSymbolFile.cs (9)
141 return sources.Count; 147 return comp_units.Count; 236 for (int i = 0; i < methods.Count; i++) 255 for (int i = 0; i < methods.Count; i++) { 265 for (int i = 0; i < sources.Count; i++) { 275 for (int i = 0; i < comp_units.Count; i++) { 296 ot.MethodCount = methods.Count; 297 ot.SourceCount = sources.Count; 298 ot.CompileUnitCount = comp_units.Count;
Mono.CompilerServices.SymbolWriter\MonoSymbolTable.cs (8)
480 CapturedVariable[] retval = new CapturedVariable [captured_vars.Count]; 493 CapturedScope[] retval = new CapturedScope [captured_scopes.Count]; 503 bw.WriteLeb128 (captured_vars.Count); 507 bw.WriteLeb128 (captured_scopes.Count); 588 int count_includes = include_files != null ? include_files.Count : 0; 595 bw.WriteLeb128 (namespaces.Count); 655 NamespaceEntry[] retval = new NamespaceEntry [namespaces.Count]; 667 SourceFileEntry[] retval = new SourceFileEntry [include_files.Count];
Mono.CompilerServices.SymbolWriter\SourceMethodBuilder.cs (5)
71 if (method_lines.Count > 0) { 72 var prev = method_lines[method_lines.Count - 1]; 83 method_lines[method_lines.Count - 1] = lne; 94 StartBlock (type, start_offset, _blocks == null ? 1 : _blocks.Count + 1); 126 CodeBlockEntry[] retval = new CodeBlockEntry [_blocks.Count];
Mono.Cecil.Pdb (1)
Microsoft.Cci.Pdb\PdbFile.cs (1)
332if (modList.Count > 0) {
MSBuild (25)
CommandLine\CommandLineParser.cs (2)
149List<string> validArgs = new(envVarArgs.Count); 180if (validArgs.Count > 0)
src\msbuild\src\Shared\TaskHostBuildResponse.cs (2)
60result = new List<IDictionary<string, ITaskItem[]>>(_targetOutputsPerProject.Count); 130int count = _targetOutputsPerProject?.Count ?? 0;
XMake.cs (21)
1631remoteLoggerRecords.Count == 0 && 3590if (actualProjectFiles.Count == 1 && actualSolutionFiles.Count == 1) 3600else if (actualSolutionFiles.Count > 1) 3605else if (actualProjectFiles.Count > 1) 3611if (actualProjectFiles.Count == 2) 3638else if (actualProjectFiles.Count == 0 && 3639actualSolutionFiles.Count == 0 && 3640solutionFilterFiles.Count == 0) 3648projectFile = actualSolutionFiles.Count == 1 ? actualSolutionFiles[0] : actualProjectFiles.Count == 1 ? actualProjectFiles[0] : solutionFilterFiles[0]; 3649InitializationException.VerifyThrow(actualSolutionFiles.Count == 1 || actualProjectFiles.Count == 1 || solutionFilterFiles.Count == 1, projectDirectory == null ? "AmbiguousProjectError" : "AmbiguousProjectDirectoryError", null, projectDirectory); 4327Assumed.InRange(loggerSpec.Count, 1, 2, "SplitUnquoted() must return at least one string, and no more than two."); 4341if (loggerSpec.Count > 1) 4372Assumed.InRange(loggerSpec.Count, 1, 2, "SplitUnquoted() must return at least one string, and no more than two."); 4379if (loggerSpec.Count == 2) 4387Assumed.Positive(loggerTypeSpec.Count, "SplitUnquoted() must return at least one string"); 4392if (loggerTypeSpec.Count >= 2) 4404for (int i = 2; i < loggerTypeSpec.Count; i++)
MSBuild.Coordinator (2)
NodeBudgetManager.cs (2)
37public int ActiveBuildCount => _activeGrants.Count; 53return _activeGrants.Count == 0 && _waitQueue.Count == 0;
NuGet.Build.Tasks (2)
BuildTasksUtility.cs (1)
269if (restoreSummaries.Count < 1)
RestoreTask.cs (1)
225ProjectsRestored = restoreSummaries.Count;
NuGet.Build.Tasks.Console (6)
MSBuildStaticGraphRestore.cs (6)
270if (frameworkReferenceItems.Count == 0) 277var frameworkDependencies = new FrameworkDependency[frameworkReferenceItems.Count]; 279for (int i = 0; i < frameworkReferenceItems.Count; i++) 357var libraryDependencies = new LibraryDependency[packageReferenceItems.Count]; 359for (int i = 0; i < packageReferenceItems.Count; i++) 474var projectReferences = new List<ProjectRestoreReference>(projectReferenceItems.Count);
NuGet.Build.Tasks.Pack (2)
PackTaskLogic.cs (2)
397foreach (var key in frameworkToAliases.Where(e => e.Value.Count <= 1).Select(e => e.Key).ToList()) 882if (unsuppressedAliases.Count > 1)
NuGet.CommandLine.XPlat (38)
_generated\24\PackageSearchJsonContext.ListPackageSearchProblem.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\25\PackageSearchJsonContext.ListPackageSearchResult.g.cs (1)
57for (int i = 0; i < value.Count; i++)
_generated\26\PackageSearchJsonContext.ListIPackageSearchMetadata.g.cs (1)
57for (int i = 0; i < value.Count; i++)
Commands\Package\Update\PackageUpdateCommandRunner.cs (2)
451if (packagesToUpdate is not null && packagesToUpdate.Count > 0) 491if (packageTfms.Count > 0)
Commands\Package\Update\PackageUpdateIO.cs (5)
212if (packageTfmAliases.Count == updatedPackageSpec.TargetFrameworks.Count) 232var lookups = new Task<NuGetVersion?>[sources.Count]; 233for (int source = 0; source < sources.Count; source++) 311var lookups = new Task<NuGetVersion?>[sources.Count]; 312for (int source = 0; source < sources.Count; source++)
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (1)
463if (userSpecifiedFrameworks.Count > 1)
Commands\PackageReferenceCommands\ListPackage\ListPackageCommand.cs (1)
287if (packageSources.Count == 0 || hasConfig)
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (9)
141if (frameworks.Count > 0) 150if (httpSources.Count > 0) 229if (vuln != null && vuln.Count > 0) 429var packageMetadataById = new Dictionary<string, List<IPackageSearchMetadata>>(capacity: allPackages.Count); 433: listPackageArgs.PackageSources.Count == 0 435: (Environment.ProcessorCount / listPackageArgs.PackageSources.Count) + 1; 573if (listPackageArgs.ReportType == ReportType.Outdated && matchingPackage.Count > 0) 612if (listPackageArgs.ReportType == ReportType.Outdated && matchingPackage.Count > 0) 684maxParallel: listPackageArgs.PackageSources.Count,
Commands\PackageSearch\PackageSearchRunner.cs (2)
62if (httpSources.Count > 0) 218if (sources.Count > 0)
Commands\PackageSearch\Table.cs (5)
62if (row.Length != _columns.Count) 81if (_rows.Count == 0) 134for (int column = 0; column < _columns.Count; column++) 194if (renderedColumns.Count >= values.Count)
Commands\Why\DependencyGraphFinder.cs (1)
54if (userInputFrameworks.Count > 0
Commands\Why\DependencyGraphPrinter.cs (2)
37if (frameworks.Count > 0) 56if (topLevelNodes == null || topLevelNodes.Count == 0)
ListPackage\ListPackageJsonRenderer.cs (3)
102if (_problems?.Count > 0) 178if (reportProject.TargetFrameworkPackages?.Count > 0) 263if (transitivePackages?.Count > 0)
ListPackage\ListReportPackage.cs (1)
105vulnerabilities: vulnerabilities.Count == 0 ? null : vulnerabilities)
Utility\AddPackageCommandUtility.cs (1)
40if (maxTasks <= tasks.Count)
Utility\HttpSourcesUtility.cs (2)
41if (httpSources.Count == 1) 49else if (httpSources.Count > 1)
NuGet.Commands (74)
CommandRunners\PackCommandRunner.cs (3)
960if (candidates.Count == 1) 968if (candidates.Count == 1) 976if (candidates.Count == 1)
ListCommand\ListCommandRunner.cs (2)
84if (httpPackageSources != null && httpPackageSources.Count != 0) 86if (httpPackageSources.Count == 1)
RestoreCommand\CompatibilityIssue.cs (2)
212if (AvailableFrameworks.Count > 1) 231if (AvailableFrameworkRuntimePairs.Count > 1)
RestoreCommand\DependencyGraphResolver.cs (10)
258if (runtimeGraphs.Count > 0) 375for (int i = 0; i < resolvedDependencyGraphItem.Item.Data.Dependencies.Count; i++) 434|| resolvedDependencyGraphItem.Suppressions.Count > 0 && resolvedDependencyGraphItem.Suppressions[0].Contains(childLibraryDependencyIndex)) 1189if (chosenResolvedItem.Suppressions.Count == 1 && chosenResolvedItem.Suppressions[0].Count == 0 && HasCommonAncestor(chosenResolvedItem.Path, currentDependencyGraphItem.Path)) 1251directPackageReferences = new HashSet<LibraryDependencyIndex>(capacity: chosenResolvedItem.Item.Data.Dependencies.Count); 1253for (int i = 0; i < chosenResolvedItem.Item.Data.Dependencies.Count; i++) 1270for (int i = 0; i < chosenResolvedItem.Item.Data.Dependencies.Count; i++) 1285suppressions ??= new HashSet<LibraryDependencyIndex>(capacity: chosenResolvedItem.Item.Data.Dependencies.Count - i); 1306for (int i = 0; i < chosenResolvedItem.Item.Data.Dependencies.Count; i++) 1335&& childResolvedDependencyGraphItem.Suppressions.Count == 1
RestoreCommand\DependencyGraphResolver.DependencyGraphItem.cs (2)
100List<LibraryDependency> dependencies = new(capacity: (RuntimeDependencies?.Count ?? 0) + item.Data.Dependencies.Count); 103for (int i = 0; i < item.Data.Dependencies.Count; i++)
RestoreCommand\DependencyGraphResolver.ResolvedDependencyGraphItem.cs (1)
59int dependencyCount = item.Data.Dependencies.Count;
RestoreCommand\LockFileBuilderCache.cs (1)
119return _lockFileTargetLibraryCache.GetOrAdd((criteriaKey, packagePath, aliases, libraryIncludeFlags, dependencies.Count, restoreEnableAnalyzerAssets),
RestoreCommand\MSBuildRestoreItemGroup.cs (1)
44if (Conditions.Count > 0)
RestoreCommand\ProjectRestoreCommand.cs (2)
362if (packagesToInstall.Count > 0) 365var threadCount = Math.Min(packagesToInstall.Count, _request.MaxDegreeOfConcurrency);
RestoreCommand\RestoreCommand.cs (14)
367telemetry.TelemetryEvent[UpdatedMSBuildFiles] = restoreResult._dirtyMSBuildFiles.Value.Count > 0; 785graphs = new(frameworkRuntimePairs.Count); 786for (var i = 0; i < frameworkRuntimePairs.Count; i++) 970telemetry.TelemetryEvent[AuditDirectVulnerabilitiesCount] = audit.DirectPackagesWithAdvisory?.Count ?? 0; 978telemetry.TelemetryEvent[AuditTransitiveVulnerabilitiesCount] = audit.TransitivePackagesWithAdvisory?.Count ?? 0; 1004List<TelemetryEvent> result = new List<TelemetryEvent>(packages.Count); 1187if (prunedPackage.Value.Count != project.TargetFrameworks.Count) 1397if (packageReferenceItemsWithVersion != null && packageReferenceItemsWithVersion.Count > 0) 1410if (implicitPackageReferenceItemsWithPackageVersion != null && implicitPackageReferenceItemsWithPackageVersion.Count > 0) 1423if (packageReferenceItemsWithNoPackageVersion != null && packageReferenceItemsWithNoPackageVersion.Count > 0) 1436if (packageVersionItemsWithFloatingVersion != null && packageVersionItemsWithFloatingVersion.Count > 0) 1449if (packageReferenceItemsWithVersionOverride != null && packageReferenceItemsWithVersionOverride.Count > 0) 1918if (graph.AnalyzeResult.Downgrades.Count > 0) 2430if (rootProjectMatches.Count > 1)
RestoreCommand\RestoreResult.cs (1)
338if (_dirtyMSBuildFiles.Value.Count > 0)
RestoreCommand\RestoreRunner.cs (5)
77if (restoreTasks.Count == maxTasks) 90while (restoreTasks.Count > 0) 143if (restoreTasks.Count == maxTasks) 156while (restoreTasks.Count > 0) 177if (restoreContext.PreLoadedRequestProviders.Count < 1 && !inputs.Any())
RestoreCommand\RestoreSummary.cs (1)
209if (logs.Count > 0)
RestoreCommand\Utility\AuditUtility.cs (2)
139if (knownVulnerabilitiesForPackage?.Count > 0) 387if (knownVulnerabilitiesForPackage?.Count > 0)
RestoreCommand\Utility\BuildAssetsUtils.cs (9)
327.Where(e => e.Items.Count > 0) 609if (packagePathsPropertyGroup.Items.Count > 0) 643var currentItems = new List<(LockFileTargetLibrary, LockFileContentFile, string)>(lockContentFiles.Count); 775if (currentItems.Count == 0) 807.Where(group => group.Items.Count > 0); 821var newConditions = new List<string>(original.Conditions.Count + 1); 884if (item.Data?.Dependencies == null || item.Data.Dependencies.Count == 0) 892List<PackageDependency> newDependencies = new List<PackageDependency>(item.Data.Dependencies.Count); 903dependencies = newDependencies.Count == 0 ? null : newDependencies;
RestoreCommand\Utility\LockFileUtils.cs (5)
101for (var i = 0; i < orderedCriteriaSets.Count; i++) 340if (contentFileGroups.Count > 0) 441if (groups.Count > 0) 584if (files.Count > 0) 588for (var i = 0; i < files.Count; i++)
RestoreCommand\Utility\MSBuildRestoreUtility.cs (1)
642var addToFrameworks = frameworkPair.Item1.Count == 0
RestoreCommand\Utility\PackageSpecFactory.cs (6)
615var projectReferences = new List<ProjectRestoreReference>(projectReferenceItems.Count); 645var libraryDependencies = new LibraryDependency[packageReferenceItems.Count]; 647for (int i = 0; i < packageReferenceItems.Count; i++) 752if (frameworkReferenceItems.Count == 0) 759var frameworkDependencies = new FrameworkDependency[frameworkReferenceItems.Count]; 761for (int i = 0; i < frameworkReferenceItems.Count; i++)
RestoreCommand\Utility\SpecValidationUtility.cs (3)
172if (frameworkNames.Count < 1) 242if (uniqueAliases.Count != aliases.Count) 259if (packageDependencies.Count != 1
SourcesCommands\SourceRunners.cs (3)
152for (var i = 0; i < sourcesList.Count; i++) 216if (httpPackageSources != null && httpPackageSources.Count != 0) 218if (httpPackageSources.Count == 1)
NuGet.Common (1)
AsyncEnumerable\AggregateEnumeratorAsync.cs (1)
57while (_asyncEnumerators.Count > 0)
NuGet.Configuration (6)
PackageSource\PackageSourceProvider.cs (1)
224defaultSourcesInsertIndex = loadedPackageSources.Count;
PackageSourceMapping\PackageSourceMappingProvider.cs (1)
103if (removeMappings.Count > 0)
Settings\Items\PackageSourceMappingSourceItem.cs (1)
83if (parsedPackagePatternItems.Count == 0)
Settings\Items\TrustedSignerItem.cs (2)
61if (parsedCertificates.Count == 0) 75if (parsedCertificates.Count == 0)
Utility\SettingsUtility.cs (1)
313for (var i = 0; i < paths.Count; i++)
NuGet.DependencyResolver.Core (14)
GraphModel\GraphNode.cs (1)
74int requiredCapacity = innerList.Count + additionalSpace;
GraphModel\GraphOperations.cs (5)
82var requiredCapacity = downgrades.Count + workingDowngrades.Count; 363var hasCentralTransitiveDependencies = centralTransitiveNodes.Count > 0; 576var count = graphNodes.Count; 853int ctdCount = centralTransitiveNodes.Count; 886int ctdCount = centralTransitiveNodes.Count;
Remote\RemoteDependencyWalker.cs (7)
100bool rootHasInnerNodes = (rootItem.Data.Dependencies.Count + (rootRuntimeDependencies == null ? 0 : rootRuntimeDependencies.Count)) > 0; 106LightweightList<GraphNodeCreationData> rootDependencies = new LightweightList<GraphNodeCreationData>(rootNode.Item.Data.Dependencies.Count); 134for (var i = 0; i < node.Item.Data.Dependencies.Count; i++) 203node.EnsureInnerNodeCapacity(node.Item.Data.Dependencies.Count - i); 221bool hasInnerNodes = (dependencyItem.Data.Dependencies.Count + (graphNodeCreationData.RuntimeDependencies == null ? 0 : graphNodeCreationData.RuntimeDependencies.Count)) > 0; 241LightweightList<GraphNodeCreationData> newDependencies = new LightweightList<GraphNodeCreationData>(newNode.Item.Data.Dependencies.Count); 303var newDependencies = new List<LibraryDependency>(runtimeDependencies.Count + node.Item.Data.Dependencies.Count);
ResolverUtility.cs (1)
510while (tasks.Count > 0)
NuGet.Frameworks (1)
FrameworkNameProvider.cs (1)
521return result.Count > 0;
NuGet.PackageManagement (33)
Audit\AuditChecker.cs (3)
160results = new(packageSources.Count); 180for (int i = 0; i < results.Count; i++) 326if (knownVulnerabilitiesForPackage?.Count > 0)
Audit\AuditCheckResult.cs (2)
68telemetryEvent[AuditVulnerabilitiesCount] = Packages?.Count ?? 0; 86List<TelemetryEvent> result = new List<TelemetryEvent>(Packages.Count);
BuildIntegration\DependencyGraphRestoreUtility.cs (1)
253for (var i = 0; i < projects.Count; i++)
NuGetPackageManager.cs (15)
688if (packageIdentities.Count > 0) 706if (packagesToUpdateInProject.Count > 0) 728if (tasks.Count >= maxTasks) 757if (packagesToUpdateInProject.Count > 0) 957if (lowLevelActions.Count > 0) 980if (actions.Count == 0) 1307if (nuGetProjectActions.Count == 0) 1330if (nuGetProjectActions.Count == 0) 1675if (buildIntegratedProjectsToUpdate.Count != 0) 1678if (otherTargetProjectsToUpdate.Count > 0) 2177if (buildIntegratedProjectsToUpdate.Count != 0) 2423if (buildIntegratedProjectsToUpdate.Count > 0) 3108successfulFrameworks.Count > 0 && 3109unsuccessfulFrameworks.Count > 0 && 3909return new ResolvedPackage(latestVersion, packages.Count > 0);
PackagePreFetcher.cs (1)
118if (downloadResults.Count == maxParallelTasks)
Projects\MSBuildNuGetProject.cs (1)
692if (references != null && references.Count > 0)
Projects\PackagesConfigNuGetProject.cs (1)
212if (installedPackagesList.Count == 1 && nuGetProjectContext.ActionType == NuGetActionType.Uninstall)
Projects\ProjectJsonNuGetProject.cs (1)
227if (references != null && references.Count > 0)
Resolution\ResolverGather.cs (6)
185if (_gatherRequests.Count < 1 && _workerTasks.Count < 1) 187_context.Log.LogDebug(string.Format(CultureInfo.CurrentCulture, "Total number of results gathered : {0}", _results.Count)); 266if (_workerTasks.Count > 0) 274while (_workerTasks.Count >= MaxDegreeOfParallelism); 378while (_workerTasks.Count < MaxDegreeOfParallelism && _gatherRequests.Count > 0) 614while (getResourceTasks.Count >= MaxDegreeOfParallelism)
Resolution\UninstallResolver.cs (2)
78if (unMarkedDependents.Count > 0) 142if (packageDependents.Count == 1)
NuGet.Packaging (32)
ContentModel\ContentItemCollection.cs (2)
92if (_assets != null && _assets.Count > 0) 318if (relatedFileExtensionList is null || relatedFileExtensionList.Count == 0)
ContentModel\ContentPropertyDefinition.cs (1)
99if (FileExtensions?.Count > 0)
PackageCreation\Authoring\ManifestReader.cs (2)
284if (references.Count > 0) 307if (throwIfEmpty && references.Count == 0)
PackageCreation\Xml\PackageMetadataXmlExtensions.cs (1)
312if (attributeList.Count > 0)
PackageExtractor.cs (1)
1013if (satelliteFiles.Count > 0)
PackageReaderBase.cs (2)
537if (nuspecPaths.Count == 0) 541else if (nuspecPaths.Count > 1)
Rules\AccidentallyCompatibleWithAllFrameworksRule.cs (5)
44if (items.Count != 0) 86if (suggestedFrameworks?.Count > 0) 103string tfmNames = possibleFrameworks.Count > 1 107string suggestedDirectories = possibleFrameworks.Count > 1 116int estimatedLength = possibleFrameworks.Count * "-lib//_.)".Length + possibleFrameworks.Sum(f => f.Length);
Rules\DependenciesGroupsForEachTFMRule.cs (1)
52if (issues.Count != 0)
RuntimeModel\JsonRuntimeFormat.cs (2)
153if (runtimes.Count == 1) 158else if (runtimes.Count > 0)
RuntimeModel\RuntimeDescription.cs (1)
116inheritedRuntimes.Count == 0 ? null : inheritedRuntimes,
RuntimeModel\RuntimeGraph.cs (1)
195for (var i = 0; i < expansions.Count; i++)
Signing\Archive\SignedPackageArchiveIOUtility.cs (2)
273if (centralDirectoryRecords.Count == 0) 361if (centralDirectoryRecords.Count == 0)
Signing\DerEncoding\DerEncoder.cs (1)
505EncodeLength(encodedBytes.Count),
Signing\Signatures\CommitmentTypeIndication.cs (1)
69if (qualifiers.Count == 0)
Signing\Signatures\NuGetPackageOwners.cs (1)
60if (packageOwners.Count == 0)
Signing\Signatures\PolicyInformation.cs (1)
77if (policyQualifiers.Count == 0)
Signing\Timestamp\Extensions.cs (1)
44if (extensions.Count == 0)
Signing\Utility\AttributeUtility.cs (2)
55if (knownValues.Count == 0) 62if (knownValues.Count > 1)
Signing\Utility\CertificateChainUtility.cs (1)
126if (chain.ChainStatus.Length == 0 || fatalStatuses.Count > 0)
TopologicalSortUtility.cs (3)
68var sorted = new List<T>(sortedInfos.Count); 132var count = children.Count; 174package.ActiveParents = package.Parents?.Count ?? 0;
NuGet.ProjectModel (5)
MacroStringsUtility.cs (1)
39for (int i = 0; i < list.Count; i++)
PackageSpecReferenceDependencyProvider.cs (3)
169if (dependencies.Count == 0) 175var uniqueDependencies = new List<LibraryDependency>(dependencies.Count); 391for (var i = 0; i < dependencies.Count; i++)
ProjectLockFile\PackagesLockFileUtilities.cs (1)
294bool isLockFileValid = invalidReasons.Count == 0;
NuGet.Protocol (10)
Converters\V3SearchResultsConverter.cs (1)
79if (searchResults.Data.Count >= _take)
LegacyFeed\V2FeedParser.cs (2)
469if (max < 0 || results.Count < max) 494if (max > -1 && results.Count > max)
Plugins\PluginDiscoverer.cs (1)
134for (var i = 0; i < _pluginFiles.Count; ++i)
RemoteRepositories\HttpFileSystemBasedFindPackageByIdResource.cs (1)
589new HashSet<NuGetVersion>(capacity: json.Versions?.Count ?? 0);
Resources\PackageSearchResourceV3.cs (1)
265if (results?.Data?.Count > take)
SourceRepository.cs (2)
209for (int start = 0; start < items.Count - 1; start++) 213for (int i = start + 1; i < items.Count; i++)
Utility\LocalFolderUtility.cs (2)
880if (topLevel.Count > 0) 890if (files.Count > 0)
NuGet.Resolver (10)
CombinationSolver.cs (3)
94_solution = new T[initialDomains.Count]; 207for (var j = i + 1; j < _currentDomains.Count && consistent; j++) 349if (subSet.Count == sorted.Count)
PackageResolver.cs (4)
88if (invalidExistingPackages.Count > 0) 252while (after.Count < before.Count); 259if (packages.Count == 0)
ResolverInputSort.cs (3)
47for (int i = 0; i < grouped.Count; i++) 51for (int j = 0; j < grouped.Count; j++) 68while (idsToSort.Count > 0)
OracleEndToEnd.ApiService (1)
Program.cs (1)
21totalEntries = users.Count,
OrderProcessor (2)
OrderProcessingWorker.cs (2)
69Activity.Current?.AddTag("product-count", order.Items.Count); 75""", order.Id, order.BuyerId, order.Items.Count);
ParameterEndToEnd.ApiService (1)
Program.cs (1)
35totalEntries = entries.Count,
Pipelines.AppHost (4)
AppHost.cs (4)
30for (var i = 0; i < fileShares.Count; i++) 53if (resourcesWithBindMounts.Count == 0) 235if (resourcesWithBindMounts.Count == 0) 252for (var i = 0; i < bindMounts.Count; i++)
PostgresEndToEnd.ApiService (1)
Program.cs (1)
34totalEntries = entries.Count,
PresentationBuildTasks (24)
Microsoft\Build\Tasks\Windows\UidManager.cs (2)
689for (int i = 0; i < _uids.Count; i++) 737get { return _uids.Count; }
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (3)
233if (modifiedXamlFiles.Count > 0) 413for (int i = 0; i < modifiedXamlFiles.Count; i++) 439if (recompiledXaml.Count > 0)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationCore\MS\internal\Media\XamlSerializationHelper.cs (6)
199writer.Write( ( uint ) point3Ds.Count ) ; 202for ( int i = 0; i < point3Ds.Count ; i ++ ) 231writer.Write( ( uint ) points.Count ) ; 234for ( int i = 0; i < points.Count ; i ++ ) 263writer.Write( ( uint ) points.Count ) ; 266for ( int i = 0; i < points.Count ; i ++ )
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (5)
1066bamlAssemblyInfoRecord.AssemblyId = (short)(AssemblyIdMap.Count - 1); 1084bamlAssemblyInfoRecord.AssemblyId = (short)(AssemblyIdMap.Count - 1); 1239bamlTypeInfoRecord.TypeId = (short)(TypeIdMap.Count - 1); 1346bamlAttributeInfoRecord.AttributeId = (short)(AttributeIdMap.Count - 1); 1462stringInfo.StringId = (short)(StringIdMap.Count - 1);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (6)
1175bamlPropertyWithStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1); 1585if (staticResourceRecordList.Count > 0) 1588for (int j=0; j<staticResourceRecordList.Count; j++) 1592for (int k=0; k<srRecords.Count; k++) 1676valueDeferRecord = _staticResourceRecordList[_staticResourceRecordList.Count-1]; 1691bamlStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlInt32CollectionSerializer.cs (1)
89count = ints.Count ;
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
3267for (int j = 0; j < namespaceAssemblyPair.Count; j++)
PresentationCore (524)
MS\Internal\DpiUtil\DpiUtil.cs (1)
180int sizeOfList = UIElement.DpiScaleXValues.Count;
MS\Internal\FontCache\FontSourceCollection.cs (1)
136fontSources = new List<Text.TextInterface.IFontSource>(resourceEntries.Count);
MS\Internal\Ink\Bezier.cs (2)
68for (int x = 0; x < points.Count; x++) 575get { return _bezierControlPoints.Count; }
MS\Internal\Ink\CuspData.cs (2)
156int s = 0, e = _cusps.Count; 189get { return _points.Count; }
MS\Internal\Ink\ErasingStroke.cs (10)
98if ((_erasingStrokeNodes == null) || (_erasingStrokeNodes.Count == 0)) 141if ((_erasingStrokeNodes == null) || (_erasingStrokeNodes.Count == 0)) 157int index = eraseAt.Count; 173for (int i = index; i < eraseAt.Count; i++) 186if ((fragment.EndFIndex <= lastFragment.EndFIndex) || ((i + 1) == eraseAt.Count)) 214if (eraseAt[eraseAt.Count - 1].IsFull) 220if ((index > 0) && (index < eraseAt.Count)) 242if (eraseAt.Count != 0) 250return (eraseAt.Count != 0); 299newPath[newPath.Count - 1] = path[i];
MS\Internal\Ink\ExtendedPropertyCollection.cs (10)
45for (int i = 0; i < _extendedProperties.Count; i++) 105for (int x = 0; x < _extendedProperties.Count; x++) 134for (int x = 0; x < _extendedProperties.Count; x++) 197if (_extendedProperties.Count > 0) 199Guid[] guids = new Guid[_extendedProperties.Count]; 200for (int i = 0; i < _extendedProperties.Count; i++) 235for (int i = 0; i < _extendedProperties.Count; i++) 294return _extendedProperties.Count; 337_optimisticIndex < _extendedProperties.Count && 344for (int i = 0; i < _extendedProperties.Count; i++)
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (1)
237if (foundAllGestures && gestures.Count != 1)
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (1)
86if (((compressedData.Count - 1/*for the algo byte we just made room for*/) >> 2) > input.Length)
MS\Internal\Ink\InkSerializedFormat\GuidTagList.cs (4)
67for (i = 0; i < _customGuids.Count; i++) 144if ((0 > nIndex) || (_customGuids.Count <= nIndex)) 207uint ul = (uint)(_customGuids.Count * Native.SizeOfGuid); 229for (int i = 0; i < _customGuids.Count; i++)
MS\Internal\Ink\InkSerializedFormat\HuffModule.cs (1)
57if ((int)codec >= _huffCodecs.Count + AlgoModule.DefaultBAACount)
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (36)
102if (0 == (byte)(charData[charData.Count - 1])) 105charData.RemoveAt(charData.Count - 1); 568if (_strokeDescriptorTable.Count <= strokeDescriptorTableIndex) 581if (_transformTable.Count <= transformTableIndex) 603if (_metricTable.Count <= metricDescriptorTableIndex) 617if (_drawingAttributesTable.Count <= drawingAttributesTableIndex) 1568while (cTags < strd.Template.Count) 1622for (int i = 0; i < tags.Count; i++) 2192if (_strokeDescriptorTable.Count == 0) 2199if (_strokeDescriptorTable.Count == 1) 2204if (tmp.Template.Count == 0) 2221for (count = 0; count < _strokeDescriptorTable.Count; count++) 2231for (count = 0; count < _strokeDescriptorTable.Count; count++) 2251if (0 == _metricTable.Count) 2254for (int i = 0; i < _metricTable.Count; i++) 2268else if (1 == _metricTable.Count) 2278for (int i = 0; i < _metricTable.Count; i++) 2300for (int count = 0; count < strd.Template.Count; count++) 2319if (_transformTable.Count == 1 && _transformTable[0].Size == 0) 2328for (int i = 0; i < _transformTable.Count; i++) 2352if (_transformTable.Count == 1) 2363for (int i = 0; i < _transformTable.Count; i++) 2373for (int i = 0; i < _transformTable.Count; i++) 2447if (1 == _drawingAttributesTable.Count) 2478uint[] sizes = new uint[_drawingAttributesTable.Count]; 2479MemoryStream[] drawingAttributeStreams = new MemoryStream[_drawingAttributesTable.Count]; 2482for (int i = 0; i < _drawingAttributesTable.Count; i++) 2495for (int i = 0; i < _drawingAttributesTable.Count; i++) 2543for (int descriptorIndex = 0; descriptorIndex < _strokeDescriptorTable.Count; descriptorIndex++) 2555_strokeLookupTable[stroke].StrokeDescriptorTableIndex = (uint)_strokeDescriptorTable.Count - 1; 2561for (int tmp = 0; tmp < _metricTable.Count; tmp++) 2584_strokeLookupTable[stroke].MetricDescriptorTableIndex = (uint)(_metricTable.Count - 1); 2596for (int i = 0; i < _transformTable.Count; i++) 2609_strokeLookupTable[stroke].TransformTableIndex = (uint)(_transformTable.Count - 1); 2618for (int i = 0; i < _drawingAttributesTable.Count; i++) 2631_strokeLookupTable[stroke].DrawingAttributesTableIndex = (uint)_drawingAttributesTable.Count - 1;
MS\Internal\Ink\InkSerializedFormat\StrokeDescriptor.cs (3)
38if( _strokeDescriptor.Count != strd.Template.Count ) 42for( int i = 0; i < _strokeDescriptor.Count; i++ )
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (2)
165for (int iTag = 1; iTag < strokeDescriptor.Template.Count && remainingBytesInStrokeBlock > 0; iTag++) 174while (iTag < strokeDescriptor.Template.Count && remainingBytesInStrokeBlock > 0)
MS\Internal\Ink\Lasso.cs (20)
51return (_points.Count < 3); 63return _points.Count; 77System.Diagnostics.Debug.Assert((0 <= index) && (index < _points.Count)); 127int last = _points.Count; 138Point prevLassoPoint = _points[_points.Count - 1]; 139for (int i = 0; i < _points.Count; i++) 188if (_points.Count < 3) 212Point lassoLastPoint = _points[_points.Count - 1]; 294if (crossingList.Count == 0) 382for (int x = 0; x <= crossingList.Count; x++) 399if (x == crossingList.Count) 445StrokeIntersection previousIntersection = strokeIntersections[strokeIntersections.Count - 1]; 454strokeIntersections[strokeIntersections.Count - 1] = previousIntersection; 505if (0 == _points.Count) 511Point lastPoint = _points[_points.Count - 1]; 684if (0 == points.Count) 705System.Diagnostics.Debug.Assert(intersection >= 0 && intersection <= points.Count - 2); 707if (intersection == points.Count - 2) 739for (int j = 0; j < points.Count; j++) 770int count = points.Count;
MS\Internal\Ink\StrokeIntersection.cs (8)
193if (inFIndices.Count > 0 && 194inFIndices[inFIndices.Count - 1].EndFIndex >= 198StrokeFIndices sfiPrevious = inFIndices[inFIndices.Count - 1]; 200inFIndices[inFIndices.Count - 1] = sfiPrevious; 225if (hitFIndices.Count > 0 && 226hitFIndices[hitFIndices.Count - 1].EndFIndex >= 230StrokeFIndices sfiPrevious = hitFIndices[hitFIndices.Count - 1]; 232hitFIndices[hitFIndices.Count - 1] = sfiPrevious;
MS\Internal\Ink\StrokeRenderer.cs (22)
159int cbEndIndex = connectingQuadPoints.Count - 1; 170for (int i = abIndex, j = connectingQuadPoints.Count - 1; i < j; i++, j--) 377if (pathFigureABSide.Count > 0) 480if (pathFigureABSide.Count == 0) 482Debug.Assert(pathFigureDCSide.Count == 0); 629if (pathFigureABSide.Count > 0) 646Debug.Assert(pathFigureDCSide.Count == 0); 672Debug.Assert(pathFigureABSide.Count == 0); 687if (pathFigureABSide.Count > 0) 707Debug.Assert(pathFigureDCSide.Count == 0); 802for (int i = 0, j = dcPoints.Count - 1; i < j; i++, j--) 867Debug.Assert(points.Count > 0); 869context.BeginFigure(startPoint: points[points.Count - 1], 895Debug.Assert(abPoints.Count > 0 && dcPoints.Count > 0); 919if (abPoints.Count == 0 || dcPoints.Count == 0) 932for (int i = startIndex; i < points.Count; ) 937if (polyLinePoints.Count > 0) 946Debug.Assert(i + 2 < points.Count); 947if (i + 2 < points.Count) 972if (polyLinePoints.Count > 0)
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (7)
399for (int i = 0; i < hitTestEdgeList.Count; i++) 534if (pointList.Count >= 2) 539else if (pointList.Count == 1) 945if (pointList.Count >= 2) 950else if (pointList.Count == 1) 1028for (int i=0, count = edges.Count; i < count; i++) 1176for (int i = 0, count = edges.Count; i < count; i++)
src\wpf\src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (7)
1057for (int i = 0; i < _others.Count; i++) 1126Debug.Assert(_others.Count > 0); 1127int j = _others.Count-1; 1149if (_others.Count == 1) 1209return _others.Count + 1; 1292for (int i = 0; i < others.Count; i++) 1447return ((List<Entry>)_head._key).Count;
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (2)
446buffer = _targetBuffer[_targetBuffer.Count - 1]; 458_targetBuffer[_targetBuffer.Count - 1] = buffer;
System\Windows\Automation\Peers\AutomationPeer.cs (14)
551int cnt = children.Count; 1257result = new IRawElementProviderSimple[controlledPeers.Count]; 1259for (int i = 0; i < controlledPeers.Count; i++) 1469if (_children != null && _children.Count > 0) 1489int count = _children.Count; 1515if (_children != null && _children.Count > 0) 1517peer = _children[_children.Count - 1]; 1542&& _index + 1 < parent._children.Count 1565&& _index < parent._children.Count 1649iterationParent = (_parent._children == null || _parent._children.Count == caller._children.Count) 1763int count = children.Count; 1903for(int count = oldChildren.Count, i = 0; i < count; i++) 1915for(int count = _children.Count, i = 0; i < count; i++)
System\Windows\FreezableCollection.cs (10)
151for (int i = _collection.Count - 1; i >= 0; i--) 158Debug.Assert(_collection.Count == 0); 350return _collection.Count; 367ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 477ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 488int count = _collection.Count; 708return _collection.Count; 793int count = source._collection.Count; 888int count = _collection.Count; 1009if (_index > -2 && _index < _list._collection.Count - 1)
System\Windows\Ink\IncrementalHitTester.cs (11)
94int count = _strokeInfos.Count; 180for (int i = 0; i < _strokeInfos.Count && localRemoved.Count > 0; ) 202if (_strokes.Count != _strokeInfos.Count) 208for (int i = 0; i < _strokeInfos.Count; i++) 230for (int x = 0; x < _strokeInfos.Count; x++) 251for (int x = 0; x < _strokeInfos.Count; x++) 261Debug.Assert(_strokeInfos.Count == _strokes.Count); 262for (int x = 0; x < _strokeInfos.Count; x++) 529for (int x = 0; x < this.StrokeInfos.Count; x++) 557System.Diagnostics.Debug.Assert(strokeHitEventArgCollection.Count != 0); 558for (int x = 0; x < strokeHitEventArgCollection.Count; x++)
System\Windows\Ink\Stroke.cs (5)
250Debug.Assert(bezierPoints != null && bezierPoints.Count > 0); 254new StylusPointCollection(_stylusPoints.Description, bezierPoints.Count); 264if (bezierPoints.Count == 1) 295for (int x = 1; x < bezierPoints.Count - 1; x++) 341bezierPoints[bezierPoints.Count - 1],
System\Windows\Input\AccessKeyManager.cs (4)
90return (targets != null && targets.Count > 0); 237for (int i = 0; i < targets.Count; i++) 276return (chosenIndex == targets.Count - 1) ? ProcessKeyResult.LastMatch : ProcessKeyResult.MoreMatches; 380for (int i = 0; i < possibleElements.Count; i++)
System\Windows\Input\Command\CanExecuteChangedEventManager.cs (3)
110removeList = (toRemove != null && toRemove.Count == list.Count); 298if (list.Count == 0)
System\Windows\Input\Command\CommandBindingCollection.cs (1)
278return _innerCBList?.Count ?? 0;
System\Windows\Input\Command\CommandManager.cs (2)
599for (int i = 0; i < list.Count; ++i) 606while (++i < list.Count && list[i].Item1 == classType)
System\Windows\Input\Command\InputBindingCollection.cs (3)
172if (index >= 0 && index < _innerBindingList.Count) 310if (index >= 0 && index < _innerBindingList.Count) 337return (_innerBindingList != null ? _innerBindingList.Count : 0);
System\Windows\Input\Command\InputGestureCollection.cs (1)
346return (_innerGestureList != null ? _innerGestureList.Count : 0 );
System\Windows\Input\ManipulationDevice.cs (3)
135for (int i = _manipulators.Count - 1; i >= 0; i--) 173if (_manipulators == null || _manipulators.Count == 0) 442Debug.Assert(_manipulators == null || _manipulators.Count == 0);
System\Windows\Input\ManipulationInertiaStartingEventArgs.cs (2)
206if (_inertiaParameters != null && _inertiaParameters.Count > 0) 242for (int i = 0, count = _inertiaParameters.Count; i < count; i++)
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (4)
176get { return _strokeInfoList.Count > 0; } 180get { return _strokeInfoList.Count == 1; } 875while (_strokeInfoList.Count > 0) 1015for (int i=0; i < _strokeInfoList.Count; i++)
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (5)
86if (points.Count == 0) 96((List<StylusPoint>)this.Items).Capacity = points.Count; 97for (int x = 0; x < points.Count; x++) 121if (stylusPoints.Count == 0) 126((List<StylusPoint>)this.Items).Capacity = stylusPoints.Count;
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (2)
50if (infos.Count < RequiredCountOfProperties || 67for (int x = RequiredCountOfProperties; x < infos.Count; x++)
System\Windows\Input\Stylus\Common\TabletDeviceCollection.cs (1)
34return TabletDevices.Count;
System\Windows\Input\Stylus\Pointer\PointerInteractionEngine.cs (1)
183UnsafeNativeMethods.SetInteractionConfigurationInteractionContext(_interactionContext, (uint)configuration.Count, configuration.ToArray());
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (2)
78for (i = 0; i < _plugInCollectionList.Count; i++) 86while (i < _plugInCollectionList.Count)
System\Windows\Input\Stylus\Pointer\PointerTabletDeviceInfo.cs (1)
267SupportedButtonPropertyIndex = supportedProperties.Count;
System\Windows\Input\Stylus\Wisp\PenContext.cs (3)
233return _stylusDevicesInRange != null && _stylusDevicesInRange.Count > 0; 357if (_stylusDevicesInRange.Count == 0) 375for(int i=0; i < _stylusDevicesInRange.Count; i++)
System\Windows\Input\Stylus\Wisp\PenContexts.cs (2)
276for (i=0; i < _plugInCollectionList.Count; i++) 284while (i < _plugInCollectionList.Count)
System\Windows\Input\Stylus\Wisp\PenThreadPool.cs (2)
90while (ignoredThreads.Count < MAX_PENTHREAD_RETRIES) 94for (int i = _penThreadWeakRefList.Count - 1; i >= 0; i--)
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (12)
1017if (penContextRefs.Count < MaxContextPerThread) 1026_pimcContexts = new IPimcContext3[penContextRefs.Count]; 1027_penContexts = new WeakReference[penContextRefs.Count]; 1028_handles = new IntPtr[penContextRefs.Count]; 1029_wispContextKeys = new UInt32[penContextRefs.Count]; 1031for (i=0; i < penContextRefs.Count; i++) 1080_pimcContexts = new IPimcContext3[penContextRefs.Count]; 1081_penContexts = new WeakReference[penContextRefs.Count]; 1082_handles = new IntPtr[penContextRefs.Count]; 1083_wispContextKeys = new UInt32[penContextRefs.Count]; 1085for (i=0; i < penContextRefs.Count; i++) 1165if (_workerOperation.Count > 0)
System\Windows\Input\Stylus\Wisp\WispLogic.cs (4)
1594int stagingItemCount = storedStagingItems.Count; 1664int count = touchDevice.StoredStagingAreaItems.Count; 3433int numDeferredTablets = _tabletDeviceCollection.DeferredTablets.Count; 3442&& _tabletDeviceCollection.DeferredTablets.Count == numDeferredTablets)
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (1)
658int c = Count + _deferredTablets.Count;
System\Windows\Input\TouchDevice.cs (9)
428int count = (_activeDevices != null) ? _activeDevices.Count : 0; 464int count = _activeDevices != null ? _activeDevices.Count : 0; 702if (_activeDevices.Count == 1) 806int count = _activeDevices != null ? _activeDevices.Count : 0; 1142int count = _activeDevices.Count; 1155if ((_activeDevices != null) && (_activeDevices.Count > 0)) 1171int count = _activeDevices.Count; 1217int count = _activeDevices.Count; 1237int count = _activeDevices.Count;
System\Windows\Media\Animation\Clock.cs (3)
1413if (_childIndex == parentChildren.Count - 1) 4270for (int childIndex = 0; childIndex < children.Count; childIndex++) 4294for (int index = 0; index < children.Count; index++)
System\Windows\Media\Animation\ClockGroup.cs (7)
130for (int index = 0; index < _children.Count; index++) 289for (int c = 0; c < _children.Count; c++) 310for (int c = 0; c < _children.Count; c++) 349for (int childIndex = 0; childIndex < _children.Count; childIndex++) 435for (int c = 0; c < _children.Count; c++) 498return (_rootChildren.Count > 0); 549for (int childIndex = 0; childIndex < _children.Count; childIndex++)
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ColorKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\DoubleKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\MatrixKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Point3DKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\PointKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\QuaternionKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\RectKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\SizeKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (2)
747for (int j = 0; j < unspecifiedBlocks.Count; j++) 880for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\Vector3DKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\VectorKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Media\Animation\ParallelTimeline.cs (1)
99for (int childIndex = 0; childIndex < children.Count; childIndex++)
System\Windows\Media\Animation\TimelineClockCollection.cs (1)
34return childList.Count;
System\Windows\Media\Animation\WeakRefEnumerator.cs (2)
106_readIndex = _writeIndex = _list.Count; 131while (_readIndex < _list.Count)
System\Windows\Media\Effects\ShaderEffect.cs (14)
202for (int i = PS_2_0_FLOAT_REGISTER_LIMIT; i < _floatRegisters.Count; i++) 216for (int i = PS_2_0_SAMPLER_LIMIT; i < _samplerData.Count; i++) 467if (list.Count <= position) 469int numToAdd = position - list.Count + 1; 494if (_samplerData.Count <= position) 496int numToAdd = position - _samplerData.Count + 1; 616for (int i = 0; i < _floatRegisters.Count; i++) 633for (int i = 0; i < _intRegisters.Count; i++) 650for (int i = 0; i < _boolRegisters.Count; i++) 670int count = _samplerData.Count; 693for (int i = 0; i < _samplerData.Count; i++) 729for (int i = 0; i < list.Count; i++) 751int numSamplers = _samplerData.Count; 788int numSamplers = _samplerData.Count;
System\Windows\Media\Imaging\BitmapMetadata.cs (9)
192count = (UInt32)_metadataBlocks.Count; 206if (index >= _metadataBlocks.Count) 330if (index >= _metadataBlocks.Count) 358if (_fixedSize && _metadataBlocks.Count>0) 381if (index >= _metadataBlocks.Count) 409if (index >= _metadataBlocks.Count) 508if (_index >= _metadataBlocks.Count || celt == 0) 540if (newIndex > _metadataBlocks.Count) 542_index = (uint)_metadataBlocks.Count;
System\Windows\Media\Visual.cs (1)
4684if (UIElement.DpiScaleXValues.Count == 0)
System\Windows\Media3D\Matrix3DStack.cs (5)
40_stack.RemoveAt(_stack.Count - 1); 50if (_stack.Count > 0) 68return _stack.Count; 76return (_stack.Count == 0); 84return _stack[_stack.Count - 1];
System\Windows\Media3D\RayHitTestParameters.cs (1)
120for(int i = 0, count = results.Count; i < count; i++)
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
371list.RemoveRange(count, list.Count - count);
PresentationFramework (847)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (1)
716List<ContentLocatorBase> tempLocators = new List<ContentLocatorBase>(locatorsToReturn.Count * locatorParts.Count);
MS\Internal\Annotations\AnnotationMap.cs (2)
43if (list.Count == 0) 96if (result.Count == 0)
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (2)
428if (adorners.Count > 0) 430for (index = adorners.Count; index > 0; index--)
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (13)
82if (_segments.Count == 0) 241for (int i = 0; i < _segments.Count; i++) 350while ((ind < _segments.Count) && (!rangeSegment.IsNull)) 441if (ind == _segments.Count) ind--; 453for (int i = 0; i < _segments.Count; i++) 477for (int i = _segments.Count - 1; i >= 0; i--) 499for (int i = 0; i < _segments.Count; i++) 669for (int i = 0; i < _owners.Count; i++) 699return _owners.Count; 1149if (_activeOwners.Count != 0) 1153return _owners.Count > 0 ? _owners[0] : null; 1175if (_activeOwners.Count != 0) 1179return _owners.Count > 0 ? new SolidColorBrush(_owners[0].Background) : null;
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (12)
626if (componentsRegister.Components.Count == 0) 895bool[] active = new bool[components.Count]; 896for (int i = 0; i < components.Count; i++) 905for (int i = 0; i < components.Count; i++) 960Debug.Assert((components != null) && (components.Count > 0), "invalid component registry"); 962for (int i = 0; i < components.Count; i++) 1005if (_components.Count == 0) 1016for (; i < _components.Count; i++) 1025for (; i < _components.Count; i++) 1040for (; ind < _components.Count; ind++) 1046if (ind < _components.Count) 1051for (; ind < _components.Count; ind++)
MS\Internal\Annotations\TextAnchor.cs (19)
121for (int i = 0; i < _segments.Count; i++) 169if (other._segments.Count != this._segments.Count) 172for (int i = 0; i < _segments.Count; i++) 289while (currentIndex < anchor._segments.Count && hasMore) 347if (anchor._segments.Count > 0) 391while (current < anchor._segments.Count && hasMore) 446if (!hasMore && current < anchor._segments.Count) 448anchor._segments.RemoveRange(current, anchor._segments.Count - current); 451if (anchor._segments.Count == 0) 507return _segments.Count > 0 ? _segments[0].Start : null; 518return _segments.Count > 0 ? _segments[_segments.Count - 1].End : null; 530return (_segments.Count == 1 && (object)_segments[0].Start == (object)_segments[0].End); 545for (int i = 0; i < _segments.Count; i++) 599for (int i = orderedList.Count - 1; i >= 0; i--) 611if (orderedList.Count > 1) 627for (; i < _segments.Count; i++) 638if (i < _segments.Count && newSegment.End.CompareTo(_segments[i].Start) > 0)
MS\Internal\Controls\InkCanvasSelectionAdorner.cs (3)
155int count = hatchBounds.Count; 156if (count != _elementsBounds.Count) 237int count = _elementsBounds.Count;
MS\Internal\Data\CollectionViewGroupRoot.cs (3)
334List<GroupTreeNode> list = new List<GroupTreeNode>(parentGroups.Count + 1); 346for (int index = 0; index < list.Count; ++index) 360for (int k = list.Count - 1; k >= 0; --k)
MS\Internal\Data\LiveShapingItem.cs (1)
214if (list.Count == 1)
MS\Internal\Data\LiveShapingList.cs (2)
715for (; _dpIndex < s_dpList.Count; ++_dpIndex) 730$"LiveSortingTargetProperty{s_dpList.Count}"),
MS\Internal\Data\StaticPropertyChangedEventManager.cs (2)
487Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 514if (_toRemove.Count > 0)
MS\Internal\Data\ValueChangedEventManager.cs (2)
187Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 219if (_toRemove.Count > 0)
MS\Internal\Documents\ContentHostHelper.cs (1)
109for (int i = 0; i < pageViews.Count; i++)
MS\Internal\Documents\DocumentGrid.cs (1)
2922for (int i = 0; i < args.Changes.Count; i++)
MS\Internal\Documents\FlowDocumentPaginator.cs (4)
432for (int index = 0; index < _asyncRequests.Count; index++) 609if (_backgroundPagination && _backgroundPaginationOperation == null && (!_brt.IsClean || _asyncRequests.Count > 0)) 620for (int index = 0; index < _asyncRequests.Count; index++) 785for (int index = 0; index < _asyncRequests.Count; index++)
MS\Internal\Documents\MultiPageTextView.cs (11)
152for (int i = 0, count = _pageTextViews.Count; i < count; ++i) 647for (int i = 0; i < _pageTextViews.Count; i++) 668if (_pageTextViews != null && _pageTextViews.Count > 0) 688for (int i = 0; i < _pageTextViews.Count; i++) 718for (index = 0; index < _pageTextViews.Count; index++) 1073for (i = 0; i < _pageTextViews.Count; i++) 1086double[] textViewProximities = new double[_pageTextViews.Count]; 1087for (i = 0; i < _pageTextViews.Count; i++) 1139for (i = 0; i < _pageTextViews.Count; i++) 1164for (i = 0; i < _pageTextViews.Count; i++) 1194for (int i = 0; i < _pageTextViews.Count; i++)
MS\Internal\Documents\PageCache.cs (24)
163return _cache.Count; 256if (pageNumber >= 0 && pageNumber < _cache.Count) 291if (pageNumber >= 0 && pageNumber < _cache.Count) 375if (args.Start >= _cache.Count) 388if (args.Start + args.Count < _cache.Count) 400change = DirtyRange(args.Start, _cache.Count - args.Start); 406change = AddRange(_cache.Count, args.Count - (_cache.Count - args.Start) + 1); 419if (pageCount < _cache.Count) 421change = new PageCacheChange(pageCount, _cache.Count - pageCount, PageCacheChangeType.Remove); 425_cache.RemoveRange(pageCount, _cache.Count - pageCount); 523if (args.Start + args.Count >= _cache.Count || 526adjustedCount = _cache.Count - args.Start; 623if (args.PageNumber > _cache.Count - 1) 709for (int i = 0; i < _cache.Count; i++) 738if (PageCacheChanged != null && changes != null && changes.Count > 0) 761if (start >= _cache.Count) 763count += (start - _cache.Count); 764start = _cache.Count; 788ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _cache.Count); 815ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(start, _cache.Count); 817ArgumentOutOfRangeException.ThrowIfGreaterThan(count, _cache.Count - start); 842if (_cache.Count > 0) 847PageCacheChange change = new PageCacheChange(0, _cache.Count, PageCacheChangeType.Remove);
MS\Internal\Documents\RowCache.cs (32)
88return _rowCache.Count; 241ArgumentOutOfRangeException.ThrowIfGreaterThan(index, _rowCache.Count); 275for (int i = 0; i < _rowCache.Count; i++) 302if (_rowCache.Count == 0) 316for (int i = 0; i < _rowCache.Count; i++) 344i == _rowCache.Count - 1) 366return _rowCache.Count - 1; 372return _rowCache.Count - 1; 398if (_rowCache.Count == 0) 415for (int i = startRowIndex + 1; i < _rowCache.Count; i++) 451for (int i = 0; i < _rowCache.Count; i++) 478changes.Add(new RowCacheChange(0, _rowCache.Count)); 571changes.Add(new RowCacheChange(0, _rowCache.Count)); 595if (_rowCache.Count == 0) 603RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 684for (int i = tempRows.Count - 1; i >= 0; i--) 690pivotRowIndex = _rowCache.Count; 886RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 917startRow = _rowCache.Count - 1; 923startRow = _rowCache.Count; 963if (_rowCache.Count == 0) 973RowInfo lastRow = _rowCache[_rowCache.Count - 1]; 1010while (currentPage < startPage + count && rowIndex < _rowCache.Count) 1060if (index > _rowCache.Count) 1078for (int i = index + 1; i < _rowCache.Count; i++) 1105for (int i = 0; i < _rowCache.Count; i++) 1149int removeCount = _rowCache.Count - rowIndex; 1152if (rowIndex < _rowCache.Count) 1200List<RowCacheChange> changes = new List<RowCacheChange>(args.Changes.Count); 1201for (int i = 0; i < args.Changes.Count; i++) 1264if (_rowCache.Count <= 1) 1268if (_rowCache.Count == 0 || _rowCache[0].PageCount < _layoutColumns)
MS\Internal\Documents\TextBoxView.cs (51)
391if (_lineMetrics.Count == 0 || constraintschanged) 406_lineMetrics.Count == 1 && _lineMetrics[0].EndOffset == 0) 433Invariant.Assert(_lineMetrics.Count >= 1); 464if (_lineMetrics == null || _lineMetrics.Count == 0) 532return (_visualChildren == null) ? 0 : _visualChildren.Count; 646int startOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, startPosition.Offset); 647int endOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, endPosition.Offset); 724int nextLineIndex = Math.Max(0, Math.Min(_lineMetrics.Count - 1, lineIndex + count)); 843if (lineIndex == _lineMetrics.Count - 1) 1056int lastValidOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 1068int newLastValidOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 1131int max = _lineMetrics.Count; 1133Invariant.Assert(_lineMetrics.Count >= 1); 1152if (offset == record.EndOffset && index < _lineMetrics.Count - 1) 1259ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[_lineMetrics.Count - 1].EndOffset, LogicalDirection.Forward); 1487if (_lineMetrics.Count == 0) 1596Invariant.Assert(_lineMetrics.Count >= 1); 1604if (point.Y >= _lineHeight * _lineMetrics.Count) 1606return snapToText ? _lineMetrics.Count - 1 : -1; 1613int max = _lineMetrics.Count; 1911int j = _visualChildren.Count - 1; // last non-discarded element index 1913for (int i = _visualChildren.Count - 1; i >= 0; i--) 1928if (j < _visualChildren.Count - 1) 1930_visualChildren.RemoveRange(j + 1, _visualChildren.Count - j - 1); 1943lineVisual._parentIndex = _visualChildren.Count; 1951for (int i = 0; i < _visualChildren.Count; i++) 2159firstLineIndex = Math.Max(0, Math.Min(firstLineIndex, _lineMetrics.Count - 1)); 2160lastLineIndex = Math.Max(0, Math.Min(lastLineIndex, _lineMetrics.Count - 1)); 2166lastLineIndex = _lineMetrics.Count - 1; 2186if (_lineMetrics.Count == 0) 2194lineOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 2284if (range.StartIndex > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2304if (range.StartIndex > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2343for (int i = lineIndex + 1; i < _lineMetrics.Count; i++) 2402if (endOffset > _lineMetrics[_lineMetrics.Count - 1].EndOffset) 2405endOffset = _lineMetrics[_lineMetrics.Count - 1].EndOffset; 2417for (int i = lastLineIndex + 1; i < _lineMetrics.Count; i++) 2510(lineIndex == _lineMetrics.Count || 2514if (lineIndex < _lineMetrics.Count && 2533if (lineIndex == _lineMetrics.Count || 2586if (endOfParagraph && lineIndex < _lineMetrics.Count) 2588int count = _lineMetrics.Count - lineIndex; 2600for (int i = 0; i < _lineMetrics.Count; i++) 2604desiredSize.Height = _lineMetrics.Count * _lineHeight; 2660int oldLastLineIndex = oldLineVisualsIndex + oldLineVisuals.Count - 1; 2680for (int i = lineIndex - oldLineVisualsIndex + lineCount; i < oldLineVisuals.Count; i++) 2718lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count) 2732lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count && 2754if (lineIndex < _viewportLineVisualsIndex + _viewportLineVisuals.Count) 2757count = Math.Min(count, _viewportLineVisuals.Count - start); 2865_lineMetrics[_lineMetrics.Count - 1].EndOffset >= position.Offset;
MS\Internal\Documents\TextContainerHelper.cs (2)
471int depth = Math.Min(ancestorsStart.Count, ancestorsEnd.Count);
MS\Internal\Documents\UndoManager.cs (6)
433if (!(_topUndoIndex < UndoStack.Count && PeekUndoStack() == null) // Non-null topmost stack item 434&& (UndoLimit == -1 || UndoStack.Count < UndoLimit)) 629if (_topUndoIndex < 0 || _topUndoIndex == UndoStack.Count) 715_topUndoIndex = undoStack.Count - 1; 865if (UndoStack.Count == 0 || _topUndoIndex < 0) 1103if (UndoStack.Count > 0)
MS\Internal\Globalization\BamlResourceSerializer.cs (1)
95for (int i = children.Count - 1; i >= 0; i--)
MS\Internal\Globalization\BamlTreeMap.cs (1)
603i < node.Children.Count && (comment.LocalizationComments.Length == 0 || comment.LocalizationAttributes.Length == 0);
MS\Internal\Globalization\BamlTreeNode.cs (4)
53get { return _nodeList.Count; } 104parent.Children = new List<BamlTreeNode>(children.Count); 116for (int i = 0; i < children.Count; i++) 504for (int i = 0; i < _children.Count; i++)
MS\Internal\Globalization\BamlTreeUpdater.cs (2)
59for (int i = 0; i < deferredResources.Count; i++) 297for (int i = 0; i < oldChildren.Count - 1; i++)
MS\Internal\Helper.cs (5)
756for (int i = 0; i < itemValues.Count; i++) 784for (int j = 0; j < itemValues.Count; j++) 809for (int i = 0; i < itemValues.Count; i++) 887for (int i = 0; i < itemValues.Count; i++) 1030for (int i=0; i<itemValuesList.Count; i++)
MS\Internal\Ink\ClipboardProcessor.cs (4)
139if ( strokes.Count != 0 || elements.Count != 0 ) 201if (elements != null && elements.Count != 0) 206if (elements.Count == 1 && elements[0] is InkCanvas inkCanvas) 324int elementCount = elements.Count;
MS\Internal\Ink\HighContrastHelper.cs (2)
84int count = __highContrastCallbackList.Count; 141int count = __highContrastCallbackList.Count;
MS\Internal\Ink\InkCanvasSelection.cs (2)
331if ( _selectedElements == null || _selectedElements.Count == 0 ) 340if ( _selectedElements.Count == 0 )
MS\Internal\Ink\LassoHelper.cs (4)
73int count = points.Count; 201int last = _lasso.Count; 213Point prevLassoPoint = _lasso[_lasso.Count - 1]; 215for (int i = 0; i < _lasso.Count; i++)
MS\Internal\Ink\XamlClipboardData.cs (1)
58return Elements != null && Elements.Count != 0;
MS\Internal\LayoutDump.cs (3)
360if (uiElements.Count > 0) 364writer.WriteAttributeString("Count", uiElements.Count.ToString(CultureInfo.InvariantCulture)); 366for (int index = 0; index < uiElements.Count; index++)
MS\Internal\PtsHost\BreakRecordTable.cs (25)
60Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "Invalid PageNumber."); 86if (pageNumber < _breakRecords.Count) 120Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "Invalid PageNumber."); 126while (pageNumber < _breakRecords.Count) 153if (_breakRecords.Count > 0) 156InvalidateBreakRecords(0, _breakRecords.Count); 177if (_breakRecords.Count > 0) 185pageCount = _breakRecords.Count - pageStart; 207if (_breakRecords.Count > 0) 210DisposePages(0, _breakRecords.Count); 214_owner.OnPagesChanged(0, _breakRecords.Count); 227if (_breakRecords.Count > 0) 255Invariant.Assert(pageNumber >= 0 && pageNumber <= _breakRecords.Count, "The previous BreakRecord does not exist."); 274if (pageNumber == _breakRecords.Count) 321if (pageNumber > _breakRecords.Count) 342get { return _breakRecords.Count; } 352if (_breakRecords.Count == 0) 354Invariant.Assert(_breakRecords[_breakRecords.Count - 1] != null, "Invalid BreakRecordTable entry."); 355return (_breakRecords[_breakRecords.Count - 1].BreakRecord == null); 379Invariant.Assert(start >= 0 && start < _breakRecords.Count, "Invalid starting index for BreakRecordTable invalidation."); 380Invariant.Assert(start + count <= _breakRecords.Count, "Partial invalidation of BreakRecordTable is not allowed."); 405Invariant.Assert(start >= 0 && start < _breakRecords.Count, "Invalid starting index for BreakRecordTable invalidation."); 406Invariant.Assert(start + count == _breakRecords.Count, "Partial invalidation of BreakRecordTable is not allowed."); 439while (pageStart < _breakRecords.Count) 477pageCount = _breakRecords.Count - pageStart;
MS\Internal\PtsHost\FigureParaClient.cs (3)
216for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 318if (trackRectangles.Count != 0) 776for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\FloaterParaClient.cs (3)
221for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 323if (trackRectangles.Count != 0) 785for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\FlowDocumentPage.cs (4)
332if(this.PageVisual != null && rectangles.Count > 0) 334List<Rect> transformedRectangles = new List<Rect>(rectangles.Count); 338for(int index = 0; index < rectangles.Count; index++) 383for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\Line.cs (3)
314if (inlineObjects.Count == 0) 679Debug.Assert(cchGlyphRuns > 0 && glyphRunsCollection.Count > 0); 710Invariant.Assert(runIndex < glyphRunsCollection.Count);
MS\Internal\PtsHost\PtsCache.cs (11)
182for (index = 0; index < _contextPool.Count; index++) 193if (index == _contextPool.Count) 251for (index = 0; index < _contextPool.Count; index++) 258Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the Context pool."); 270for (index = 0; index < _contextPool.Count; index++) 277Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the context pool."); 311while (index < _contextPool.Count) 373for (index = 0; index < _contextPool.Count; index++) 382Invariant.Assert(index < _contextPool.Count, "PtsContext not found in the context pool."); 393if (cleanContextPool && _contextPool.Count > 4) 397while (index < _contextPool.Count)
MS\Internal\PtsHost\PtsHelper.cs (8)
73if(floatingElementList == null || floatingElementList.Count == 0) 79for(int index = 0; index < floatingElementList.Count; index++) 97if(visualChildren.Count > floatingElementList.Count) 99visualChildren.RemoveRange(floatingElementList.Count, visualChildren.Count - floatingElementList.Count); 498if (rectangles.Count != 0) 514List<Rect> offsetRectangles = new List<Rect>(rectangleList.Count); 516for(int index = 0; index < rectangleList.Count; index++)
MS\Internal\PtsHost\PtsHost.cs (4)
1965for(int objectIndex = 0; objectIndex < attachedObjects.Count; objectIndex++) 1982cObjects = attachedObjects.Count; 2080for(int objectIndex = 0; objectIndex < attachedObjects.Count; objectIndex++) 2097cObjects = attachedObjects.Count;
MS\Internal\PtsHost\PtsPage.cs (4)
1183for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 1286if (rectangles.Count != 0) 1408if (trackRectangles.Count != 0) 1559if(_floatingElementList.Count == 0)
MS\Internal\PtsHost\SubpageParaClient.cs (3)
155for(int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++) 256if (trackRectangles.Count != 0) 695for (int i = 0; i < floatingElementList.Count; i++)
MS\Internal\PtsHost\TableParaClient.cs (2)
474if (rectangles.Count != 0) 480if (rectangles.Count != 0)
MS\Internal\PtsHost\TextParaClient.cs (20)
278if (rectangles.Count != 0) 287if (rectangles.Count == 0 && textDetails.u.full.cLines > 0) 301if(rectangles.Count > 0 && ThisFlowDirection != PageFlowDirection) 305for(int index = 0; index < rectangles.Count; index++) 412return (floaters != null && floaters.Count > 0) ? new ReadOnlyCollection<ParagraphResult>(floaters) : null; 449return (figures != null && figures.Count > 0) ? new ReadOnlyCollection<ParagraphResult>(figures) : null; 1264for (int i = 0; i < inlineObjects.Count; i++) 1298for (int i = 0; i < inlineObjects.Count; i++) 1549if (lines.Count != 0) 1552TextParaLineResult lastLineResult = (TextParaLineResult)lines[lines.Count - 1]; 1560return (lines.Count > 0) ? new ReadOnlyCollection<LineResult>(lines) : null; 1611if (lines.Count != 0) 1614TextParaLineResult lastLineResult = (TextParaLineResult)lines[lines.Count - 1]; 1622return (lines.Count > 0) ? new ReadOnlyCollection<LineResult>(lines) : null; 2118for (int i = 0, count = rectangles.Count; i < count; ++i) 2228for (int i = 0, count = rectangles.Count; i < count; ++i) 3885if (lineRectangles.Count != 0) 3943Invariant.Assert(rectangles.Count > 0); 4065if (lineRectangles.Count != 0) 4142Invariant.Assert(elementRectangles.Count > 0);
MS\Internal\PtsHost\TextParagraph.cs (25)
924if(textElements.Count == 0) 929return textElements.Count; 941for(int index = 0; index < textElements.Count; index++) 988if(attachedObjects.Count != 0) 1057objects = new List<InlineObject>(_inlineObjects.Count); 1058for (int i = 0; i < _inlineObjects.Count; i++) 1073if(objects == null || objects.Count == 0) 1142for (int index=0; index < _attachedObjects.Count; index++) 1178if(_attachedObjects != null && _attachedObjects.Count > 0) 1209for (int index=0; index < _attachedObjects.Count; index++) 1233for (int index=0; index < _attachedObjects.Count; index++) 1354if(HasFiguresOrFloaters() || (_inlineObjects != null && _inlineObjects.Count > 0)) 1367return _attachedObjects != null && _attachedObjects.Count > 0; 1379for(int index = 0; _attachedObjects != null && index < _attachedObjects.Count; index++) 1523ErrorHandler.Assert(objectsNew == null || (objectsNew[0].Dcp >= dcpStart && objectsNew[objectsNew.Count-1].Dcp <= dcpLim), ErrorHandler.SubmitInvalidList); 1533objectsCached = new List<T>(objectsNew.Count); 1537int end = objectsCached.Count; 1572while (idx < objectsNew.Count) 1597if (idx >= objectsNew.Count) 1605if (idxNew < objectsNew.Count) 1608objectsCached.InsertRange(end, objectsNew.GetRange(idxNew, objectsNew.Count - idxNew)); 1643while (first < objectsCached.Count && objectsCached[first].Dcp < dcpStart) 1648while (last < objectsCached.Count && objectsCached[last].Dcp < dcpStart + cchDeleted) 1664while (last < objectsCached.Count) 1670if (objectsCached.Count == 0)
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.cs (2)
148var iids = new Guid[interfaceTableEntries.Count]; 149for (int i = 0; i < interfaceTableEntries.Count; i++)
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.net5.cs (1)
90count = entries.Count;
System\Windows\Annotations\AnnotationService.cs (8)
791if (annotations.Count > _maxAnnotationsBatch) 794List<IAttachedAnnotation> leftover = new List<IAttachedAnnotation>(annotations.Count); 795leftover = annotations.GetRange(_maxAnnotationsBatch, annotations.Count - _maxAnnotationsBatch); 800annotations.RemoveRange(_maxAnnotationsBatch, annotations.Count - _maxAnnotationsBatch); 958for (int i = existingAnnotations.Count - 1; i >= 0; i--) 974if ((existingAnnotations != null) && (existingAnnotations.Count > 0)) 1270if (_annotationMap.GetAttachedAnnotations(annotation.Id).Count > 0) 1501if (list.Count == 0)
System\Windows\Automation\Peers\CalendarAutomationPeer.cs (2)
464if (providers.Count > 0) 620if (providers.Count > 0)
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (2)
254if (providers.Count > 0) 284if (providers.Count > 0)
System\Windows\Automation\Peers\DataGridCellItemAutomationPeer.cs (1)
808if (this.Index != -1 && parent != null && parent.Children != null && this.Index < parent.Children.Count && parent.Children[this.Index] == this)
System\Windows\Automation\Peers\DataGridItemAutomationPeer.cs (1)
389if (selectedProviders.Count > 0)
System\Windows\Automation\Peers\DateTimeAutomationPeer.cs (1)
924if (this.Index != -1 && parent != null && parent.Children != null && this.Index < parent.Children.Count && parent.Children[this.Index] == this)
System\Windows\Automation\Peers\FlowDocumentPageViewerAutomationPeer.cs (4)
41if (Owner is IFlowDocumentViewer && children != null && children.Count > 0) 43if (children[children.Count-1] is DocumentAutomationPeer) 45children.RemoveAt(children.Count - 1); 46if (children.Count == 0)
System\Windows\Automation\Peers\GridViewAutomationPeer.cs (3)
132List<IRawElementProviderSimple> array = new List<IRawElementProviderSimple>(_owner.HeaderRowPresenter.ActualColumnHeaders.Count); 174return _owner.HeaderRowPresenter.ActualColumnHeaders.Count; 237if (columns.Count > column)
System\Windows\Automation\Peers\GridViewCellAutomationPeer.cs (2)
75return children != null && children.Count >= 1; 105if (gridview.HeaderRowPresenter != null && gridview.HeaderRowPresenter.ActualColumnHeaders.Count > Column)
System\Windows\Automation\Peers\GridViewHeaderRowPresenterAutomationPeer.cs (1)
43newList = new List<AutomationPeer>(list.Count);
System\Windows\Automation\Peers\GridViewItemAutomationPeer.cs (1)
49_dataChildren = new Hashtable(rowPresenter.ActualCells.Count);
System\Windows\Automation\Peers\GroupItemAutomationPeer.cs (2)
171if (itemsControlAP.RecentlyRealizedPeers.Count > 0 && this.AncestorsInvalid) 291for (int i=0; i<recentlyRealizedPeers.Count; i++)
System\Windows\Automation\Peers\ItemAutomationPeer.cs (1)
131if(this.Index != -1 && parent != null && parent.Children != null && this.Index < parent.Children.Count && parent.Children[this.Index] == this)
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (4)
93if (_recentlyRealizedPeers != null && _recentlyRealizedPeers.Count > 0 && this.AncestorsInvalid) 580for (int i = 0; i < _list.Count; i++) 640for (i = 0; i < _list.Count; i++) 646if(i < _list.Count)
System\Windows\BroadcastEventHelper.cs (1)
265for (int i=0; i< eventRoute.Count; i++)
System\Windows\Controls\AlternationConverter.cs (3)
36if (_values.Count > 0 && o is int) 38int index = ((int)o) % _values.Count; 40index += _values.Count;
System\Windows\Controls\CustomDictionarySources.cs (1)
172return _uriList.Count;
System\Windows\Controls\DataGrid.cs (11)
431if (displayIndex >= 0 && displayIndex < DisplayIndexMap.Count) 2172for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 2228for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 3677for (int i = 0, count = columnIndexRanges.Count; i < count; i += 2) 4496int count = e.RemovedInfos.Count; 4504count = e.AddedInfos.Count; 7239for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7250for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7292for (int i = 0, count = GroupingSortDescriptionIndices.Count; i < count; i++) 7722if (_pendingInfos != null && _pendingInfos.Count > 0 && (columnCount = _columns.Count) > 0) 7726for (int i = _pendingInfos.Count - 1; i >= 0; --i)
System\Windows\Controls\DataGridCellsPanel.cs (27)
172if (blockList.Count > 0) 174for (int i = 0, count = blockList.Count; i < count; i++) 194measureWidth += GetColumnEstimatedMeasureWidthSum(blockList[blockList.Count - 1].EndIndex + 1, parentDataGrid.Columns.Count - 1, averageColumnWidth); 461if (indexList.Count == 1) 465else if (indexList.Count > 0) 468for (int i = 1, count = indexList.Count; i < count; i++) 472if (resultList.Count == 0) 478RealizedColumnsBlock lastRealizedColumnsBlock = resultList[resultList.Count - 1]; 488if (resultList.Count == 0) 494RealizedColumnsBlock lastRealizedColumnsBlock = resultList[resultList.Count - 1]; 756if (realizedChildIndex < _realizedChildren.Count) 790if (blockIndex == blockList.Count - 1) 996for (int count = realizedColumnDisplayIndices.Count; displayIndexListIterator < count; displayIndexListIterator++) 1035int blockCount = blockList.Count; 1163UIElement realizedChild = _realizedChildren.Count > 0 ? _realizedChildren[0] : null; 1184if (realizedIndex < _realizedChildren.Count) 1323blockList != null && blockList.Count > 0, 1326RealizedColumnsBlock lastBlock = blockList[blockList.Count - 1]; 1327RealizedColumnsBlock lastDisplayIndexBlock = displayIndexBlockList[displayIndexBlockList.Count - 1]; 1360if (displayIndexBlockList != null && displayIndexBlockList.Count > 0) 1388for (int j = 0, additionalChildrenCount = additionalChildIndices.Count; 1415for (int i = 0, count = additionalChildIndices.Count; i < count; i++) 1534for (int i = 0, count = blockList.Count; i < count; i++) 1554RealizedColumnsBlock lastBlock = blockList[blockList.Count - 1]; 1564if (blockList.Count == 0) 1591if (blockIndex >= blockList.Count) 1637for (int j=0; j<blockList.Count; ++j)
System\Windows\Controls\DataGridColumnCollection.cs (15)
226Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated"); 430for (int i = 0; i < DisplayIndexMap.Count; i++) 469Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call."); 561Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated"); 569for (int i = 0; i < DisplayIndexMap.Count; i++) 669for (int i = 0; i < DisplayIndexMap.Count; i++) 690for (int i = 0; i < DisplayIndexMap.Count; i++) 725Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size"); 726for (int i = 0; i < DisplayIndexMap.Count; i++) 930while (unResolvedColumns.Count > 0) 936for (int i = 0, count = unResolvedColumns.Count; i < count; i++) 959for (int i = 0, count = unResolvedColumns.Count; i < count; i++) 987for (int i = 0, count = partialResolvedColumns.Count; i < count; i++) 1000for (int i = 0, count = partialResolvedColumns.Count; i < count; i++) 1010for (int i = 0, count = unResolvedColumns.Count; i < count; i++)
System\Windows\Controls\DataGridRowClipboardEventArgs.cs (1)
67int count = ClipboardRowContent.Count;
System\Windows\Controls\DefinitionBase.cs (5)
763if (_registry.Count == 0) 779for (int i = 0, count = _registry.Count; i < count; ++i) 828for (int i = 0, count = _registry.Count; i < count; ++i) 864for (int i = 0, count = _registry.Count; i < count; ++i) 872for (int i = 0, count = _registry.Count; i < count; ++i)
System\Windows\Controls\GridViewColumnCollection.cs (5)
324for (int sourceIndex = index + 1; sourceIndex < _actualIndices.Count; sourceIndex++) 337_actualIndices.RemoveAt(_actualIndices.Count - 1); 343for (int i = iStart; i < _columns.Count; i++) 351int count = _columns.Count; 421ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _actualIndices.Count, indexName);
System\Windows\Controls\GridViewHeaderRowPresenter.cs (4)
816if (DesiredWidthList == null || column.ActualIndex >= DesiredWidthList.Count) 1308for (int i = 0; i < HeadersPositionList.Count; i++) 1325if (i != HeadersPositionList.Count - 1) 1342Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index");
System\Windows\Controls\GridViewRowPresenter.cs (1)
539if (DesiredWidthList == null || column.ActualIndex >= DesiredWidthList.Count)
System\Windows\Controls\InkCanvas.cs (1)
2106else if ( newStrokes.Count == 0 && newElements.Count == 0 )
System\Windows\Controls\ItemContainerGenerator.cs (1)
1047if (errors.Count > 0)
System\Windows\Controls\PopupControlService.cs (3)
1359if (rects.Count == 1) 1382for (int i=1, N=points.Count; i<N; ++i) 1403int N = points.Count;
System\Windows\Controls\Primitives\GridViewRowPresenterBase.cs (2)
159if (DesiredWidthList.Count > e.ActualIndex) 192int c = count - DesiredWidthList.Count;
System\Windows\Controls\Primitives\Popup.cs (1)
218if (registeredPopups.Count == 0)
System\Windows\Controls\Primitives\Selector.cs (7)
1978knownCount = knownIndices.Count; 2305if (unselected.Count > 0 || selected.Count > 0) 2784return _list.Count; 2807int j=0, n=_list.Count; 2851_set = new Dictionary<ItemInfo, ItemInfo>(_list.Count); 2852for (int i=0; i<_list.Count; ++i)
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (1)
69int generatedItemsCount = (generatedItemsCollection != null) ? generatedItemsCollection.Count : 0;
System\Windows\Controls\Primitives\ToolBarPanel.cs (1)
57for (int i = 0; i < _generatedItemsCollection.Count; i++)
System\Windows\Controls\SelectionChangedEventArgs.cs (4)
51_removedItems = new object[unselectedInfos.Count]; 52for (int i=0; i<unselectedInfos.Count; ++i) 57_addedItems = new object[selectedInfos.Count]; 58for (int i=0; i<selectedInfos.Count; ++i)
System\Windows\Controls\TextAdaptor.cs (3)
536if (visibleTextSegments.Count > 0) 538ranges = new ITextRangeProvider[visibleTextSegments.Count]; 539for (int i = 0; i < visibleTextSegments.Count; i++)
System\Windows\Controls\TextBlock.cs (4)
1233int subsequentLinesInitialSize = (_subsequentLines == null) ? 1 : _subsequentLines.Count; 1820Debug.Assert(lineBounds.Count > 0); 3508return (_subsequentLines == null) ? 1 : _subsequentLines.Count + 1; 3740int subsequentLineCount = _subsequentLines.Count;
System\Windows\Controls\TextRangeAdaptor.cs (3)
2091if (peers.Count > 0) 2093elements = new IRawElementProviderSimple[peers.Count]; 2094for (int i = 0; i < peers.Count; i++)
System\Windows\Controls\TextSearch.cs (5)
202if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 265if (_charsEntered.Count > 0) 267string lastChar = _charsEntered[_charsEntered.Count - 1]; 270_charsEntered.RemoveAt(_charsEntered.Count - 1);
System\Windows\Controls\ToolBarTray.cs (20)
351for (bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 359for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 371for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 418for (bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 429for (toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 567if (toolBarIndex + 1 == band.Count) // If toolBar was the last item in the band 601if (toolBarIndex < band.Count - 1) // Swap toolbars 613if (toolBarIndex + 2 == band.Count) // If toolBar becomes the last item in the band 637if (hittestBand >= 0 && hittestBand < _bands.Count) 644for (int i = 0; i < oldBand.Count; i++) 776for (i = 0; i < newBand.Count; i++) 811for (int i = 0; i < _bands.Count; i++) 818return _bands.Count; 839for (int bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 842for (int toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 861for (int bandIndex = 0; bandIndex < _bands.Count; bandIndex++) 864for (int toolBarIndex = 0; toolBarIndex < band.Count; toolBarIndex++) 870totalNumber += band.Count; 880for (int i = 0; i < _bands.Count; i++) 917for (int i = 0; i < band.Count; i++)
System\Windows\Controls\VirtualizedCellInfoCollection.cs (34)
155int numRegions = _regions.Count; 182int numRegions = _regions.Count; 202int numRegions = _regions.Count; 241int numRegions = _regions.Count; 310int numRegions = _regions.Count; 401int numRegions = _regions.Count; 771int numRegions = _regions.Count; 793int numRegions = _regions.Count; 836int numRegions = _regions.Count; 840for (int c = 0; c < addList.Count; c++) 856if (addList.Count > 0) 864for (int c = 0; c < addList.Count; c++) 877int numToAdd = addList.Count; 896if ((removeList != null) && (removeList.Count > 0)) 908for (int i = 0; i < _regions.Count; i++) 931i += remainder.Count; // Skip the remainder 990int numKeptRegions = keepRegions.Count; 1022int numKeptRegions = keepRegions.Count; 1078int numKeptRegions = slideRegions.Count; 1094int numMovedRegions = movedRegions.Count; 1106int numKeptRegions = slideRegions.Count; 1163int numKeptRegions = keepRegions.Count; 1210int numKeptRegions = keepRegions.Count; 1269int numKeptRegions = slideRegions.Count; 1284int numMovedRegions = movedRegions.Count; 1296int numKeptRegions = slideRegions.Count; 1351int numRegions = collection._regions.Count; 1370int numRegions = c1._regions.Count; 1378numRegions = orig2._regions.Count; 1398if (_regions.Count == 1) 1420if (removeList.Count > 0) 1506int numRegions = _regions.Count; 1532int numRegions = _regions.Count; 1582int numRegions = regions.Count;
System\Windows\Controls\VirtualizingStackPanel.cs (25)
4515for (int i = 0, n = offsetList.Count; i < n; ++i) 4527object[] args = new object[offsetList.Count + 7]; 4535for (int i=0; i<offsetList.Count; ++i) 4548viewport.X = offsetList[offsetList.Count-1]; 4552viewport.Y = offsetList[offsetList.Count-1]; 4561if (index < 0 || offsetList.Count <= 1) 5668int count = childOffsetList.Count; 5692object[] args = new object[offsetList.Count + 2]; 5695for (int i = 0; i < offsetList.Count; ++i) 9219Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match"); 9240if (realizedChildIndex < _realizedChildren.Count) 9268UIElement realizedChild = _realizedChildren.Count > 0 ? _realizedChildren[0] : null; 9279if (realizedIndex < _realizedChildren.Count) 10935for (int i=0; i<previouslyMeasuredOffsets.Count; i++) 12085for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12098for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12475for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12534for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 12546for (int i=0; i<s_TargetToTraceListMap.Count; ++i) 12586for (; _flushIndex < _traceList.Count; ++_flushIndex) 12599_flushIndex = _traceList.Count; 12802int n = children.Count; 12881writer.Write(_realizedChildren.Count); 12882for (int i=0; i<_realizedChildren.Count; ++i) 12893writer.Write(_effectiveOffsets.Count);
System\Windows\Data\BindingExpression.cs (1)
2358if (result != null && result.Count == 0)
System\Windows\Data\BindingExpressionBase.cs (9)
2282if (toAdd != null && toAdd.Count > 0) 2301if (toRemove != null && toRemove.Count > 0) 2310if (notifyDataErrors.Count == 0) 2319if (previousErrors == null || previousErrors.Count == 0) 2324else if (errors == null || errors.Count == 0) 2334for (int i=errors.Count-1; i>=0; --i) 2339for (j=toRemove.Count-1; j>=0; --j) 2449for (int k = 0; k < tempList.Count; ++k) 2465return tempList.Count > 0 ?
System\Windows\Data\BindingGroup.cs (3)
1092if (toAdd != null && toAdd.Count > 0) 1107if (toRemove != null && toRemove.Count > 0) 1115if (itemErrors.Count == 0)
System\Windows\Data\CollectionView.cs (8)
1806Debug.Assert(changeLog != null && changeLog.Count > 0, "don't defer when there's no work"); 1816_engine.ChangeCost(_databindOperation, changeLog.Count); 1820_databindOperation = _engine.Marshal(new DispatcherOperationCallback(ProcessInvoke), null, changeLog.Count); 1840for ( ; currentIndex < changeLog.Count && !mustDeferProcessing; currentIndex++) 1850if (mustDeferProcessing && currentIndex < changeLog.Count) 1891if (_changeLog.Count == 0 && CheckAccess()) 1910null, _changeLog.Count); 1936if (unprocessedChanges != null && unprocessedChanges.Count > 0)
System\Windows\Data\ListCollectionView.cs (1)
3090double dirtyDensity = ((double)list.SortDirtyItems.Count) / (list.Count + 1);
System\Windows\Diagnostics\BindingDiagnostics.cs (1)
106if (s_pendingEvents.Count < MaxPendingEvents)
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (3)
153if (!_dictionariesFromUri.TryGetValue(uri, out list) || list.Count == 0) 158List<ResourceDictionary> result = new List<ResourceDictionary>(list.Count); 262if (list.Count == 0)
System\windows\Documents\CaretElement.cs (1)
461for (int i = 0; i < textSegments.Count; i++)
System\Windows\Documents\DocumentSequenceTextContainer.cs (3)
732if (lastBlock != null && cdbScan != lastBlock && !(lastBlock.ChildContainer is NullTextContainer) && rangeArray.Count != 0) 750if (!(cdbScan.ChildContainer is NullTextContainer) && rangeArray.Count != 0) 777if (rangeArray.Count > 0 && (!(cdbScan == null || cdbScan.ChildContainer is NullTextContainer)))
System\Windows\Documents\FixedDSBuilder.cs (2)
67_visitedArray = new BitArray(fixedNodes.Count); 199for (int i = startIndex+1; i < _fixedNodes.Count; i++)
System\Windows\Documents\FixedElement.cs (1)
340for(int i = 0, n = _children.Count; i < n; i++)
System\Windows\Documents\FixedFlowMap.cs (4)
129Debug.Assert(fp >= 0 && fp < _flowOrder.Count); 167for (int i = index; i < _flowOrder.Count; i++) 309return _flowOrder.Count; 362for (int i = newFlow.Fp + 1, n = _flowOrder.Count; i < n; i++)
System\Windows\Documents\FixedSOMContainer.cs (5)
113if (This.FixedNodes.Count == 0 || compared.FixedNodes.Count == 0) 120FixedNode thisObjLastNode = This.FixedNodes[This.FixedNodes.Count - 1]; 123FixedNode otherObjLastNode = compared.FixedNodes[compared.FixedNodes.Count - 1]; 148int i=_semanticBoxes.Count-1;
System\Windows\Documents\FixedSOMFixedBlock.cs (7)
38if (this.SemanticBoxes.Count > 1) 40FixedSOMTextRun run = this.SemanticBoxes[this.SemanticBoxes.Count - 2] as FixedSOMTextRun; 65return (_semanticBoxes.Count == 1 && (_semanticBoxes[0] is FixedSOMImage)); 81if (_semanticBoxes.Count == 0) 125for (int i=_semanticBoxes.Count - 1; i>=0 && run==null; i--) 156for (int i=0; i<SemanticBoxes.Count; i++) 237if (_semanticBoxes.Count == 1)
System\Windows\Documents\FixedSOMLineCollection.cs (3)
79for (int i=0; i < ranges.Count; i++) 113int endIndex = lines.Count; 145while (i<lines.Count && lines[i].Line <= parallelHighEnd)
System\Windows\Documents\FixedSOMLineRanges.cs (3)
15for (int i = 0; i < Start.Count; ) 50int endIndex = Start.Count - 1; 107get { return Start.Count; }
System\Windows\Documents\FixedSOMPage.cs (2)
49for (int i=0; i<_semanticBoxes.Count; i++) 60for (int j=0; j<groupBoxes.Count; j++)
System\Windows\Documents\FixedSOMPageConstructor.cs (24)
573Debug.Assert (fixedBlock.SemanticBoxes.Count > 0); 574if (fixedBlock.SemanticBoxes.Count == 0) 589FixedSOMTextRun lastLine = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count - 1] as FixedSOMTextRun; 609compareLine = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count-1] as FixedSOMTextRun; 680FixedSOMElement element = fixedBlock.SemanticBoxes[fixedBlock.SemanticBoxes.Count - 1] as FixedSOMElement; 755if (horizontal.Count < 2 || vertical.Count < 2) 762for (int h = 0; h < horizontal.Count; h++) 780while (v < vertical.Count && vertical[v].Line < hStart) 784for (; v < vertical.Count && vertical[v].Line < hEnd; v++) 821for (h2 = h + 1; h2 < horizontal.Count && horizontal[h2].Line < vBottom + minLineSeparation; h2++) 858if (_fixedSOMPage.SemanticBoxes.Count < 2) 867prevBoxCount = _fixedSOMPage.SemanticBoxes.Count; 870for (int i = 0; i < boxes.Count; i++) 876for (int j = i + 1; j < boxes.Count; j++) 895for (int j = i + 1; j < boxes.Count; j++) 909} while (_fixedSOMPage.SemanticBoxes.Count > 1 && _fixedSOMPage.SemanticBoxes.Count != prevBoxCount); 1045for (int i=0; i<tables.Count-1; i++) 1047for (int j=i+1; j<tables.Count; j++) 1075for (int i = 0; i < _fixedSOMPage.SemanticBoxes.Count;) 1100for (int i=0; i<cell.SemanticBoxes.Count;) 1127if (container.SemanticBoxes.Count > 0) 1140for (int i=1; i<container.SemanticBoxes.Count; i++)
System\Windows\Documents\FixedSOMTable.cs (9)
52for (int i = 0; i < _semanticBoxes.Count; i++) 61int colCount = row.SemanticBoxes.Count; 160if (this.SemanticBoxes.Count == 1) 164return (row.SemanticBoxes.Count == 1); 176for (int i=0; i<this.SemanticBoxes.Count;) 196int nRows = this.SemanticBoxes.Count; 210deleteCol = deleteCol && idx < row.SemanticBoxes.Count; 219if (idx + 1 < row.SemanticBoxes.Count) 267if (idx + 1 < row.SemanticBoxes.Count && row.SemanticBoxes[idx + 1].BoundingRect.Left == nextCol)
System\Windows\Documents\FixedSOMTableRow.cs (1)
51for (int i = 0; i < _semanticBoxes.Count; i++)
System\Windows\Documents\FixedTextBuilder.cs (16)
158DocumentsTrace.FixedTextOM.Builder.Trace($"AppendVirtualPage {_pageStructures.Count}"); 160FixedPageStructure pageStructure = new FixedPageStructure(_pageStructures.Count); 947fixedNodes.Count); 1277if (relUri == null && _hyperlinks.Count > 0) 1318for (int i=0; i<_hyperlinks.Count; i++) 1342for (int i = 0; i < _hyperlinks.Count; i++) 1476FixedSOMTextRun lastRun = _textRuns[_textRuns.Count - 1]; 1501if (_fixedNodes.Count == 0 || _fixedNodes[_fixedNodes.Count - 1] != element.FixedNode) 1550_pageStructure.SetFlowBoundary(_flowNodes[0], _flowNodes[_flowNodes.Count-1]); 1631if (_textRuns.Count > 0) 1635for (int i=0; i<_textRuns.Count; i++) 1649run.LineIndex = _lineResults.Count; 1650if (_nodesInLine.Count == 0 || _nodesInLine[_nodesInLine.Count - 1] != run.FixedNode) 1750if (_nodesInLine.Count > 0)
System\Windows\Documents\Glyphs.cs (1)
330Debug.Assert(parsedGlyphs.Count == glyphCount);
System\Windows\Documents\Highlights.cs (1)
369if (ranges.Count > 0)
System\Windows\Documents\MsSpellCheckLib\SpellChecker\SpellChecker.cs (1)
428int cacheSize = (hasErrorsCache != null) ? hasErrorsCache.Count : 0;
System\windows\Documents\TextEditorDragDrop.cs (1)
610for (int i = 0; i < selection.TextSegments.Count; i++)
System\Windows\Documents\TextRange.cs (2)
375Invariant.Assert(_textSegments.Count > 0, "_textSegments.Count must be > 0"); 1619for (int i = 0; i < _textSegments.Count; i++)
System\Windows\Documents\TextRangeBase.cs (11)
81for (int i = 0; i < thisRange._TextSegments.Count; i++) 394for (int i = 0; i < thisRange._TextSegments.Count; i++) 463for (int i = 0; i < thisRange._TextSegments.Count; i++) 1190Invariant.Assert(thisRange._TextSegments != null && thisRange._TextSegments.Count > 0, "expecting nonempty _TextSegments array for Start position"); 1198Invariant.Assert(thisRange._TextSegments != null && thisRange._TextSegments.Count > 0, "expecting nonempty _TextSegments array for End position"); 1199return thisRange._TextSegments[thisRange._TextSegments.Count - 1].End; 1209(thisRange._TextSegments.Count == 1 && 1215return (thisRange._TextSegments.Count == 1 && 1265for (int i = 0; i < thisRange._TextSegments.Count; i++) 1918ITextPointer end = thisRange._TextSegments[thisRange._TextSegments.Count - 1].End; 2038ITextPointer finalEnd = thisRange._TextSegments[thisRange._TextSegments.Count - 1].End;
System\Windows\Documents\TextRangeEditTables.cs (3)
404for (int i = 0; i < textSegments.Count; i++ ) 421end = textSegments[textSegments.Count - 1].End; 984for (int i = 0; i < textSegments.Count; i++)
System\Windows\Documents\TextRangeSerialization.cs (2)
274if (ignoreList.Count > 0) 345for (int i = 0; i < textSegments.Count; i++)
System\windows\Documents\TextSelection.cs (3)
415movingPosition = thisSelection.TextSegments[thisSelection.TextSegments.Count - 1].Start; 1881else if (thisSelection.TextSegments.Count < 2) 1901else if (movingPosition.CompareTo(thisSelection.TextSegments[thisSelection.TextSegments.Count-1].Start) == 0)
System\windows\Documents\TextSelectionHighlightLayer.cs (4)
84segmentCount = textSegments.Count; 112segmentCount = textSegments.Count; 307Invariant.Assert(textRange._TextSegments.Count > 0); 308return textRange._TextSegments[0].Start.CompareTo(textRange._TextSegments[textRange._TextSegments.Count - 1].End) == 0;
System\Windows\Documents\TextStore.cs (12)
1360CompositionEventRecord previousRecord = (this.CompositionEventList.Count == 0) ? null : this.CompositionEventList[this.CompositionEventList.Count - 1]; 3493if (this.CompositionEventList.Count == 0 || 3604IMECompositionTracer.Trace(this, IMECompositionTraceOp.BRaiseCompositionEvents, CompositionEventList.Count); 3613for (int i = 0; i < this.CompositionEventList.Count; i++) 4733for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 4746for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 4950for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 5009for (int i=0, n=s_TargetToTraceListMap.Count; i<n; ++i) 5021for (int i=0; i<s_TargetToTraceListMap.Count; ++i) 5061for (; _flushIndex < _traceList.Count; ++_flushIndex) 5074_flushIndex = _traceList.Count;
System\Windows\Documents\WinRTSpellerInteropExtensions.cs (6)
88if (allTokens.Count > 0) 90var substToken = GetSpellCheckCleanSubstitutionToken(spellChecker, text, allTokens[allTokens.Count - 1], missingFragment); 93allTokens[allTokens.Count - 1] = new SpellerSegment(text, substToken.Value, spellChecker, owner); 125if (allTokens.Count > 0) 127var substToken = GetSpellCheckCleanSubstitutionToken(spellChecker, text, allTokens[allTokens.Count - 1], missingFragment); 130allTokens[allTokens.Count - 1] = new SpellerSegment(text, substToken.Value, spellChecker, owner);
System\Windows\Documents\WpfPayload.cs (3)
433for (int imageIndex = 0; imageIndex < _images.Count; imageIndex++) 504for (int i = 0; i < _images.Count; i++) 520imagePartUriString = GetImageName(_images.Count, imageContentType);
System\Windows\FrameworkContextData.cs (3)
58int last = _currentWalkers.Count - 1; 72if (_currentWalkers.Count > 0) 74int last = _currentWalkers.Count - 1;
System\Windows\Ink\Events.cs (1)
310if (results.Count == 0)
System\Windows\Input\KeyboardNavigation.cs (5)
3468public int Count { get { return _list.Count; } } 3476if (_list.Count == _list.Capacity) 3488for (int i=0; i<_list.Count; ++i) 3515for (int i=0; i<_list.Count; ++i) 3543int n = _list.Count;
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (3)
59get { return (_resources != null && _resources.Count > 0); } 66Debug.Assert(StaticResources[StaticResources.Count - 1] is StaticResource); 67return StaticResources[StaticResources.Count - 1] as StaticResource;
System\Windows\Markup\Baml2006\Baml2006ReaderContext.cs (2)
51if (KeyList != null && KeyList.Count > 0) 53return KeyList[KeyList.Count - 1];
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (12)
314if (stringId >= 0 && stringId < _bamlString.Count) 343if (assemblyId == _bamlAssembly.Count) 348else if (assemblyId > _bamlAssembly.Count) 367if (typeId == _bamlType.Count) 375else if (typeId > _bamlType.Count) 394if (propertyId == _bamlProperty.Count) 399else if (propertyId > _bamlProperty.Count) 413if (stringId == _bamlString.Count) 417else if (stringId > _bamlString.Count) 565if (assemblyId >= 0 && assemblyId < _bamlAssembly.Count) 589if (typeId >= 0 && typeId < _bamlType.Count) 618if (propertyId >= 0 && propertyId < _bamlProperty.Count)
System\Windows\Markup\BamlMapTable.cs (19)
358if (AttributeIdMap.Count > 0 || TypeIdMap.Count > 0) 369for (int i = 0; i < AttributeIdMap.Count; i++) 380for (int j = 0; j < TypeIdMap.Count; j++) 508for (int i = 0; i < AssemblyIdMap.Count; i++) 611Debug.Assert(id < StringIdMap.Count); 1066bamlAssemblyInfoRecord.AssemblyId = (short)(AssemblyIdMap.Count - 1); 1084bamlAssemblyInfoRecord.AssemblyId = (short)(AssemblyIdMap.Count - 1); 1102Debug.Assert(AssemblyIdMap.Count == record.AssemblyId || record.AssemblyFullName == AssemblyIdMap[record.AssemblyId].AssemblyFullName); 1104if (AssemblyIdMap.Count == record.AssemblyId) 1239bamlTypeInfoRecord.TypeId = (short)(TypeIdMap.Count - 1); 1256Debug.Assert(TypeIdMap.Count == record.TypeId || record.TypeFullName == TypeIdMap[record.TypeId].TypeFullName); 1258if (TypeIdMap.Count == record.TypeId) 1346bamlAttributeInfoRecord.AttributeId = (short)(AttributeIdMap.Count - 1); 1462stringInfo.StringId = (short)(StringIdMap.Count - 1); 1635Debug.Assert(AttributeIdMap.Count == record.AttributeId || record.Name == AttributeIdMap[record.AttributeId].Name); 1637if (AttributeIdMap.Count == record.AttributeId) 1649Debug.Assert(StringIdMap.Count == record.StringId || record.Value == StringIdMap[record.StringId].Value); 1651if (StringIdMap.Count == record.StringId)
System\Windows\Markup\BamlReader.cs (4)
485if (_currentStaticResourceRecordIndex == _currentStaticResourceRecords.Count) 1378BamlKeyInfo keyInfo = _deferKeys[_deferKeys.Count-1]; 2301if (_deferKeys.Count > 0) 2739for (int i=0; i<xmlnsList.Count; i++)
System\Windows\Markup\BamlRecordReader.cs (5)
1878object[] staticResourceValues = ParserContext.StaticResourcesStack[ParserContext.StaticResourcesStack.Count-1]; 1957object[] staticResourceValues = ParserContext.StaticResourcesStack[ParserContext.StaticResourcesStack.Count-1]; 4284if (_stackDataFactoryCache.Count == 0) 4291d = _stackDataFactoryCache[_stackDataFactoryCache.Count-1]; 4292_stackDataFactoryCache.RemoveAt(_stackDataFactoryCache.Count-1);
System\Windows\Markup\BamlRecordWriter.cs (6)
1175bamlPropertyWithStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1); 1585if (staticResourceRecordList.Count > 0) 1588for (int j=0; j<staticResourceRecordList.Count; j++) 1592for (int k=0; k<srRecords.Count; k++) 1676valueDeferRecord = _staticResourceRecordList[_staticResourceRecordList.Count-1]; 1691bamlStaticResourceId.StaticResourceId = (short)(keyDeferRecord.StaticResourceRecordList.Count-1);
System\Windows\Markup\ParserContext.cs (1)
619get { return (_staticResourcesStack != null && _staticResourcesStack.Count > 0); }
System\Windows\Markup\Primitives\MarkupWriter.cs (3)
305result = _entries.Count; 345for (int i=0; i<_entries.Count; ++i) 351for (int i=0; i<_entries.Count; ++i)
System\Windows\Markup\XamlTypeMapper.cs (1)
3267for (int j = 0; j < namespaceAssemblyPair.Count; j++)
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (2)
839for (int j = 0; j < unspecifiedBlocks.Count; j++) 972for (int i = 0, currentKeyFrameIndex = firstPacedBlockKeyFrameIndex; i < segmentLengths.Count; i++, currentKeyFrameIndex++)
System\Windows\Media\Animation\Generated\ThicknessKeyFrameCollection.cs (9)
96int count = sourceCollection._keyFrames.Count; 117int count = sourceCollection._keyFrames.Count; 138int count = sourceCollection._keyFrames.Count; 159int count = sourceCollection._keyFrames.Count; 178for (int i = 0; i < _keyFrames.Count && canFreeze; i++) 213return _keyFrames.Count; 291return _keyFrames.Count - 1; 301if (_keyFrames.Count > 0) 303for (int i = 0; i < _keyFrames.Count; i++)
System\Windows\Navigation\Journal.cs (2)
100return _journalEntryList.Count; 329_journalEntryList.RemoveRange(_currentEntryIndex, _journalEntryList.Count - _currentEntryIndex);
System\Windows\ResourcesChangeInfo.cs (3)
202get { return _key != null || (_newDictionaries != null && _newDictionaries.Count > 0); } 245for (int i=0; i<_oldDictionaries.Count; i++) 256for (int i=0; i<_newDictionaries.Count; i++)
System\Windows\Shell\JumpList.cs (20)
333&& JumpItems.Count == 0 493successList = new List<JumpItem>(JumpItems.Count); 496rejectedList = new List<_RejectedJumpItemPair>(JumpItems.Count); 545if (list.Count > 0 && list[0].JumpItem.CustomCategory == jumpItem.CustomCategory) 588if (categoryList.Count > 0) 641if (rejectedList.Count > 0 && rejectedHandler != null) 643var items = new List<JumpItem>(rejectedList.Count); 644var reasons = new List<JumpItemRejectionReason>(rejectedList.Count); 655if (removedList.Count > 0 && removedHandler != null) 657var items = new List<JumpItem>(removedList.Count); 667if (items.Count > 0) 679if (removedList.Count == 0) 794Debug.Assert(jumpItems.Count != 0); 818for (int i = jumpItems.Count; --i >= 0;) 847if (linksOnlyList.Count > 0) 850Debug.Assert(jumpItems.Count != linksOnlyList.Count); 1099if (_jumpItems.Count > 0) 1101var reasons = new List<JumpItemRejectionReason>(_jumpItems.Count); 1102for (int i = 0; i < _jumpItems.Count; ++i)
System\Windows\StaticResourceExtension.cs (1)
243for(int i=0; i<ambientList.Count; i++)
System\Windows\StyleHelper.cs (14)
2146Debug.Assert(templatedChildren.Count > 0, 2215int[] childIndices = new int[templateChain.Count]; 2222for (int i=0; i< templateChain.Count; i++) 2253for (int i=0; i< templateChain.Count; i++) 2517for (int i = 0; i < actionsList.Count; i++) 3456if ((oldStyleTables != null && oldStyleTables.Count > 0) || 3457(newStyleTables != null && newStyleTables.Count > 0)) 3518if (dictionaries != null && dictionaries.Count > 0 && !fo.ShouldLookupImplicitStyles) 3520for (int i=0; i<dictionaries.Count; i++) 4345for( int i = 0; i < triggerList.Count; i++ ) 4389if ((styledChildren != null) && (childIndex <= styledChildren.Count)) 4796for (int i = 0; i < actionList.Count; i++) 5275for( int i = 0; i < triggerList.Count; i++ ) 5427if (styledChildren == null || childIndex > styledChildren.Count)
System\Windows\SystemResources.cs (1)
1219int count = keys.Count;
System\Windows\TemplateContent.cs (2)
260for (int i = 0; i < sharedProperties.Count; i++) 326for (int i = sharedProperties.Count - 1; i >= 0; i--)
System\Windows\TemplateNameScope.cs (1)
161Debug.Assert(_affectedChildren.Count == childIndex);
System\Windows\ThemeDictionaryExtension.cs (3)
121for (int i = 0; i < _themeDictionaryInfos.Count; i++) 196for (int i = 0; i < _themeDictionaryInfos.Count; i++) 232for (int i = 0; i < _themeDictionaryInfos.Count; i++)
System\Windows\TriggerActionCollection.cs (3)
52return _rawList.Count; 74for (int i = _rawList.Count - 1; i >= 0; i--) 266for( int i = 0; i < _rawList.Count; i++ )
System\Windows\Window.cs (1)
3618for (int i = 0; i < _threadWindowHandles.Count; i++)
PresentationFramework.Aero (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Aero2 (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.AeroLite (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Classic (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Luna (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationFramework.Royale (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (1)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount.");
PresentationUI (1)
MS\Internal\Documents\Application\TransactionalPackage.cs (1)
444PackagePart[] result = new PackagePart[_proxiedParts.Count];
Publishers.ApiService (1)
Program.cs (1)
28totalEntries = entries.Count,
QuarantineTools.Tests (11)
ActiveIssueTests.cs (5)
360if (a.Count != b.Count) 364for (int i = 0; i < a.Count; i++) 399if (remaining.Count == list.Attributes.Count) 405if (remaining.Count > 0)
QuarantineScriptTests.cs (6)
304if (a.Count != b.Count) 308for (int i = 0; i < a.Count; i++) 343if (remaining.Count == list.Attributes.Count) 349if (remaining.Count > 0) 437if (nodesToRemove.Count > 0)
ReachFramework (37)
AlphaFlattener\Flattener.cs (15)
292int count = commands.Count; 611if ((gj == null) || (pj.underlay == null) || (pj.underlay.Count == 0)) 616for (int n = pj.underlay.Count - 1; n >= 0; n --) 629if ((gi != null) && (gi.Pen == null) && (pi.overlap.Count == 1) && pj.FullyCovers(pi)) 669if ((pi.underlay != null) && (pi.underlay.Count != 0)) 671qi = commands[pi.underlay[pi.underlay.Count - 1]]; 733for (int k = 0; k < pi.underlay.Count; k++) 758int len = pi.underlay.Count; 792oldUnderlay[i] = new List<int>(l.Count); 794for (int j = 0; j < l.Count; j++) 839for (int j = 0; j < pi.overlap.Count; j++) 859if ((pi.overlap != null) && (pi.overlap.Count != 0)) 867if ((pj.underlay[pj.underlay.Count - 1] == i) && pj.FullyCovers(pi) && !pi.FullyCovers(pj)) 992for (int i = 0; i < transparentCluster.Count; i++) 1045for (int i = 0; i < transparentCluster.Count; i++)
AlphaFlattener\Optimizer.cs (6)
145bool[] addedPrimitives = new bool[commands.Count]; 177for (int clusterIndex = 0; clusterIndex < transparentCluster.Count; clusterIndex++) 286for (int i = 0; i < c.m_primitives.Count; i++) 408for (int j = 0; j < transparentCluster.Count; j++) 444for (int i = 0; i < transparentCluster.Count; i++) 445for (int j = i + 1; j < transparentCluster.Count; j++)
AlphaFlattener\PrimitiveList.cs (4)
115Console.Write(LeftPad(info.underlay.Count, 3)); 120Console.Write(' ' + LeftPad(info.overlap.Count, 3)); 247int index = _commands.Count; 308int pos = list.Count;
AlphaFlattener\PrimitiveRenderer.cs (2)
329for (int s = start; s < _overlapping.Count; s++) 347while (start < _overlapping.Count)
Packaging\XpsFixedDocumentReaderWriter.cs (1)
986IXpsFixedPageReader pageReader = new XpsFixedPageReaderWriter(CurrentXpsManager, this, pagePart, null, _pageCache.Count+1);
Packaging\XpsFixedDocumentSequenceReaderWriter.cs (1)
625IXpsFixedDocumentReader fixedDocument = new XpsFixedDocumentReaderWriter(CurrentXpsManager, null, documentPart, _documentCache.Count+1);
Packaging\XpsFixedPageReaderWriter.cs (1)
2071if ( _currentChildren!= null && _currentChildren.Count > 0)
Serialization\DrawingContextFlattener.cs (7)
137Debug.Assert(_fullTransform.Count == _fullClip.Count); 139int lastIndex = _fullTransform.Count - 1; 152if (_fullTransform.Count == 0) 158return _fullTransform[_fullTransform.Count - 1]; 170if (_fullClip.Count == 0) 176return _fullClip[_fullClip.Count - 1];
RepoTasks (7)
BatchHelixWorkItems.cs (2)
98for (var index = 0; index < orderedItems.Count; index += batchSize) 200Log.LogMessage(MessageImportance.High, "Created batched Helix work item {0} with {1} assemblies.", batchedWorkItem.ItemSpec, chunk.Count);
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (2)
1035var certificatesDescription = list.Count switch 1039_ => $"{list.Count} certificates",
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
138if (nssDbs.Count > 0) 305if (nssDbs.Count > 0) 506if (nssDbs.Count > 0)
Roslyn.Diagnostics.Analyzers (47)
DoNotMixAttributesFromDifferentVersionsOfMEF.cs (1)
70if (appliedExportAttributes.Count == 0)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.State.cs (2)
93if (findReferencesList.Count != 1) 99if (references.Count == 0)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
79ThrowIfTrue(_index + values.Count > _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
252return source.Count == 0;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
34for (var i = 0; i < _weakReferencedEntries.Count; i++)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (4)
31for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 40list.RemoveRange(targetIndex, list.Count - targetIndex); 50for (var sourceIndex = 0; sourceIndex < list.Count; sourceIndex++) 59list.RemoveRange(targetIndex, list.Count - targetIndex);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
414while (spans.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
71if (results.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
127if (_initialIndentBlockOperations.Count <= 0) 145var count = _initialIndentBlockOperations.Count - 1 + operations.Count; 149for (var i = 1; i < _initialIndentBlockOperations.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
108if (operations.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
191Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\RemoveUnnecessaryImportsHelpers.cs (2)
17while (trimmedLeadingTrivia.Count >= 3 && 22trimmedLeadingTrivia.RemoveAt(trimmedLeadingTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 419_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
497for (int i = 0, n = _methodSymbolStack.Count; i < n; i++) 517Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519_methodSymbolStack.RemoveAt(_methodSymbolStack.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (4)
33if (orderedExistingConstants.Count == 0) 43else if (orderedExistingConstants.Count > 0) 116if (existingConstants.Count >= 1 && 121if (existingConstants.Count == 1)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
278if (membersList.Count > 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (4)
86for (var index = allFieldsAndValues.Count - 1; index >= 0 && result != 0; index--) 99if (result == 0 && usedFieldsAndValues.Count > 0) 103for (var i = usedFieldsAndValues.Count - 1; i >= 0; i--) 154for (var i = allFieldsAndValues.Count - 1; i >= 0; i--)
src\roslyn\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++)
Roslyn.Diagnostics.CSharp.Analyzers (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
886finalTrivia.RemoveAt(finalTrivia.Count - 1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
31return attributeNodes.Count == 0
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
227if (members.Count > 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
30if (members.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
327if (types.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
180for (var i = 0; i < list.Count; i++)
rzc (34)
CompilerHost.cs (1)
97for (var i = 0; i < args.Count; i++)
DefaultRequestDispatcher.cs (6)
71while (_connections.Count > 0 || _state == State.Running); 134Debug.Assert(_connections.Count == 0); 143var all = new List<Task>(_connections.Count + 3); 224if (_connections.Count == 0 && _timeoutTask == null) 233if (_connections.Count == 0 && _gcTask == null) 248while (i < _connections.Count)
DiscoverCommand.cs (4)
58if (Assemblies.Values.Count == 0) 86if (ExtensionNames.Values.Count != ExtensionFilePaths.Values.Count) 117for (int i = 0; i < extensionNames.Values.Count; i++)
GenerateCommand.cs (23)
111if (Sources.Values.Count == 0) 117if (Outputs.Values.Count != Sources.Values.Count) 119Error.WriteLine($"{Sources.Description} has {Sources.Values.Count}, but {Outputs.Description} has {Outputs.Values.Count} values."); 123if (RelativePaths.Values.Count != Sources.Values.Count) 125Error.WriteLine($"{Sources.Description} has {Sources.Values.Count}, but {RelativePaths.Description} has {RelativePaths.Values.Count} values."); 129if (FileKinds.Values.Count != 0 && FileKinds.Values.Count != Sources.Values.Count) 133Error.WriteLine($"{Sources.Description} has {Sources.Values.Count}, but {FileKinds.Description} has {FileKinds.Values.Count} values."); 137if (CssScopeSources.Values.Count != CssScopeValues.Values.Count) 140Error.WriteLine($"{CssScopeSources.Description} has {CssScopeSources.Values.Count}, but {CssScopeValues.Description} has {CssScopeValues.Values.Count} values."); 166if (ExtensionNames.Values.Count != ExtensionFilePaths.Values.Count) 411for (var cssScopeSourceIndex = 0; cssScopeSourceIndex < cssScopeSources.Count; cssScopeSourceIndex++) 416var items = new SourceItem[sources.Count]; 419var fileKind = fileKinds.Count > 0
sdk-tasks (8)
_generated\2\SdkTasksJsonSerializerContext.ListString.g.cs (1)
57for (int i = 0; i < value.Count; i++)
CopyPreservingRelativeSymlinks.cs (1)
78Log.LogMessage(MessageImportance.Normal, $"Copied {copiedFiles.Count} files.");
DeduplicateAssembliesWithLinks.cs (3)
49Log.LogMessage(MessageImportance.Normal, $"Found {files.Count} assemblies eligible for deduplication."); 57var duplicateGroups = filesByHash.Values.Where(g => g.Count > 1).ToList(); 58Log.LogMessage(MessageImportance.Normal, $"Found {duplicateGroups.Count} groups of duplicate assemblies.");
FilterItemsByDuplicateHash.cs (1)
74$"FilterItemsByDuplicateHash: {unmatched.Count} of {CandidateFiles.Length} candidates are unique.");
OverrideAndCreateBundledNETCoreAppPackageVersion.cs (2)
62if (matches0.Count == 0) 67if (matches0.Count > 1)
Shared.Tests (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.ListBoolean.g.cs (1)
57for (int i = 0; i < value.Count; i++)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.ListSimpleRecord.g.cs (1)
57for (int i = 0; i < value.Count; i++)
SqlServerEndToEnd.ApiService (2)
Program.cs (2)
32totalEntries = entries1.Count + entries2.Count,
Stress.ApiService (4)
TestMetrics.cs (2)
53for (var i = 0; i < uploadSpeed.Count; i++) 57return 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)];
System.CodeDom (3)
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (3)
236for (int i = 0; i < typeArgumentList.Count; i++) 252else if (typeArgumentList.Count > 0) 254for (int i = 0; i < typeArgumentList.Count; i++)
System.Collections (2)
System\Collections\Generic\SortedSet.cs (1)
1442for (int i = matches.Count - 1; i >= 0; i--)
System\Collections\Generic\SortedSet.TreeSubSet.cs (1)
102for (int i = toRemove.Count - 1; i >= 0; i--)
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)); 1378if (handles.Count == 0 && isTakeOperation) //case#5 1381if (handles.Count == 0) //case#4 1397Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1402if (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)
1199if (list.Count == 0) 1212Debug.Assert(list.Count > 0); 1218for (int i = 1; i < list.Count; i++) 1225list.RemoveRange(index, list.Count - index); 1228Node root = Node.NodeTreeFromList(list.AsReadOnlyList(), 0, list.Count); 1264Debug.Assert(list.Count > 0); 1270for (int i = 1; i < list.Count; i++) 1277list.RemoveRange(index, list.Count - index); 1280Node root = Node.NodeTreeFromList(list.AsReadOnlyList(), 0, list.Count);
System.CommandLine (26)
Argument.cs (1)
135internal bool HasValidators => (_validators?.Count ?? 0) > 0;
ChildSymbolList{T}.cs (1)
33public int Count => _children.Count;
Command.cs (1)
89internal bool HasValidators => _validators is not null && _validators.Count > 0;
Help\HelpBuilder.cs (2)
320while (end.Count > 0) 323end.RemoveAt(end.Count - 1);
Help\HelpBuilder.Default.cs (2)
97if (completionSources.Count <= 0) 276if (optionRows.Count > 0)
Option.cs (1)
90internal bool HasValidators => _validators is not null && _validators.Count > 0;
ParseResult.cs (1)
44if (tokens.Count > 1)
Parsing\ArgumentResult.cs (5)
31internal bool ArgumentLimitReached => Argument.Arity.MaximumNumberOfValues == (_tokens?.Count ?? 0); 45for (var i = 0; i < Argument.Validators.Count; i++) 92if (_tokens is null || numberOfTokens >= _tokens.Count) 101int tokensToPass = _tokens.Count - numberOfTokens; 166for (var i = 0; i < Argument.Validators.Count; i++)
Parsing\CommandResult.cs (2)
53for (var i = 0; i < Command.Validators.Count; i++) 129for (var j = 0; j < optionResult.Option.Validators.Count; j++)
Parsing\ParseOperation.cs (1)
52bool result = _index < _tokens.Count;
Parsing\StringExtensions.cs (5)
208int tokensBefore = tokenList.Count; 222if (tokensBefore != tokenList.Count && tokenList[tokenList.Count - 1].Type == TokenType.Option) 250if (tokenList.Count > 1) 252var token = tokenList[tokenList.Count - 1];
Parsing\SymbolResult.cs (1)
36for (var i = 0; i < parseErrors.Count; i++)
Parsing\SymbolResultTree.cs (3)
23Errors = new List<ParseError>(tokenizeErrors.Count); 25for (var i = 0; i < tokenizeErrors.Count; i++) 32internal int ErrorCount => Errors?.Count ?? 0;
System.CommandLine.StaticCompletions (1)
shells\FishShellProvider.cs (1)
63states.Add((states.Count, cmd));
System.ComponentModel.Annotations (21)
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (1)
248for (int i = attributes.Count - 1; i >= 0; --i)
System\ComponentModel\DataAnnotations\Validator.cs (20)
227if (errors.Count > 0) 290if (errors.Count > 0) 320if (errors.Count > 0) 534if (errors.Count > 0) 601if (errors.Count > 0) 628if (errors.Count > 0) 654if (errors.Count > 0) 664if (errors.Count > 0) 723var tasks = new List<Task<List<ValidationError>>>(properties.Count); 734while (tasks.Count > 0) 749if (propertyErrors.Count > 0) 766if (tasks.Count > 0) 795if (breakOnFirstError && errors.Count > 0) 863if (errors.Count == 0 && asyncAttributes is not null) 867var tasks = new List<Task<(AsyncValidationAttribute Attr, ValidationResult? Result)>>(asyncAttributes.Count); 875while (tasks.Count > 0) 908if (tasks.Count > 0) 1023if (errors.Count > 0) 1033if (errors.Count > 0) 1105if (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)
152for (int i = _revertActionList.Count - 1; i >= 0; i--)
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (1)
837if (resurrectedExports.Count != 0)
System\ComponentModel\Composition\Hosting\ComposablePartCatalogCollection.cs (2)
93if (_catalogs.Count == 0) 156return _catalogs.Count;
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (1)
212if (parts.Count == 0)
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (2)
595if (catalogsToAdd.Count == 0 && catalogsToRemove.Count == 0)
System\ComponentModel\Composition\Hosting\ImportEngine.RecompositionManager.cs (3)
106if (aliveItems.Count == 0) 122if (partsToIndex.Count == 0 && partsToUnindex.Count == 0)
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (1)
483if (parameters.Count > 0)
System.ComponentModel.Composition.Registration (3)
System\ComponentModel\Composition\Registration\PartBuilder.cs (3)
295if (_interfaceExports.Count != 0) 419if (_propertyImports.Count != 0 || _propertyExports.Count != 0)
System.ComponentModel.TypeConverter (17)
System\ComponentModel\Design\Serialization\ContextStack.cs (7)
36if (_contextStack != null && _contextStack.Count > 0) 38return _contextStack[_contextStack.Count - 1]; 53if (_contextStack != null && level < _contextStack.Count) 55return _contextStack[_contextStack.Count - 1 - level]; 74int level = _contextStack.Count; 112if (_contextStack != null && _contextStack.Count > 0) 114int idx = _contextStack.Count - 1;
System\ComponentModel\ExtendedPropertyDescriptor.cs (1)
37Attribute[] temp = new Attribute[attrList.Count];
System\ComponentModel\MemberDescriptor.cs (2)
113_attributes = new Attribute[newList.Count]; 347for (int i = 0; i < list.Count;)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
631PropertyDescriptor[] fullArray = new PropertyDescriptor[propertyList.Count]; 1294extendedProperties = new ReflectPropertyDescriptor[extendedList.Count];
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (5)
100int ifaceStartIdx = attributes.Count; 115if (attributes.Count != 0) 117var filter = new HashSet<object>(attributes.Count); 120for (int idx = 0; idx < attributes.Count; idx++) 143attributes.RemoveRange(next, attributes.Count - next);
System.Composition.Convention (3)
System\Composition\Convention\PartConventionBuilder.cs (3)
493if (_interfaceExports.Count != 0) 664if (_propertyImports.Count != 0 || _propertyExports.Count != 0)
System.Composition.Hosting (1)
System\Composition\Hosting\Core\UpdateResult.cs (1)
52if (_providedDescriptors.Count == 0)
System.Configuration.ConfigurationManager (9)
System\Configuration\BaseConfigurationRecord.cs (3)
450Debug.Assert(inputsPerConfigKey.Count > 0, "We won't get here unless we have inputs."); 1295int i = locationInputs.Count; 2162for (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)
3249return 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) 6854if (t_usedTables.Count == 0) 6922if (RowDiffIdUsageSection.t_usedTables != null && RowDiffIdUsageSection.t_usedTables.Count == 0) 6966if ((null != _dependentColumns) && (0 < _dependentColumns.Count)) 7148int count = columns.Count; 7201count = 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)
299if (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; 842resultRows = _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)
3067if (tableList.Count > 0) 3076for (int readPos = 0; readPos < tableList.Count; readPos++) 3114for (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\runtime\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.Data.OleDb (17)
OleDbConnectionStringBuilder.cs (1)
461Guid[] arrayPropertySets = new Guid[listPropertySets.Count];
OleDbDataReader.cs (3)
2408int visibleCount = metainfo.Count; 2419for (int index = metainfo.Count - 1; visibleCount <= index; --index) 2436for (int index2 = metainfo.Count - 1; index < index2; --index2)
OleDbException.cs (2)
106Debug.Assert(0 < exceptions.Count, "missing exceptions"); 107if (1 < exceptions.Count)
OleDbParameterCollectionHelper.cs (2)
20return ((null != _items) ? _items.Count : 0); 197int count = items.Count;
System\Data\ProviderBase\DbConnectionFactory.cs (2)
440if (0 != _poolsToRelease.Count) 464if (0 != _poolGroupsToRelease.Count)
System\Data\ProviderBase\DbConnectionPool.cs (7)
110int i = connections.Count - 1; 621int count = _objectList.Count; 677_totalObjects = _objectList.Count; 691oldConnectionPool._totalObjects = oldConnectionPool._objectList.Count; 897_totalObjects = _objectList.Count; 1601count = _objectList.Count; 1642count = reclaimedObjects.Count;
System.Diagnostics.DiagnosticSource (8)
System\Diagnostics\ActivitySource.cs (1)
463if (predicateFailures.Count == 1)
System\Diagnostics\ActivityTagsCollection.cs (4)
98List<string> list = new List<string>(_list.Count); 114List<object?> list = new List<object?>(_list.Count); 131public int Count => _list.Count; 261for (int i = 0; i < _list.Count; i++)
System\Diagnostics\Metrics\InstrumentAdvice.cs (1)
58for (int i = 1; i < values.Count; i++)
System\Diagnostics\Metrics\Meter.cs (1)
602if (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.EventLog (1)
System\Diagnostics\EventLogInternal.cs (1)
1153if (info.listeningComponents.Count != 0)
System.Diagnostics.Process (2)
System\Diagnostics\Process.cs (1)
571int 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)
67List<WeakReference<Switch>> buffer = new List<WeakReference<Switch>>(s_switches.Count); 68for (int i = 0; i < s_switches.Count; i++) 75if (buffer.Count < s_switches.Count) 267for (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.DirectoryServices (1)
System\DirectoryServices\ActiveDirectory\DirectoryServerCollection.cs (1)
265for (int i = 0; i < _copyList.Count; i++)
System.DirectoryServices.AccountManagement (45)
System\DirectoryServices\AccountManagement\AD\ADDNLinkedAttrSet.cs (10)
363_groupsToVisit.Count); 365if (_groupsToVisit.Count > 0) 543_groupsToVisit.Count); 545if (_groupsToVisit.Count > 0) 583List<byte[]> sidList = new List<byte[]>(_foreignMembersCurrentGroup.Count); 648if (_foreignMembersCurrentGroup.Count > 0) 653if (_fakePrincipalMembers.Count > 0) 723if (_foreignGroups.Count > 0) 814_foreignGroups.Count); 844_foreignGroups.Count);
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs (4)
1519if (insertedMembers.Count > 0 || removedMembers.Count > 0) 1579if (insertedMembers.Count > 0) 1625if (removedMembers.Count > 0)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs (2)
1263enumerators = new IEnumerable[roots.Count]; 1284searchers = new DirectorySearcher[roots.Count];
System\DirectoryServices\AccountManagement\AD\SidList.cs (3)
19GlobalDebug.WriteLineIf(GlobalDebug.Info, "SidList", "SidList: processing {0} ByteFormat SIDs", sidListByteFormat.Count); 25int sidCount = sidListByteFormat.Count; 216get { return _entries.Count; }
System\DirectoryServices\AccountManagement\AuthenticablePrincipal.cs (4)
548GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthenticablePrincipal", "LoadCertificateCollection: loading {0} certs", certificatesToLoad.Count); 586if (_certificates.Count != _certificateOriginalThumbprints.Count) 592_certificateOriginalThumbprints.Count, 625Debug.Assert(remainingOriginalThumbprints.Count == 0);
System\DirectoryServices\AccountManagement\PrincipalCollection.cs (2)
736return ((_insertedValuesPending.Count > 0) || (_removedValuesPending.Count > 0) || (_clearPending));
System\DirectoryServices\AccountManagement\SAM\SAMMembersSet.cs (8)
231GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: recursive processing, groupsToVisit={0}", _groupsToVisit.Count); 233if (_groupsToVisit.Count > 0) 273GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextForeign: foreignMembers count={0}", _foreignMembers.Count); 275if (_foreignMembers.Count > 0) 312if (_foreignResultSet == null && _foreignGroups.Count > 0) 317_foreignGroups.Count); 356if (_foreignGroups.Count > 0) 364Debug.Assert(_foreignMembers.Count == 0);
System\DirectoryServices\AccountManagement\TrackedCollection.cs (3)
31if ((array.GetLength(0) - index) < this.combinedValues.Count) 101return this.combinedValues.Count; 298if (this.removedValues.Count > 0)
System\DirectoryServices\AccountManagement\ValueCollection.cs (9)
231if ((index < 0) || (index > _inner.combinedValues.Count)) 233GlobalDebug.WriteLineIf(GlobalDebug.Warn, "PrincipalValueCollection", "Insert({0}): out of range (count={1})", index, _inner.combinedValues.Count); 256if ((index < 0) || (index >= _inner.combinedValues.Count)) 258GlobalDebug.WriteLineIf(GlobalDebug.Warn, "PrincipalValueCollection", "RemoveAt({0}): out of range (count={1})", index, _inner.combinedValues.Count); 284if ((index < 0) || (index >= _inner.combinedValues.Count)) 286GlobalDebug.WriteLineIf(GlobalDebug.Warn, "PrincipalValueCollection", "this[{0}].get: out of range (count={1})", index, _inner.combinedValues.Count); 308if ((index < 0) || (index >= _inner.combinedValues.Count)) 310GlobalDebug.WriteLineIf(GlobalDebug.Warn, "PrincipalValueCollection", "this[{0}].set: out of range (count={1})", index, _inner.combinedValues.Count); 377GlobalDebug.WriteLineIf(GlobalDebug.Info, "PrincipalValueCollection", "Load, count={0}", values.Count);
System.Drawing.Common (4)
System\Drawing\ImageAnimator.cs (2)
347for (int i = 0; i < s_imageInfoList.Count; i++) 405for (int i = 0; i < s_imageInfoList.Count; i++)
System\Drawing\Printing\PrinterSettings.StringCollection.cs (2)
23public int Count => _list.Count; 48return _list.Count;
System.Formats.Cbor (2)
System\Formats\Cbor\Writer\CborWriter.Map.cs (2)
135if (!_keysRequireSorting && keyValuePairEncodingRanges.Count > 0) 138KeyValuePairEncodingRange previousKeyValueRange = keyValuePairEncodingRanges[keyValuePairEncodingRanges.Count - 1];
System.Formats.Nrbf (8)
System\Formats\Nrbf\ArrayRecord.cs (1)
159Debug.Assert(numElementsWritten == (uint)source.Count, "We should have traversed the entirety of the source records collection.");
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
38for (int recordIndex = 0; recordIndex < Records.Count; recordIndex++)
System\Formats\Nrbf\ArraySingleStringRecord.cs (1)
52for (int recordIndex = 0; recordIndex < Records.Count; recordIndex++)
System\Formats\Nrbf\ClassRecord.cs (1)
158if (MemberValues.Count < ExpectedValuesCount)
System\Formats\Nrbf\ClassWithIdRecord.cs (1)
85=> MetadataClass.MemberTypeInfo.GetNextAllowedRecordType(MemberValues.Count);
System\Formats\Nrbf\ClassWithMembersAndTypesRecord.cs (1)
37=> MemberTypeInfo.GetNextAllowedRecordType(MemberValues.Count);
System\Formats\Nrbf\MemberTypeInfo.cs (1)
41for (int i = 0; i < info.Count; i++)
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (1)
104=> MemberTypeInfo.GetNextAllowedRecordType(MemberValues.Count);
System.Formats.Tar (1)
System\Formats\Tar\TarReader.cs (1)
75if (_dataStreamsToDispose?.Count > 0)
System.IO.Compression (14)
System\IO\Compression\ZipArchive.Async.cs (6)
243ZipArchiveEntry lastEntry = _entries[_entries.Count - 1]; 373entriesToWrite = new(_entries.Count); 417bool archiveEpilogueRequiresUpdate = _entries.Count == 0; 445|| _entries.Count >= ZipHelper.Mask16Bit 456await Zip64EndOfCentralDirectoryRecord.WriteBlockAsync(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, cancellationToken).ConfigureAwait(false); 468await ZipEndOfCentralDirectoryBlock.WriteBlockAsync(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, _archiveComment, cancellationToken).ConfigureAwait(false);
System\IO\Compression\ZipArchive.cs (8)
652for (int i = 0; i < _entries.Count; i++) 654_entries[i].EndOfLocalEntryData = i < _entries.Count - 1 689ZipArchiveEntry lastEntry = _entries[_entries.Count - 1]; 920entriesToWrite = new(_entries.Count); 963bool archiveEpilogueRequiresUpdate = _entries.Count == 0; 995|| _entries.Count >= ZipHelper.Mask16Bit 1006Zip64EndOfCentralDirectoryRecord.WriteBlock(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory); 1018ZipEndOfCentralDirectoryBlock.WriteBlock(_archiveStream, _entries.Count, startOfCentralDirectory, sizeOfCentralDirectory, _archiveComment);
System.IO.FileSystem.AccessControl (3)
src\runtime\src\libraries\Common\src\System\IO\FileSystem.DirectoryCreation.Windows.cs (3)
73int count = stackDir.Count; 82while (stackDir.Count > 0) 85stackDir.RemoveAt(stackDir.Count - 1);
System.IO.FileSystem.Watcher (6)
System\IO\FileSystemWatcher.Linux.cs (6)
401if (watch.Watchers.Count == 0) 424_allWatchersStopped = _watchers.Count == 0; 468removeINotifyWatches |= watch.Watchers.Count == 0; 480if (_watchers.Count == 0) 751int watchersCount = watch.Watchers.Count; 1351for (int i = 0; i < children.Count; i++)
System.IO.Packaging (22)
System\IO\Packaging\InterleavedZipPackagePartStream.PieceDirectory.cs (7)
113Debug.Assert(sortedPieceInfoList.Count > 0); 126_lastPieceIndex = sortedPieceInfoList.Count - 1; 271for (int i = _indexOfLastPieceStreamInfoAccessed + 1; i < _pieceStreamInfoList.Count; i++) 275_pieceStreamInfoList.RemoveRange(_indexOfLastPieceStreamInfoAccessed + 1, _pieceStreamInfoList.Count - (_indexOfLastPieceStreamInfoAccessed + 1)); 393while (pieceNumber < _sortedPieceInfoList.Count) 399_sortedPieceInfoList.RemoveRange(_lastPieceIndex + 1, _sortedPieceInfoList.Count - (_lastPieceIndex + 1)); 446Debug.Assert(_pieceStreamInfoList.Count == 0);
System\IO\Packaging\Package.cs (2)
435if (partIndex.Count > 0) 437precedingPartName = (partIndex[partIndex.Count - 1]);
System\IO\Packaging\PackagePart.cs (1)
771for (int i = _requestedStreams.Count - 1; i >= 0; i--)
System\IO\Packaging\ZipPackage.cs (11)
135if (partToDelete.PieceDescriptors.Count > 0) 541if (sortedPieceInfoList.Count > 0) 582for (int i = 0; i < pieces.Count; ++i) 661_ignoredItemHelper.AddItemsForInvalidSequence(normalizedPrefixNameForCurrentSequence, pieces, startIndexOfCurrentSequence, checked(pieces.Count - startIndexOfCurrentSequence)); 1087_ignoredItemHelper.AddItemsForInvalidSequence(ContentTypesFileUpperInvariant, partPieces, 0, partPieces.Count); 1096for (int pieceNumber = 0; pieceNumber < partPieces.Count; ++pieceNumber) 1100_ignoredItemHelper.AddItemsForInvalidSequence(ContentTypesFileUpperInvariant, partPieces, 0, partPieces.Count); 1118_ignoredItemHelper.AddItemsForInvalidSequence(ContentTypesFileUpperInvariant, partPieces, 0, partPieces.Count); 1125if (lastPieceNumber < partPieces.Count - 1) 1129_ignoredItemHelper.AddItemsForInvalidSequence(ContentTypesFileUpperInvariant, partPieces, lastPieceNumber + 1, partPieces.Count - lastPieceNumber - 1); 1130partPieces.RemoveRange(lastPieceNumber + 1, partPieces.Count - lastPieceNumber - 1);
System\IO\Packaging\ZipPackagePart.cs (1)
48else if (_pieces.Count > 0)
System.IO.Pipelines (1)
System\IO\Pipelines\PipeCompletionCallbacks.cs (1)
22var count = _callbacks.Count;
System.Linq (14)
System\Linq\AppendPrepend.SpeedOpt.cs (1)
270_appended?.FillReversed(SetCountAndGetSpan(list, list.Count + _appendCount));
System\Linq\DebugView.cs (1)
81if (tempList.Count == 0)
System\Linq\DefaultIfEmpty.SpeedOpt.cs (1)
23if (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)
230private int CountForDebugger => _source.Count;
System\Linq\Select.SizeOpt.cs (1)
100for (int i = 0; i < list.Count; i++)
System\Linq\Select.SpeedOpt.cs (5)
433int count = _source.Count; 460if ((uint)index < (uint)_source.Count) 472if (_source.Count != 0) 484int len = _source.Count; 497int count = _source.Count;
System\Linq\Shuffle.SpeedOpt.cs (3)
121if (i < buffer.Count) 240while (reservoir.Count < takeCount) 244totalElementCount = reservoir.Count;
System.Linq.AsyncEnumerable (1)
System\Linq\ToAsyncEnumerable.cs (1)
50for (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 (46)
System\Net\Http\Headers\HttpHeaders.cs (5)
235rawValues.EnsureCapacity(rawValues.Count + count); 526for (int i = 0; i < parsedValues.Count; i++) 562if (parsedValues.Count == 0) 999if (parsedValues.Count == 0 && addWhenInvalid && info.ParsedAndInvalidValues is null) 1305valueStore is List<T> list ? list.Count :
System\Net\Http\MultipartContent.cs (6)
167for (int contentIndex = 0; contentIndex < _nestedContent.Count; contentIndex++) 212for (int contentIndex = 0; contentIndex < _nestedContent.Count; contentIndex++) 255var streams = new Stream[2 + (_nestedContent.Count * 2)]; 262for (int contentIndex = 0; contentIndex < _nestedContent.Count; contentIndex++) 353if (_nestedContent.Count > 1) 356currentLength += (_nestedContent.Count - 1) * (CrLfBytes.Length + _startBoundaryBytes.Length);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (7)
975if (_availableHttp2Connections is { Count: > 0 } http2) 992if (_availableHttp3Connections is { Count: > 0 } http3) 1036_associatedHttp2ConnectionCount -= _availableHttp2Connections.Count; 1044_associatedHttp3ConnectionCount -= _availableHttp3Connections.Count; 1061Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0"); 1107(_http2ConnectionsForHeartBeat?.Count ?? 0) == 0)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (14)
89int availableConnectionCount = _availableHttp2Connections?.Count ?? 0; 154int availableHttp2ConnectionCount = _availableHttp2Connections?.Count ?? 0; 396Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0)); 415Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0), 416$"Expected _associatedHttp2ConnectionCount={_associatedHttp2ConnectionCount} > _availableHttp2Connections.Count={(_availableHttp2Connections?.Count ?? 0)}"); 438Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"With {(_availableHttp2Connections?.Count ?? 0)} available HTTP2 connections, we shouldn't have a waiter."); 565Debug.Assert(_associatedHttp2ConnectionCount >= _availableHttp2Connections.Count); 659while (freeIndex < list.Count && list[freeIndex].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 667if (freeIndex < list.Count) 675while (current < list.Count) 679while (current < list.Count && !list[current].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 686if (current < list.Count) 697removed = list.Count - freeIndex;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (14)
141int availableConnectionCount = _availableHttp3Connections?.Count ?? 0; 216int availableHttp3ConnectionCount = _availableHttp3Connections?.Count ?? 0; 375Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0)); 394Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0), 395$"Expected _associatedHttp3ConnectionCount={_associatedHttp3ConnectionCount} > _availableHttp3Connections.Count={(_availableHttp3Connections?.Count ?? 0)}"); 417Debug.Assert((_availableHttp3Connections?.Count ?? 0) == 0, $"With {(_availableHttp3Connections?.Count ?? 0)} available HTTP3 connections, we shouldn't have a waiter."); 537Debug.Assert(_associatedHttp3ConnectionCount >= _availableHttp3Connections.Count); 567while (freeIndex < list.Count && list[freeIndex].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 575if (freeIndex < list.Count) 583while (current < list.Count) 587while (current < list.Count && !list[current].IsUsable(nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout)) 594if (current < list.Count) 605removed = list.Count - freeIndex;
System.Net.HttpListener (11)
System\Net\HttpListenerRequest.cs (1)
391int n = values.Count;
System\Net\HttpListenerRequestUriBuilder.cs (3)
150Debug.Assert(_rawOctets.Count == 0, 296if (_rawOctets!.Count == 0) 344StringBuilder octetString = new StringBuilder(octets.Count * 3);
System\Net\Managed\ChunkStream.cs (2)
108int count = _chunks.Count; 196int count = _chunks.Count;
System\Net\Managed\HttpEndPointListener.cs (3)
277int c = list.Count; 296if (list != null && list.Count > 0) 300if (list != null && list.Count > 0)
System\Net\Managed\HttpListener.Managed.cs (2)
198if (_asyncWaitQueue.Count == 0) 261if (_contextQueue.Count == 0)
System.Net.Mail (9)
System\Net\Mail\MailAddressCollection.cs (1)
44for (int i = 0; i < result.Count; i++)
System\Net\Mail\SmtpAuthenticationManager.cs (2)
33ISmtpAuthenticationModule[] copy = new ISmtpAuthenticationModule[s_modules.Count]; 34s_modules.CopyTo(0, copy, 0, s_modules.Count);
System\Net\Mail\SmtpClient.cs (1)
531var e = failedRecipientExceptions.Count == 1
System\Net\Mail\SmtpFailedRecipientsException.cs (2)
50innerExceptions.Count > 0 ? innerExceptions[0].FailedRecipient : null, 51innerExceptions.Count > 0 ? innerExceptions[0] : null)
System\Net\Mail\SmtpTransport.cs (3)
132if (failedRecipientExceptions?.Count > 0 && failedRecipientExceptions.Count == recipients.Count) 134var exception = failedRecipientExceptions.Count == 1
System.Net.NameResolution (9)
System\Net\DnsResolverPal.Managed.cs (9)
158TimeSpan negTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 212List<SrvRecord> records = new List<SrvRecord>(srvs.Count); 223TimeSpan negTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 253TimeSpan txtNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 278TimeSpan mxNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 303TimeSpan cnameNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 328TimeSpan ptrNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 353TimeSpan nsNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 852if (systemServers.Count > 0)
System.Net.NetworkInformation (5)
System\Net\NetworkInformation\GatewayIPAddressInformationCollection.cs (1)
31return _addresses.Count;
System\Net\NetworkInformation\InternalIPAddressCollection.cs (1)
31return _addresses.Count;
System\Net\NetworkInformation\IPAddressInformationCollection.cs (1)
25return _addresses.Count;
System\Net\NetworkInformation\MulticastIPAddressInformationCollection.cs (1)
25return _addresses.Count;
System\Net\NetworkInformation\UnicastIPAddressInformationCollection.cs (1)
26return _addresses.Count;
System.Net.Primitives (1)
System\Net\CookieContainer.cs (1)
704for (int i = 0; i < matchingDomainKeys.Count; i++)
System.Net.Quic (5)
System\Net\Quic\Internal\MsQuicConfiguration.Cache.cs (3)
79if (ApplicationProtocols.Count != other.ApplicationProtocols.Count) 84for (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 (9)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (4)
201bool hasAlpn = sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0; 290if (sslAuthenticationOptions.IsServer && sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0) 448if (sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0) 1229for (int i = 0; i < protocolList.Count; i++)
System\Net\Security\SslStream.Protocol.cs (3)
465if (filteredCerts != null && filteredCerts.Count != 0) 467NetEventSource.Log.CertsAfterFiltering(filteredCerts.Count, this); 486for (int i = 0; i < filteredCerts.Count; ++i)
System\Net\Security\SslStreamCertificateContext.Linux.cs (2)
275Debug.Assert(_ocspUrls.Count > 0); 317for (int i = 0; i < _ocspUrls.Count; i++)
System.ObjectModel (1)
System\Collections\ObjectModel\KeyedCollection.cs (1)
142for (int i = 0; i < Items.Count; i++)
System.Private.CoreLib (83)
src\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (1)
145_numOfFrames = frameList.Count;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (3)
199if (s_needsResetIncrementingPollingCounters.Count > 0) 247counterCount = _counters.Count; 330if (s_needsResetIncrementingPollingCounters.Count > 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventListener.cs (3)
281if (s_EventSources.Count % 64 == 63) // on every block of 64, fill up the block before continuing 283int i = s_EventSources.Count; // Work from the top down. 298newIndex = s_EventSources.Count;
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingTypeInfo.cs (2)
148int recursionCheckCount = recursionCheck.Count; 151recursionCheck.RemoveRange(recursionCheckCount, recursionCheck.Count - recursionCheckCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (7)
153for (int i = 0; i < datePatternsList.Count; i++) 173if (shortDatePatterns.Count == 0) 240for (int i = 1; i < shortDatePatterns.Count; i++) 379if (callbackContext.Results.Count == 12) 384if (callbackContext.Results.Count > 13) 386Debug.Assert(calendarId == CalendarId.HEBREW && callbackContext.Results.Count == 14); 392callbackContext.Results.RemoveRange(13, callbackContext.Results.Count - 13);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (1)
512if (m_dateWords is { Count: > 0 } dateWords)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (4)
120int startIndex = abbrevEnglishEraNames == s_abbreviatedEnglishEraNames ? eras.Count - 1 : abbrevEnglishEraNames.Length - 1; 122Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 125for (int i = 0; i < eras.Count; i++) 127eras[i].era = eras.Count - i;
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (3)
1444if (s_cache.Count > 0) 1476for (int i = s_cache.Count - 1; i >= 0; i--) 1753for (int i = 0; i < list.Count; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (1)
152if (edis.Count > 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (3)
44if (tokens.Count == 0 && 67if (tokens.Count == 0) 86tokens = new Token[registrations.Count];
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (2)
55StartupHookNameOrPath[] startupHooks = new StartupHookNameOrPath[startupHookParts.Count]; 56for (int i = 0; i < startupHookParts.Count; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (2)
829Debug.Assert(exceptionList.Count > 0, $"Expected {exceptionList.Count} > 0");
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (8)
4780if (list.Count == list.Capacity) 5251Debug.Assert(tasks.Count > 0, "Expected at least one task"); 5256var mres = new SetOnCountdownMres(tasks.Count); 6368Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6466return taskList.Count == 0 ? 6640Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6953if (taskList.Count == 0) 7702if (lookForOce && edis.Count > 0 &&
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource_T.cs (1)
173if (defensiveCopy.Count == 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource.cs (1)
173if (defensiveCopy.Count == 0)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (1)
628int freeIdCount = _freeIds.Count;
src\runtime\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\runtime\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)); 548if (rulesList.Count == 0 && index < dts.Length)
System\Reflection\Runtime\Assemblies\RuntimeAssemblyInfo.cs (2)
127int numTypes = types.Count; 128int numExceptions = exceptions.Count;
System.Private.DataContractSerialization (73)
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (3)
236for (int i = 0; i < typeArgumentList.Count; i++) 252else if (typeArgumentList.Count > 0) 254for (int i = 0; i < typeArgumentList.Count; i++)
System\Runtime\Serialization\ClassDataContract.cs (21)
363XmlDictionaryString?[] childElementNamespaces = new XmlDictionaryString?[Members.Count + baseChildElementNamespaceCount]; 368for (int i = 0; i < Members.Count; i++) 473for (int i = 0; i < Members.Count; i++) 556for (int i = 0; i < Members.Count; i++) 685XmlDictionary dictionary = new XmlDictionary(2 + Members.Count); 693MemberNames = new XmlDictionaryString[Members.Count]; 694MemberNamespaces = new XmlDictionaryString[Members.Count]; 704MemberNames = new XmlDictionaryString[Members.Count + baseMemberCount]; 706MemberNamespaces = new XmlDictionaryString[Members.Count + baseMemberCount]; 713for (int i = 0; i < Members.Count; i++) 731XmlDictionary dictionary = new XmlDictionary(1 + Members.Count); 735MemberNames = new XmlDictionaryString[Members.Count]; 736MemberNamespaces = new XmlDictionaryString[Members.Count]; 737for (int i = 0; i < Members.Count; i++) 952if (tempMembers.Count > 1) 1001for (int i = 0; i < membersInHierarchy.Count - 1; i++) 1006while (endIndex < membersInHierarchy.Count - 1 1375boundClassContract.Members = new List<DataMember>(Members.Count); 1423Dictionary<string, DataMember> membersDictionary = new Dictionary<string, DataMember>(Members.Count); 1425for (int i = 0; i < Members.Count; i++) 1430for (int i = 0; i < dataContract.Members.Count; i++)
System\Runtime\Serialization\DataContract.cs (10)
1529else if (nestedParamCounts.Count > 1 || !parametersFromBuiltInNamespaces) 1652if (nestedParamCounts.Count > 1 || !parametersFromBuiltInNamespaces) 2421if (level >= _nestedParamCounts.Count) 2425_nestedParamCounts.Add((level == _nestedParamCounts.Count) ? count : 0); 2426} while (level >= _nestedParamCounts.Count); 2439return _paramGenericInfos?.Count ?? 0; 2459if (_paramGenericInfos == null || _paramGenericInfos.Count == 0) 2463for (int j = 0; j < _paramGenericInfos.Count; j++) 2481if (_paramGenericInfos == null || _paramGenericInfos.Count == 0) 2484for (int j = 0; j < _paramGenericInfos.Count; j++)
System\Runtime\Serialization\DataContractSet.cs (2)
150for (int i = 0; i < classDataContract.Members.Count; i++) 596for (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)
125if (elementNameList.Count > 0) 999int prevMemberIndex = dataContract.Members.Count - 1; 1004memberOrder = dataContract.Members.Count; 1010memberOrder = dataContract.Members.Count; 1105if (keyValueContract == null || keyValueContract.Members == null || keyValueContract.Members.Count != 2 1212long 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.Reflection.Execution (2)
src\runtime\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
System.Private.TypeLoader (2)
src\runtime\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
System.Private.Windows.Core (6)
System\Collections\Generic\CollectionExtensions.cs (1)
29list.RemoveRange(count, list.Count - count);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
355list.Count, 390list.Count,
System\Private\Windows\Ole\FormatEnumerator.cs (2)
61if (_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 (142)
System\Xml\Core\QueryOutputWriter.cs (1)
56if (settings.CDataSectionElements.Count > 0)
System\Xml\Core\QueryOutputWriterV1.cs (1)
70if (settings.CDataSectionElements != null && settings.CDataSectionElements.Count > 0)
System\Xml\Core\XmlEventCache.cs (4)
114for (idxPage = 0; idxPage < _pages!.Count; idxPage++) 125Debug.Assert(idxPage + 1 == _pages.Count); 268for (idxPage = 0; idxPage < _pages!.Count; idxPage++) 279Debug.Assert(idxPage + 1 == _pages.Count);
System\Xml\Core\XmlWriterSettings.cs (2)
331private bool IsQuerySpecific => CDataSectionElements.Count != 0 || _docTypePublic != null || _docTypeSystem != null || _standalone == XmlStandalone.Yes; 626writer.Write(CDataSectionElements.Count);
System\Xml\Dom\DocumentXmlWriter.cs (8)
378for (int i = _fragment.Count - 1; i >= 0; i--) 391for (int i = 0; i < _fragment.Count; i++) 398for (int i = _fragment.Count - 1; i >= 0; i--) 405for (int i = 0; i < _fragment.Count; i++) 415if (_fragment.Count == 0) 435for (int i = 0; i < _fragment.Count; i++) 446for (int i = 0; i < _fragment.Count; i++) 478for (int i = _fragment.Count - 1; i >= 1; i--)
System\Xml\Dom\DocumentXPathNavigator.cs (1)
1813for (int i = elements.Count - 1; i >= 0; i--)
System\Xml\Dom\XmlNamedNodeMap.SmallXmlNodeList.cs (1)
31return list.Count;
System\Xml\Dom\XPathNodeList.cs (4)
32return _list.Count; 44int count = _list.Count; 68if (_list.Count <= index) 72if (index < 0 || _list.Count <= index)
System\Xml\Schema\ContentValidator.cs (1)
1976if (matchCount + 2 >= runningPositions.Count)
System\Xml\Schema\Preprocessor.cs (1)
778for (int i = 0; i < removeItemsList.Count; ++i)
System\Xml\Schema\SchemaAttDef.cs (2)
179(values.Count <= 2)) 183if (values.Count == 2)
System\Xml\Schema\SchemaCollectionpreProcessor.cs (1)
577for (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)
999for (int i = 0; i < newMembers.Count; ++i) 1301for (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)
252if (attributeMembersList.Count > 0) 555if (collection is Array currentArray && currentArray.Length == collectionMember.Count) 561a = Array.CreateInstanceFromArrayType(collectionType, collectionMember.Count); 564for (int i = 0; i < collectionMember.Count; i++)
System\Xml\Serialization\SoapReflectionImporter.cs (1)
581if (constants.Count == 0)
System\Xml\Serialization\Types.cs (1)
1157for (int i = 0; i < list.Count; i++)
System\Xml\Serialization\XmlReflectionImporter.cs (2)
911for (int i = 0; i < members.Count; i++) 1226if (constants.Count == 0)
System\Xml\Serialization\XmlSerializationReader.cs (2)
2002if (xmlNodeList.Count <= skippableNodeCount) 2637if (attributeMembersList.Count > 0)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (4)
589if (attributeMembersList.Count > 0) 1178for (int i = 0; i < caseLabels.Count; i++) 2073if (attributes.Count > 0) 2077for (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)
441Debug.Assert(defList != null && defList.Count > 0); 442if (defList.Count == 1) 458Debug.Assert(defList != null && defList.Count > 0); 467return 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) 1430newtemplate.SetContent(new List<XslNode>(content.Count - split + 8)); 1471for (int t = split; t < content.Count; ++t) 1478content.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)) 1531if (content.Count != 0) 1547if (content.Count != 0) ReportNYI("xsl:apply-imports/xsl:with-param"); 1766if (content.Count != 0) 1872CheckError(select == null && content.Count == 0, /*[???]*/SR.Xslt_NoSelectNoContent, _input.ElementName); 1873if (content.Count != 0) 1958CheckError((required == TriState.True) && (select != null || content.Count != 0), /*[???]*/SR.Xslt_RequiredAndSelect, name!.ToString()); 1983CheckError(hasSelect && content.Count != 0, /*[XT0620]*/SR.Xslt_ElementCntSel, parentName); 1985if (content.Count != 0) 2147if (content.Count != 0) 2596if (fallbacksArray.Count == 0) 2718if (1 < modes.Count) 2723if (modes.Count == 0) 2893Debug.Assert(list != null && list.Count == 0, "It happened that we always add use-attribute-sets first. Otherwise we can't call list.Clear()"); 3083if (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)
334_queryList = new Query[queryStore.Count]; 336for (int i = 0; i < queryStore.Count; i++) 359_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)
132if (matchingProperties.Count == 0) 258if (matchingMethods.Count == 0) 267if (matchingMethods.Count == 1)
System.Reflection.DispatchProxy (2)
System\Reflection\DispatchProxyGenerator.cs (2)
291Type[] args = new Type[_fields.Count]; 362int methodInfoIndex = _methodInfos.Count;
System.Reflection.Emit (23)
src\runtime\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]; 761if (_exceptionStack.Count < 1) 766ExceptionBlock currentExBlock = _exceptionStack[_exceptionStack.Count - 1];
System\Reflection\Emit\ModuleBuilderImpl.cs (3)
229if (typeBuilder._eventDefinitions.Count == 0) 267if (typeBuilder._propertyDefinitions.Count == 0) 475for (int i = 0; i < sequencePoints.Count; i++)
System\Reflection\Emit\SignatureHelper.cs (1)
18LocalVariablesEncoder encoder = new BlobEncoder(localSignature).LocalVariableSignature(locals.Count);
System\Reflection\Emit\TypeBuilderImpl.cs (7)
114if (_constructorDefinitions.Count == 0 && (_attributes & TypeAttributes.Interface) == 0 && !IsValueType && 128for (int i = 0; i < _methodDefinitions.Count; i++) 913List<FieldInfo> fields = new List<FieldInfo>(_fieldDefinitions.Count); 1021List<PropertyInfo> candidates = new List<PropertyInfo>(_propertyDefinitions.Count); 1047if (candidates.Count == 0) 1055if (candidates.Count == 1) 1283for (int j = 0; j < mapping.Count; j++)
System.Reflection.Metadata (141)
System\Reflection\Internal\Utilities\EnumerableExtensions.cs (1)
30int[] map = new int[source.Count];
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (10)
114return new LabelHandle(_labels.Count); 120Debug.Assert(_branches.Count == 0 || operandOffset > _branches[_branches.Count - 1].OperandOffset); 165if (label.Id > _labels.Count) 258internal int BranchCount => _branches.Count; 260internal int ExceptionHandlerCount => _lazyExceptionHandlers?.Count ?? 0; 338if (branchIndex == _branches.Count) 358if (_lazyExceptionHandlers == null || _lazyExceptionHandlers.Count == 0) 363var regionEncoder = ExceptionRegionEncoder.SerializeTableHeader(builder, _lazyExceptionHandlers.Count, HasSmallExceptionRegions()); 406if (!ExceptionRegionEncoder.IsSmallRegionCount(_lazyExceptionHandlers.Count))
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (1)
543int 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\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
344bw.Write(typeNames.Count); 490typeIndex = types.Count;
System.Resources.Writer (2)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
344bw.Write(typeNames.Count); 490typeIndex = types.Count;
System.Runtime.Caching (1)
System\Runtime\Caching\MemoryCache.cs (1)
419if (keysClone.Count == 0)
System.Runtime.InteropServices.JavaScript (3)
System\Runtime\InteropServices\JavaScript\JSProxyContext.cs (3)
288if (JSVHandleFreeList.Count > 0) 290var jsvHandle = JSVHandleFreeList[JSVHandleFreeList.Count - 1]; 291JSVHandleFreeList.RemoveAt(JSVHandleFreeList.Count - 1);
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.AccessControl (2)
System\Security\AccessControl\ACL.cs (2)
305get { return _aces.Count; } 382int newBinaryLength = BinaryLength - (index < _aces.Count ? _aces[index].BinaryLength : 0) + value.BinaryLength;
System.Security.Claims (12)
System\Security\Claims\ClaimsIdentity.cs (5)
375for (int i = 0; i < _instanceClaims.Count; i++) 380for (int j = 0; j < _externalClaims!.Count; j++) 525for (int i = 0; i < _instanceClaims.Count; i++) 904if (_instanceClaims.Count > 0) 951writer.Write(_instanceClaims.Count);
System\Security\Claims\ClaimsPrincipal.cs (7)
369for (int i = 0; i < _identities.Count; i++) 395for (int i = 0; i < _identities.Count; i++) 423for (int i = 0; i < _identities.Count; i++) 475for (int i = 0; i < _identities.Count; i++) 510if (_identities.Count > 0) 526writer.Write(_identities.Count); 550if (_identities.Count > 0)
System.Security.Cryptography (20)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (3)
47for (int index = 0; index < _list.Count; index++) 73int indexOfNewItem = _list.Count; 103return _list.Count;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (2)
122if (authSafeData.Count == 0) 128Pkcs12SafeContents[] contentsArray = new Pkcs12SafeContents[authSafeData.Count];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
351if (serializedBags.Count == 0) 361List<Pkcs12SafeBag> bags = new List<Pkcs12SafeBag>(serializedBags.Count); 363for (int i = 0; i < serializedBags.Count; i++)
System\Security\Cryptography\AsnEncodedDataCollection.cs (2)
28int indexOfNewItem = _list.Count; 52return _list.Count;
System\Security\Cryptography\CryptoConfig.cs (1)
459if (candidates.Count == 0)
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
1082if (extensionAsns.Count > 0)
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (1)
384if (_revoked.Count > 0)
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.cs (1)
248for (int i = _revoked.Count - 1; i >= 0; i--)
System\Security\Cryptography\X509Certificates\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\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)
369if (signatures.Count < 1)
System.Security.Cryptography.Pkcs (11)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (3)
47for (int index = 0; index < _list.Count; index++) 73int indexOfNewItem = _list.Count; 103return _list.Count;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (2)
122if (authSafeData.Count == 0) 128Pkcs12SafeContents[] contentsArray = new Pkcs12SafeContents[authSafeData.Count];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
351if (serializedBags.Count == 0) 361List<Pkcs12SafeBag> bags = new List<Pkcs12SafeBag>(serializedBags.Count); 363for (int i = 0; i < serializedBags.Count; i++)
System\Security\Cryptography\Pkcs\CmsRecipientCollection.cs (3)
41if (index < 0 || index >= _recipients.Count) 52return _recipients.Count; 60int indexOfNewItem = _recipients.Count;
System.Security.Principal.Windows (7)
System\Security\Principal\IRCollection.cs (7)
57return _identities.Count; 161if (Identities.Count == 0) 174for (int i = 0; i < Identities.Count; i++) 232Result = new IdentityReferenceCollection(Identities.Count); 234for (int i = 0; i < Identities.Count; i++) 325Result = new IdentityReferenceCollection(Identities.Count); 327for (int i = 0; i < Identities.Count; i++)
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 (84)
Internals\System\Runtime\Fx.cs (1)
255if (types.Count != 0)
Internals\System\Runtime\InputQueue.cs (2)
770if (_readerQueue.Count == 0 && _waiterList.Count == 0) 790if (_waiterList.Count > 0)
Internals\System\Xml\XmlMtomWriter.cs (3)
281_contentID = GenerateUriForMimePart((_mimeParts == null) ? 1 : _mimeParts.Count + 1); 299_contentID = GenerateUriForMimePart((_mimeParts == null) ? 1 : _mimeParts.Count + 1); 327_contentID = GenerateUriForMimePart((_mimeParts == null) ? 1 : _mimeParts.Count + 1);
System\IdentityModel\Tokens\KeyInfoSerializer.cs (10)
83for (int i = 0; i < _serializerEntries.Count; ++i) 135for (int i = 0; i < _keyIdentifierEntries.Count; i++) 174for (int i = 0; i < _keyIdentifierEntries.Count; ++i) 189for (int i = 0; i < _keyIdentifierEntries.Count; ++i) 228for (int i = 0; i < _keyIdentifierClauseEntries.Count; i++) 242for (int i = 0; i < _keyIdentifierClauseEntries.Count; i++) 271for (int i = 0; i < _keyIdentifierClauseEntries.Count; ++i) 286for (int i = 0; i < _keyIdentifierClauseEntries.Count; ++i) 339for (int i = 0; i < _tokenEntries.Count; i++) 356for (int i = 0; i < _tokenEntries.Count; i++)
System\IdentityModel\Tokens\SecurityKeyIdentifier.cs (2)
59get { return _clauses.Count; } 128for (int i = 0; i < _clauses.Count; i++)
System\ServiceModel\Channels\BinaryMessageEncoder.cs (1)
952get { return _bytes.Count; }
System\ServiceModel\Channels\RequestChannel.cs (2)
105if (_outstandingRequests.Count > 0) 107requests = new IRequestBase[_outstandingRequests.Count];
System\ServiceModel\Channels\ServiceChannelFactory.cs (7)
226channel = (_channelsList.Count > 0) ? _channelsList[_channelsList.Count - 1] : null; 236channel = (_channelsList.Count > 0) ? _channelsList[_channelsList.Count - 1] : null; 250count = _channelsList.Count; 268for (int index = 0; index < _channelsList.Count; index++) 404count = _channelsList.Count;
System\ServiceModel\Channels\TransmissionStrategy.cs (3)
361if (_retransmissionWindow.Count == 0) 369while (_retransmissionWindow.Count > 0) 671send = (_retransmissionWindow.Count == 0);
System\ServiceModel\Description\ServiceReflector.cs (1)
638if (types.Count == 0)
System\ServiceModel\Description\TypeLoader.cs (3)
728for (int i = 0; i < types.Count; i++) 780for (int i = 0; i < types.Count; i++) 1392for (int i = 0; i < contractMembers.Count; i++)
System\ServiceModel\Description\XmlSerializerOperationBehavior.cs (7)
892int[] uniqueIndexes = new int[_mappings.Count]; 893for (int srcIndex = 0; srcIndex < _mappings.Count; srcIndex++) 900uniqueIndex = uniqueMappings.Count - 1; 905if (uniqueMappings.Count == _mappings.Count) 910XmlSerializer[] serializers = new XmlSerializer[_mappings.Count]; 911for (int i = 0; i < _mappings.Count; i++)
System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (2)
573if (_timedOutRequests != null && _timedOutRequests.Count > 0) 577if (_timedOutRequests != null && _timedOutRequests.Count > 0)
System\ServiceModel\Dispatcher\EndpointAddressProcessor.cs (2)
76if (attrSet.Count > 0) 79for (int i = 0; i < attrSet.Count; ++i)
System\ServiceModel\Dispatcher\EndpointDispatcherTable.cs (1)
34if (_cachedEndpoints.Count < optimizationThreshold)
System\ServiceModel\Dispatcher\SynchronizedChannelCollection.cs (1)
52for (int i = 0; i < items.Count; i++)
System\ServiceModel\ExtensionCollection.cs (1)
85for (int i = 0; i < items.Count; i++)
System\ServiceModel\Security\MessagePartSpecification.cs (9)
41get { return _headerTypes != null && _headerTypes.Count > 0; } 107if (headerTypes != null && headerTypes.Count > 0) 111_headerTypes = new List<XmlQualifiedName>(headerTypes.Count); 114for (int i = 0; i < headerTypes.Count; i++) 131List<XmlQualifiedName> noDuplicates = new List<XmlQualifiedName>(_headerTypes.Count); 132for (int i = 0; i < _headerTypes.Count; i++) 138for (int j = 0; j < noDuplicates.Count; j++) 215for (int i = 0; i < _headerTypes.Count; i++) 241if (_headerTypes != null && _headerTypes.Count > 0)
System\ServiceModel\Security\ReceiveSecurityHeader.cs (1)
502if (_supportingTokenTrackers != null && _supportingTokenTrackers.Count > 0)
System\ServiceModel\Security\WSSecurityTokenSerializer.cs (11)
139for (int i = 0; i < _serializerEntries.Count; ++i) 190for (int i = 0; i < _tokenEntries.Count; i++) 204for (int i = 0; i < _tokenEntries.Count; i++) 228for (int i = 0; i < _tokenEntries.Count; i++) 243for (int i = 0; i < _tokenEntries.Count; i++) 345for (int i = 0; i < _tokenEntries.Count; i++) 362for (int i = 0; i < _tokenEntries.Count; i++) 403for (int i = 0; i < _tokenEntries.Count; i++) 526for (int i = 0; i < _dictionaryStrings.Count; ++i) 540for (int i = 0; i < _dictionaryStrings.Count; ++i) 559for (int i = 0; i < _dictionaryStrings.Count; ++i)
System\ServiceModel\Security\WSTrust.cs (1)
405if (rstrCollection.Count == 0)
System\ServiceModel\SynchronizedCollection.cs (9)
57get { lock (_sync) { return Items.Count; } } 80if (index < 0 || index >= Items.Count) 83SRP.Format(SRP.ValueMustBeInRange, 0, Items.Count - 1))); 95int index = Items.Count; 144if (index < 0 || index > Items.Count) 147SRP.Format(SRP.ValueMustBeInRange, 0, Items.Count))); 156int count = Items.Count; 187if (index < 0 || index >= Items.Count) 190SRP.Format(SRP.ValueMustBeInRange, 0, Items.Count - 1)));
System\ServiceModel\SynchronizedKeyedCollection.cs (3)
78for (int i = 0; i < Items.Count; i++) 170for (int i = 0; i < Items.Count; i++) 251for (int i = 0; i < Items.Count; i++)
System\ServiceModel\XmlBuffer.cs (1)
75get { return _sections.Count; }
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.Speech (46)
Internal\GrammarBuilding\BuilderElements.cs (3)
34if (refObj.Count != Count || refObj.Items.Count != Items.Count) 40for (int i = 0; i < Items.Count; i++)
Internal\SeekableReadStream.cs (5)
98if (value < _buffer.Count) 109long bytesToReadLong = value - _buffer.Count; 146if (_virtualPosition < _buffer.Count) 149int toCopy = (int)(_buffer.Count - _virtualPosition); 159if (!_cacheDataForSeeking && _virtualPosition >= _buffer.Count)
Internal\SrgsCompiler\BackEnd.cs (5)
164for (int i = _tags.Count - 1; i >= 0; i--) 538while (CloneStack.Count > 0) 821int previousCfgLastRules = _rules.Count; 1038header.cRules = _rules.Count; 1040ulOffset += (uint)(_rules.Count * Marshal.SizeOf<CfgRule>());
Internal\SrgsCompiler\CustomGrammar.cs (1)
34if (_rules.Count == 0)
Internal\SrgsCompiler\GrammarElement.cs (1)
87if (_undefRules.Count > 0)
Internal\SrgsCompiler\Graph.cs (2)
842if (identicalWords.Count >= 2) 859if (identicalWords.Count >= 2)
Internal\SrgsCompiler\State.cs (3)
58Arc? lastArc = outArcs.Count > 0 ? outArcs[outArcs.Count - 1] : null; 63uint nextAvailableArc = (uint)outArcs.Count + iArcOffset;
Internal\StringBlob.cs (1)
60System.Diagnostics.Debug.Assert(_strings.Count == _refStrings.Count);
Internal\Synthesis\AudioDeviceOut.cs (6)
113if (_queueIn.Count != 0) 174_queueIn.RemoveAt(_queueIn.Count - 1); 235if (_queueIn.Count > 0) 250if (_queueIn.Count == 0) 360while (_queueIn.Count > 0) 380if (_queueIn.Count == 0)
Internal\Synthesis\ConvertTextFrag.cs (1)
18for (int iFrag = ssmlFrags.Count - 1; iFrag >= 0; iFrag--)
Internal\Synthesis\SpeakInfo.cs (1)
71if (_listSeg.Count > 0)
Internal\Synthesis\SSmlParser.cs (8)
226if (extraAttributes != null && extraAttributes.Count > 0) 287if (extraAttributes != null && extraAttributes.Count > 0) 1555if (points.Count == 0) 1567if (points[points.Count - 1].Start > timePosition.Number) 1585if (points.Count < 1) 1591if (!points[points.Count - 1].Start.Equals(1.0f)) 1593points.Add(new ContourPoint(1, points[points.Count - 1].Change, points[points.Count - 1].ChangeType));
Internal\Synthesis\TextWriterEngine.cs (1)
36if (fNewCulture || !string.IsNullOrEmpty(_pexmlPrefix) || extraNamespace.Count > 0)
Internal\Synthesis\TTSVoice.cs (1)
48for (int i = _lexicons.Count - 1; i >= 0; i--)
Internal\Synthesis\VoiceSynthesis.cs (6)
58if (s_allVoices.Count == 0) 66_installedVoices = new List<InstalledVoice>(s_allVoices.Count); 1127while (voice == null && _installedVoices.Count > 0) 1192for (int i = tokens.Count - 1; i >= 0; i--) 1201for (; voice == null && tokens.Count > 0;) 1234for (int iToken = 0; iToken < tokensInfo.Count; iToken++)
Synthesis\PromptBuilder.cs (1)
824return _elements.Count == 0;
System.Text.Json (38)
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (5)
118for (int i = 0; i < nodes.Count; i++) 131var adjacencyRow = new bool[Math.Max(nodes.Count, count)]; 139index = nodes.Count; 161var sortedNodes = new T[nodes.Count]; 170for (int i = 0; i < adjacency.Count; i++)
System\Text\Json\Nodes\JsonArray.cs (10)
87_list = new List<JsonNode?>(list.Count) 90for (int i = 0; i < list.Count; i++) 111if (currentList.Count != otherList.Count) 116for (int i = 0; i < currentList.Count; i++) 153for (int i = 0; i < list.Count; i++) 174for (int i = 0; i < list.Count; i++) 361DebugViewItem[] properties = new DebugViewItem[_node.List.Count]; 363for (int i = 0; i < _node.List.Count; i++) 399return $"JsonArray[{jsonArray.List.Count}]";
System\Text\Json\Nodes\JsonArray.IList.cs (3)
14public int Count => List.Count; 42for (int i = 0; i < list.Count; i++) 168if (list.Count - index < count)
System\Text\Json\Schema\JsonSchemaExporter.cs (7)
104List<JsonSchema>? anyOf = new(derivedTypes.Count); 127state.PushSchemaNode(anyOf.Count.ToString(CultureInfo.InvariantCulture)); 140if (anyOf.Count == 0) 373state.PushSchemaNode(unionAnyOf.Count.ToString(CultureInfo.InvariantCulture)); 382if (unionAnyOf.Count == 0) 524public int CurrentDepth => _currentPath.Count; 541_currentPath.RemoveAt(_currentPath.Count - 1);
System\Text\Json\Serialization\ConfigurationList.cs (1)
46public int Count => _list.Count;
System\Text\Json\Serialization\Converters\Collection\ListOfTConverter.cs (2)
47for (; index < list.Count; index++) 54for (; index < list.Count; index++)
System\Text\Json\Serialization\Converters\FSharp\FSharpMapConverter.cs (1)
47int totalItemsAdded = listToConvert.Count;
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
674Debug.Assert(conflictingFields.Count > 0);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (1)
375if (matchingBases.Count == 0)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (4)
51if (_caseEntries.Count == 0) 145Debug.Assert(_caseEntries.Count > 0); 183Type[] caseTypes = new Type[_caseEntries.Count]; 184for (int i = 0; i < _caseEntries.Count; i++)
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverChain.cs (1)
66if (_list.Count > 0)
System\Text\Json\Serialization\Metadata\PropertyRefCacheBuilder.cs (2)
22public int Count => _propertyRefs.Count; 23public int TotalCount => OriginalCache.Length + _propertyRefs.Count;
System.Text.Json.SourceGeneration (29)
JsonSourceGenerator.Parser.cs (24)
137Debug.Assert(rootSerializableTypes.Count > 0); 224Debug.Assert(typeDeclarations?.Count > 0); 839if (unionCaseTypes.Count > 0 && HasCompatibleUnionValueProperty(namedUnionType)) 843var resolvedUnionCaseSpecs = new List<UnionCaseSpec>(unionCaseTypes.Count); 844for (int i = 0; i < unionCaseTypes.Count; i++) 881if (resolvedUnionCaseSpecs.Count > 0) 1180hasClosedDerivedTypes = closedDerivedTypes is { Count: > 0 }; 1201derivedTypes is not { Count: > 0 } && 1204if (!optedOutOfPolymorphism && (hasPolymorphicAttribute || derivedTypes is { Count: > 0 })) 1376if (matchingBases.Count == 0) 1422var substitution = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(requiredParams.Count, SymbolEqualityComparer.Default); 1490ITypeSymbol[] closedArgs = new ITypeSymbol[requiredParams.Count]; 1491for (int i = 0; i < requiredParams.Count; i++) 1630if (caseTypes.Count > 1 && !hasUnionTypeClassifierSpecified) 1676var result = new List<(ITypeSymbol, bool)>(sorted.Count); 1698bool[] isSwitchArm = new bool[caseTypes.Count]; 1701for (int i = 0; i < caseTypes.Count; i++) 1735if (caseTypes.Count <= 1) 1744Debug.Assert(sortedTypesWithRoot.Length == caseTypes.Count + 1); 1747var sortedCaseTypes = new List<ITypeSymbol>(caseTypes.Count); 1758ITypeSymbol[] rootChildren = new ITypeSymbol[caseTypes.Count]; 1826if (kvp.Value.Count > 1) 2294AddPropertyWithConflictResolution(propertySpec, memberInfo, propertyIndex: properties.Count, ref state); 2331if (state.AddedProperties.TryAdd(propertySpec.EffectiveJsonPropertyName, (propertySpec, memberInfo, state.Properties.Count)))
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (5)
118for (int i = 0; i < nodes.Count; i++) 131var adjacencyRow = new bool[Math.Max(nodes.Count, count)]; 139index = nodes.Count; 161var sortedNodes = new T[nodes.Count]; 170for (int i = 0; i < adjacency.Count; i++)
System.Text.RegularExpressions (122)
System\Text\RegularExpressions\MatchCollection.cs (3)
109return _matches.Count; 192if (_matches.Count > i) 215} while (_matches.Count <= i);
System\Text\RegularExpressions\Regex.Cache.cs (12)
110else if (value < s_cacheList.Count) 118for (int i = value; i < s_cacheList.Count; i++) 122s_cacheList.RemoveRange(value, s_cacheList.Count - value); 124Debug.Assert(s_cacheList.Count == value); 219Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 232if (s_cacheList.Count == s_maxCacheSize) 241itemsToExamine = s_cacheList.Count; 256int minListIndex = useRandom ? s_random.Next(s_cacheList.Count) : 0; 262int nextIndex = useRandom ? s_random.Next(s_cacheList.Count) : i; 276s_cacheList.RemoveAt(s_cacheList.Count - 1); 291Debug.Assert(s_cacheList.Count <= s_maxCacheSize); 292Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count);
System\Text\RegularExpressions\Regex.Debug.cs (2)
56for (int attempt = 0; attempt < MaxAttempts && results.Count < k; attempt++) 58foreach (string input in srmFactory._matcher.SampleMatches(k - results.Count, randomseed + attempt))
System\Text\RegularExpressions\Regex.Split.cs (3)
316if (state.results.Count == 0) 344if (state.results.Count == 0) 350state.results.Reverse(0, state.results.Count);
System\Text\RegularExpressions\RegexCharClass.cs (10)
246int ccRangeCount = cc._rangelist?.Count ?? 0; 353int count = rangeList.Count; 1651for (int i = 0; i < rangelist.Count; i++) 1691if (rangelist.Count > 1) 1703if (i == rangelist.Count || last == LastChar) 1736rangelist.RemoveRange(j, rangelist.Count - j); 1746if (rangelist.Count == 2) 1759else if (rangelist.Count == 1) 1787rangelist.Count == 1 && rangelist[0].First == 0 && rangelist[0].Last == LastChar) 1803rangelist.Count == 2 && rangelist[0].First == 0 && rangelist[0].Last + 2 == rangelist[1].First && rangelist[1].Last == LastChar)
System\Text\RegularExpressions\RegexCompiler.cs (4)
869Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 874int setsToUse = Math.Min(sets.Count, MaxSets); 1200Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 6517int index = list.Count;
System\Text\RegularExpressions\RegexFindOptimizations.cs (11)
187Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 239fixedDistanceSets.Count == 1 && 251if (fixedDistanceSets.Count > MaxSetsToUse) 253fixedDistanceSets.RemoveRange(MaxSetsToUse, fixedDistanceSets.Count - MaxSetsToUse); 258FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].Distance == 0) ? 261_asciiLookups = new uint[fixedDistanceSets.Count][]; 344if (fixedDistanceSets.Count >= 2) 354for (int i = 0; i < fixedDistanceSets.Count + 1; i++) 356char[]? chars = i < fixedDistanceSets.Count ? fixedDistanceSets[i].Chars : null; 767for (int i = 1; i < sets.Count; i++) 795for (int i = 1; i < sets.Count; i++)
System\Text\RegularExpressions\RegexNode.cs (27)
754Debug.Assert(branches is not null && branches.Count != 0); 768for (int i = 1; i < branches.Count - 1; i++) 772branches.RemoveRange(i + 1, branches.Count - (i + 1)); 791for (int start = 0; start < branches.Count; start++) 802while (endExclusive < branches.Count && branches[endExclusive].FindBranchOneOrMultiStart() is not null) 1134for (i = 0, j = 0; i < children.Count; i++, j++) 1147for (int k = 0; k < atChildren.Count; k++) 1242Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1251for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1278for (; endingIndex < children.Count; endingIndex++) 1347while (i < children.Count) 1369children.RemoveRange(j, children.Count - j); 1385Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1402for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1423for (; endingIndex < children.Count; endingIndex++) 1792for (i = 0, j = 0; i < children.Count; i++, j++) 1806for (int k = 0; k < atChildren.Count; k++) 1873while (next < children.Count) 2037if (nextSave < children.Count) 2039children.RemoveRange(nextSave, children.Count - nextSave); 2713if (currentIndex + 1 < peers.Count) 2810if ((uint)index < (uint)peers.Count) 3394return children.Count; 3474sb.Append(' ', stack.Count * 2).Append(curNode.Describe()).AppendLine(); 3478if (stack.Count == 0) 3483curChild = stack[stack.Count - 1]; 3484stack.RemoveAt(stack.Count - 1);
System\Text\RegularExpressions\RegexParser.cs (5)
639if (parents is { Count: > 0 }) 641RegexCharClass? parent = parents[parents.Count - 1]; 642parents.RemoveAt(parents.Count - 1); 2021for (int i = 0; i < _capnamelist!.Count; i++) 2083next = (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)
155for (int i = 0; i < nodes.Count; i++) 170for (int i = nodes.Count - 1; i >= 0; --i) 338SymbolicRegexNode<TNewSet>[] reverseTransformed = new SymbolicRegexNode<TNewSet>[concatElements.Count];
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (1)
124if (possibleEndings.Count > 0)
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (12)
541int firstRightElem = elems.Count; 548for (int i = 0; i < elems.Count; i++) 566for (int i = elems.Count - 1; i >= 0; i--) 1463alternativesAndEffects.Add((this, currentEffects.Count > 0 ? 1475int oldEffectCount = currentEffects.Count; 1480currentEffects.RemoveRange(oldEffectCount, currentEffects.Count - oldEffectCount); 1489int oldAlternativesCount = alternativesAndEffects.Count; 1491for (int i = oldAlternativesCount; i < alternativesAndEffects.Count; i++) 1512alternativesAndEffects.Add((builder.Epsilon, currentEffects.Count > 0 ? 1519alternativesAndEffects.Add((builder.Epsilon, currentEffects.Count > 0 ? 1527int oldAlternativesCount = alternativesAndEffects.Count; 1529for (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 (82)
RegexGenerator.Emitter.cs (9)
702int uncheckedStart = lines.Count; 703lines.Add(excludedAsciiChars.Count == 128 ? $" int i = span.IndexOfAnyExceptInRange('\\0', '\\u007f');" : // no ASCII is in the set 704excludedAsciiChars.Count == 0 ? $" int i = 0;" : // all ASCII is in the set 708if (excludedAsciiChars.Count is not (0 or 128)) 738for (int i = uncheckedStart + 2; i < lines.Count - 1; i++) 742lines.Insert(lines.Count - 1, " }"); 1278Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1283int setsToUse = Math.Min(sets.Count, MaxSets); 1466Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 });
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (10)
246int ccRangeCount = cc._rangelist?.Count ?? 0; 353int count = rangeList.Count; 1651for (int i = 0; i < rangelist.Count; i++) 1691if (rangelist.Count > 1) 1703if (i == rangelist.Count || last == LastChar) 1736rangelist.RemoveRange(j, rangelist.Count - j); 1746if (rangelist.Count == 2) 1759else if (rangelist.Count == 1) 1787rangelist.Count == 1 && rangelist[0].First == 0 && rangelist[0].Last == LastChar) 1803rangelist.Count == 2 && rangelist[0].First == 0 && rangelist[0].Last + 2 == rangelist[1].First && rangelist[1].Last == LastChar)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (9)
187Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 239fixedDistanceSets.Count == 1 && 251if (fixedDistanceSets.Count > MaxSetsToUse) 253fixedDistanceSets.RemoveRange(MaxSetsToUse, fixedDistanceSets.Count - MaxSetsToUse); 258FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].Distance == 0) ? 261_asciiLookups = new uint[fixedDistanceSets.Count][]; 344if (fixedDistanceSets.Count >= 2) 354for (int i = 0; i < fixedDistanceSets.Count + 1; i++) 356char[]? chars = i < fixedDistanceSets.Count ? fixedDistanceSets[i].Chars : null;
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (27)
754Debug.Assert(branches is not null && branches.Count != 0); 768for (int i = 1; i < branches.Count - 1; i++) 772branches.RemoveRange(i + 1, branches.Count - (i + 1)); 791for (int start = 0; start < branches.Count; start++) 802while (endExclusive < branches.Count && branches[endExclusive].FindBranchOneOrMultiStart() is not null) 1134for (i = 0, j = 0; i < children.Count; i++, j++) 1147for (int k = 0; k < atChildren.Count; k++) 1242Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1251for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1278for (; endingIndex < children.Count; endingIndex++) 1347while (i < children.Count) 1369children.RemoveRange(j, children.Count - j); 1385Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1402for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) 1423for (; endingIndex < children.Count; endingIndex++) 1792for (i = 0, j = 0; i < children.Count; i++, j++) 1806for (int k = 0; k < atChildren.Count; k++) 1873while (next < children.Count) 2037if (nextSave < children.Count) 2039children.RemoveRange(nextSave, children.Count - nextSave); 2713if (currentIndex + 1 < peers.Count) 2810if ((uint)index < (uint)peers.Count) 3394return children.Count; 3474sb.Append(' ', stack.Count * 2).Append(curNode.Describe()).AppendLine(); 3478if (stack.Count == 0) 3483curChild = stack[stack.Count - 1]; 3484stack.RemoveAt(stack.Count - 1);
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (5)
639if (parents is { Count: > 0 }) 641RegexCharClass? parent = parents[parents.Count - 1]; 642parents.RemoveAt(parents.Count - 1); 2021for (int i = 0; i < _capnamelist!.Count; i++) 2083next = (k == oldcapnamelist.Count) ? -1 : (int)_capnames[oldcapnamelist[k]]!;
src\runtime\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)
UpgradeToGeneratedRegexCodeFixer.cs (1)
546if (callSites.Count <= 1)
System.Threading.Tasks.Dataflow (22)
Base\DataflowBlock.cs (1)
2440if (_tempSendAsyncTaskList != null && _tempSendAsyncTaskList.Count > 0)
Blocks\BatchBlock.cs (11)
801while (reserved.Count < _batchSize) 816Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch."); 819if (reserved.Count > 0) 849if (shouldProceedToConsume && (allowFewerThanBatchSize || reserved.Count == _batchSize)) 915while (reserved.Count < itemCountNeededToCompleteBatch) 928Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch."); 931if (reserved.Count > 0) 985for (int i = 0; i < reserved.Count; i++) 1013if (_boundingState != null) _boundingState.CurrentCount += reserved.Count; 1037for (int i = 0; i < reserved.Count; i++) 1089for (int i = 0; i < reserved.Count; i++)
Blocks\BatchedJoinBlock.cs (2)
550internal int Count { get { return _messages.Count; } } 628$"{Common.GetNameForDebugger(this)} InputCount = {_messages.Count}";
Blocks\TransformManyBlock.cs (1)
407itemCount = itemCopy.Count;
Blocks\TransformManyBlock.netstandard21.cs (1)
161itemCount = itemCopy.Count;
Internal\QueuedMap.cs (4)
78Debug.Assert(0 <= _freeIndex && _freeIndex < _storage.Count, "Index is out of range."); 86newIndex = _storage.Count; 122Debug.Assert(0 <= _headIndex && _headIndex < _storage.Count, "Head is out of range."); 140Debug.Assert(0 <= index && index < _storage.Count, "Index is out of range.");
Internal\SourceCore.cs (2)
340countReceived = tmpList.Count; 420for (int i = 0; i < itemsAsList.Count; i++)
System.Windows.Controls.Ribbon (35)
Microsoft\Windows\Automation\Peers\RibbonAutomationPeer.cs (2)
182if (ribbonTabs != null && ribbonTabs.Count > 0) 188for (int i=0; i<ribbonTabs.Count; i++)
Microsoft\Windows\Automation\Peers\RibbonGalleryAutomationPeer.cs (1)
182if (selectedProviders.Count != 0)
Microsoft\Windows\Controls\KeyTipService.cs (9)
845if (_currentActiveKeyTipElements.Count > 0) 992activeKeyTipElements.Count == 0) 999int currentActiveCount = _currentActiveKeyTipElements.Count; 1000int newActiveCount = activeKeyTipElements.Count; 1507current._cachedKeyTipControls.Count > 0) 1510int count = current._cachedKeyTipControls.Count; 1626for (int i = 0; i < handlerList.Count; i++) 1647for (int i = 0; i < handlerList.Count; i++) 1672for (int i = 0; i < handlerList.Count; i++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupItemsPanel.cs (5)
60double starLayoutCombinationCount = _starLayoutCombinations.Count; 166if (starChildIndices.Count > 0) 177int starLayoutIndex = _starLayoutCombinations.Count - 1; 268int starLayoutCombinationCount = _starLayoutCombinations.Count; 340if (columnStarChildren != null && columnStarChildren.Count > 0 && starLayoutIndex >= 0)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupsPanel.cs (3)
438int elementCount = starInfoList.Count; 474Debug.Assert(index >= 0 && index < starInfoList.Count); 501Debug.Assert(distributionCount > 0 && distributionCount <= starInfoList.Count);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonMenuItemsPanel.cs (2)
176if (InvalidateRegisteredLayoutProvidersList.Count > 0) 178for (int i = 0; i < InvalidateRegisteredLayoutProvidersList.Count; i++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (4)
180for (int i = 0; i < generatedItems.Count; i++) 305Debug.Assert(GeneratedChildren.Count > InternalChildren.Count); 306int numItemsExpectedInOverflowPanel = GeneratedChildren.Count - InternalChildren.Count; 324for (int k = InternalChildren.Count; k < GeneratedChildren.Count; k++)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (2)
506int sizeCount = elementSizes.Count; 561int sizeCount = desiredPaddings.Count;
Microsoft\Windows\Controls\TextSearchInternal.cs (7)
118if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 259if (_charsEntered.Count > 0 && string.Compare(_charsEntered[_charsEntered.Count - 1], nextChar, true, GetCulture(_attachedTo)) == 0) 323if (_charsEntered.Count > 0) 325string lastChar = _charsEntered[_charsEntered.Count - 1]; 328_charsEntered.RemoveAt(_charsEntered.Count - 1);
System.Windows.Forms (272)
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (1)
594if (oleControls.Count > 0)
System\Windows\Forms\ActiveX\AxHost.AxPropertyDescriptor.cs (1)
252if (_updateAttributes.Count == 0)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
619_accelCount = (short)mnemonicList.Count;
System\Windows\Forms\Application.ThreadContext.cs (8)
134if (_parkingWindows.Count == 0) 143Debug.Assert(_parkingWindows.Count == 1, "parkingWindows count can not be > 1 for legacy OS/target framework versions"); 211if (_messageFilters.Count > 0 && filter is IMessageModifyAndFilter) 345if (_parkingWindows.Count != 0) 358for (int i = 0; i < _parkingWindows.Count; i++) 850if (_messageFilters.Count > 0) 862if (_messageFilterSnapshot is not null && _messageFilterSnapshot.Count != 0) 865int count = _messageFilterSnapshot.Count;
System\Windows\Forms\AutoCompleteStringCollection.cs (3)
42public int Count => _data.Count; 92if (nonNullItems.Count <= 0) 137ArgumentOutOfRangeException.ThrowIfGreaterThan(index, _data.Count);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (5)
169if (attributes.Count != baseCount) 171_baseAttributes = new Attribute[attributes.Count]; 239if (attributeList.Count > 0) 244for (int i = 0; i < attributeList.Count; i++) 261Attribute[] temp = new Attribute[newAttributes.Count];
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (7)
122if (handles.Count > 0) 124ITypeInfo*[] typeInfos = new ITypeInfo*[handles.Count]; 125for (int i = 0; i < handles.Count; i++) 277Com2PropertyDescriptor[] temp2 = new Com2PropertyDescriptor[propList.Count]; 779if (strings.Count > 0) 789if (vars.Count > 0 && vars[0] is { } var) 795for (int i = 0; i < strings.Count; i++)
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.cs (1)
255return attributes.Count == 0 ? new(s_staticAttributes) : new(attributes.ToArray());
System\Windows\Forms\Control.cs (7)
5697holders.Add(new ControlTabOrderHolder(holders.Count, tabIndex, ctl)); 5702int[] indexes = new int[holders.Count]; 5703for (int i = 0; i < holders.Count; i++) 5725holders.Add(new ControlTabOrderHolder(holders.Count, c.TabIndex, c)); 5731Control[] controls = new Control[holders.Count]; 5732for (int i = 0; i < holders.Count; i++) 7560for (int i = _state.LayoutRequests.Count - 1; i >= 0; 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)
169get => _links.Count == 0 273get => _links.Count != 0 && _links[0].Visited; 281if (_links.Count == 0) 604if (_links is not null && _links.Count == 1) 668if (_links is null || _links.Count != 1 || Text is null) 855for (int i = 0; i < _links.Count; i++) 889for (int i = 0; i < _links.Count; i++) 1206for (int i = 0; i < _links.Count; i++) 1461for (int i = 0; i < _links.Count; i++) 1533return focusIndex < 0 || focusIndex >= _links.Count ? -1 : focusIndex; 1565if (directed && _links.Count > 0) 1588newFocus = GetNextLinkIndex(_links.Count, forward); 1616if (_links.Count == 1) 1656for (int i = 0; i < _links.Count; i++) 1677for (int x = 0; x < _links.Count; x++) 1685for (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) 2233if (newItems.Count > 0) 5610s += $", Items.Count: {_listViewItems.Count}"; 5611if (_listViewItems.Count > 0)
System\Windows\Forms\Controls\ListView\ListView.SelectedIndexCollection.cs (1)
38return _owner._savedSelectedItems.Count;
System\Windows\Forms\Controls\ListView\ListView.SelectedListViewItemCollection.cs (3)
63ListViewItem[] cloned = new ListViewItem[_owner._savedSelectedItems.Count]; 64for (int i = 0; i < _owner._savedSelectedItems.Count; i++) 100return _owner._savedSelectedItems.Count;
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (4)
24public int Count => List.Count; 63for (int i = 0; i < _list.Count; i++) 84for (int i = 0; i < _list.Count; i++) 127_listView.InsertGroupInListView(List.Count, group);
System\Windows\Forms\Controls\ListView\ListViewGroupItemCollection.cs (1)
18public int Count => Items.Count;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (1)
239_owner._subItems.EnsureCapacity(_owner._subItems.Count + additionalCapacity);
System\Windows\Forms\Controls\Menus\MenuStrip.cs (1)
252if (m.Msg == (int)PInvokeCore.WM_MOUSEACTIVATE && (ActiveDropDowns.Count == 0))
System\Windows\Forms\Controls\Menus\MenuTimer.cs (1)
147if (toolStrip.IsDropDown && toolStrip.ActiveDropDowns.Count > 0)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (6)
1525int length = _annualBoldDates.Count; 1557for (int i = 0; i < _boldDates.Count; i++) 1576int length = _monthlyBoldDates.Count; 1895=> _annualBoldDates.Count > 0; 1898=> _boldDates.Count > 0; 1913=> _monthlyBoldDates.Count > 0;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (24)
1083if (showEvents && _tabs.Count > EventsTabIndex 1145if (selectedTab < _tabs.Count && (selectedTab == PropertiesTabIndex || _tabs[selectedTab].Button.Visible)) 1509for (int i = 0; i < _tabs.Count; i++) 1538tabIndex = _tabs.Count; 1552for (int i = 1; i < _tabs.Count; i++) 2114if (_tabs.Count > 1) 2213for (int i = 1; i < components.Length && tabClasses.Count > 0; i++) 2222for (int j = tabClasses.Count - 1; j >= 0; j--) 3513for (int i = 0; i < _tabs.Count; i++) 3576if (_tabs.Count == 0) 3593Debug.Assert(_tabs.Count > 0, "We don't have any tabs left!"); 3608Debug.Assert(_tabs.Count > 0, "Tab array destroyed!"); 3611ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(tabIndex, _tabs.Count); 3645for (int i = 0; i < _tabs.Count; i++) 3746Debug.Assert(_tabs.Count > 0, "No view tab buttons to select!"); 3812if (state >= (_tabs.Count * _viewSortButtons.Length)) 3818state = (_tabs.Count * _viewSortButtons.Length) - 1; 3945int count = buttonList.Count; 3965if (_tabs.Count > 1) 4019for (int j = 0; j < buttonList.Count; j++) 4036if (_tabs.Count > EventsTabIndex && _tabs[EventsTabIndex] is { } info && info.Tab is EventsTab) 4160if (_tabs.Count <= 1) 4168for (int i = 1; i < _tabs.Count; i++) 4183if (!GetFlag(Flags.PropertiesChanged) || _tabs.Count == 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyTabCollection.cs (3)
33return _ownerPropertyGrid._tabs.Count; 98if (_ownerPropertyGrid._tabs.Count > 0) 105_ownerPropertyGrid._tabs.Count);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiSelectRootGridEntry.PropertyMerger.cs (6)
33var entries = new MultiPropertyDescriptorGridEntry[commonProperties.Count]; 78var entries = new MultiPropertyDescriptorGridEntry[firstProperties.Count]; 93var firstPropertyDescriptors = new PropertyDescriptor[firstProperties.Count]; 94for (int i = 0; i < firstProperties.Count; i++) 101var entries = new MultiPropertyDescriptorGridEntry[properties.Count]; 313int length = sortedMergedEntries.Count;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (1)
269if (gridEntries.Count > 0)
System\Windows\Forms\Controls\TabControl\TabControl.cs (5)
731if (index == -1 || _tabPages.Count == 0) 804public int TabCount => _tabPages?.Count ?? 0; 1040for (int i = 0; i < _tabPages.Count; i++) 1069if (_tabPages.Count > 0) 1604if (index < _tabPages.Count)
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
686if (_associatedToolTips.Count == 1)
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
2876for (int i = paintBands.Count - 1; i >= 0; i--)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (3)
1069if (ActiveDropDowns.Count == 0) 1940int count = ActiveDropDowns.Count; 1952for (int i = 0; i < dropDowns.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (4)
224if (_inputFilterQueue is not null && _inputFilterQueue.Count > 0) 314int countDropDowns = _inputFilterQueue?.Count ?? 0; 361int countDropDowns = _inputFilterQueue?.Count ?? 0; 452if (!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)
186for (int i = 0; i < _items.Count; i++) 210for (int i = 0; i < _items.Count; i++) 226for (int i = 0; i < _items.Count; i++) 235for (int j = 0; j < _items.Count; j++) 260if (_items.Count == 0) 303for (int i = 0; i < _items.Count; i++) 312for (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)
3551for (int i = ownedForms.Count - 1; i >= 0; i--) 4866for (int i = ownedForms.Count - 1; i >= 0; i--) 4894for (int i = ownedForms.Count - 1; i >= 0; i--) 6754for (int i = ownedForms.Count - 1; i >= 0; i--) 6823for (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\SuspendPaintingScope.cs (2)
263if (exceptions.Count == 1) 268if (exceptions.Count > 1)
System.Windows.Forms.Design (145)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
287if (_originalItems is not null && _originalItems.Count > 0)
System\ComponentModel\Design\DesignerActionPanel.cs (10)
376for (int i = 0; i < _lines.Count; i++) 492while ((index < (_lineYPositions.Count - 1)) && (_lineYPositions[index + 1] <= originalClip.Top)) 498for (int i = index; i < _lineYPositions.Count; i++) 778for (int i = 0; i < _lines.Count; i++) 787for (int i = 0; i < _lines.Count; i++) 829for (int i = 0; i < categoryList.Count; i++) 852for (int i = 0; i < newLines.Count; i++) 857if (i < _lines.Count) 888for (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)
790if (exceptions.Count > 0) 1129List<IComponent> selectedComponents = new(_savedSelection.Count);
System\ComponentModel\Design\MenuCommandService.cs (9)
252verbCount += _globalVerbs.Count; 262for (int i = 0; i < _globalVerbs!.Count; i++) 266buildVerbs[key] = verbsOrder.Count - 1; 270if (designerActionVerbs.Count > 0) 272for (int i = 0; i < designerActionVerbs.Count; i++) 276buildVerbs[designerActionVerb.Text] = verbsOrder.Count - 1; 286buildVerbs[localVerb.Text] = verbsOrder.Count - 1; 293for (int i = 0; i < verbsOrder.Count; i++) 491if (commands.Count == 0)
System\ComponentModel\Design\ReferenceService.cs (5)
95if (_addedComponents is not null && _addedComponents.Count > 0) 107if (_removedComponents is not null && _removedComponents.Count > 0) 176int size = _references.Count; 269object[] references = new object[_references.Count]; 287List<object> results = new(_references.Count);
System\ComponentModel\Design\SelectionService.cs (8)
168internal IComponent? PrimarySelection => _selection?.Count > 0 ? _selection[0] : null; 217if (_selection.Count == 0) 221else if (_selection.Count == 1) 231for (int i = 0; i < _selection.Count; i++) 256int count = _selection.Count; 305int ISelectionService.SelectionCount => _selection?.Count ?? 0; 416IComponent[] selections = new IComponent[_selection.Count]; 467if (_selection?.Count > 0)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (1)
243if (_shimObjectNames.Count > 0)
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (1)
623if (arrayList.Count > 0)
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (1)
392if (oldEntry?.Dependencies is { Count: > 0 })
System\ComponentModel\Design\Serialization\StatementContext.cs (4)
59for (int idx = 0; idx < _table.Count; idx++) 96for (int idx = 0; idx < _table.Count; idx++) 217if (_position < 0 || _table._table is null || _position >= _table._table.Count) 238if (_table._table is not null && (_position + 1) < _table._table.Count)
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (9)
53public virtual bool IsEmpty => _events is null || _events.Count == 0; 143for (int i = startIndex + 1; i < _events!.Count; i++) 169for (int i = 0; i < _events.Count; i++) 176if (_events[i] is ChangeUndoEvent ce && ChangeEventsSymmetric(ce.ComponentChangingEventArgs, e) && i != _events.Count - 1) 214for (int idx = 0; idx < _changeEvents.Count; idx++) 288for (int idx = _events.Count - 1; idx >= 0; idx--) 303if (idx != _events.Count - 1 && changeEvt is not null) 438for (int idx = _events.Count - 1; idx >= 0; idx--) 488int count = _events.Count;
System\Windows\Forms\Design\BaseContextMenuStrip.cs (1)
111nParentControls = parentControls.Count;
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (1)
69if (s_adornerWindowList.Count == 0 && s_mouseHook is not null)
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (2)
63Debug.Assert(s_adornerWindowList.Count > 0, "No AdornerWindow available to create the mouse hook"); 66if (_mouseHookHandle != 0 || s_adornerWindowList.Count == 0)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (5)
144public Behavior? CurrentBehavior => _behaviorStack.Count > 0 ? _behaviorStack[0] : null; 339if (_behaviorStack.Count > 0) 342if ((index != -1) && (index < _behaviorStack.Count - 1)) 389if (_behaviorStack.Count == 0) 570return _behaviorStack.Count > 0 ? _behaviorStack[0] : g?.Behavior;
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (1)
237if (dragControls.Count > 0)
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (12)
275for (int i = 0; i < snapLines.Count; i++) 289for (int j = 0; j < targetSnapLines.Count; j++) 343for (int j = 0; j < tempLines.Count; j++) 411lines = new Line[tempLines.Count]; 526if (dragComponents is not null && dragComponents.Count > 0) 618_verticalDistances = new int[_verticalSnapLines.Count]; 619_horizontalDistances = new int[_horizontalSnapLines.Count]; 735_vertLines = new Line[_tempVertLines.Count]; 741_horzLines = new Line[_tempHorzLines.Count]; 904for (int i = 0; i < currentLines.Count; i++) 1104for (int i = 0; i < _targetHorizontalSnapLines.Count; i++) 1109for (int i = 0; i < _targetVerticalSnapLines.Count; i++)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (7)
94if (dragComponents is null || dragComponents.Count <= 0) 109_dragComponents = new DragComponent[dragComponents.Count]; 421for (int j = 0; j < temp.Count; j++) 512for (int i = 0; i < originalControls.Count; i++) 568for (int i = 0; i < originalControls.Count; i++) 686for (int i = 0; i < _dragObjects.Count; i++) 937for (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)
417_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)
1712List<ITreeDesigner> shorterList = designerChain.Count < parentDesignerChain.Count ? designerChain : parentDesignerChain; 1716if (shorterList.Count > 0 && longerList.Count > 0) 1718int shortIndex = Math.Max(0, shorterList.Count - 1); 1719int longIndex = Math.Max(0, longerList.Count - 1); 2110if (compsWithControlDesigners.Count > 0) 3230if (controls.Count == 0) 3367if (controls.Count > 1)
System\Windows\Forms\Design\ComponentTray.cs (8)
345if (_controls is null || _controls.Count <= 0) 905for (int i = 0; i < _controls.Count; i++) 911if (targetIndex >= 0 && targetIndex < _controls.Count) 922if (_controls.Count > 0) 924int targetIndex = (forward ? 0 : _controls.Count - 1); 1722if (_controls.Count > 1) 1753if (_controls.Count > 1) 1778if (_controls.Count > 1)
System\Windows\Forms\Design\ControlDesigner.cs (1)
1450if (dragControls.Count > 0)
System\Windows\Forms\Design\DataGridViewDesigner.cs (1)
676for (int i = 0; i < columnsToBeAdded.Count; i++)
System\Windows\Forms\Design\DesignerFrame.cs (2)
460for (int i = _overlayList.Count - 1; i >= 0; i--) 477for (int i = _overlayList.Count - 1; i >= 0; i--)
System\Windows\Forms\Design\DesignerUtils.cs (1)
778Debug.Assert(newObjects.Count == objects.Count, "Why is the count of the copied objects not the same?");
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (6)
338if (_dragControls.Count == 1) 349return string.Format(performCopy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, _dragControls.Count); 637for (int j = 0; j < tempList.Count; j++) 670for (int i = _dragControls.Count - 1; i >= 0; i--) 692for (int i = 0; i < originalControls.Count; i++) 795|| _commonSizes.Count == 0)
System\Windows\Forms\Design\GroupedContextMenuStrip.cs (1)
54if (Items.Count > 0 && items.Count > 0)
System\Windows\Forms\Design\ImageListDesigner.OriginalImageCollection.cs (2)
39return _items.Count; 149for (int i = 0; i < _items.Count; i++)
System\Windows\Forms\Design\MaskDesignerDialog.cs (3)
401for (int index = 0; index < _maskDescriptors.Count; index++) 424for (int selectedIndex = 0; selectedIndex < _maskDescriptors.Count; selectedIndex++) 493_maskDescriptors.RemoveAt(_maskDescriptors.Count - 1);
System\Windows\Forms\Design\NavigationalTableLayoutPanel.cs (3)
37for (int i = 0; i < radioButtons.Count; i++) 45focusIndex = i == RadioButtons.Count - 1 ? 0 : i + 1; 49focusIndex = i == 0 ? RadioButtons.Count - 1 : i - 1;
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
1261if (selectedControls is null || selectedControls.Count == 0) 1881if (selection.Count > 0)
System\Windows\Forms\Design\SelectionUIService.cs (1)
1002if (list.Count == 0)
System\Windows\Forms\Design\StyleEditorForm.cs (1)
1050if (_deleteList.Count > 0)
System\Windows\Forms\Design\TabControlDesigner.cs (1)
492for (int i = 0; i < dragControls.Count; i++)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (2)
1277(_localDragControl is not null && _dragComponents.Count > 1) || 1880if (deleteList.Count > 0)
System\Windows\Forms\Design\TabOrder.cs (2)
650_tabGlyphs = new Rectangle[_tabControls.Count]; 801if (_tabComplete.Count == _tabControls.Count)
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1859if (dragComponents.Count == 1) 1871transDesc = string.Format(copy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, dragComponents.Count);
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
307t_customToolStripItemCount = creatableTypes.Count;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (2)
658if (dragComponents.Count == 1) 670transDesc = string.Format(copy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, dragComponents.Count);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
2646if (dragComponents.Count == 1) 2658transDesc = string.Format(copy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, dragComponents.Count);
System.Windows.Forms.Primitives (6)
System\Collections\Generic\WeakRefCollection.cs (2)
62for (int i = 0; i < _list.Count; i++) 89public int Count => _list.Count;
System\Windows\Forms\Automation\UiaTextProvider.cs (3)
83if (rectArray is null || rectArray.Count == 0) 88SafeArrayScope<double> result = new((uint)(rectArray.Count * 4)); 90for (int i = 0; i < rectArray.Count; i++)
System\Windows\Forms\NonNullCollection.cs (1)
32public int Count => _list.Count;
System.Windows.Input.Manipulations (4)
System\Windows\Input\Manipulations\ManipulationSequence.cs (4)
394(addedManipulatorList == null || addedManipulatorList.Count == 0) && 419if (addedManipulatorList != null && addedManipulatorList.Count > 0) 437if ((addedManipulatorList != null && addedManipulatorList.Count > 0) || 470if (addedManipulatorList != null && addedManipulatorList.Count > 0)
System.Xaml (75)
System\Xaml\Context\NameFixupGraph.cs (5)
209if (token.NeededNames.Count == 0) 359while (markupExtensionTokens.Count > 0) 363while (i < markupExtensionTokens.Count) 374for (int j = dependencies.Count - 1; j >= 0; j--) 408for (int j = dependencies.Count - 1; j >= 0; j--)
System\Xaml\Context\ObjectWriterContext.cs (3)
175return (valueList.Count == 0) ? null : valueList[0]; 181return (valueList.Count == 0) ? null : valueList[0]; 405if (stopAfterFirst && retList.Count > 0)
System\Xaml\Context\ServiceProviderContext.cs (1)
295if (token.CanAssignDirectly && token.NeededNames.Count != 1)
System\Xaml\Context\XamlContext.cs (1)
281typeArgs = new XamlType[typeNames.Count];
System\Xaml\InfosetObjects\XamlObjectWriter.cs (7)
1239object[] argInstances = new object[rawArgs.Count]; 1240IList<XamlType> paramTypes = meType.GetPositionalParameters(rawArgs.Count); 1245string msg = string.Format(TypeConverterHelper.InvariantEnglishUS, SR.NoSuchConstructor, rawArgs.Count, meType.Name); 1252if (i >= rawArgs.Count) 1962keyToken.Target.TemporaryCollectionIndex = pendingCollection.Count; 1968valueToken.Target.TemporaryCollectionIndex = pendingCollection.Count; 2489Debug.Assert(token.NeededNames.Count == 0 || nameResolutionIsComplete);
System\Xaml\Parser\GenericTypeNameParser.cs (1)
302if (frame.TypeArgs.Count != 1)
System\Xaml\Parser\NodeStreamSorter.cs (4)
37if (_seenStack.Count == 0) 49if (_seenStack.Count <=_startObjectDepth) 560if (_moveList.Count == 0) 565for (int i = 0; i < _moveList.Count; i++)
System\Xaml\Parser\XamlPullParser.cs (2)
577for (int i = 0; i < savedPrefixDefinitions.Count; i++) 763for (int i = 0; i < _savedPrefixDefinitions.Count; i++)
System\Xaml\Parser\XamlScanner.cs (5)
589if (list.Count > 0) 602for (int i = 0; i < attrList.Count; i++) 733for (int i = _attributes.Count - 1; i >= 0; i--) 741if (_attributes.Count == 0) 822if (_nextAttribute >= _attributes.Count)
System\Xaml\Schema\Reflector.cs (1)
338if (cads.Count == 0)
System\Xaml\Schema\TypeReflector.cs (7)
671if (candidates.Count > 0) 676else if (setters is null || setters.Count == 0 677|| (getters is not null && getters.Count > 0 && UnderlyingType.IsVisible && getters[0].IsPublic && !setters[0].IsPublic)) 712if ((setters is null || setters.Count == 0) && (getters is null || getters.Count == 0)) 727if (adders is null || adders.Count == 0) 1205for (int i = 0; i < listOfNulls.Count; i++)
System\Xaml\XamlMember.cs (1)
573if (doPropertyNames is null || doPropertyNames.Count == 0)
System\Xaml\XamlNodeList.cs (2)
64return new ReaderMultiIndexDelegate(_writer.SchemaContext, Index, _nodeList.Count, _hasLineInfo); 120get { return _nodeList.Count; }
System\Xaml\XamlObjectReader.cs (25)
267return (children.Count == 1) && (children[0] is ValueMarkupInfo); 275if (children.Count != 1) 304if (Children.Count > 1) { return false; } 307if (Children.Count == 0 || Children[0] is ValueMarkupInfo) { return true; } 534if (itemsInfo is not null && itemsInfo.Children.Count != 0) 562if (itemsInfo is not null && itemsInfo.Children.Count != 0) 671if (memberInfo.Children.Count == 1) 673if (memberInfo.Children[0] is ObjectMarkupInfo objectInfo && objectInfo.Properties.Count == 1 && memberType == objectInfo.XamlNode.XamlType) 677if (objectInfo.Properties[0] is MemberMarkupInfo itemsMemberInfo && itemsMemberInfo.Children.Count > 0) 745if (itemInfo.Properties is not null && itemInfo.Properties.Count == 1) 754if (memberInfo.Children.Count == 1) 1072for (i = 0; i < Properties.Count; i++) 1092for (int i = 0; i < properties.Count; ) 1205if (propertyInfo is not null && propertyInfo.Children.Count != 0) 1647if (constructorParameters.Length != ctorArgProps.Count) { continue; } 1676if (constructorArguments.Count == ctorArgProps.Count) 1699if (ctorArgProps.Count == 0) 1840if (items.Children.Count != 0) 2090if (propertyInfo.Children.Count == 1) 2103return propertyInfo.Children.Count == 1 && 2133if (propertyInfo.Children.Count == 1) 2914objectPosition = nodes.Count; 3086result = _entries.Count; 3128for (int i = 0; i < _entries.Count; ++i) 3134for (int i = 0; i < _entries.Count; ++i)
System\Xaml\XamlSchemaContext.cs (1)
1459for (int i = 0; i < Count; i++)
System\Xaml\XamlType.cs (1)
828contentWrappers = new List<XamlType>(wrapperTypes.Count);
System\Xaml\XamlTypeName.cs (1)
146return _typeArguments is not null && _typeArguments.Count > 0;
System\Xaml\XamlXmlWriter.cs (7)
1915int numOfParameters = writer.ppStateInfo.NodesList.Count; 1921if (constructorParameters.Length != ctorArgProps.Count) 2058writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2077Debug.Assert(writer.ppStateInfo.NodesList.Count != 0); 2078writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2095writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node); 2124writer.ppStateInfo.NodesList[writer.ppStateInfo.NodesList.Count - 1].Add(node);
UIAutomationClientSideProviders (8)
MS\Internal\AutomationProxies\ClickablePoint.cs (2)
419for (int i = 0; i < listIn.Count; i++) 438for (int i = 0; i < rectList.Count; i++)
MS\Internal\AutomationProxies\WinEventTracker.cs (6)
234for (int index = eventCreateParams.Count - 1; index >= 0; index--) 287for (int index = eventCreateParams.Count - 1; index >= 0; index--) 400for (int index = eventCreateParams.Count - 1; index >= 0; index--) 418if (eventCreateParams.Count == 0) 434for (int index = eventCreateParams.Count - 1; index >= 0; index--) 457if (eventCreateParams.Count == 0)
VBCSCompiler (7)
src\roslyn\src\Compilers\Server\VBCSCompiler\AnalyzerConsistencyChecker.cs (1)
115for (int i = 0; i < resolvedPaths.Count; i++)
src\roslyn\src\Compilers\Server\VBCSCompiler\BuildProtocolUtil.cs (1)
64while (argIndex >= commandLineArguments.Count)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (1)
695if (details.Count == 0)
src\roslyn\src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (4)
140} while (_connectionList.Count > 0 || _state == State.Running); 249if (_state == State.Running && _connectionList.Count == 0 && _timeoutTask is null && _keepAlive != Timeout.InfiniteTimeSpan) 258if (_state == State.Running && _connectionList.Count == 0 && _gcTask is null) 272while (i < _connectionList.Count)
vstest.console (6)
Internal\ConsoleLogger.cs (1)
671return time.Count == 0 ? "< 1 ms" : string.Join(" ", time);
Internal\MSBuildLogger.cs (1)
414return time.Count == 0 ? "< 1ms" : string.Join(" ", time);
Processors\CLIRunSettingsArgumentProcessor.cs (1)
180var length = mergedArgs.Count;
TestPlatformHelpers\TestRequestManager.cs (3)
389TestRunCriteria runCriteria = testRunRequestPayload.Sources != null && testRunRequestPayload.Sources.Count != 0 1445if (testRunRequestPayload.Sources is { Count: > 0 }) 1450if (testRunRequestPayload.TestCases is { Count: > 0 })
vstest.console.arm64 (6)
src\vstest\src\vstest.console\Internal\ConsoleLogger.cs (1)
671return time.Count == 0 ? "< 1 ms" : string.Join(" ", time);
src\vstest\src\vstest.console\Internal\MSBuildLogger.cs (1)
414return time.Count == 0 ? "< 1ms" : string.Join(" ", time);
src\vstest\src\vstest.console\Processors\CLIRunSettingsArgumentProcessor.cs (1)
180var length = mergedArgs.Count;
src\vstest\src\vstest.console\TestPlatformHelpers\TestRequestManager.cs (3)
389TestRunCriteria runCriteria = testRunRequestPayload.Sources != null && testRunRequestPayload.Sources.Count != 0 1445if (testRunRequestPayload.Sources is { Count: > 0 }) 1450if (testRunRequestPayload.TestCases is { Count: > 0 })
WaitForSandbox.ApiService (1)
Program.cs (1)
28totalEntries = entries.Count,
WindowsFormsIntegration (2)
System\Windows\Integration\ApplicationInterop.cs (2)
323for (int i = _internalList.Count - 1; i >= 0; i--) 368for (int i = 0; i < _internalList.Count; i++)