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
1087 references to Count
Aspire.Dashboard (4)
Components\Pages\Resources.razor.cs (1)
303if (_applicationUnviewedErrorCounts == null || _applicationUnviewedErrorCounts.Count != newApplicationUnviewedErrorCounts.Count)
Model\TraceHelpers.cs (1)
74new OrderedApplication(span.Source.Application, appFirstTimes.Count, currentMinDate.Value, totalSpans: 1, erroredSpans: span.Status == OtlpSpanStatusCode.Error ? 1 : 0));
Otlp\Model\OtlpApplication.cs (1)
132var instruments = new List<OtlpInstrumentSummary>(_instruments.Count);
Otlp\Storage\TelemetryRepository.cs (1)
161if (_applicationUnviewedErrorLogs.Count > 0)
Aspire.Hosting (2)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
108if (launchSettings == null || launchSettings.Profiles.Count == 0)
src\Shared\SecretsStore.cs (1)
33public int Count => _secrets.Count;
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
286endpointIndexMap[endpoint.Name] = endpointIndexMap.Count;
Aspire.Hosting.Azure.Functions (1)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
108if (launchSettings == null || launchSettings.Profiles.Count == 0)
Aspire.Hosting.Tests (4)
DistributedApplicationTests.cs (2)
221if (pids.Count == replicaCount) 232Assert.Equal(3, pids.Count);
WithEnvironmentTests.cs (2)
200Assert.Equal(4, config.Count); 206Assert.Equal(4, manifestConfig.Count);
Aspire.Playground.Tests (1)
AppHostTests.cs (1)
338public override string? ToString() => $"{AppHost} ({ResourceEndpoints?.Count ?? 0} resources)";
Aspire.Workload.Tests (2)
WorkloadTestsBase.cs (2)
160while (foundNames.Count < expectedRowsTable.Count && !cts.IsCancellationRequested) 249if (foundNames.Count != expectedRowsTable.Count)
Client.ClientBase.IntegrationTests (2)
ClientBaseTests.4.0.0.cs (2)
42Assert.True(property.Headers.Count > 0, "TestHttpRequestMessageProperty.Headers should not have empty headers"); 89Assert.True(property.Headers.Count > 0, "TestHttpRequestMessageProperty.Headers should not have empty headers");
dotnet-svcutil.xmlserializer (1)
Microsoft\Tools\ServiceModel\SvcUtil\CommandLineParser.cs (1)
146get { return _contents.Count; }
dotnet-svcutil-lib (28)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriter.cs (3)
2249Debug.Assert(_attrHashTable.Count == 0); 2275int count = _attrHashTable.Count; 2277if (count != _attrHashTable.Count)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaObjectTable.cs (5)
100Debug.Assert(_table.Count == _entries.Count); 101return _table.Count; 130return new NamesCollection(_entries, _table.Count); 139return new ValuesCollection(_entries, _table.Count); 146return new XSODictionaryEnumerator(_entries, _table.Count, EnumeratorType.DictionaryEntry);
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (2)
92ArgBuilder arg = new ArgBuilder(argNames[i], _argList.Count, argTypes[i]); 161localTmp = DeclareLocal(type, "_tmp" + _tmpLocals.Count);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (2)
980if (knownContracts == null || knownContracts.Count == 0) 996if (knownContractDictionary == null || knownContractDictionary.Count == 0)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExtensionDataReader.cs (1)
524prefix = (ns == null || ns.Length == 0) ? String.Empty : "p" + s_nsToPrefixTable.Count;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\MruCache.cs (2)
55return _items.Count; 68if (_items.Count == _highWatermark)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeaderCollection.cs (2)
125if (myHeaders.Count != otherHeaders.Count)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SecurityBindingElement.cs (2)
1425if (_operationSupportingTokenParameters.Count == 0) 1437if (_optionalOperationSupportingTokenParameters.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ImportedPolicyConversionContext.cs (2)
242Dictionary<K, V> counterValue = new Dictionary<K, V>(sets.Count); 255KeyValuePair<K, IEnumerator<V>>[] digits = new KeyValuePair<K, IEnumerator<V>>[sets.Count];
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (1)
485get { return _usedRetrievers.Count == _maxResolvedReferences; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (1)
1870if (_warnings.Count >= 1024)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\XmlSerializerOperationGenerator.cs (1)
121if (_partInfoTable != null && _partInfoTable.Count > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
128messageInfo.AnyHeaders = messageInfo.UnknownHeaderDescription != null || messageInfo.HeaderDescriptionTable.Count > 0;
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs (1)
62object[] headerValues = new object[headerDescriptionTable.Count];
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityProtocolFactory.cs (2)
764if (_mergedSupportingTokenAuthenticatorsMap != null && _mergedSupportingTokenAuthenticatorsMap.Count > 0) 792if (_scopedSupportingTokenAuthenticatorSpecification.Count == 0)
dotnet-user-jwts (1)
Helpers\JwtIssuer.cs (1)
44if (options.Claims is { Count: > 0 } claimsToAdd)
illink (8)
ILLink.RoslynAnalyzer (7)
DataFlowAnalyzerContext.cs (1)
28 public readonly bool AnyAnalyzersEnabled => EnableTrimAnalyzer || _enabledAnalyzers.Count > 0;
src\tools\illink\src\ILLink.Shared\DataFlow\DefaultValueDictionary.cs (3)
58 if (Dictionary.Count != other.Dictionary.Count) 71 public int Count => Dictionary?.Count ?? 0;
TrimAnalysis\ArrayValue.cs (2)
52 equals &= IndexValues.Count == otherArr.IndexValues.Count;
TrimAnalysis\TrimAnalysisVisitor.cs (1)
267 } else if (arr.IndexValues.TryGetValue (index.Value, out _) || arr.IndexValues.Count < MaxTrackedArrayValues) {
ILLink.Tasks (2)
CreateRuntimeRootDescriptorFile.cs (2)
311 if (featureSwitchMembers.Count > 0) { 313 if (members.Count == 0)
InMemory.FunctionalTests (148)
Http2\Http2ConnectionTests.cs (1)
4998Assert.Equal(11, _decodedHeaders.Count);
Http2\Http2StreamTests.cs (99)
110Assert.Equal(4, _decodedHeaders.Count); 129Assert.Equal(4, _decodedHeaders.Count); 160Assert.Equal(3, _decodedHeaders.Count); 212Assert.Equal(2, _decodedHeaders.Count); 263Assert.Equal(2, _decodedHeaders.Count); 287Assert.Equal(3, _decodedHeaders.Count); 316Assert.Equal(5, _decodedHeaders.Count); 347Assert.Equal(5, _decodedHeaders.Count); 384Assert.Equal(6, _decodedHeaders.Count); 429Assert.Equal(3, _decodedHeaders.Count); 501Assert.Equal(3, _decodedHeaders.Count); 552Assert.Equal(3, _decodedHeaders.Count); 581Assert.Equal(3, _decodedHeaders.Count); 610Assert.Equal(4, _decodedHeaders.Count); 641Assert.Equal(4, _decodedHeaders.Count); 672Assert.Equal(4, _decodedHeaders.Count); 703Assert.Equal(4, _decodedHeaders.Count); 825Assert.Equal(3, _decodedHeaders.Count); 859Assert.Equal(3, _decodedHeaders.Count); 896Assert.Equal(3, _decodedHeaders.Count); 937Assert.Equal(3, _decodedHeaders.Count); 980Assert.Equal(3, _decodedHeaders.Count); 1023Assert.Equal(3, _decodedHeaders.Count); 1076Assert.Equal(3, _decodedHeaders.Count); 1318Assert.Equal(3, _decodedHeaders.Count); 1356Assert.Equal(3, _decodedHeaders.Count); 1395Assert.Equal(3, _decodedHeaders.Count); 1429Assert.Equal(3, _decodedHeaders.Count); 1464Assert.Equal(2, _decodedHeaders.Count); 1499Assert.Equal(3, _decodedHeaders.Count); 1539Assert.Equal(2, _decodedHeaders.Count); 1574Assert.Equal(2, _decodedHeaders.Count); 1622Assert.Equal(2, _decodedHeaders.Count); 1662Assert.Equal(2, _decodedHeaders.Count); 1698Assert.Equal(3, _decodedHeaders.Count); 1740Assert.Equal(2, _decodedHeaders.Count); 1776Assert.Equal(3, _decodedHeaders.Count); 1810Assert.Equal(2, _decodedHeaders.Count); 1847Assert.Equal(3, _decodedHeaders.Count); 1885Assert.Equal(3, _decodedHeaders.Count); 1932Assert.Equal(3, _decodedHeaders.Count); 1971Assert.Equal(3, _decodedHeaders.Count); 2019Assert.Equal(3, _decodedHeaders.Count); 2082Assert.Equal(3, _decodedHeaders.Count); 2133Assert.Equal(3, _decodedHeaders.Count); 2172Assert.Equal(2, _decodedHeaders.Count); 2213Assert.Equal(4, _decodedHeaders.Count); 2264Assert.Equal(3, _decodedHeaders.Count); 2297Assert.Equal(3, _decodedHeaders.Count); 2385Assert.Equal(2, _decodedHeaders.Count); 2440Assert.Equal(2, _decodedHeaders.Count); 2448Assert.Equal(5, _decodedHeaders.Count); 2498Assert.Equal(2, _decodedHeaders.Count); 2541Assert.Equal(2, _decodedHeaders.Count); 2549Assert.Equal(3, _decodedHeaders.Count); 2582Assert.Equal(2, _decodedHeaders.Count); 2860Assert.Equal(2, _decodedHeaders.Count); 2918Assert.Equal(2, _decodedHeaders.Count); 3027Assert.Equal(2, _decodedHeaders.Count); 3079Assert.Equal(2, _decodedHeaders.Count); 3117Assert.Equal(3, _decodedHeaders.Count); 3155Assert.Equal(2, _decodedHeaders.Count); 3811Assert.Equal(3, _decodedHeaders.Count); 3860Assert.Equal(2, _decodedHeaders.Count); 3904Assert.Equal(2, _decodedHeaders.Count); 3950Assert.Equal(2, _decodedHeaders.Count); 4003Assert.Equal(2, _decodedHeaders.Count); 4056Assert.Equal(2, _decodedHeaders.Count); 4102Assert.Equal(2, _decodedHeaders.Count); 4152Assert.Equal(2, _decodedHeaders.Count); 4197Assert.Equal(2, _decodedHeaders.Count); 4240Assert.Equal(2, _decodedHeaders.Count); 4278Assert.Equal(3, _decodedHeaders.Count); 4421Assert.Equal(2, _decodedHeaders.Count); 4471Assert.Equal(3, _decodedHeaders.Count); 4517Assert.Equal(3, _decodedHeaders.Count); 4557Assert.Equal(3, _decodedHeaders.Count); 4621Assert.Equal(3, _decodedHeaders.Count); 4653Assert.Equal(3, _decodedHeaders.Count); 4686Assert.Equal(3, _decodedHeaders.Count); 4719Assert.Equal(3, _decodedHeaders.Count); 4774Assert.Equal(3, _decodedHeaders.Count); 4834Assert.Equal(3, _decodedHeaders.Count); 4895Assert.Equal(3, _decodedHeaders.Count); 4960Assert.Equal(2, _decodedHeaders.Count); 5017Assert.Equal(3, _decodedHeaders.Count); 5084Assert.Equal(2, _decodedHeaders.Count); 5129Assert.Equal(3, _decodedHeaders.Count); 5202Assert.Equal(2, _decodedHeaders.Count); 5276Assert.Equal(2, _decodedHeaders.Count); 5352Assert.Equal(3, _decodedHeaders.Count); 5423Assert.Equal(3, _decodedHeaders.Count); 5497Assert.Equal(2, _decodedHeaders.Count); 5581Assert.Equal(2, _decodedHeaders.Count); 5663Assert.Equal(2, _decodedHeaders.Count); 5750Assert.Equal(2, _decodedHeaders.Count); 5797Assert.Equal(3, _decodedHeaders.Count); 5872Assert.Equal(2, _decodedHeaders.Count); 5924Assert.Equal(2, _decodedHeaders.Count);
Http2\Http2WebSocketTests.cs (8)
71Assert.Equal(2, _decodedHeaders.Count); 136Assert.Equal(2, _decodedHeaders.Count); 227Assert.Equal(2, _decodedHeaders.Count); 263Assert.Equal(2, _decodedHeaders.Count); 366Assert.Equal(2, _decodedHeaders.Count); 430Assert.Equal(2, _decodedHeaders.Count); 498Assert.Equal(2, _decodedHeaders.Count); 562Assert.Equal(3, _decodedHeaders.Count);
Http3\Http3StreamTests.cs (40)
117Assert.Equal(4, responseHeaders.Count); 154Assert.Equal(3, responseHeaders.Count); 171Assert.Equal(5, responseHeaders.Count); 190Assert.Equal(5, responseHeaders.Count); 216Assert.Equal(6, responseHeaders.Count); 250Assert.Equal(3, responseHeaders.Count); 309Assert.Equal(3, responseHeaders.Count); 348Assert.Equal(3, responseHeaders.Count); 368Assert.Equal(3, responseHeaders.Count); 389Assert.Equal(4, responseHeaders.Count); 412Assert.Equal(4, responseHeaders.Count); 435Assert.Equal(4, responseHeaders.Count); 458Assert.Equal(4, responseHeaders.Count); 568Assert.Equal(3, responseHeaders.Count); 604Assert.Equal(3, responseHeaders.Count); 639Assert.Equal(3, responseHeaders.Count); 670Assert.Equal(2, responseHeaders.Count); 842Assert.Equal(2, responseTrailers.Count); 873Assert.Equal(2, responseHeaders.Count); 907Assert.Equal(4, responseHeaders.Count); 968Assert.Equal(2, responseTrailers.Count); 1057Assert.Equal(3, responseTrailers.Count); 1161Assert.Equal(3, decodedHeaders.Count); 1213Assert.Equal(3, decodedHeaders.Count); 1308Assert.Equal(2, decodedHeaders.Count); 1360Assert.Equal(3, decodedHeaders.Count); 1412Assert.Equal(2, decodedHeaders.Count); 1454Assert.Equal(3, decodedHeaders.Count); 1508Assert.Equal(2, decodedHeaders.Count); 1563Assert.Equal(2, decodedHeaders.Count); 1737Assert.Equal(2, decodedHeaders.Count); 1801Assert.Equal(2, decodedHeaders.Count); 2337Assert.Equal(3, receivedHeaders.Count); 2395Assert.Equal(3, receivedHeaders.Count); 2519Assert.Equal(3, receivedHeaders.Count); 2560Assert.Equal(3, receivedHeaders.Count); 2592Assert.Equal(3, receivedHeaders.Count); 2632Assert.Equal(3, receivedHeaders.Count); 2687Assert.Equal(3, receivedHeaders.Count); 2731Assert.Equal(3, receivedHeaders.Count);
IOperationGenerator (1)
IOperationClassWriter.cs (1)
335int numKinds = elementsToKind.Count + explicitKinds.Count + unusedKinds.Count;
Microsoft.AspNetCore.Components (1)
src\Http\Routing\src\Tree\TreeEnumerator.cs (1)
92if (next.Literals.Count > 0)
Microsoft.AspNetCore.Components.Endpoints (4)
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (4)
92var saveServerTask = server.Saved.Count > 0 96var saveWebAssemblyTask = webAssembly.Saved.Count > 0 106server.Saved.Count > 0 ? serverStore : null, 107webAssembly.Saved.Count > 0 ? webAssemblyStore : null);
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
Binding\FormDataMapperTests.cs (3)
80var dictionary = new Dictionary<FormKey, StringValues>(collection.Count); 1006Assert.Equal(expected.Count, dictionary.Count); 1036Assert.Equal(expected.Count, dictionary.Count);
Microsoft.AspNetCore.Components.Server (1)
src\Components\Shared\src\WebRootComponentManager.cs (1)
42if (_webRootComponents.Count + 1 > renderer._options.RootComponents.MaxJSRootComponents)
Microsoft.AspNetCore.Components.Web (1)
JSComponents\JSComponentConfigurationStore.cs (1)
31var parameters = new JSComponentParameter[parameterTypes.Count];
Microsoft.AspNetCore.Components.WebAssembly.Tests (4)
Hosting\WebAssemblyHostConfigurationTest.cs (4)
99Assert.Equal(4, section.Count); 162Assert.Equal(3, dict.Count); 168Assert.Equal(3, dict2.Count); 174Assert.Equal(5, dict3.Count);
Microsoft.AspNetCore.Components.WebView (3)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (2)
347internal bool HasChildren() => Children != null && Children.Count > 0; 422if (value.Children.Count > 0)
WebViewManager.cs (1)
230var pendingRenders = new List<Task>(_rootComponentsBySelector.Count);
Microsoft.AspNetCore.DataProtection (3)
XmlEncryption\XmlEncryptionExtensions.cs (2)
62Debug.Assert(placeholderReplacements.Count > 0); 143Debug.Assert(placeholderReplacements.Count > 0);
XmlEncryption\XmlKeyDecryptionOptions.cs (1)
18public int KeyDecryptionCertificateCount => _certs.Count;
Microsoft.AspNetCore.DataProtection.Tests (2)
KeyManagement\XmlKeyManagerTests.cs (2)
964Assert.Equal(4, keyDictWithRevocations.Count); 975Assert.Equal(2, keyDictWithDeletions.Count);
Microsoft.AspNetCore.Grpc.Swagger.Tests (2)
GrpcSwaggerServiceExtensionsTests.cs (1)
86Assert.Equal(2, swagger.Paths.Count);
SchemaGeneratorIntegrationTests.cs (1)
138_ = repository.Schemas.Count;
Microsoft.AspNetCore.Hosting (2)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (2)
347internal bool HasChildren() => Children != null && Children.Count > 0; 422if (value.Children.Count > 0)
Microsoft.AspNetCore.Http (14)
FormCollection.cs (4)
88return Store?.Count ?? 0; 133if (Store == null || Store.Count == 0) 148if (Store == null || Store.Count == 0) 163if (Store == null || Store.Count == 0)
HeaderDictionary.cs (4)
152public int Count => Store?.Count ?? 0; 333if (Store == null || Store.Count == 0) 347if (Store == null || Store.Count == 0) 361if (Store == null || Store.Count == 0)
QueryCollection.cs (4)
97return Store.Count; 152if (Store == null || Store.Count == 0) 166if (Store == null || Store.Count == 0) 180if (Store == null || Store.Count == 0)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionaryHolder.cs (1)
92return ReadDictionary.Count;
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
144public int Count => _dictionaryStorage != null ? _dictionaryStorage.Count : _count;
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (2)
108Assert.Equal(3, elements.Count); 145Assert.Equal(3, elements.Count);
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\Validation\ValidationStateDictionary.cs (1)
55public int Count => _inner.Count;
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
107if (responseTypes.Count == 0 && type != null)
Microsoft.AspNetCore.Mvc.Core (2)
ApplicationModels\ApplicationModelFactory.cs (1)
95if (attributeRoutingConfigurationErrors.Count > 0)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionaryHolder.cs (1)
92return ReadDictionary.Count;
Microsoft.AspNetCore.Mvc.Core.Test (5)
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (2)
1628if (Results.Count == 0) 1650if (Results.Count == 0)
ModelBinding\Binders\DictionaryModelBinderTest.cs (1)
88Assert.Equal(2, dictionary.Count);
Routing\UrlHelperTestBase.cs (2)
636Assert.Equal(2, dictionary.Count); 681Assert.Equal(3, dict.Count);
Microsoft.AspNetCore.Mvc.FunctionalTests (4)
FormFileUploadTest.cs (1)
79Assert.Equal(2, product.Specs.Count);
HtmlGenerationTest.cs (1)
204Assert.Equal(expectedAttributes.Count + 1, imgElement.Attributes.Length); // + 1 for the id-attribute
InputValidationTests.cs (1)
95Assert.Equal(10, errors.Count);
JsonOutputFormatterTestBase.cs (1)
65Assert.Equal(2, modelStateErrors.Count);
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
BodyValidationIntegrationTests.cs (1)
296Assert.Equal(2, modelStateErrors.Count);
TryValidateModelIntegrationTest.cs (1)
148Assert.Equal(2, modelStateErrors.Count);
Microsoft.AspNetCore.Mvc.Razor (1)
Compilation\DefaultViewCompiler.cs (1)
68if (compiledViews.Count == 0)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RuntimeViewCompiler.cs (1)
79if (_precompiledViews.Count == 0)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
TempDataDictionary.cs (1)
50return _data.Count;
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
CookieTempDataProviderTest.cs (1)
347return _cookies.Count;
Microsoft.AspNetCore.OpenApi (2)
Services\OpenApiGenerator.cs (2)
190if (responseType != null && eligibileAnnotations.Count == 0) 294if (requestBodyContent.Count == 0)
Microsoft.AspNetCore.OpenApi.Tests (7)
Extensions\OpenApiRouteHandlerBuilderExtensionTests.cs (1)
141Assert.Equal(2, operation.Responses.Count);
Services\OpenApiGeneratorTests.cs (6)
206Assert.Equal(2, responses.Count); 229Assert.Equal(2, operation.Responses.Count); 251Assert.Equal(2, operation.Responses.Count); 268Assert.Equal(2, operation.Responses.Count); 288Assert.Equal(5, operation.Responses.Count); 315Assert.Equal(3, operation.Responses.Count);
Microsoft.AspNetCore.Razor.Runtime (1)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionaryHolder.cs (1)
92return ReadDictionary.Count;
Microsoft.AspNetCore.Rewrite (1)
IISUrlRewrite\IISRewriteMapCollection.cs (1)
20public int Count => _rewriteMaps.Count;
Microsoft.AspNetCore.Routing (13)
DecisionTree\DecisionTreeBuilder.cs (2)
151foreach (var criterion in criteria.OrderByDescending(c => c.Value.Count)) 177if (reducedBranches.Count > 0)
Internal\DfaGraphWriter.cs (1)
66label = visited.Count;
Matching\AcceptsMatcherPolicy.cs (1)
239var result = new PolicyNodeEdge[edges.Count];
Matching\DfaMatcherBuilder.cs (5)
598pathEntries = new (string text, int destination)[node.Literals.Count]; 634if (node.PolicyEdges != null && node.PolicyEdges.Count > 0) 636policyEntries = new PolicyJumpTableEdge[node.PolicyEdges.Count]; 749_assignments.Add(kvp.Key, _assignments.Count); 769slotIndex = _assignments.Count;
Matching\HostMatcherPolicy.cs (1)
262var result = new PolicyNodeEdge[edges.Count];
Matching\HttpMethodMatcherPolicy.cs (1)
289var policyNodeEdges = new PolicyNodeEdge[edges.Count];
Matching\NegotiationMatcherPolicy.cs (1)
282var result = new PolicyNodeEdge[edges.Count];
Tree\TreeEnumerator.cs (1)
92if (next.Literals.Count > 0)
Microsoft.AspNetCore.Routing.Tests (2)
Template\TemplateBinderTests.cs (2)
1179Assert.Equal(expectedParts.Parameters.Count, actualParts.Parameters.Count);
Microsoft.AspNetCore.Server.Kestrel.Core (15)
Internal\CertificatePathWatcher.cs (1)
262internal int TestGetDirectoryWatchCountUnsynchronized() => _metadataForDirectory.Count;
Internal\ConfigSectionClone.cs (3)
33if (Value != other.Value || Children.Count != other.Children.Count) 54public override int GetHashCode() => HashCode.Combine(Value, Children.Count);
Internal\ConfigurationReader.cs (4)
228if (endpoint.Sni.Count > 0) 314Certificate, ClientCertificateMode ?? Https.ClientCertificateMode.NoCertificate, Sni.Count, _configSectionClone); 321if (lhs.Count != rhs.Count)
Internal\Http\HttpHeaders.Generated.cs (3)
2586return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0); 10872return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0); 17169return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0);
Internal\Http\HttpResponseHeaders.cs (1)
44if (extraHeaders != null && extraHeaders.Count > 0)
Internal\Http2\Http2Connection.cs (2)
1308if (_streams.Count > MaxTrackedStreams || SendEnhanceYourCalmOnStartStream) 1481while (_streams.Count >= maxStreams && _completedStreams.TryDequeue(out var stream))
TlsConfigurationLoader.cs (1)
102if (endpoint.Sni.Count == 0)
Microsoft.AspNetCore.Session (1)
DefaultDistributedSessionStore.cs (1)
13public int Count => _store.Count;
Microsoft.AspNetCore.Shared.Tests (4)
CopyOnWriteDictionaryHolderTest.cs (1)
81Assert.Equal(2, source.Count);
CopyOnWriteDictionaryTest.cs (1)
101Assert.Equal(2, sourceDictionary.Count);
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionaryHolder.cs (1)
92return ReadDictionary.Count;
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
144public int Count => _dictionaryStorage != null ? _dictionaryStorage.Count : _count;
Microsoft.AspNetCore.WebUtilities (1)
KeyValueAccumulator.cs (1)
82public int KeyCount => _accumulator?.Count ?? 0;
Microsoft.AspNetCore.WebUtilities.Tests (15)
FormPipeReaderTests.cs (3)
99Assert.Equal(3, formCollection.Count); 142Assert.Equal(3, formCollection.Count); 170Assert.Equal(3, formCollection.Count);
FormReaderTests.cs (3)
73Assert.Equal(3, formCollection.Count); 112Assert.Equal(3, formCollection.Count); 139Assert.Equal(3, formCollection.Count);
MultipartReaderTests.cs (5)
200Assert.Equal(2, section.Headers.Count); 226Assert.Equal(2, section.Headers.Count); 252Assert.Equal(2, section.Headers.Count); 261Assert.Equal(2, section.Headers.Count); 299Assert.Equal(2, section.Headers.Count);
QueryHelpersTests.cs (4)
14Assert.Equal(2, collection.Count); 23Assert.Equal(2, collection.Count); 32Assert.Equal(2, collection.Count); 41Assert.Equal(2, collection.Count);
Microsoft.Build (66)
BackEnd\BuildManager\BuildManager.cs (4)
978ErrorUtilities.VerifyThrow(_buildSubmissions.Count == 0, "All submissions not yet complete."); 989if (_projectStartedEvents.Count != 0) 2003while (blockedNodes.Count > 0 || buildingNodes.Count > 0) 2738if (_buildSubmissions.Count == 0)
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (4)
242if (_unresolvedConfigurations.Count == 0) 348if (result.CircularDependency || (_outstandingRequests.Count == 0 && (_unresolvedConfigurations == null || _unresolvedConfigurations.Count == 0))) 427_outstandingResults = new Dictionary<int, BuildResult>(_outstandingRequests.Count);
BackEnd\Components\Communications\NodeManager.cs (1)
290if (_nodeIdToProvider.Count == 0)
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (2)
136return MaxNodeCount - _nodeContexts.Count; 535ErrorUtilities.ThrowInternalError("All allowable nodes already created ({0}).", _nodeContexts.Count);
BackEnd\Components\RequestBuilder\BatchingEngine.cs (5)
131if (consumedMetadataReferences?.Count > 0) 152if (itemListsToBeBatched.Count == 0) 307ErrorUtilities.VerifyThrow(itemListsToBeBatched.Count > 0, "Need item types consumed by the batchable object."); 308ErrorUtilities.VerifyThrow(consumedMetadataReferences.Count > 0, "Need item metadata consumed by the batchable object."); 392var itemMetadataValues = new Dictionary<string, string>(consumedMetadataReferences.Count, MSBuildNameIgnoreCaseComparer.Default);
BackEnd\Components\RequestBuilder\Lookup.cs (3)
506if (modifies.Count != 0) 508allModifies ??= new Dictionary<ProjectItemInstance, MetadataModifications>(modifies.Count); 1074get { return _modifications.Count > 0 || _keepOnlySpecified; }
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (4)
172else if (discreteItemsInTargetOutputs.Count == 0) 227if ((discreteItemsInTargetOutputs.Count > 0) || 609ErrorUtilities.VerifyThrow(inputItemVectors.Count == 1, 852ErrorUtilities.VerifyThrow((itemVectorTransforms == null) || (itemVectorCollection.Equals(itemVectorTransforms)) || (itemVectorPartition.Count == 1),
BackEnd\Components\Scheduler\SchedulableRequest.cs (5)
207return _requestsWeAreBlockedBy.Count; 421ErrorUtilities.VerifyThrow(_requestsWeAreBlockedBy.Count == 0, "We can't be complete if we are still blocked on requests."); 439ErrorUtilities.VerifyThrow(_requestsWeAreBlockedBy.Count == 0, "We are blocked by requests."); 611if (_requestsWeAreBlockedBy.Count != 0) 654if (_requestsWeAreBlockedBy.Count == 0)
BackEnd\Components\Scheduler\Scheduler.cs (10)
728if (_availableNodes.Count > 0) 784TraceScheduler("Requests scheduled: {0} Unassigned Requests: {1} Blocked Requests: {2} Unblockable Requests: {3} Free Nodes: {4}/{5} Responses: {6}", nodesFreeToDoWorkPriorToScheduling - idleNodes.Count, _schedulingData.UnscheduledRequestsCount, _schedulingData.BlockedRequestsCount, _schedulingData.ReadyRequestsCount, idleNodes.Count, _availableNodes.Count, responses.Count); 1291Dictionary<int, int> configurationCountsByNode = new Dictionary<int, int>(_availableNodes.Count); 1303configurationCountLimit = Math.Max(1, (int)Math.Ceiling(configurationCountLimit * _customSchedulerForSQLConfigurationLimitMultiplier / _availableNodes.Count)); 2296int[] currentWork = new int[_availableNodes.Count]; 2303TimeSpan[] nodeActiveTimes = new TimeSpan[_availableNodes.Count]; 2304DateTime[] nodeStartTimes = new DateTime[_availableNodes.Count]; 2307Dictionary<int, int> availableNodeIdsToIndex = new Dictionary<int, int>(_availableNodes.Count); 2308int[] indexToAvailableNodeId = new int[_availableNodes.Count]; 2422loggingService.LogComment(context, MessageImportance.Normal, "NodeUtilizationSummary", utilitzationPercentages.ToString(), (utilizationAverage / (double)_availableNodes.Count) * 100);
BackEnd\Components\Scheduler\SchedulingData.cs (4)
147get { return _executingRequests.Count; } 163get { return _readyRequests.Count; } 187get { return _blockedRequests.Count; } 203get { return _yieldingRequests.Count; }
BackEnd\Components\Scheduler\SchedulingPlan.cs (1)
167if (_configIdToData.Count > 0)
BackEnd\Shared\BuildRequestConfiguration.cs (1)
278public bool IsActivelyBuilding => _activelyBuildingTargets?.Count > 0;
Collections\HashTableUtility.cs (2)
44int comparison = Math.Sign(h1.Count - h2.Count);
Collections\ItemDictionary.cs (1)
85public int Count => _nodes.Count;
Collections\MultiDictionary.cs (1)
74internal int KeyCount => _backing.Count;
Collections\WeakValueDictionary.cs (4)
55public int Count => _dictionary.Count; 118if (_dictionary.Count == _capacity) 125if (_dictionary.Count == _capacity) 127_capacity = _dictionary.Count * 2;
Evaluation\Evaluator.cs (1)
1941escapedMetadata = new Dictionary<string, string>(item.Value.Metadata.Count, StringComparer.OrdinalIgnoreCase);
Evaluation\ExpressionShredder.cs (1)
88bool result = (pair.Metadata?.Count > 0);
Evaluation\LazyItemEvaluator.cs (2)
204var cacheCount = _cache?.Count ?? 0; 439if (itemsWithNoWildcards.Count > 0)
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
96CapturedItems = capturedItems == null || capturedItems.Count == 0
Graph\GraphBuilder.cs (1)
136Dictionary<ProjectGraphNode, HashSet<ProjectGraphNode>> transitiveReferenceCache = new(allParsedProjects.Count);
Instance\TaskRegistry.cs (2)
552if (taskRecord == null && _taskRegistrations?.Count > 0) 1178ErrorUtilities.VerifyThrow(taskFactoryParameters.Count == 2, "if the parameter dictionary is non-null, it should contain both parameters when we get here!");
Logging\ParallelLogger\ParallelConsoleLogger.cs (2)
253if (!showOnlyErrors && !showOnlyWarnings && _deferredMessages.Count > 0) 1769if (_internalPerformanceCounters?.Count > 0)
TaskParameter.cs (3)
809int count = (_customEscapedMetadata == null) ? 0 : _customEscapedMetadata.Count; 1004if (_customEscapedMetadata == null || _customEscapedMetadata.Count == 0) 1009var result = new KeyValuePair<string, string>[_customEscapedMetadata.Count];
Tracing.cs (1)
146if (s_counts.Count > 0)
Microsoft.Build.Engine.OM.UnitTests (1)
Construction\ProjectTaskElement_Tests.cs (1)
142Assert.Equal(2, parameters.Count);
Microsoft.Build.Engine.UnitTests (33)
BackEnd\BinaryTranslator_Tests.cs (6)
443Assert.Equal(value.Count, deserializedValue.Count); 481Assert.Equal(value.Count, deserializedValue.Count); 520Assert.Equal(value.Count, deserializedValue.Count);
BackEnd\BuildManager_Tests.cs (3)
807(properties == null || properties.Count == 0).ShouldBeTrue(); 844(properties == null || properties.Count == 0).ShouldBeTrue(); 941(properties == null || properties.Count == 0).ShouldBeTrue();
BackEnd\BuildRequestConfiguration_Tests.cs (1)
176Assert.Equal(props.Count, Helpers.MakeList((IEnumerable<ProjectPropertyInstance>)(config1.GlobalProperties)).Count);
BackEnd\RequestedProjectState_Tests.cs (1)
62clone.ItemFilters.Count.Should().NotBe(items.Count);
BackEnd\TaskHostConfiguration_Tests.cs (10)
473Assert.Equal(config.TaskParameters.Count, deserializedConfig.TaskParameters.Count); 476Assert.Equal(config.GlobalProperties.Count, deserializedConfig.GlobalProperties.Count); 524Assert.Equal(config.TaskParameters.Count, deserializedConfig.TaskParameters.Count); 573Assert.Equal(config.TaskParameters.Count, deserializedConfig.TaskParameters.Count); 621Assert.Equal(config.TaskParameters.Count, deserializedConfig.TaskParameters.Count);
BackEnd\TaskHostTaskComplete_Tests.cs (8)
149Assert.Equal(complete.TaskOutputParameters.Count, deserializedComplete.TaskOutputParameters.Count); 175Assert.Equal(complete.TaskOutputParameters.Count, deserializedComplete.TaskOutputParameters.Count); 202Assert.Equal(complete.TaskOutputParameters.Count, deserializedComplete.TaskOutputParameters.Count); 228Assert.Equal(complete.TaskOutputParameters.Count, deserializedComplete.TaskOutputParameters.Count);
Collections\OMcollections_tests.cs (1)
231Assert.Equal(2, dictionary.Count);
ExpressionTree_Tests.cs (3)
357Assert.Equal(4, conditionedProperties.Count); 368Assert.Equal(4, conditionedProperties.Count); 379Assert.Equal(4, conditionedProperties.Count);
Microsoft.Build.Framework (8)
BinaryTranslator.cs (5)
1337if ((dictionary is null) && ((additionalEntries is null) || (additionalEntries.Count == 0))) 1350(additionalEntries is null ? 0 : additionalEntries.Count) + 1351(dictionary is null ? 0 : dictionary.Count); 1446int count = dictionary.Count; 1527int count = dictionary.Count;
BinaryWriterExtensions.cs (1)
124writer.Write7BitEncodedInt(data.ExtendedMetadata.Count);
Sdk\SdkResultItem.cs (2)
43Metadata?.Count == item.Metadata.Count)
Microsoft.Build.Tasks.CodeAnalysis (2)
MapSourceRoots.cs (2)
142int index = topLevelMappedPaths.Count; 158if (topLevelMappedPaths.Count == 0)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
TestUtilities\SimpleTaskItem.cs (1)
20public int MetadataCount => Metadata.Count;
Microsoft.Build.Tasks.Core (20)
AssemblyDependency\Reference.cs (1)
757get { return _preUnificationVersions.Count != 0; }
AssemblyDependency\ReferenceTable.cs (4)
1849if (baseNameToReferences.Count == 0) 1860var fullNameToReference = new Dictionary<string, AssemblyNameReference>(References.Count, StringComparer.OrdinalIgnoreCase); 2177var baseNameToReferences = new Dictionary<string, List<AssemblyNameReference>>(References.Count, StringComparer.OrdinalIgnoreCase); 2205List<string> toRemove = new(baseNameToReferences.Count);
AssemblyDependency\ResolveAssemblyReference.cs (3)
2075else if (!string.IsNullOrEmpty(_stateFile) && (_cache.IsDirty || _cache.instanceLocalOutgoingFileStateCache.Count < _cache.instanceLocalFileStateCache.Count)) 3059AssemblyTableInfo[] extensions = new AssemblyTableInfo[tableMap.Count];
BootstrapperUtil\BootstrapperBuilder.cs (6)
235resourceUpdater.AddStringResource(44, "COUNT", eulas.Count.ToString(CultureInfo.InvariantCulture)); 740while (buildQueue.Count > 0) 766if (buildQueue.Count > 0 && productsToRemove.Count == 0) 776if (productsInLoop.Length > 0 && (buildQueue.Count == 0 || productsToRemove.Count == 0)) 1533string configFileKey = string.Format(CultureInfo.InvariantCulture, "EULA{0}", eulas.Count); 1750if (_cultures.Count == 0)
CreateItem.cs (1)
107(excludeItems.Count == 0) || // minor perf optimization
ResolveSDKReference.cs (2)
1288if (FrameworkIdentitiesFromManifest.Count > 0) 1338if (AppxLocationsFromManifest.Count > 0)
system.design\stronglytypedresourcebuilder.cs (1)
724Capacity = resourceList.Count
SystemState.cs (1)
279internal override bool HasStateToSave => instanceLocalOutgoingFileStateCache.Count > 0;
Tracing.cs (1)
146if (s_counts.Count > 0)
Microsoft.Build.Tasks.UnitTests (9)
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (3)
130cache2.Count.ShouldBe(cache.Count); 167cache2.Count.ShouldBe(1);
PropertyParser_Tests.cs (6)
55Assert.Equal(3, propertiesTable.Count); 75Assert.Equal(2, propertiesTable.Count); 94Assert.Equal(2, propertiesTable.Count); 164Assert.Equal(2, propertiesTable.Count); 181Assert.Equal(2, propertiesTable.Count); 198Assert.Equal(2, propertiesTable.Count);
Microsoft.Build.Utilities.Core (12)
Tracing.cs (1)
146if (s_counts.Count > 0)
TrackedDependencies\CanonicalTrackedInputFiles.cs (3)
374if (sourcesNeedingCompilation.Count == 0) 402if (sourcesNeedingCompilation.Count > CanonicalTrackedFilesHelper.MaxLogCount) 404FileTracker.LogMessageFromResources(_log, MessageImportance.Low, "Tracking_InputsNotShown", sourcesNeedingCompilation.Count);
TrackedDependencies\CanonicalTrackedOutputFiles.cs (7)
323if (DependencyTable[sourceRoot].Count == 0) 356if (outputs.Count == 0) 366if (outputs.Count > CanonicalTrackedFilesHelper.MaxLogCount) 368FileTracker.LogMessageFromResources(_log, MessageImportance.Low, "Tracking_OutputsNotShown", outputs.Count); 442if (outputs.Count == 0) 452if (outputs.Count > CanonicalTrackedFilesHelper.MaxLogCount) 454FileTracker.LogMessageFromResources(_log, MessageImportance.Low, "Tracking_OutputsNotShown", outputs.Count);
TrackedDependencies\FlatTrackingData.cs (1)
734if (!inputs.TlogsAvailable || !outputs.TlogsAvailable || inputs.DependencyTable.Count == 0)
Microsoft.Build.Utilities.UnitTests (15)
ToolLocationHelper_Tests.cs (15)
237sdk.ExtensionSDKs.Count.ShouldBe(0); 262sdk.ExtensionSDKs.Count.ShouldBe(0); 288sdk.ExtensionSDKs.Count.ShouldBe(1); 314sdk.ExtensionSDKs.Count.ShouldBe(1); 3113targetPlatform.Count.ShouldBe(0); 3793targetPlatforms[key].ExtensionSDKs.Count.ShouldBe(2); 3801targetPlatforms[key].ExtensionSDKs.Count.ShouldBe(2); 3814targetPlatforms[key].ExtensionSDKs.Count.ShouldBe(1); 3819targetPlatforms[key].ExtensionSDKs.Count.ShouldBe(1); 3825targetPlatforms[key].ExtensionSDKs.Count.ShouldBe(1); 3832targetPlatforms[key].ExtensionSDKs.Count.ShouldBe(0); 3836targetPlatforms[key].ExtensionSDKs.Count.ShouldBe(0); 3837targetPlatforms[key].Platforms.Count.ShouldBe(3); 3845targetPlatforms[key].ExtensionSDKs.Count.ShouldBe(0); 3846targetPlatforms[key].Platforms.Count.ShouldBe(1);
Microsoft.CodeAnalysis (25)
Binding\AbstractLookupSymbolsInfo.cs (1)
271public int Count => _nameMap.Count;
CodeGen\SwitchStringJumpTableEmitter.cs (1)
132int count = stringHashMap.Count;
Collections\ImmutableArrayExtensions.cs (3)
861if (dictionary.Count == 0) 1218var capacity = map.Count > 3 ? map.Count : 0;
Collections\TopologicalSort.cs (1)
85bool hadCycle = predecessorCounts.Count != resultBuilder.Count;
CommandLine\SarifV1ErrorLogger.cs (1)
243public int Count => _keys.Count;
CommandLine\SarifV2ErrorLogger.cs (1)
464public int Count => _distinctDescriptors.Count;
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (2)
482Debug.Assert(_lazyPendingMemberSymbolsMap == null || _lazyPendingMemberSymbolsMap.Count == 0); 483Debug.Assert(_lazyPendingSymbolEndActionsMap == null || _lazyPendingSymbolEndActionsMap.Count == 0);
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
1498get { return this.added.Count + _firstRowId; }
InternalUtilities\ConcurrentLruCache.cs (2)
68var copy = new KeyValuePair<K, V>[_cache.Count]; 135if (_cache.Count == _capacity)
InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
MetadataReader\MetadataHelpers.cs (1)
892if (names.Count != nestedNamespaces.Count) // nothing to merge otherwise
MetadataReader\PEModule.cs (2)
678var result = new ArrayBuilder<IGrouping<string, TypeDefinitionHandle>>(namespaces.Count); 3792if (_lazyForwardedTypesToAssemblyIndexMap.Count == 0)
Operations\OperationMapBuilder.cs (1)
21Debug.Assert(dictionary.Count == 0);
PEWriter\MetadataWriter.cs (2)
4254Debug.Assert(index.Count == 0); 4281Debug.Assert(index.Count == 0);
ReferenceManager\CommonReferenceManager.State.cs (1)
428Debug.Assert(referencedModules.Length == referencedModulesMap.Count);
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
548var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
Microsoft.CodeAnalysis.CodeStyle (19)
src\Analyzers\Core\Analyzers\OrderModifiers\OrderModifiersHelpers.cs (1)
88if (result.Count == 0)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
820return idToSuppressMessageAttributesMap.Count > 0;
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (3)
861if (dictionary.Count == 0) 1218var capacity = map.Count > 3 ? map.Count : 0;
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
548var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
125other._reachingWrites.Count != _reachingWrites.Count) 175private bool IsEmpty => _reachingWrites.Count == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
433if (SymbolsWriteBuilder.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
Microsoft.CodeAnalysis.CSharp (36)
Binder\Binder_Constraints.cs (1)
49names.Add(name, names.Count);
Binder\PatternExplainer.cs (2)
558needsPropertyString = properties.Count != 0; 584needsPropertyString |= deconstruction == null && typeName == null || properties.Count != 0;
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (4)
2340var result = dictionary.Count != interfaces.Length ? dictionary.Values.ToImmutableArray() : interfaces; 2889if (candidates.Count >= 2) 2895if (candidates.Count == 0) 3296builder.EnsureCapacity(builder.Count + candidates.Count);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1109else if (containingTypeMapOpt.Count == 1)
BoundTree\BoundNode_Source.cs (1)
421identifier = tempIdentifiers.Count + 1;
CodeGen\Optimizer.cs (2)
72if (locals.Count == 0) 114if (info.Count != 0)
Compilation\MemberSemanticModel.cs (3)
1160if (_guardedIOperationNodeMap.Count != 0) 1170if (_guardedIOperationNodeMap.Count != 0) 1949if (_guardedBoundNodeMap.Count > 0)
Compiler\TypeCompilationState.cs (1)
165get { return _wrappers == null ? 0 : _wrappers.Count; }
FlowAnalysis\NullableWalker.cs (1)
442Debug.Assert(_targetTypedAnalysisCompletionOpt is null or { Count: 0 });
FlowAnalysis\NullableWalker.SnapshotManager.cs (3)
172Debug.Assert(_symbolToSlot.Count == _walkerStates.Count); 173Debug.Assert(_symbolToSlot.Count > 0); 195_currentWalkerSlot = _symbolToSlot.Count;
FlowAnalysis\NullableWalker.Variables.cs (4)
164Debug.Assert(_variableSlot.Count == 0); 165Debug.Assert(_variableTypes.Count == 0); 325return fromContainer + _variableSlot.Count; 433return $"Id={Id}, Symbol={symbol}, Count={_variableSlot.Count}";
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
70var fieldName = GeneratedNames.DelegateCacheContainerFieldName(_delegateFields.Count, targetMethod.Name);
Lowering\LocalRewriter\LocalRewriter.cs (1)
521Debug.Assert(_placeholderReplacementMapDoNotUseDirectly.Count == 0);
Lowering\SpillSequenceSpiller.cs (1)
201if (tempSubstitution.Count == 0)
Lowering\SynthesizedSubmissionFields.cs (1)
44return _previousSubmissionFieldMap == null ? 0 : _previousSubmissionFieldMap.Count;
Symbols\Metadata\PE\PENamespaceSymbol.cs (2)
81if (lazyNamespaces.Count == 0) 84var builder = ArrayBuilder<Symbol>.GetInstance(memberTypes.Length + lazyNamespaces.Count);
Symbols\Source\ConstantEvaluationHelpers.cs (5)
63Debug.Assert(graph.Count >= 1); 159Debug.Assert(graph.Count > 0); 164while (graph.Count > 0) 269Debug.Assert(graph.Count > 0); 273fieldsInvolvedInCycles = ArrayBuilder<SourceFieldSymbolWithSyntaxReference>.GetInstance(graph.Count);
Symbols\Source\SourceMemberContainerSymbol.cs (2)
1366Debug.Assert(s_emptyTypeMembers.Count == 0); 3615var memberNames = ArrayBuilder<ReadOnlyMemory<char>>.GetInstance(membersByName.Count);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
646if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_WellKnownAttributes.cs (1)
2848Assert.Equal(5, visitedEntryPoints.Count);
Microsoft.CodeAnalysis.CSharp.Features (1)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
108if (map.Count > 0)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\PartialPropertiesTests.cs (1)
865Assert.Equal(2, visitedEntryPoints.Count);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
646if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Microsoft.CodeAnalysis.EditorFeatures (1)
Classification\Syntactic\SyntacticClassificationTaggerProvider.ClassifiedLineCache.cs (1)
160Contract.ThrowIfTrue(_lruList.Count != _spanToLruNode.Count);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (2)
158if (expectedMap.Count > 0) 737if (expectedMap.Count > 0)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
PDB\MethodDebugInfo.Native.cs (1)
452Debug.Assert(localNames.Count == 0);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\MemberExpansion.cs (1)
106if (favoritesMembersByName.Count > 0)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\MemberExpansion.cs (1)
106if (favoritesMembersByName.Count > 0)
Microsoft.CodeAnalysis.Features (13)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncDocumentWorkItemQueue.cs (4)
20protected override int WorkItemCount_NoLock => _documentWorkQueue.Count; 30if (documentMap.Count == 0) 47if (_documentWorkQueue.Count == 0) 118if (_documentWorkQueue.Count == 1)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncProjectWorkItemQueue.cs (2)
21protected override int WorkItemCount_NoLock => _projectWorkQueue.Count; 49if (_projectWorkQueue.Count == 0)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (1)
166if (_cancellationMap.Count == 0)
ExtractMethod\MethodExtractor.Analyzer.cs (1)
497var list = new FixedSizeArrayBuilder<VariableInfo>(variableInfoMap.Count);
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (2)
82_namedTypes.Add(symbol, (order: _namedTypes.Count, count: 1)); 96_namedTypes.Add(symbol, (order: _namedTypes.Count, count: 1));
src\Analyzers\Core\Analyzers\OrderModifiers\OrderModifiersHelpers.cs (1)
88if (result.Count == 0)
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (2)
34projectAssets.Targets.Count == 0) 40projectAssets.Libraries.Count == 0)
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
548var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Features\DecompiledSource\AssemblyResolver.cs (1)
35Log(FeaturesResources._0_items_in_cache, _cache.Count);
Handler\SemanticTokens\SemanticTokensSchema.cs (2)
110tokenTypeToIndex.Add(lspTokenType, tokenTypeToIndex.Count); 113tokenTypeToIndex.Add(roslynTokenType, tokenTypeToIndex.Count);
Microsoft.CodeAnalysis.PooledObjects.Package (2)
ArrayBuilder.cs (1)
548var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\FindUsages\RemoteFindUsagesService.cs (1)
124id = _definitionItemToId.Count;
Microsoft.CodeAnalysis.Scripting (1)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (1)
631get { return _shadowCopies.Count; }
Microsoft.CodeAnalysis.Test.Utilities (4)
Compilation\CompilationDifference.cs (1)
98Assert.True(sequencePointMarkers.Count > 0, $"No sequence points found in:{Environment.NewLine}{actualPdb}");
Compilation\ControlFlowGraphVerifier.cs (1)
1824int id = _anonymousFunctionsMap.Count;
Diagnostics\OptionsDiagnosticAnalyzer.cs (1)
68Assert.True(_mismatchedOptions.Count == 0,
InstrumentationChecker.cs (1)
327if (_spanExpectations.Count == 0)
Microsoft.CodeAnalysis.VisualBasic (11)
Binding\Binder_XmlLiterals.vb (2)
129Debug.Assert((namespaces Is Nothing) OrElse (namespaces.Count > 0)) 1482Debug.Assert(namespaces.Count > 0)
Lowering\Diagnostics\DiagnosticsPass.vb (1)
199If _withExpressionPlaceholderMap IsNot Nothing AndAlso _withExpressionPlaceholderMap.Count > 0 Then
Lowering\SynthesizedSubmissionFields.vb (1)
38Return If(_previousSubmissionFieldMap Is Nothing, 0, _previousSubmissionFieldMap.Count)
Symbols\Source\SourceFieldSymbol.vb (5)
271Debug.Assert(graph.Count >= 1) 430Debug.Assert(graph.Count > 0) 435While graph.Count > 0 526Debug.Assert(graph.Count > 0) 529fieldsInvolvedInCycles = ArrayBuilder(Of SourceFieldSymbol).GetInstance(graph.Count)
Symbols\Source\SourceFile.vb (2)
273importAliasesOpt = If(data.Aliases.Count = 0, Nothing, data.Aliases) 274xmlNamespacesOpt = If(data.XmlNamespaces.Count > 0, data.XmlNamespaces, Nothing)
Microsoft.CodeAnalysis.Workspaces (28)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
66if (docIdToTextMerger.Count == 0)
FindSymbols\SymbolFinder_Helpers.cs (2)
113if (equivalentTypesWithDifferingAssemblies.Count > 0) 131Contract.ThrowIfTrue(equivalentTypesWithDifferingAssemblies.Count == 0);
FindSymbols\SyntaxTree\SyntaxTreeIndex_Persistence.cs (1)
43writer.WriteInt32(_interceptsLocationInfo?.Count ?? 0);
Log\KeyValueLogMessage.cs (1)
70return _lazyMap.Count > 0;
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (3)
861if (dictionary.Count == 0) 1218var capacity = map.Count > 3 ? map.Count : 0;
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
548var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
186if (SymbolsWriteBuilder.Count != 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
125other._reachingWrites.Count != _reachingWrites.Count) 175private bool IsEmpty => _reachingWrites.Count == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
433if (SymbolsWriteBuilder.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
101if (map.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
18var dictionary = new Dictionary<K, V>(builders.Count); 32var dictionary = new Dictionary<K, ImmutableArray<V>>(builders.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
227if (first == null || last == null || importToSyntax.Count == 0)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
503if (_documentPathsToDocumentIds.Count != filePaths.Length)
Workspace\Solution\Solution.cs (1)
1543Contract.ThrowIfTrue(solution._documentIdToFrozenSolution.Count != 0);
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (1)
179documentToIndex.Add(document, documentToIndex.Count);
Workspace\Workspace.cs (1)
394if (relatedDocumentIdsAndStates.Count == 0)
Workspace\Workspace_Editor.cs (1)
194if (_projectToOpenDocumentsMap.Count == 0)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (11)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (3)
861if (dictionary.Count == 0) 1218var capacity = map.Count > 3 ? map.Count : 0;
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (2)
68var copy = new KeyValuePair<K, V>[_cache.Count]; 135if (_cache.Count == _capacity)
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (2)
210public int Count => _dictionary.Count; 212public bool IsEmpty => _dictionary.Count == 0;
src\Compilers\Core\Portable\InternalUtilities\OrderedMultiDictionary.cs (1)
17public int Count => _dictionary.Count;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
548var dictionary = new Dictionary<K, ImmutableArray<T>>(accumulator.Count, comparer);
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
292if (map.Count > Threshold)
Microsoft.DotNet.Arcade.Sdk (1)
src\InstallDotNetCore.cs (1)
78if (runtimeItems.Count > 0)
Microsoft.DotNet.AsmDiff (1)
MefHelpers.cs (1)
49subsetOfConstraints.Count == 0 ? null : subsetOfConstraints);
Microsoft.DotNet.Build.Tasks.Packaging (2)
GetLayoutFiles.cs (1)
75if (frameworks.Count != 0)
SplitReferences.cs (1)
91if (packageReferences.Count == 0)
Microsoft.DotNet.NuGetRepack.Tasks (1)
src\ReplacePackageParts.cs (1)
223if (replacementMap.Count > 0)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
StampedeTests.cs (1)
453Assert.Equal(8, counts.Count);
Microsoft.Extensions.Compliance.Redaction (1)
RedactorProvider.cs (1)
46var dict = new Dictionary<DataClassificationSet, Redactor>(map.Count);
Microsoft.Extensions.Configuration (1)
ConfigurationManager.cs (1)
287public int Count => _properties.Count;
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\CallSiteChain.cs (1)
35_callSiteChain[serviceIdentifier] = new ChainItemInfo(_callSiteChain.Count, implementationType);
ServiceLookup\ServiceProviderEngineScope.cs (1)
209DependencyInjectionEventSource.Log.ScopeDisposed(RootProvider.GetHashCode(), ResolvedServices.Count, _disposables?.Count ?? 0);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (4)
Linux\Resources\HardcodedValueFileSystem.cs (4)
47if (_fileContent.Count == 0 || !_fileContent.TryGetValue(file.FullName, out var content)) 61if (_fileContent.Count == 0 || !_fileContent.TryGetValue(file.FullName, out var content)) 75if (_fileContent.Count != 0 && _fileContent.TryGetValue(file.FullName, out var content)) 98if (_fileContent.Count == 0 || flag)
Microsoft.Extensions.Options.SourceGeneration (4)
Emitter.cs (4)
615if (_optionsSourceGenContext.AttributesToGenerate.Count == 0) 778if (attr.Properties.Count > 0) 800var fieldNumber = staticValidationAttributesDict.Count + 1; 906var fieldNumber = staticValidatorsDict.Count + 1;
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
SyntaxContextReceiverTests.cs (1)
33Assert.Equal(3, typeDeclarations!.Count);
Microsoft.Gen.Logging.Generated.Tests (2)
LogPropertiesTests.cs (2)
177Assert.Equal(11, ss.Count); 195Assert.Equal(4, ss.Count);
Microsoft.Interop.SourceGeneration (1)
ManualTypeMarshallingHelper.cs (1)
230if (modes.Count == 0)
Microsoft.Maui (2)
Platform\iOS\KeyboardAcceleratorExtensions.cs (1)
13 var index = MenuFlyoutItemHandler.menus.Count;
Platform\iOS\MauiUISceneDelegate.cs (1)
63 if (persistedState.Count == 0)
Microsoft.Maui.Controls (11)
DragAndDrop\DataPackagePropertySet.cs (1)
26 public int Count => _propertyBag.Count;
Element\Element.cs (1)
735 if (DynamicResources.Count == 0)
ListProxy.cs (1)
194 if (_items != null && _items.Count > 0)
OrderedDictionary.cs (1)
145 get { return _dict.Count; }
ResourceDictionary.cs (3)
180 get { return _innerDictionary.Count + (_mergedInstance?.Count ?? 0); } 248 if (_innerDictionary.Count == 0) 267 if (_innerDictionary.Count == 0)
Shell\ShellContent.cs (1)
347 if (query.Count == 0 && !this.IsSet(QueryAttributesProperty))
Shell\ShellNavigationQueryParameters.cs (1)
55 public int Count => _internal.Count;
Shell\ShellRouteParameters.cs (2)
43 : base(query.Count) 91 if (queryStringParameters == null || queryStringParameters.Count == 0)
Microsoft.Maui.Controls.Xaml (1)
RemoveDuplicateDesignNodes.cs (1)
24 if (node.Properties == null || node.Properties.Count == 0)
Microsoft.Maui.Graphics.Text.Markdig (1)
Renderer\HtmlInlineRenderer.cs (1)
57 if (attributes.Count > 0)
Microsoft.Maui.Resizetizer (1)
DetectInvalidResourceOutputFilenamesTask.cs (1)
45 if (tempInvalidItems.Count > 0)
Microsoft.ML.AutoML (4)
Sweepers\ISweeper.cs (3)
118get { return _parameterValues.Count; } 135if (other == null || other._hash != _hash || other._parameterValues.Count != _parameterValues.Count)
Tuner\CostFrugalTuner.cs (1)
88if (_searchThreadPool.Count == 0)
Microsoft.ML.Core (5)
CommandLine\CmdParser.cs (1)
1345Contracts.Assert(map.Count >= args.Length);
Data\RoleMappedSchema.cs (1)
313var copy = new Dictionary<string, IReadOnlyList<DataViewSchema.Column>>(map.Count);
Utilities\LruCache.cs (1)
67if (_cache.Count > _size)
Utilities\Tree.cs (1)
79public int Count { get { return _children.Count; } }
Utilities\Utils.cs (1)
111return x == null ? 0 : x.Count;
Microsoft.ML.Data (18)
DataLoadSave\Database\DatabaseLoader.cs (1)
489if (iinfo == nameToInfoIndex.Count && nameToInfoIndex.ContainsKey(name))
DataLoadSave\Text\TextLoader.cs (1)
765if (iinfo == nameToInfoIndex.Count && nameToInfoIndex.ContainsKey(name))
Evaluators\EvaluatorBase.cs (1)
404public override int Count => _dict.Count;
Evaluators\EvaluatorUtils.cs (11)
489slotNames[name] = slotNames.Count; 494var reconciledSlotNames = new VBuffer<ReadOnlyMemory<char>>(slotNames.Count, slotNames.Keys.Select(k => k.AsMemory()).ToArray()); 513var editor = VBufferEditor.Create(ref dst, slotNames.Count); 524var mappedIndices = new bool[slotNames.Count]; 537var editor = VBufferEditor.Create(ref dst, slotNames.Count); 547var typeDst = new VectorDataViewType(itemType, slotNames.Count); 589reconciledKeyNames[name] = reconciledKeyNames.Count; 614var keyType = new KeyDataViewType(typeof(uint), keyNames.Count); 615var keyNamesVBuffer = new VBuffer<ReadOnlyMemory<char>>(keyNames.Count, keyNames.Keys.ToArray()); 682var keyType = new KeyDataViewType(typeof(uint), keyNames.Count); 683var keyNamesVBuffer = new VBuffer<ReadOnlyMemory<char>>(keyNames.Count, keyNames.Keys.ToArray());
Model\Pfa\BoundPfaContext.cs (2)
84_host.Assert(_nameToVarName.Count == fields.Count); 85_host.Assert(_nameToVarName.Count == fieldNames.Count);
Transforms\ColumnBindingsBase.cs (1)
341Contracts.Assert(_nameToInfoIndex.Count == names.Length);
Transforms\InvertHashUtils.cs (1)
231int count = _slotToValueSet.Count;
Microsoft.ML.FastTree (10)
Dataset\DatasetUtils.cs (3)
51uvalToOrder[uintQid] = uvalToOrder.Count; 54skel.NumDocs, IntArrayType.Dense, IntArray.NumBitsNeeded(uvalToOrder.Count), 57uint[] valueMap = uvalToOrder.Keys.OrderBy(x => x).ToArray(uvalToOrder.Count);
FastTree.cs (1)
3240if (gainMap.Count == 0)
GamModelParameters.cs (1)
185ctx.Writer.Write(_inputFeatureToShapeFunctionMap.Count);
TreeEnsemble\InternalRegressionTree.cs (4)
1203sbInput.AppendFormat("\n[Input:{0}]\n", featureToId.Count + 1); 1207featureToId.Add(SplitFeatures[n], featureToId.Count + 1); 1283sbInput.AppendFormat("\n[Input:{0}]\n", featureToId.Count + 1); 1287featureToId.Add(categoricalSplitFeature, featureToId.Count + 1);
TreeEnsemble\InternalTreeEnsemble.cs (1)
136sb.AppendFormat("[TreeEnsemble]\nInputs={0}\nEvaluators={1}\n", featureToID.Count, evaluatorCounter + 1);
Microsoft.ML.GenAI.Core (1)
Extension\ModuleExtension.cs (1)
123if (deviceMap.Count == 0)
Microsoft.ML.LightGbm (1)
LightGbmTrainerBase.cs (1)
897cnt = ivPair.Count;
Microsoft.ML.SearchSpace (1)
Parameter.cs (1)
233public int Count => ParameterType == ParameterType.Object ? (_value as Dictionary<string, Parameter>).Count : 1;
Microsoft.ML.Sweeper (3)
ISweeper.cs (3)
147get { return _parameterValues.Count; } 164if (other == null || other._hash != _hash || other._parameterValues.Count != _parameterValues.Count)
Microsoft.ML.TimeSeries (18)
PolynomialUtils.cs (1)
332if (hash.Count > 0)
RootCauseAnalyzer.cs (15)
54if (anomalyTree.ParentNode == null || dimPointMapping.Count == 0) 136if (anomalyTree.ChildrenNodes.Count == 0) 235int pointSize = isLeaveslevel ? pointDistribution.Count : GetTotalNumber(pointDistribution); 310double entropy = GetEntropy(dimension.PointDis.Count, dimension.AnomalyDis.Count); 490if (dimension.Key.AnomalyDis.Count == 1 || (isLeavesLevel ? dimension.Value >= meanGain : dimension.Value <= meanGain)) 499if (dimension.Key.AnomalyDis.Count > 1) 501if (best.AnomalyDis.Count != 1 && !isRatioNan && (isLeavesLevel ? valueRatioMap[best].CompareTo(dimension.Value) <= 0 : valueRatioMap[best].CompareTo(dimension.Value) >= 0)) 506else if (dimension.Key.AnomalyDis.Count == 1) 509if (best.AnomalyDis.Count > 1) 513else if (best.AnomalyDis.Count == 1) 539if (dimension.Key.AnomalyDis.Count != dimension.Key.PointDis.Count) 816if (x.Count != y.Count)
RootCauseLocalizationType.cs (2)
154if (Dimension.Count == other.Dimension.Count)
Microsoft.ML.TimeSeries.Tests (5)
TimeSeriesDirectApi.cs (5)
965Assert.Equal(3, (int)rootCause.Items[0].Dimension.Count); 994Assert.Equal(3, (int)preparedCauses[0].Items[0].Dimension.Count); 1010Assert.Equal(3, (int)preparedCauses[1].Items[0].Dimension.Count); 1042Assert.Equal(3, rootCause.Items[0].Dimension.Count); 1192Assert.Equal(3, rootCause.Items[0].Dimension.Count);
Microsoft.ML.Tokenizers (3)
Model\Cache.cs (1)
50if (_map.Count < _capacity)
Utils\LruCache.cs (1)
109while (_cache.Count >= _cacheSize)
Utils\StringSpanOrdinalKey.cs (1)
120if (_map.Count < _capacity)
Microsoft.ML.TorchSharp (3)
AutoFormerV2\Attention.cs (2)
83attentionOffsets.Add(offset, attentionOffsets.Count); 91this.attention_biases = nn.Parameter(torch.zeros(numHeads, attentionOffsets.Count));
Utils\DefaultDictionary.cs (1)
80public int Count => _dictionary.Count;
Microsoft.ML.Transforms (2)
Dracula\CMCountTable.cs (1)
135ctx.Writer.Write(dict.Count);
Dracula\DictCountTable.cs (1)
106ctx.Writer.Write(table.Count);
Microsoft.NET.StringTools.net35 (2)
WeakStringCache.Locking.cs (2)
63if (_stringsByHashCode.Count >= _scavengeThreshold) 68_scavengeThreshold = _stringsByHashCode.Count * 2;
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (1)
1595ElseIf _dict.Count = _maxSize Then
Microsoft.VisualStudio.LanguageServices (3)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (2)
68var copy = new KeyValuePair<K, V>[_cache.Count]; 135if (_cache.Count == _capacity)
Utilities\VsCodeWindowViewTracker.cs (1)
138Debug.Assert(_trackedTextViews.Count == 0);
MSBuild (4)
TaskParameter.cs (3)
809int count = (_customEscapedMetadata == null) ? 0 : _customEscapedMetadata.Count; 1004if (_customEscapedMetadata == null || _customEscapedMetadata.Count == 0) 1009var result = new KeyValuePair<string, string>[_customEscapedMetadata.Count];
XMake.cs (1)
1593result = ExecuteRestore(projectFile, toolsVersion, buildManager, restoreProperties.Count > 0 ? restoreProperties : globalProperties, saveProjectResult: saveProjectResult);
MSBuildTaskHost (10)
BinaryTranslator.cs (5)
1337if ((dictionary is null) && ((additionalEntries is null) || (additionalEntries.Count == 0))) 1350(additionalEntries is null ? 0 : additionalEntries.Count) + 1351(dictionary is null ? 0 : dictionary.Count); 1446int count = dictionary.Count; 1527int count = dictionary.Count;
BinaryWriterExtensions.cs (1)
124writer.Write7BitEncodedInt(data.ExtendedMetadata.Count);
Immutable\ImmutableDictionary.cs (1)
47public int Count => _backing.Count;
TaskParameter.cs (3)
809int count = (_customEscapedMetadata == null) ? 0 : _customEscapedMetadata.Count; 1004if (_customEscapedMetadata == null || _customEscapedMetadata.Count == 0) 1009var result = new KeyValuePair<string, string>[_customEscapedMetadata.Count];
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\ParserContext.cs (1)
897return cache.Count == 0 ? null : cache;
PresentationCore (14)
MS\Internal\Automation\EventMap.cs (3)
172if (_eventsTable.Count == 0) 188if (_eventsTable != null && _eventsTable.Count != 0) 200if (_eventsTable != null && _eventsTable.Count != 0)
MS\Internal\DeferredElementTreeState.cs (2)
119return _oldCoreParents.Count == 0 && _oldLogicalParents.Count == 0;
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
737get { return CMap.Count; }
MS\Internal\FontFace\CompositeFontInfo.cs (1)
147Dictionary<XmlLanguage, ushort[]> table = new Dictionary<XmlLanguage, ushort[]>(_familyMapRangesByLanguage.Count);
MS\Internal\Ink\Renderer.cs (1)
560i = Math.Min(_visuals.Count, _strokes.Count); //not -1, we're about to decrement
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\MimeTypeMapper.cs (1)
38if (_fileExtensionToMimeType.Count == 0)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SizeLimitedCache.cs (1)
260return (_nodeLookup.Count - _permanentCount >= _maximumItems);
System\Windows\Input\ManipulationLogic.cs (1)
685get { return (_currentManipulators.Count > 0) ? _currentManipulators.Values : null; }
System\Windows\Input\Stylus\Wisp\WispLogic.cs (1)
3143if (__penContextsMap.Count == 1)
System\Windows\Media\UniqueEventHelper.cs (2)
129if (_delegates is { Count: > 0 } delegates) 131var handlers = new TEventHandler[delegates.Count];
PresentationFramework (19)
MS\Internal\Annotations\AnnotationMap.cs (1)
59return _annotationIdToAttachedAnnotations.Count == 0;
MS\Internal\Annotations\ObservableDictionary.cs (2)
76int count = _nameValues.Count; 223return _nameValues.Count;
MS\Internal\Data\AccessorTable.cs (3)
107int originalCount = _table.Count; 123Console.WriteLine($"After generation {_generation}, removed {originalCount - _table.Count} of {originalCount} entries from AccessorTable, new count is {_table.Count}");
MS\Internal\Data\CommitManager.cs (6)
21get { return _bindings.Count == 0 && _bindingGroups.Count == 0; } 99int count = _bindings.Count; 109foundDirt = foundDirt || (_bindings.Count < count); 111count = _bindingGroups.Count; 121foundDirt = foundDirt || (_bindingGroups.Count < count);
System\Windows\Markup\ParserContext.cs (1)
897return cache.Count == 0 ? null : cache;
System\Windows\SystemResources.cs (6)
1039_hwndNotify.Count == 0 || 1147if (_hwndNotify != null && _hwndNotify.Count != 0) 1302&& _hwndNotify.Count != 0) 1662if (_hwndNotify != null && _hwndNotify.Count != 0) 2135List<object> deadKeys = new(Math.Min(_potentiallyDeadEntryCount, _entries.Count)); 2159var aliveItems = new List<DeferredResourceReference>(_entries.Count);
System.Collections.Immutable (12)
System\Collections\Frozen\FrozenDictionary.cs (5)
88if (newDictionary is null || (newDictionary.Count != 0 && !newDictionary.Comparer.Equals(comparer))) 100if (newDictionary.Count == 0) 116Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller"); 125if (source.Count <= Constants.MaxItemsInSmallValueTypeFrozenCollection) 233if (source.Count <= Constants.MaxItemsInSmallFrozenCollection)
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (2)
24Debug.Assert(source.Count != 0); 26KeyValuePair<int, TValue>[] entries = new KeyValuePair<int, TValue>[source.Count];
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (2)
20Debug.Assert(source.Count != 0); 22KeyValuePair<TKey, TValue>[] entries = new KeyValuePair<TKey, TValue>[source.Count];
System\Collections\Frozen\SmallFrozenDictionary.cs (1)
26Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (1)
31Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenDictionary.cs (1)
23Debug.Assert(source.Count != 0);
System.ComponentModel.Composition (2)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
247if (dictionary.Count == 0)
System\ComponentModel\Composition\Hosting\ImportEngine.PartManager.cs (1)
162if (_importedDisposableExports.Count == 0)
System.ComponentModel.TypeConverter (3)
System\ComponentModel\CultureInfoConverter.cs (1)
551Debug.Assert(result.Count == Count);
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (2)
459eventArray = new EventDescriptor[eventList.Count]; 494propertyArray = new PropertyDescriptor[propertyList.Count];
System.Composition.TypedParts (4)
System\Composition\Hosting\SinglePartExportDescriptorProvider.cs (1)
32subsetOfConstraints.Count == 0 ? null : subsetOfConstraints);
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (1)
71if (propertyDependencies.Count == 0)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (1)
219return partMetadata.Count == 0 ? s_noMetadata : partMetadata;
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (1)
90if (subsettedConstraints.Count != 0)
System.Console (1)
System\TerminalFormatStrings.cs (1)
161if (KeyFormatToConsoleKey.Count > 0)
System.Data.Common (7)
System\Data\Common\DbConnectionStringBuilder.cs (3)
196get { return CurrentValues.Count; } 316if ((GetType() != connectionStringBuilder.GetType()) || (CurrentValues.Count != connectionStringBuilder.CurrentValues.Count))
System\Data\Common\ObjectStorage.cs (1)
6111 + cache.Count, TempAssemblyComparer.s_default);
System\Data\DataView.cs (3)
275Debug.Assert(_rowViewCache.Count == CountFromIndex, "DataView.Count mismatch"); 276return _rowViewCache.Count; 1474Debug.Assert(rvc.Count == CountFromIndex, "didn't add expected count");
System.Data.Odbc (2)
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (2)
221Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup> newConnectionPoolGroups = new Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup>(1 + connectionPoolGroups.Count); 303Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup> newConnectionPoolGroups = new Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup>(connectionPoolGroups.Count);
System.Diagnostics.Process (1)
System\Collections\Specialized\DictionaryWrapper.cs (1)
35public int Count => _contents.Count;
System.Drawing.Common.Tests (2)
System\Drawing\Imaging\ImageCodecInfoTests.cs (2)
215Assert.Equal(5, _encoders.Count); 221Assert.Equal(8, _decoders.Count);
System.Formats.Nrbf (7)
System\Formats\Nrbf\ClassWithMembersAndTypesRecord.cs (1)
27MemberTypeInfo memberTypeInfo = MemberTypeInfo.Decode(reader, classInfo.MemberNames.Count, options, recordMap);
System\Formats\Nrbf\RecordMap.cs (1)
20public int Count => _map.Count;
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (5)
28MemberTypeInfo memberTypeInfo = MemberTypeInfo.Decode(reader, classInfo.MemberNames.Count, options, recordMap); 43if (!classInfo.TypeName.IsSimple || classInfo.MemberNames.Count == 0 || memberTypeInfo.Infos[0].BinaryType != BinaryType.Primitive) 47else if (classInfo.MemberNames.Count == 1) 75else if (classInfo.MemberNames.Count == 2 && typeName.FullName == "System.DateTime" 81else if (classInfo.MemberNames.Count == 4 && typeName.FullName == "System.Decimal"
System.Formats.Tar (4)
System\Formats\Tar\TarHeader.Read.cs (1)
102if (dictionaryFromExtendedAttributesHeader == null || dictionaryFromExtendedAttributesHeader.Count == 0)
System\Formats\Tar\TarHeader.Write.cs (3)
462Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 471Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 836if (extendedAttributes.Count > 0)
System.IO.FileSystem.Watcher (1)
System\IO\FileSystemWatcher.Linux.cs (1)
329if (_wdToPathMap.Count > 0)
System.IO.Packaging (4)
System\IO\Packaging\ContentType.cs (2)
189if (_parameterDictionary.Count > 0) 225if (_parameterDictionary != null && _parameterDictionary.Count > 0)
System\IO\Packaging\OrderedDictionary.cs (1)
69public int Count => _dictionary.Count;
System\IO\Packaging\Package.cs (1)
1214_partList = new SortedList<PackUriHelper.ValidatedPartUri, PackagePart>(partDictionary.Count);
System.Linq.Expressions (5)
System\Linq\Expressions\DebugViewWriter.cs (1)
90id = ids.Count + 1;
System\Linq\Expressions\ExpressionStringBuilder.cs (1)
43id = _ids.Count;
System\Linq\Expressions\Interpreter\Interpreter.cs (1)
42internal int ClosureSize => ClosureVariables?.Count ?? 0;
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
2783_instructions.Emit(new QuoteInstruction(unary.Operand, mapping.Count > 0 ? mapping : null));
System\Linq\Expressions\Interpreter\LocalVariables.cs (1)
161LocalVariable result = new LocalVariable(_closureVariables.Count, true);
System.Linq.Parallel (1)
System\Linq\Parallel\Utils\Lookup.cs (1)
53int count = _dict.Count;
System.Net.Http (16)
src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (3)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 27return _forward.Count;
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (1)
110if (cache.Count == 0)
System\Net\Http\Headers\HttpHeaders.cs (2)
1389var entries = new HeaderEntry[dictionary.Count]; 1499Debug.Assert(dictionary.Count == _count - 1);
System\Net\Http\HttpRequestOptions.cs (3)
35int ICollection<KeyValuePair<string, object?>>.Count => Options.Count; 50int IReadOnlyCollection<KeyValuePair<string, object?>>.Count => Options.Count; 87private string DebuggerToString() => $"Count = {Options.Count}";
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
835if (added && altSvcBlocklist.Count >= MaxAltSvcIgnoreListSize && _altSvcEnabled)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (3)
313Debug.Assert(_streamsInUse >= _httpStreams.Count); 1602if (_httpStreams.Count == 0) 2074if (_httpStreams.Count == 0)
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (3)
129if (_activeRequests.Count != 0) 262if (_activeRequests.Count == 0) 445if (_activeRequests.Count == 0)
System.Net.HttpListener (2)
System\Net\Managed\HttpEndPointListener.cs (1)
292if (_prefixes.Count > 0)
System\Net\Managed\HttpEndPointManager.cs (1)
176if (p.Count == 0)
System.Net.Mail (3)
src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (3)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 27return _forward.Count;
System.Net.NetworkInformation (10)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (10)
72if (s_addressChangedSubscribers.Count == 0 && s_availabilityChangedSubscribers.Count == 0) 80if (s_addressChangedSubscribers.Count == 0 && s_availabilityChangedSubscribers.Count == 0) 123if (s_addressChangedSubscribers.Count == 0 && s_availabilityChangedSubscribers.Count == 0) 131if (s_availabilityChangedSubscribers.Count == 0) 140if (s_addressChangedSubscribers.Count == 0) 268if (s_addressChangedSubscribers.Count > 0) 303if (s_availabilityChangedSubscribers.Count > 0)
System.Net.Ping (4)
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (4)
14Debug.Assert(s_nativeErrorToSocketError.Count == NativeErrorToSocketErrorCount, 15$"Expected s_nativeErrorToSocketError to have {NativeErrorToSocketErrorCount} count instead of {s_nativeErrorToSocketError.Count}."); 17Debug.Assert(s_socketErrorToNativeError.Count == SocketErrorToNativeErrorCount, 18$"Expected s_socketErrorToNativeError to have {SocketErrorToNativeErrorCount} count instead of {s_socketErrorToNativeError.Count}.");
System.Net.Primitives (5)
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (1)
110if (cache.Count == 0)
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (4)
14Debug.Assert(s_nativeErrorToSocketError.Count == NativeErrorToSocketErrorCount, 15$"Expected s_nativeErrorToSocketError to have {NativeErrorToSocketErrorCount} count instead of {s_nativeErrorToSocketError.Count}."); 17Debug.Assert(s_socketErrorToNativeError.Count == SocketErrorToNativeErrorCount, 18$"Expected s_socketErrorToNativeError to have {SocketErrorToNativeErrorCount} count instead of {s_socketErrorToNativeError.Count}.");
System.Net.Sockets (4)
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (4)
14Debug.Assert(s_nativeErrorToSocketError.Count == NativeErrorToSocketErrorCount, 15$"Expected s_nativeErrorToSocketError to have {NativeErrorToSocketErrorCount} count instead of {s_nativeErrorToSocketError.Count}."); 17Debug.Assert(s_socketErrorToNativeError.Count == SocketErrorToNativeErrorCount, 18$"Expected s_socketErrorToNativeError to have {SocketErrorToNativeErrorCount} count instead of {s_socketErrorToNativeError.Count}.");
System.Private.CoreLib (26)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (11)
121if (source.Count == 0) 131Debug.Assert(_entries.Length >= source.Count); 354if (array.Length - index < Count) 373Count == 0 ? GenericEmptyEnumerator<KeyValuePair<TKey, TValue>>.Instance : 391var array = new KeyValuePair<TKey, TValue>[Count]; 1913if (array.Length - index < _dictionary.Count) 1926public int Count => _dictionary.Count; 1973if (array.Length - index < _dictionary.Count) 2108if (array.Length - index < _dictionary.Count) 2121public int Count => _dictionary.Count; 2167if (array.Length - index < _dictionary.Count)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\DiagnosticCounter.cs (1)
129Debug.Assert(_metadata.Count > 0);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
74if (m_subscriptions.Count <= 0)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
5603if (channelTab.Count == MaxCountChannels)
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (2)
675Debug.Assert(s_lookupTable.Count == 253, $"There should be 253 HTML entities, but {nameof(s_lookupTable)} has {s_lookupTable.Count} of them.");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceSet.cs (1)
217caseTable = new Dictionary<string, object?>(copyOfTable.Count, StringComparer.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
285alcSnapshot = new WeakReference<AssemblyLoadContext>[allContexts.Count];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (2)
139Debug.Assert(children.Count > 0); 149int dictionarySize = DictionaryMemoryFootprintBytesEstimate(children.Count);
src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (1)
166var result = new EncodingInfo[encodingInfoList.Count];
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (2)
486int count = Count; 535Debug.Assert(map.Count == count - 1);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (1)
643_freeIds.EnsureCapacity(_usedIdToTracksAllValuesMap.Count + 1);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (1)
910TimeZoneInfo[] array = new TimeZoneInfo[cachedData._systemTimeZones.Count];
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (1)
519Type[] typeList = new Type[_typeBuilderDict.Count];
System.Private.DataContractSerialization (7)
System\Runtime\Serialization\DataContractSet.cs (1)
205if (knownDataContracts?.Count > 0)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (1)
267if (dataContract.KnownDataContracts?.Count > 0)
System\Runtime\Serialization\XmlObjectSerializerContext.cs (1)
211if (knownDataContracts?.Count > 0)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (2)
147if (dataContract.KnownDataContracts?.Count > 0) 206if (knownDataContracts?.Count > 0)
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
130if (dataContract.KnownDataContracts?.Count > 0) 235if (dataContract.KnownDataContracts?.Count > 0)
System.Private.Xml (26)
System\Xml\Core\XmlWellFormedWriter.cs (3)
2123Debug.Assert(_attrHashTable.Count == 0); 2150int count = _attrHashTable.Count; 2152if (count != _attrHashTable.Count)
System\Xml\Schema\ContentValidator.cs (4)
1494int newState = stateTable.Count - 1; 2127int i = _elements.Count; 2149Debug.Assert(_elements.Count > 0); 2150context.AllElementsSet = new BitSet(_elements.Count);
System\Xml\Schema\XmlSchemaObjectTable.cs (5)
94Debug.Assert(_table.Count == _entries.Count); 95return _table.Count; 121return new NamesCollection(_entries, _table.Count); 129return new ValuesCollection(_entries, _table.Count); 135return new XSODictionaryEnumerator(_entries, _table.Count, EnumeratorType.DictionaryEntry);
System\Xml\Serialization\CodeGenerator.cs (2)
100ArgBuilder arg = new ArgBuilder(argNames[i], _argList.Count, argTypes[i]); 155localTmp = DeclareLocal(type, $"_tmp{_tmpLocals.Count}");
System\Xml\Serialization\NameTable.cs (1)
100Array a = Array.CreateInstance(type, _table.Count);
System\Xml\Serialization\XmlSerializer.cs (2)
726if (pendingKeys.Count > 0) 728XmlMapping[] pendingMappings = new XmlMapping[pendingKeys.Count];
System\Xml\Serialization\XmlSerializerNamespaces.cs (6)
85if (_namespaces == null || _namespaces.Count == 0) 88XmlQualifiedName[] array = new XmlQualifiedName[_namespaces.Count]; 98get { return (_namespaces == null) ? 0 : _namespaces.Count; } 109if (_namespaces == null || _namespaces.Count == 0) 120if (_namespaces == null || _namespaces.Count == 0 || string.IsNullOrEmpty(ns)) 138if (_namespaces == null || _namespaces.Count == 0 || string.IsNullOrEmpty(prefix))
System\Xml\Xsl\Xslt\Compiler.cs (1)
98_moduleOrder[baseUri] = _moduleOrder.Count;
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
2139Debug.Assert(sheet.TemplateMatches.Count == 0);
System\Xml\Xsl\Xslt\Scripts.cs (1)
66public int Count => _backingDictionary.Count;
System.Reflection.Emit (2)
System\Reflection\Emit\ModuleBuilderImpl.cs (2)
415if (il.DocumentToSequencePoints.Count == 0) 423if (il.DocumentToSequencePoints.Count > 1)
System.Reflection.Metadata (2)
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
104public int Count => _dictionary.Count;
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (1)
455handle = StringHandle.FromWriterVirtualIndex(_strings.Count + 1); // idx 0 is reserved for empty string
System.Resources.Extensions (1)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
307numResources += _preserializedData.Count;
System.Resources.Writer (1)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
307numResources += _preserializedData.Count;
System.Runtime.Caching (1)
System\Runtime\Caching\MemoryCacheEntry.cs (1)
251if (_fields != null && _fields._dependents != null && _fields._dependents.Count > 0)
System.Runtime.Serialization.Schema (2)
System\Runtime\Serialization\Schema\CodeExporter.cs (2)
968if (knownContracts == null || knownContracts.Count == 0) 988if (knownContractDictionary == null || knownContractDictionary.Count == 0)
System.Security.Claims (2)
System\Security\Claims\Claim.cs (2)
455if (_properties != null && _properties.Count > 0) 493writer.Write(_properties!.Count);
System.Security.Cryptography (10)
System\Security\Cryptography\CryptoConfig.cs (2)
96Debug.Assert(ht.Count <= capacity); // if more entries are added in the future, increase initial capacity. 274Debug.Assert(ht.Count <= capacity); // // if more entries are added in the future, increase initial capacity.
System\Security\Cryptography\OidLookup.cs (6)
125Debug.Assert(s_friendlyNameToOid.Count == FriendlyNameToOidCount, 126$"Expected {nameof(s_friendlyNameToOid)}.{nameof(s_friendlyNameToOid.Count)} == {FriendlyNameToOidCount}, got {s_friendlyNameToOid.Count}"); 127Debug.Assert(s_oidToFriendlyName.Count == OidToFriendlyNameCount, 128$"Expected {nameof(s_oidToFriendlyName)}.{nameof(s_oidToFriendlyName.Count)} == {OidToFriendlyNameCount}, got {s_oidToFriendlyName.Count}");
System\Security\Cryptography\X509Certificates\FindPal.cs (1)
32Debug.Assert(s_keyUsages.Count == NamedKeyUsageFlagsCount);
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (1)
641Debug.Assert(lookup.Count == LookupDictionarySize);
System.Security.Cryptography.Cose (4)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (4)
55public int Count => _headerParameters.Count; 337if (map._headerParameters.Count == 0 && isProtected && !shouldSlipAlgHeader) 342int mapLength = map._headerParameters.Count; 388int mapLength = map._headerParameters.Count;
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (1)
84Debug.Assert(converters.Count <= NumberOfSimpleConverters);
System.Text.Json.SourceGeneration (4)
JsonSourceGenerator.Emitter.cs (2)
102Debug.Assert(_typeIndex.Count == 0); 103Debug.Assert(_propertyNames.Count == 0);
JsonSourceGenerator.Parser.cs (2)
89Debug.Assert(_generatedTypes.Count == 0); 151Debug.Assert(_generatedTypes.Count > 0);
System.Text.RegularExpressions (11)
System\Text\RegularExpressions\RegexCharClass.cs (2)
325s_definedCategories.Count == DefinedCategoriesCapacity, 326$"Expected (s_definedCategories.Count): {s_definedCategories.Count}, Actual (DefinedCategoriesCapacity): {DefinedCategoriesCapacity}");
System\Text\RegularExpressions\RegexWriter.cs (2)
115var strings = new string[_stringTable.Count]; 184i = _stringTable.Count - 1;
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (3)
258state.Id = _stateCache.Count; 315nfaStateId = _nfaIdByCoreId.Count; 368(checkThreshold && _builder._nodeCache.Count >= SymbolicRegexThresholds.NfaNodeCountThreshold)) // if # of nodes exceeds the NFA threshold
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (3)
29writer.WriteLine(" <Node Id=\"dfa\" Label=\" \" Group=\"Collapsed\" Category=\"DFA\" DFAInfo=\"{0}\" />", FormatInfo(this, transitions.Count)); 30writer.WriteLine(" <Node Id=\"dfainfo\" Category=\"DFAInfo\" Label=\"{0}\"/>", FormatInfo(this, transitions.Count)); 185sb.Append($"States = {matcher._stateCache.Count}&#13;");
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
67BDD[] catBDDs = new BDD[catMap.Count];
System.Text.RegularExpressions.Generator (4)
RegexGenerator.cs (1)
257if (requiredHelpers.Count != 0)
RegexGenerator.Emitter.cs (1)
1555if (additionalLocalFunctions.Count != 0)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (2)
325s_definedCategories.Count == DefinedCategoriesCapacity, 326$"Expected (s_definedCategories.Count): {s_definedCategories.Count}, Actual (DefinedCategoriesCapacity): {DefinedCategoriesCapacity}");
System.Threading.Tasks.Dataflow (3)
Internal\QueuedMap.cs (1)
228internal int Count { get { return _mapKeyToIndex.Count; } }
Internal\ReorderingBuffer.cs (1)
176private int CountForDebugging { get { return _reorderingBuffer.Count; } }
Internal\TargetRegistry.cs (1)
277private int Count { get { return _targetInformation.Count; } }
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (1)
244int elementCount = ribbon.TabDisplayIndexToIndexMap.Count;
System.Windows.Forms (7)
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (1)
430int propertyCount = propertyInfo.Count;
System\Windows\Forms\Controls\WebBrowser\HtmlShim.cs (1)
63EventHandler[] events = new EventHandler[_attachedEventList.Count];
System\Windows\Forms\Controls\WebBrowser\HtmlShimManager.cs (2)
173HtmlDocument.HtmlDocumentShim[] shims = new HtmlDocument.HtmlDocumentShim[_htmlDocumentShims.Count]; 191HtmlElement.HtmlElementShim[] shims = new HtmlElement.HtmlElementShim[_htmlElementShims.Count];
System\Windows\Forms\DataBinding\BindingContext.cs (1)
35return _listManagers.Count;
System\Windows\Forms\NativeWindow.cs (1)
607if (s_windowHandles.Count > 0)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.TableLayoutSettingsStub.cs (1)
88List<ControlInformation> listOfControlInfo = new(_controlsInfo.Count);
System.Windows.Forms.Design (13)
System\ComponentModel\Design\DesignerActionPanel.cs (2)
839if (categoryIndex < category.Count) 847if (categoriesIndex < categories.Count)
System\ComponentModel\Design\DesignerActionService.cs (1)
94if (_designerActionLists.Count == 0)
System\ComponentModel\Design\MenuCommandService.cs (1)
294DesignerVerb[] result = new DesignerVerb[buildVerbs.Count];
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (3)
136Dictionary<string, CodeDomComponentSerializationState> state = new(_objects.Count); 172Dictionary<Assembly, AssemblyName> assemblies = new(_objects.Count); 183AssemblyNames = new AssemblyName[assemblies.Count];
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (1)
176OrderedCodeStatementCollection[] statementArray = new OrderedCodeStatementCollection[_statementTable.Count];
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (1)
472List<IComponent> list = new(_lastSelection.Count);
System\Drawing\Design\ToolboxItem.cs (1)
573AssemblyName[] parentAssemblies = new AssemblyName[parents.Count];
System\Resources\Tools\StronglyTypedResourceBuilder.cs (1)
866SortedList<string, ResourceData> cleanedResourceList = new(resourceList.Count, StringComparer.InvariantCultureIgnoreCase);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1289propArray = new PropertyDescriptor[hash.Count + 1];
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
122if (t_customToolStripItemCount > 0 && (t_customToolStripItemCount * 2 < t_cachedToolboxItems.Count))
System.Windows.Forms.Design.Tests (1)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (1)
139Assert.Equal(2, state.Count);
System.Windows.Input.Manipulations (9)
System\Windows\Input\Manipulations\ManipulationSequence.cs (9)
305removedManipulatorIds = ((this.manipulatorStates != null) && (this.manipulatorStates.Count > 0)) 447if (this.manipulatorStates != null && this.manipulatorStates.Count > 0) 689if (this.manipulatorStates.Count > 1 && // rotate and scale require more than one manipulator 695else if ((this.manipulatorStates.Count == 1) // try single-manipulator rotation 808if ((this.manipulatorStates.Count < 2) 1017Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1027PointF result = new PointF(x / this.manipulatorStates.Count, y / this.manipulatorStates.Count); 1038Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0);
System.Xaml (10)
System\Xaml\AttachablePropertyServices.cs (1)
152return instanceProperties.Count;
System\Xaml\Context\NameFixupGraph.cs (1)
381while (_dependenciesByParentObject.Count > 0)
System\Xaml\Context\XamlParserContext.cs (1)
144if (_prescopeNamespaces.Count > 0)
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
437_subsumeCount = new Dictionary<string,int>(nsInfo.OldToNewNs.Count);
System\Xaml\Schema\TypeReflector.cs (4)
515if (result.Count == 0) 519List<PropertyInfo> filteredResult = new List<PropertyInfo>(result.Count); 565if (result.Count == 0) 569List<EventInfo> filteredResult = new List<EventInfo>(result.Count);
System\Xaml\XamlSchemaContext.cs (1)
588return map.Count > 0 ? map : null;
System\Xaml\XamlXmlWriter.cs (1)
747return (namespaceMap.Count == 0);
xunit.assert (2)
Sdk\AssertHelper.cs (2)
701 if (strict && expectedGetters.Count != actualGetters.Count)