464 implementations of Count
Aspire.Dashboard (1)
src\Shared\CircularBuffer.cs (1)
48public int Count => _buffer.Count;
Aspire.Hosting (2)
ApplicationModel\ResourceCollection.cs (1)
16public int Count => _resources.Count;
src\Shared\CircularBuffer.cs (1)
48public int Count => _buffer.Count;
dotnet-svcutil-lib (5)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageProperties.cs (1)
88public int Count
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceChannelManager.cs (1)
425public int Count
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedCollection.cs (1)
56public int Count
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedReadOnlyCollection.cs (1)
70public int Count
Shared\Options\ListValue.cs (1)
67public int Count { get { return this.InnerList.Count; } }
InMemory.FunctionalTests (2)
Http2\Http2ConnectionTests.cs (1)
297public int Count => _innerHeaders.Count;
Http3\Http3ConnectionTests.cs (1)
832public int Count => _innerHeaders.Count;
Microsoft.AspNetCore.Components (1)
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
312public int Count => _count;
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Binding\FormDataMapperTests.cs (1)
2420public int Count => _inner.Count;
Microsoft.AspNetCore.Connections.Abstractions (1)
ConnectionItems.cs (1)
104int ICollection<KeyValuePair<object, object?>>.Count
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.AspNetCore.Hosting.Tests (1)
WebHostTests.cs (1)
1386public int Count => 0;
Microsoft.AspNetCore.Http (4)
HeaderDictionary.cs (1)
152public int Count => Store?.Count ?? 0;
Internal\ItemsDictionary.cs (1)
111int ICollection<KeyValuePair<object, object?>>.Count => _items?.Count ?? 0;
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
71public int Count
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
144public int Count => _dictionaryStorage != null ? _dictionaryStorage.Count : _count;
Microsoft.AspNetCore.Http.Abstractions (11)
EndpointFilterInvocationContextOfT.Generated.cs (10)
46public int Count => 1; 174public int Count => 2; 309public int Count => 3; 451public int Count => 4; 600public int Count => 5; 756public int Count => 6; 919public int Count => 7; 1089public int Count => 8; 1266public int Count => 9; 1450public int Count => 10;
Routing\RouteValueDictionary.cs (1)
312public int Count => _count;
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\Validation\ValidationStateDictionary.cs (1)
55public int Count => _inner.Count;
Microsoft.AspNetCore.Mvc.Abstractions.Test (1)
ModelBinding\ModelMetadataTest.cs (1)
773public int Count
Microsoft.AspNetCore.Mvc.Core (2)
Infrastructure\CopyOnWriteList.cs (1)
43public int Count => Readable.Count;
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
71public int Count
Microsoft.AspNetCore.Mvc.IntegrationTests (8)
ActionParametersIntegrationTest.cs (1)
1014public int Count
CollectionModelBinderIntegrationTest.cs (4)
1236int ICollection<string>.Count 1305int ICollection<string>.Count 1376int ICollection<T>.Count 1445int ICollection<T>.Count
DictionaryModelBinderIntegrationTest.cs (2)
1533int ICollection<KeyValuePair<string, string>>.Count 1638int ICollection<KeyValuePair<TKey, TValue>>.Count
TryUpdateModelIntegrationTest.cs (1)
1305public int Count
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
AttributeDictionary.cs (3)
57public int Count => _items == null ? 0 : _items.Count; 375public int Count => _attributes.Count; 482public int Count => _attributes.Count;
TempDataDictionary.cs (1)
45public int Count
ViewDataDictionary.cs (1)
320public int Count
Microsoft.AspNetCore.Owin (3)
DictionaryStringArrayWrapper.cs (1)
32int ICollection<KeyValuePair<string, string[]>>.Count => Inner.Count;
DictionaryStringValuesWrapper.cs (1)
77int ICollection<KeyValuePair<string, StringValues>>.Count => Inner.Count;
OwinEnvironment.cs (1)
271int ICollection<KeyValuePair<string, object>>.Count
Microsoft.AspNetCore.Razor.Runtime (1)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
71public int Count
Microsoft.AspNetCore.Server.HttpSys (3)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
103public int Count
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
115public int Count
UrlPrefixCollection.cs (1)
32public int Count
Microsoft.AspNetCore.Server.IIS (2)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
103public int Count
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
115public int Count
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Internal\Http\HttpHeaders.cs (1)
115public int Count => GetCountFast();
Internal\ServerAddressesCollection.cs (2)
27public int Count 115public int Count => _addressesCollection.Count;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Http1\Http1ConnectionTests.cs (1)
1202public int Count => _innerHeaders.Count;
Microsoft.AspNetCore.Shared.Tests (5)
ClosedGenericMatcherTest.cs (1)
251int ICollection<KeyValuePair<string, object>>.Count
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
71public int Count
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
144public int Count => _dictionaryStorage != null ? _dictionaryStorage.Count : _count;
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
103public int Count
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
115public int Count
Microsoft.Build (20)
Collections\ArrayDictionary.cs (1)
84public int Count => count;
Collections\CopyOnWritePropertyDictionary.cs (1)
83public int Count => _backing.Count;
Collections\PropertyDictionary.cs (1)
139int ICollection<KeyValuePair<string, T>>.Count => Count;
Collections\ReadOnlyConvertingDictionary.cs (1)
68public int Count => _backing.Count;
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (2)
462public int CountCount
Construction\ProjectElementContainer.cs (1)
801public int Count => RealizedElements.Count;
CopyOnWriteDictionary.cs (1)
124public int Count => _backing.Count;
Instance\ImmutableProjectCollections\ImmutableElementCollectionConverter.cs (3)
39public int CountCount => _values.Count; 121public int Count => _projectElements.Count;
Instance\ImmutableProjectCollections\ImmutableGlobalPropertiesCollectionConverter.cs (3)
60public int CountCount => _globalProperties.Count; 171public int Count => _parent._globalProperties.Count;
Instance\ImmutableProjectCollections\ImmutableItemDefinitionsListConverter.cs (1)
69public int Count => (_itemList == null ? 0 : _itemList.Count) + (_itemTypeDefinition == null ? 0 : 1);
Instance\ImmutableProjectCollections\ImmutableItemDictionary.cs (1)
192public int Count => _list.Count;
Instance\ImmutableProjectCollections\ImmutableStringValuedListConverter.cs (1)
29public int Count => _itemList.Count;
ReadOnlyCollection.cs (1)
46public int Count
ReadOnlyEmptyCollection.cs (1)
53public int Count
ReadOnlyEmptyDictionary.cs (1)
57public int Count
Microsoft.Build.Framework (14)
ImmutableSegmentedDictionary`2.cs (1)
84public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+Builder.cs (1)
54public int Count => ReadOnlyDictionary.Count;
ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
26public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
26public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
22public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
22public int Count => _dictionary.Count;
ImmutableSegmentedList`1.cs (1)
81public int Count => _list.Count;
ImmutableSegmentedList`1+Builder.cs (1)
24public int Count => _builder.Count;
ImmutableSegmentedList`1+ValueBuilder.cs (1)
33public int Count => ReadOnlyList.Count;
SegmentedArray`1.cs (1)
127int ICollection<T>.Count => Length;
SegmentedDictionary`2.cs (3)
165public int Count => _count - _freeCount; 1301public int Count => _dictionary.Count; 1501public int Count => _dictionary.Count;
SegmentedList`1.cs (1)
152public int Count => _size;
Microsoft.Build.Tasks.Core (4)
CopyOnWriteDictionary.cs (1)
124public int Count => _backing.Count;
ReadOnlyCollection.cs (1)
46public int Count
ReadOnlyEmptyCollection.cs (1)
53public int Count
ReadOnlyEmptyDictionary.cs (1)
57public int Count
Microsoft.Build.Utilities.Core (3)
CopyOnWriteDictionary.cs (1)
124public int Count => _backing.Count;
ReadOnlyEmptyCollection.cs (1)
53public int Count
ReadOnlyEmptyDictionary.cs (1)
57public int Count
Microsoft.CodeAnalysis (26)
Collections\IdentifierCollection.Collection.cs (1)
39public int Count
Collections\UnionCollection.cs (1)
106public int Count
InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
InternalUtilities\SpecializedCollections.Empty.Collection.cs (1)
41public int Count => 0;
InternalUtilities\SpecializedCollections.ReadOnly.Collection.cs (1)
42public int Count
InternalUtilities\SpecializedCollections.Singleton.Collection`1.cs (1)
44public int Count => 1;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
84public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (1)
31public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
26public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
26public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
22public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
22public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (1)
80public int Count => _set.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (1)
32public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
54public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (1)
81public int Count => _list.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
24public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (1)
33public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\SegmentedArray`1.cs (1)
124int ICollection<T>.Count => Length;
src\Dependencies\Collections\SegmentedDictionary`2.cs (3)
228public int Count => _count - _freeCount; 1337public int Count => _dictionary.Count; 1545public int Count => _dictionary.Count;
src\Dependencies\Collections\SegmentedHashSet`1.cs (1)
356public int Count => _count - _freeCount;
src\Dependencies\Collections\SegmentedList`1.cs (1)
179public int Count => _size;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
104public int Count
Microsoft.CodeAnalysis.CodeStyle (24)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Empty.Collection.cs (1)
41public int Count => 0;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.ReadOnly.Collection.cs (1)
42public int Count
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Singleton.Collection`1.cs (1)
44public int Count => 1;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
84public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (1)
31public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
26public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
26public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
22public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
22public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (1)
80public int Count => _set.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (1)
32public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
54public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (1)
81public int Count => _list.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
24public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (1)
33public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\SegmentedArray`1.cs (1)
124int ICollection<T>.Count => Length;
src\Dependencies\Collections\SegmentedDictionary`2.cs (3)
228public int Count => _count - _freeCount; 1337public int Count => _dictionary.Count; 1545public int Count => _dictionary.Count;
src\Dependencies\Collections\SegmentedHashSet`1.cs (1)
356public int Count => _count - _freeCount;
src\Dependencies\Collections\SegmentedList`1.cs (1)
179public int Count => _size;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
104public int Count
Microsoft.CodeAnalysis.Collections.Package (19)
ImmutableSegmentedDictionary`2.cs (1)
84public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+Builder.cs (1)
31public int Count => _builder.Count;
ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
26public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
26public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
22public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlyDictionary.Count;
ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
22public int Count => _dictionary.Count;
ImmutableSegmentedHashSet`1.cs (1)
80public int Count => _set.Count;
ImmutableSegmentedHashSet`1+Builder.cs (1)
32public int Count => _builder.Count;
ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
54public readonly int Count => ReadOnlySet.Count;
ImmutableSegmentedList`1.cs (1)
81public int Count => _list.Count;
ImmutableSegmentedList`1+Builder.cs (1)
24public int Count => _builder.Count;
ImmutableSegmentedList`1+ValueBuilder.cs (1)
33public readonly int Count => ReadOnlyList.Count;
SegmentedArray`1.cs (1)
124int ICollection<T>.Count => Length;
SegmentedDictionary`2.cs (3)
228public int Count => _count - _freeCount; 1337public int Count => _dictionary.Count; 1545public int Count => _dictionary.Count;
SegmentedHashSet`1.cs (1)
356public int Count => _count - _freeCount;
SegmentedList`1.cs (1)
179public int Count => _size;
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
104public int Count
Microsoft.CodeAnalysis.PooledObjects.Package (1)
ArrayBuilder.cs (1)
104public int Count
Microsoft.CodeAnalysis.Scripting (1)
Hosting\SynchronizedList.cs (1)
36public int Count
Microsoft.CodeAnalysis.UnitTests (1)
Collections\List\SegmentedList.Generic.Tests.AddRange.cs (1)
156public int Count => int.MaxValue;
Microsoft.CodeAnalysis.Workspaces (24)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Empty.Collection.cs (1)
41public int Count => 0;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.ReadOnly.Collection.cs (1)
42public int Count
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Singleton.Collection`1.cs (1)
44public int Count => 1;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
84public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (1)
31public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
26public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
26public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
22public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
22public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (1)
80public int Count => _set.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (1)
32public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
54public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (1)
81public int Count => _list.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
24public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (1)
33public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\SegmentedArray`1.cs (1)
124int ICollection<T>.Count => Length;
src\Dependencies\Collections\SegmentedDictionary`2.cs (3)
228public int Count => _count - _freeCount; 1337public int Count => _dictionary.Count; 1545public int Count => _dictionary.Count;
src\Dependencies\Collections\SegmentedHashSet`1.cs (1)
356public int Count => _count - _freeCount;
src\Dependencies\Collections\SegmentedList`1.cs (1)
179public int Count => _size;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
104public int Count
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (24)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Empty.Collection.cs (1)
41public int Count => 0;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.ReadOnly.Collection.cs (1)
42public int Count
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Singleton.Collection`1.cs (1)
44public int Count => 1;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
84public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (1)
31public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
26public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
26public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
22public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
22public int Count => _dictionary.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (1)
80public int Count => _set.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (1)
32public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
54public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (1)
81public int Count => _list.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
24public int Count => _builder.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (1)
33public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\SegmentedArray`1.cs (1)
124int ICollection<T>.Count => Length;
src\Dependencies\Collections\SegmentedDictionary`2.cs (3)
228public int Count => _count - _freeCount; 1337public int Count => _dictionary.Count; 1545public int Count => _dictionary.Count;
src\Dependencies\Collections\SegmentedHashSet`1.cs (1)
356public int Count => _count - _freeCount;
src\Dependencies\Collections\SegmentedList`1.cs (1)
179public int Count => _size;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
104public int Count
Microsoft.Extensions.AI (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.AI.Abstractions (4)
AdditionalPropertiesDictionary{TValue}.cs (1)
77public int Count => _dictionary.Count;
Embeddings\GeneratedEmbeddings.cs (1)
56public int Count => _embeddings.Count;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.AI.AzureAIInference (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.AI.Ollama (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.AI.OpenAI (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.Configuration (2)
ConfigurationManager.cs (2)
206public int Count => _sources.Count; 287public int Count => _properties.Count;
Microsoft.Extensions.DependencyInjection.Abstractions (1)
ServiceCollection.cs (1)
22public int Count => _descriptors.Count;
Microsoft.Extensions.Http (1)
DependencyInjection\DefaultHttpClientBuilderServiceCollection.cs (1)
64public int Count => _services.Count;
Microsoft.Extensions.Http.Diagnostics (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.Primitives (1)
StringValues.cs (1)
91public int Count
Microsoft.Gen.ComplianceReports.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.ContextualOptions.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.Logging.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.MetadataExtractor.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.Metrics.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.MetricsReports.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Interop.SourceGeneration (1)
ValueEqualityImmutableDictionary.cs (1)
49public int Count => Map.Count;
Microsoft.Maui (3)
Hosting\Internal\FontCollection.cs (1)
10 public int Count => _descriptors.Count;
Hosting\Internal\MauiServiceCollection.cs (1)
14 public int Count => _descriptors.Count;
Primitives\LockableObservableListWrapper.cs (1)
46 public int Count
Microsoft.Maui.Controls (25)
DefinitionCollection.cs (1)
42 public int Count
Element\Element.cs (1)
1086 int ICollection<Element>.Count => _inner.Count;
Interactivity\TriggerBase.cs (1)
166 public int Count
Items\SelectionList.cs (1)
32 public int Count => _internal.Count;
Layout\Layout.cs (2)
50 public int CountCount => _children.Count;
LegacyLayouts\LayoutOfT.cs (1)
11 int ICollection<IView>.Count => _children.Count;
Menu\MenuBar.cs (1)
33 public int Count => _menus.Count;
Menu\MenuBarItem.cs (1)
57 public int Count => _menus.Count;
Menu\MenuFlyout.cs (1)
33 public int Count => _menus.Count;
Menu\MenuFlyoutSubItem.cs (1)
25 public int Count => _menus.Count;
NavigationStepRequest.cs (1)
28 public int Count => _pages.Count;
ObservableWrapper.cs (1)
71 public int Count
OrderedDictionary.cs (2)
143 public int Count 404 public int Count
ReadOnlyCastingList.cs (1)
86 public int Count => _list.Count;
ResourceDictionary.cs (1)
178 public int Count
Shell\MenuItemCollection.cs (1)
21 public int Count => _inner.Count;
Shell\ShellElementCollection.cs (1)
22 public int Count => Inner.Count;
Shell\ShellNavigationQueryParameters.cs (1)
55 public int Count => _internal.Count;
SwipeView\SwipeItems.cs (1)
65 public int Count => _swipeItems.Count;
SynchronizedList.cs (1)
44 public int Count
TableView\TableSection.cs (1)
65 public int Count
VisualStateManager.cs (2)
290 public int Count => _internalList.Count; 772 public int Count => _internalList.Count;
Microsoft.Maui.Controls.Maps (2)
HandlerImpl\Polygon.Impl.cs (1)
34 public int Count => Geopath.Count;
HandlerImpl\Polyline.Impl.cs (1)
32 public int Count => Geopath.Count;
Microsoft.ML.Core (1)
Utilities\Tree.cs (1)
79public int Count { get { return _children.Count; } }
Microsoft.ML.SearchSpace (3)
Option\NestOption.cs (1)
86public int Count => ((ICollection<KeyValuePair<string, OptionBase>>)_options).Count;
Parameter.cs (1)
233public int Count => ParameterType == ParameterType.Object ? (_value as Dictionary<string, Parameter>).Count : 1;
SearchSpace.cs (1)
89public int Count => ((ICollection<KeyValuePair<string, OptionBase>>)_options).Count;
Microsoft.ML.TorchSharp (1)
Utils\DefaultDictionary.cs (1)
80public int Count => _dictionary.Count;
MSBuild (3)
CopyOnWriteDictionary.cs (1)
124public int Count => _backing.Count;
ReadOnlyEmptyCollection.cs (1)
53public int Count
ReadOnlyEmptyDictionary.cs (1)
57public int Count
MSBuildTaskHost (4)
CopyOnWriteDictionary.cs (1)
124public int Count => _backing.Count;
Immutable\ImmutableDictionary.cs (1)
47public int Count => _backing.Count;
ReadOnlyEmptyCollection.cs (1)
53public int Count
ReadOnlyEmptyDictionary.cs (1)
57public int Count
PresentationCore (41)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
735public int Count
MS\Internal\FontFace\TypefaceCollection.cs (1)
78public int Count
MS\Internal\PartialArray.cs (1)
114public int Count
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (1)
56public int Count
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (1)
51public int Count
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (1)
120public abstract int Count
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\PartialList.cs (1)
141public int Count
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SequentialUshortCollection.cs (1)
55public int Count
System\Windows\FreezableCollection.cs (1)
345public int Count
System\Windows\Generated\TextDecorationCollection.cs (1)
253public int Count
System\Windows\Media\Animation\Generated\TimelineCollection.cs (1)
252public int Count
System\Windows\Media\Animation\TimelineClockCollection.cs (1)
24public int Count
System\Windows\Media\CharacterMetricsDictionary.cs (1)
60public int Count
System\Windows\Media\CultureSpecificStringDictionary.cs (1)
64public int Count
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (1)
252public int Count
System\Windows\Media\FamilyMapCollection.cs (1)
136public int Count
System\Windows\Media\FamilyTypefaceCollection.cs (1)
123public int Count
System\Windows\Media\Fonts.cs (1)
331public int Count
System\Windows\Media\Generated\DoubleCollection.cs (1)
207public int Count
System\Windows\Media\Generated\DrawingCollection.cs (1)
265public int Count
System\Windows\Media\Generated\GeneralTransformCollection.cs (1)
250public int Count
System\Windows\Media\Generated\GeometryCollection.cs (1)
265public int Count
System\Windows\Media\Generated\GradientStopCollection.cs (1)
251public int Count
System\Windows\Media\Generated\Int32Collection.cs (1)
206public int Count
System\Windows\Media\Generated\PathFigureCollection.cs (1)
256public int Count
System\Windows\Media\Generated\PathSegmentCollection.cs (1)
250public int Count
System\Windows\Media\Generated\PointCollection.cs (1)
206public int Count
System\Windows\Media\Generated\TextEffectCollection.cs (1)
250public int Count
System\Windows\Media\Generated\TransformCollection.cs (1)
265public int Count
System\Windows\Media\Generated\VectorCollection.cs (1)
206public int Count
System\Windows\Media\GlyphRun.cs (2)
2143public int Count 2245public int Count
System\Windows\Media\GlyphTypeface.cs (2)
1828public int Count 1913public int Count
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (1)
250public int Count
System\Windows\Media3D\Generated\MaterialCollection.cs (1)
265public int Count
System\Windows\Media3D\Generated\Model3DCollection.cs (1)
265public int Count
System\Windows\Media3D\Generated\Point3DCollection.cs (1)
207public int Count
System\Windows\Media3D\Generated\Transform3DCollection.cs (1)
265public int Count
System\Windows\Media3D\Generated\Vector3DCollection.cs (1)
207public int Count
System\Windows\Media3D\Visual3DCollection.cs (1)
260public int Count
PresentationFramework (19)
MS\Internal\Annotations\ObservableDictionary.cs (1)
219public int Count
MS\Internal\Data\RBTree.cs (1)
582public int Count
MS\Internal\Documents\ContentElementCollection.cs (1)
537public int Count
MS\Internal\ListOfObject.cs (1)
75int ICollection<object>.Count
MS\Internal\WeakDictionary.cs (3)
56public int Count 143public int Count 310public int Count
MS\Internal\WeakHashSet.cs (1)
57public int Count
System\Windows\Controls\ColumnDefinition.cs (1)
372public int Count // int ICollection.Count {get;}; int ICollection<T>.Count {get;}
System\Windows\Controls\CustomDictionarySources.cs (1)
169int ICollection<Uri>.Count
System\Windows\Controls\RowDefinition.cs (1)
367public int Count // int ICollection.Count {get;}; int ICollection<T>.Count {get;}
System\Windows\Controls\VirtualizedCellInfoCollection.cs (1)
397public int Count
System\Windows\Data\XmlNamespaceMappingCollection.cs (1)
171public int Count
System\Windows\Documents\TableCellCollection.cs (1)
351public int Count
System\Windows\Documents\TableColumnCollection.cs (1)
358public int Count
System\Windows\Documents\TableRowCollection.cs (1)
351public int Count
System\Windows\Documents\TableRowGroupCollection.cs (1)
351public int Count
System\Windows\Documents\TextElementCollection.cs (1)
150public int Count
System\Windows\TriggerActionCollection.cs (1)
49public int Count
Shared (2)
EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Shared.Tests (1)
EmptyCollections\EmptyCollectionExtensionsTests.cs (1)
110public int Count => 0;
System.Collections (11)
System\Collections\Generic\LinkedList.cs (1)
49public int Count
System\Collections\Generic\OrderedDictionary.cs (3)
243public int Count => _count; 1473public int Count => _dictionary.Count; 1668public int Count => _dictionary.Count;
System\Collections\Generic\SortedDictionary.cs (3)
137public int Count 589public int Count 750public int Count
System\Collections\Generic\SortedList.cs (3)
282public int Count 1011public int Count 1125public int Count
System\Collections\Generic\SortedSet.cs (1)
266public int Count
System.Collections.Immutable (15)
System\Collections\Frozen\FrozenDictionary.cs (1)
321public int Count => CountCore;
System\Collections\Frozen\FrozenSet.cs (1)
264public int Count => CountCore;
System\Collections\Immutable\ImmutableArray_1.Builder.cs (1)
90public int Count
System\Collections\Immutable\ImmutableArray_1.cs (1)
52int ICollection<T>.Count
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (1)
140public int Count
System\Collections\Immutable\ImmutableDictionary_2.cs (1)
131public int Count
System\Collections\Immutable\ImmutableHashSet_1.Builder.cs (1)
83public int Count
System\Collections\Immutable\ImmutableHashSet_1.cs (1)
92public int Count
System\Collections\Immutable\ImmutableList_1.Builder.cs (1)
70public int Count
System\Collections\Immutable\ImmutableList_1.cs (1)
142public int Count => _root.Count;
System\Collections\Immutable\ImmutableSortedDictionary_2.Builder.cs (1)
118public int Count
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
108public int Count
System\Collections\Immutable\ImmutableSortedSet_1.Builder.cs (1)
76public int Count
System\Collections\Immutable\ImmutableSortedSet_1.cs (1)
115public int Count
System\Collections\Immutable\KeysOrValuesCollectionAccessor.cs (1)
53public int Count
System.ComponentModel.Composition (3)
Microsoft\Internal\Collections\CollectionServices.CollectionOfObject.cs (2)
66public int Count 121public int Count
System\ComponentModel\Composition\Hosting\ComposablePartCatalogCollection.cs (1)
148public int Count
System.Composition.Hosting (1)
System\Composition\Hosting\Core\CycleBreakingMetadataDictionary.cs (1)
95public int Count
System.Data.Common (1)
System\Data\Common\DbBatchCommandCollection.cs (1)
25public abstract int Count { get; }
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\ActivityTagsCollection.cs (1)
137public int Count => _list.Count;
System\Diagnostics\Metrics\TagList.netcore.cs (1)
52public readonly int Count => _tagsCount;
System.Diagnostics.Process (1)
System\Collections\Specialized\DictionaryWrapper.cs (1)
35public int Count => _contents.Count;
System.DirectoryServices.AccountManagement (2)
artifacts\obj\System.DirectoryServices.AccountManagement\Debug\net10.0\System.DirectoryServices.AccountManagement.notsupported.cs (2)
229public int Count { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } } 356public int Count { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } }
System.IO.FileSystem.Watcher (1)
System\IO\FileSystemWatcher.cs (1)
738public int Count => Items.Length;
System.Linq (5)
System\Linq\Grouping.cs (1)
399int ICollection<TElement>.Count => _count;
System\Linq\Lookup.cs (1)
307public int Count => 0;
System\Linq\Range.SpeedOpt.cs (1)
38public int Count => _end - _start;
System\Linq\Repeat.SpeedOpt.cs (1)
34public int Count => _count;
System\Linq\SkipTake.SpeedOpt.cs (1)
104public int Count
System.Linq.AsyncEnumerable (1)
System\Linq\GroupBy.cs (1)
413int ICollection<TElement>.Count => _count;
System.Linq.Expressions (6)
System\Dynamic\ExpandoObject.cs (3)
415public int Count 565public int Count 669int ICollection<KeyValuePair<string, object?>>.Count => _count;
System\Dynamic\Utils\ListArgumentProvider.cs (1)
110public int Count => ElementCount;
System\Linq\Expressions\BlockExpression.cs (1)
783public int Count => _block.ExpressionCount;
System\Runtime\CompilerServices\ReadOnlyCollectionBuilder.cs (1)
106public int Count => _size;
System.Linq.Parallel (1)
System\Linq\Parallel\QueryOperators\QueryResults.cs (1)
131public int Count
System.Net.Http (3)
System\Net\Http\Headers\HttpHeaderValueCollection.cs (1)
38public int Count
System\Net\Http\Headers\ObjectCollection.cs (1)
32public int Count => _size;
System\Net\Http\HttpRequestOptions.cs (1)
35int ICollection<KeyValuePair<string, object?>>.Count => Options.Count;
System.Net.HttpListener (1)
System\Net\HttpListenerPrefixCollection.cs (1)
70public int Count => _httpListener.PrefixCollection.Count;
System.Net.NetworkInformation (4)
System\Net\NetworkInformation\GatewayIPAddressInformationCollection.cs (1)
27public virtual int Count
System\Net\NetworkInformation\IPAddressInformationCollection.cs (1)
21public virtual int Count
System\Net\NetworkInformation\MulticastIPAddressInformationCollection.cs (1)
21public virtual int Count
System\Net\NetworkInformation\UnicastIPAddressInformationCollection.cs (1)
22public virtual int Count
System.Net.Primitives (2)
System\Net\CookieCollection.cs (1)
121public int Count
System\Net\NetworkInformation\IPAddressCollection.cs (1)
19public virtual int Count
System.Private.CoreLib (13)
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (1)
71public int Count => _count;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (3)
209public int Count => _count - _freeCount; 1926public int Count => _dictionary.Count; 2121public int Count => _dictionary.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (1)
357public int Count => _count - _freeCount;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (1)
127public int Count => _size;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (1)
32public int Count => items.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (1)
33public int Count => list.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyDictionary.cs (3)
71public int Count => m_dictionary.Count; 278public int Count => _collection.Count; 331public int Count => _collection.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlySet.cs (1)
34public int Count => _set.Count;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
81public int Count => m_names.Length;
System.Private.Xml (3)
System\Xml\Xsl\ListBase.cs (1)
25public abstract int Count { get; }
System\Xml\Xsl\QIL\QilNode.cs (1)
114public virtual int Count
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (1)
134public int Count
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (1)
55public int Count => _headerParameters.Count;
System.Security.Principal.Windows (1)
artifacts\obj\System.Security.Principal.Windows\Debug\net10.0\System.Security.Principal.Windows.notsupported.cs (1)
46public int Count { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } }
System.ServiceModel.Primitives (2)
netstandard.cs (2)
20public int Count { get { return default; } } 1726public int Count { get { return default; } }
System.Speech (1)
artifacts\obj\System.Speech\Debug\net10.0\System.Speech.notsupported.cs (1)
301public int Count { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } }
System.Text.Json (3)
System\Text\Json\Nodes\JsonArray.IList.cs (1)
14public int Count => List.Count;
System\Text\Json\Nodes\JsonObject.IDictionary.cs (1)
95public int Count => Dictionary.Count;
System\Text\Json\Serialization\ConfigurationList.cs (1)
49public int Count => _list.Count;
System.Text.RegularExpressions (3)
System\Text\RegularExpressions\CaptureCollection.cs (1)
31public int Count => _capcount;
System\Text\RegularExpressions\GroupCollection.cs (1)
36public int Count => _match._matchcount.Length;
System\Text\RegularExpressions\MatchCollection.cs (1)
45public int Count
System.Windows.Forms (1)
System\Windows\Forms\Controls\UpDown\NumericUpDownAccelerationCollection.cs (1)
69public int Count
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\ListAdapter.cs (1)
26int ICollection<T>.Count => _list.Count;
System.Windows.Forms.Primitives (1)
System\Windows\Forms\NonNullCollection.cs (1)
32public int Count => _list.Count;
System.Windows.Forms.Tests (1)
System\Windows\Forms\ListBindingHelperTests.cs (1)
577public int Count => throw new NotImplementedException();
System.Xaml (2)
System\Xaml\NameScope.cs (1)
107public int Count => _nameMap?.Count ?? 0;
System\Xaml\NameScopeDictionary.cs (1)
245int ICollection<KeyValuePair<string, object>>.Count
System.Xaml.Tests (6)
System\Xaml\XamlTypeTests.cs (6)
1820public int CountCount => throw new NotImplementedException(); 3101int ICollection<object>.Count => throw new NotImplementedException(); 3103int ICollection<int>.Count => throw new NotImplementedException(); 3150int ICollection<KeyValuePair<string, int>>.Count => throw new NotImplementedException(); 3152int ICollection<KeyValuePair<int, string>>.Count => throw new NotImplementedException();
3463 references to Count
Aspire.Dashboard (3)
Components\Controls\Chart\ChartBase.cs (2)
226for (var i = dimensionValues.Count - 1; i >= 0; i--) 443for (var i = dimensionValues.Count - 1; i >= 0; i--)
Components\Controls\Chart\MetricTable.razor.cs (1)
65if (xValuesToAnnounce.Count == 0)
Aspire.Dashboard.Tests (1)
TelemetryRepositoryTests\MetricsTests.cs (1)
1137Assert.Equal(valueCount, scope.Values.Count);
Aspire.Hosting.Azure (1)
AzureProvisioningResource.cs (1)
42Debug.Assert(compilation.Count == 1);
Aspire.RabbitMQ.Client (1)
RabbitMQEventSourceLogForwarder.cs (1)
111Debug.Assert(exData is not null && exData.Count == 4);
BasicWebSite (2)
ActionDescriptorCreationCounter.cs (1)
36if (context.Results.Count == 0)
Controllers\TempDataController.cs (1)
77return $"{value1} {value2} {value3.Count} {value4} {value5}";
CodeGenerator (2)
src\Servers\Kestrel\shared\KnownHeaders.cs (2)
403var useVarForFirstTerm = values.Count > 1 && values.Select(h => h.FirstNameIgnoreCaseSegment()).Distinct().Count() == 1; 1476if (values.Count == 1 && values[0].Field.Value.Length == 0)
csc (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
85var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 101for (int i = 0; i < args.Count; ++i)
dotnet-dev-certs (1)
Program.cs (1)
280if (certificates.Count == 0)
dotnet-razorpagegenerator (1)
Program.cs (1)
48Console.WriteLine($"{results.Count} files successfully generated.");
dotnet-svcutil.xmlserializer (5)
Microsoft\Tools\ServiceModel\SvcUtil\Options.cs (5)
263_parent._namespaceMappings = new Dictionary<string, string>(namespaceMappingsArgs.Count); 296if (excludeTypesArgs != null && excludeTypesArgs.Count > 0) 334_parent._referencedAssemblies = new List<Assembly>(referenceArgs.Count); 384Dictionary<string, Type> specifiedTypes = new Dictionary<string, Type>(typeArgs.Count); 419if (referencedAssembliesArgs != null && referencedAssembliesArgs.Count > 0)
dotnet-svcutil-lib (79)
CodeDomFixup\ConfigToCode.cs (3)
169if (toRemoves.Count > 0) 295if (toRemoves.Count > 0) 421if (toRemoves.Count > 0)
CommandProcessorOptions.cs (1)
860Dictionary<string, Type> specifiedTypes = new Dictionary<string, Type>(typeArgs.Count);
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerInfo.cs (1)
77if (_providerOptions.Count > 0)
FrameworkFork\Microsoft.Xml\Xml\schema\GenerateConverter.cs (16)
466if (rules.Count > 0) 481if (uniqueSourceTypes.Count > 0) 495_w.Write(group.FindUniqueSourceTypes(typeof(object)).Count > 0 ? "ChangeTypeWildcardDestination" : "ChangeListType"); 522if (uniqueDestTypes.Count > 0) 534if (group.FindUniqueDestinationTypes(typeof(object)).Count > 0) 568while (i < uniqueSourceTypes.Count) 576if (uniqueSourceTypes.Count != 0) 578if (IsInterfaceMethod(tDst) && uniqueSourceTypes.Count > 1) 615if (uniqueSourceTypes.Count != 0 || uniqueDestTypes.Count != 0) 625if (uniqueSourceTypes.Count != 0) 644if (uniqueDestTypes.Count != 0) 736int cnt = rulesSwitch.Count; 792if (rules.Count == 0) 803if (rules.Count > 1 && IsInterfaceMethod(tSrc) && IsInterfaceMethod(tDst)) 812if (rules.Count == 1)
FrameworkFork\Microsoft.Xml\Xml\schema\xdrvalidator.cs (1)
302for (int i = 0; i < context.ElementDecl.DefaultAttDefs.Count; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaValidator.cs (1)
1056for (int i = 0; i < currentElementDecl.DefaultAttDefs.Count; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\xsdvalidator.cs (1)
545for (int i = 0; i < context.ElementDecl.DefaultAttDefs.Count; ++i)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\FunctionQuery.cs (5)
27Query[] tmp = new Query[other._args.Count]; 51XPathResultType[] argTypes = new XPathResultType[_args.Count]; 52for (int i = 0; i < _args.Count; i++) 73object[] argVals = new object[_args.Count]; 74for (int i = 0; i < _args.Count; i++)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (7)
30Query[] tmp = new Query[other._argList.Count]; 42for (int i = 0; i < _argList.Count; i++) 78if (_argList.Count > 0) 124while (count < _argList.Count) 174if (_argList.Count == 3) 207if (_argList.Count > 0) 217if (_argList.Count > 0)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (3)
716DataContract[] paramContracts = new DataContract[genInfo.Parameters.Count]; 717for (int i = 0; i < genInfo.Parameters.Count; i++) 914if (knownTypeContracts == null || knownTypeContracts.Count == 0)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (2)
1707else if (nestedParamCounts.Count > 1 || !parametersFromBuiltInNamespaces) 2025if (nestedParameterCounts.Count > 1 || !genericNameProvider.ParametersFromBuiltInNamespaces)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerContext.cs (1)
205for (int i = 0; i < knownTypeList.Count; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (1)
479IncrementCollectionCount(xmlWriter, collection.Count);
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\DefaultClaimSet.cs (3)
46get { return _claims.Count; } 59for (int i = 0; i < _claims.Count; ++i) 74for (int i = 0; i < _claims.Count; ++i)
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (2)
65return _claims.Count; 286for (int i = 0; i < _claims.Count; ++i)
FrameworkFork\System.ServiceModel\System\IdentityModel\SecurityUtils.cs (4)
135if (authorizationPolicies != null && authorizationPolicies.Count == 1 && authorizationPolicies[0] is UnconditionalPolicy) 140else if (authorizationPolicies == null || authorizationPolicies.Count <= 0) 148object[] policyState = new object[authorizationPolicies.Count]; 156for (int i = 0; i < authorizationPolicies.Count; i++)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\WSSecurityJan2004.cs (1)
234for (int i = 0; i < _strEntries.Count; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeaderCollection.cs (1)
28for (int i = 0; i < collection.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncoder.cs (2)
389for (int i = 0; i < newStrings.Count; i++) 419for (int i = 0; i < newStrings.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CloseCollectionAsyncResult.cs (2)
24_count = collection.Count; 31for (int index = 0; index < collection.Count; index++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ContextBindingElementImporter.cs (1)
68if (unrecognized.BindingAsserions.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\OpenCollectionAsyncResult.cs (2)
25_count = collection.Count; 32for (int index = 0; index < collection.Count; index++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Configuration\SecurityElementBase.cs (2)
156if (b1.OperationSupportingTokenParameters.Count != b2.OperationSupportingTokenParameters.Count)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlExporter.cs (4)
736if (assertions.Count > 0) 754if (assertions.Count > 0) 772if (assertions.Count > 0) 787if (assertions.Count > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\FaultFormatter.cs (1)
112for (int i = 0; i < faultInfos.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerFaultFormatter.cs (1)
91for (int i = 0; i < faultInfos.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs (1)
493object[] messageHeaderOfTArray = (object[])Array.CreateInstance(TypedHeaderManager.GetMessageHeaderType(headerDescription.Type), messageHeaderOfTAttributes.Count);
FrameworkFork\System.ServiceModel\System\ServiceModel\EmptyArray.cs (2)
21if (collection.Count == 0) 27T[] array = new T[collection.Count];
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityProtocolFactory.cs (2)
804if (scopedAuthenticators == null || scopedAuthenticators.Count == 0) 973if (_channelSupportingTokenAuthenticatorSpecification.Count == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceChannelManager.cs (1)
78if ((outgoing != null) && (outgoing.Count > 0))
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceSecurityContext.cs (1)
94if (identities != null && identities.Count == 1)
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedReadOnlyCollection.cs (1)
72get { lock (_sync) { return _items.Count; } }
Shared\MSBuildProj.cs (1)
803LockFileTarget target = lockFile.Targets.Count == 1 ? lockFile.Targets[0] : lockFile.Targets.FirstOrDefault(t =>
Shared\ProjectDependency.cs (1)
435for (int idx = dependencies.Count - 1; idx >= 0; idx--)
dotnet-user-jwts (3)
Commands\ClearCommand.cs (1)
49var count = jwtStore.Jwts.Count;
Commands\ListCommand.cs (2)
55if (jwtStore.Jwts is { Count: > 0 } jwts) 70if (jwtStore.Jwts is { Count: > 0 } jwts)
dotnet-user-secrets (2)
Internal\SecretsStore.cs (1)
48public int Count => _secrets.Count;
Internal\SetCommand.cs (1)
81context.Reporter.Output(Resources.FormatMessage_Saved_Secrets(provider.CurrentData.Count));
HostFilteringSample (1)
Startup.cs (1)
28if (options.AllowedHosts == null || options.AllowedHosts.Count == 0)
Identity.ExternalClaims (1)
Pages\Account\Manage\ExternalLogins.cshtml.cs (1)
50ShowRemoveButton = user.PasswordHash != null || CurrentLogins.Count > 1;
IdentitySample.Mvc (1)
Controllers\ManageController.cs (1)
309ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1;
illink (5)
InMemory.FunctionalTests (2)
Http2\Http2ConnectionTests.cs (1)
297public int Count => _innerHeaders.Count;
Http3\Http3ConnectionTests.cs (1)
832public int Count => _innerHeaders.Count;
Interop.FunctionalTests (1)
Http3\Http3RequestTests.cs (1)
1351Logger.LogInformation($"Server trailer count: {feature.Trailers.Count}");
Microsoft.Analyzers.Extra.Tests (1)
UsingToStringInLoggersTests.cs (1)
72Assert.Equal(3, d.Count);
Microsoft.Analyzers.Local (1)
ApiLifecycle\Json\JsonObject.cs (1)
33public int Count => _properties.Count;
Microsoft.Analyzers.Local.Tests (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Arcade.Test.Common (2)
DiffUtil.cs (2)
54foreach (var edit in GetEdits(sequenceA, sequenceA.Count, sequenceB, sequenceB.Count).Reverse())
Microsoft.AspNetCore (3)
BootstrapHostBuilder.cs (1)
106for (int i = _builder.Services.Count - 1; i >= 0; i--)
WebApplication.cs (1)
280if (compositeEndpointDataSource.DataSources.Intersect(_webApplication.DataSources).Count() == _webApplication.DataSources.Count)
WebHost.cs (1)
256if (options.AllowedHosts == null || options.AllowedHosts.Count == 0)
Microsoft.AspNetCore.AsyncState (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.AspNetCore.Authentication (2)
PropertiesSerializer.cs (1)
51writer.Write(properties.Items.Count);
TicketSerializer.cs (1)
132writer.Write(claim.Properties.Count);
Microsoft.AspNetCore.Authentication.Core (1)
AuthenticationSchemeProvider.cs (1)
214if (_schemes.Count == 1)
Microsoft.AspNetCore.Authentication.Core.Test (1)
AuthenticationPropertiesTests.cs (1)
95Assert.Equal(2, props.Items.Count);
Microsoft.AspNetCore.Authentication.Facebook (1)
FacebookHandler.cs (1)
47if (Options.Fields.Count > 0)
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectHandler.cs (1)
693if (properties == null || properties.Items.Count == 0)
Microsoft.AspNetCore.Authentication.Test (15)
FacebookTests.cs (1)
450Assert.Equal(2, transaction.SetCookie.Count);
GoogleTests.cs (8)
560Assert.Equal(2, transaction.SetCookie.Count); 723Assert.Equal(2, transaction.SetCookie.Count); 763Assert.Equal(2, transaction.SetCookie.Count); 884Assert.Equal(2, transaction.SetCookie.Count); 928Assert.Equal(2, transaction.SetCookie.Count); 972Assert.Equal(2, transaction.SetCookie.Count); 1009Assert.Equal(2, transaction.SetCookie.Count); 1083Assert.Equal(2, transaction.SetCookie.Count);
MicrosoftAccountTests.cs (2)
245Assert.Equal(2, transaction.SetCookie.Count); 350Assert.Equal(2, transaction.SetCookie.Count);
OpenIdConnect\OpenIdConnectChallengeTests.cs (1)
456Assert.Equal(2, challengeCookies.Count);
OpenIdConnect\OpenIdConnectTests.cs (1)
534Assert.Equal(2, options.Scope.Count);
OpenIdConnect\TestTransaction.cs (1)
25if (SetCookie != null && SetCookie.Count > 0)
Transaction.cs (1)
23if (SetCookie != null && SetCookie.Count > 0)
Microsoft.AspNetCore.Authorization (1)
AuthorizationPolicy.cs (1)
127skipEnumeratingData = dataList.Count == 0;
Microsoft.AspNetCore.Authorization.Test (4)
AuthorizationEndpointConventionBuilderExtensionsTests.cs (4)
136Assert.Equal(2, endpointModel.Metadata.Count); 159Assert.Equal(2, endpointModel.Metadata.Count); 187Assert.Equal(2, endpointModel.Metadata.Count); 213Assert.Equal(2, endpointModel.Metadata.Count);
Microsoft.AspNetCore.Components (5)
ParameterView.cs (1)
305var builder = new ParameterViewBuilder(parameters.Count);
Routing\RouteTableFactory.cs (2)
203seen.EnsureCapacity(builder.InboundEntries.Count); 205for (var i = 0; i < builder.InboundEntries.Count; i++)
src\Http\Routing\src\RouteConstraintMatcher.cs (1)
56if (constraints == null || constraints.Count == 0)
src\Shared\Debugger\DictionaryDebugView.cs (1)
23var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count];
Microsoft.AspNetCore.Components.Endpoints (5)
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (4)
191for (var i = 0; i < props.Count; i++) 208for (var i = 0; i < props.Count; i++) 339for (var i = 0; i < properties.Count; i++) 439for (var i = 0; i < constructorParameters.Count; i++)
Rendering\EndpointHtmlRenderer.cs (1)
240var result = new List<StringValues>(form.Keys.Count);
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
Binding\FormDataMapperTests.cs (2)
1247Assert.Equal(expected.Count, dictionary.Count);
WebRootComponentParametersTest.cs (1)
176for (var i = 0; i < parameterValues.Count; i++)
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
328_ariaBodyRowCount = _currentNonVirtualizedViewItems.Count;
Microsoft.AspNetCore.Components.Server (10)
Builder\ServerRazorComponentsEndpointConventionBuilderExtensions.cs (1)
50for (var i = 0; i < b.Metadata.Count; i++)
Circuits\ComponentParameterDeserializer.cs (5)
27if (parameterValues.Count != parametersDefinitions.Count) 30Log.MismatchedParameterAndDefinitions(_logger, parametersDefinitions.Count, parameterValues.Count); 34for (var i = 0; i < parametersDefinitions.Count; i++)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
79for (var i = 0; i < c.Metadata.Count; i++)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (3)
326if (source != null && source.Count > 0) 596writer.WriteMapHeader(headers.Count); 597if (headers.Count > 0)
Microsoft.AspNetCore.Components.Tests (8)
CascadingParameterTest.cs (4)
167Assert.Equal(3, firstBatch.DiffsByComponentId.Count); // Root + CascadingValue + nested 176Assert.Equal(2, secondBatch.DiffsByComponentId.Count); // Root + CascadingValue, but not nested one 229Assert.Equal(3, secondBatch.DiffsByComponentId.Count); // Root + CascadingValue + CascadingValue, but not nested component 295Assert.Equal(2, secondBatch.DiffsByComponentId.Count); // Root + CascadingValue, but not nested one
RendererTest.cs (3)
80Assert.Equal(2, batch.DiffsByComponentId.Count); 2981Assert.Equal(4, batch.DiffsInOrder.Count); 3435Assert.Equal(2, batch2.DiffsInOrder.Count); // Parent and first child
RouteViewTest.cs (1)
92Assert.Equal(4, batch.DiffsInOrder.Count);
Microsoft.AspNetCore.Components.Web (1)
Virtualization\Virtualize.cs (1)
454Items!.Count));
Microsoft.AspNetCore.Components.WebAssembly (6)
HotReload\HotReloadAgent.cs (1)
78if (ctorArgs.Count != 1 ||
Prerendering\WebAssemblyComponentParameterDeserializer.cs (5)
28if (parameterValues.Count != parametersDefinitions.Count) 31throw new InvalidOperationException($"The number of parameter definitions '{parametersDefinitions.Count}' does not match the number parameter values '{parameterValues.Count}'."); 34for (var i = 0; i < parametersDefinitions.Count; i++)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
ContentEncodingNegotiator.cs (1)
48if (!StringWithQualityHeaderValue.TryParseList(accept, out var encodings) || encodings.Count == 0)
Microsoft.AspNetCore.Components.WebView.Maui (1)
iOS\BlazorWebViewHandler.iOS.cs (1)
197 Logger.AddingRootComponent(rootComponent.ComponentType?.FullName ?? string.Empty, rootComponent.Selector ?? string.Empty, rootComponent.Parameters?.Count ?? 0);
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
BlazorWebView.cs (1)
211 logger.AddingRootComponent(rootComponent.ComponentType.FullName ?? string.Empty, rootComponent.Selector, rootComponent.Parameters?.Count ?? 0);
Microsoft.AspNetCore.Components.WebView.Wpf (1)
BlazorWebView.cs (1)
294 logger.AddingRootComponent(rootComponent.ComponentType.FullName ?? string.Empty, rootComponent.Selector, rootComponent.Parameters?.Count ?? 0);
Microsoft.AspNetCore.Connections.Abstractions (2)
ConnectionItems.cs (1)
106get { return Items.Count; }
src\Shared\Debugger\DictionaryDebugView.cs (1)
23var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count];
Microsoft.AspNetCore.CookiePolicy.Test (4)
CookieConsentTests.cs (2)
218Assert.Equal(2, cookies.Count); 399Assert.Equal(2, cookies.Count);
CookiePolicyTests.cs (1)
450Assert.Equal(3, transaction.SetCookie.Count);
Transaction.cs (1)
24if (SetCookie != null && SetCookie.Count > 0)
Microsoft.AspNetCore.Cors (8)
Infrastructure\CorsPolicy.cs (3)
33if (Headers == null || Headers.Count != 1 || Headers[0] != CorsConstants.AnyHeader) 49if (Methods == null || Methods.Count != 1 || Methods[0] != CorsConstants.AnyMethod) 65if (Origins == null || Origins.Count != 1 || Origins[0] != CorsConstants.AnyOrigin)
Infrastructure\CorsService.cs (5)
109result.VaryByOrigin = policy.Origins.Count > 1 || !policy.IsDefaultIsOriginAllowed; 178if (result.AllowedHeaders.Count > 0) 183if (result.AllowedMethods.Count > 0) 197if (result.AllowedExposedHeaders.Count > 0) 216for (var i = 0; i < headerValues.Count; i++)
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\XmlKeyManager.cs (1)
116_keyEscrowSink = escrowSinks.Count > 0 ? new AggregateKeyEscrowSink(escrowSinks) : null;
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (1)
CertificateManagerTests.cs (1)
469Assert.Equal(2, httpsCertificateList.Count);
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\Views\CompilationErrorPage.Designer.cs (1)
334for (var i = 0; i < Model.ErrorDetails.Count; i++)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (1)
253for (var i = 0; i < attributes.Count; i++)
Microsoft.AspNetCore.Diagnostics.Middleware (3)
Logging\HeaderReader.cs (2)
25_headers = headersToLog.Count == 0 ? [] : headersToLog.ToArray(); 31if (headers.Count == 0)
Logging\HttpLoggingRedactionInterceptor.cs (1)
146|| (!logContext.IsAnyEnabled(HttpLoggingFields.Response) && logContext.Parameters.Count == 0))
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Internal\Binding\JsonTranscodingProviderServiceBinder.cs (1)
256for (var i = 0; i < _serviceDescriptor.Methods.Count; i++)
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
111for (var i = fields.Count - 1; i >= 0; i--)
Microsoft.AspNetCore.Grpc.Swagger (1)
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
111for (var i = fields.Count - 1; i >= 0; i--)
Microsoft.AspNetCore.Grpc.Swagger.Tests (14)
Binding\ParametersTests.cs (8)
29Assert.Equal(2, operation.Parameters.Count); 45Assert.Equal(2, operation.Parameters.Count); 61Assert.Equal(3, operation.Parameters.Count); 87Assert.Equal(4, swagger.Components.Schemas["RequestTwo"].Properties.Count); 99Assert.Equal(4, operation.Parameters.Count); 129Assert.Equal(5, operation.Parameters.Count); 151Assert.Equal(3, operation.Parameters.Count); 179Assert.Equal(2, operation.Parameters.Count);
Binding\ResponseBodyTests.cs (1)
65Assert.Equal(5, enumSchema.Enum.Count);
SchemaGeneratorIntegrationTests.cs (5)
45Assert.Equal(5, enumSchema.Enum.Count); 65Assert.Equal(5, schema.Enum.Count); 85Assert.Equal(2, schema.Properties.Count); 115Assert.Equal(2, schema.Properties.Count); 175Assert.Equal(4, schema.Properties.Count);
Microsoft.AspNetCore.HeaderParsing (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.AspNetCore.HostFiltering (1)
MiddlewareConfigurationManager.cs (1)
47if (options.AllowedHosts?.Count > 0 && !TryProcessHosts(options.AllowedHosts, allowedHosts))
Microsoft.AspNetCore.HostFiltering.Tests (1)
MiddlewareConfigurationManagerTests.cs (1)
88Assert.True(options.AllowedHosts.All(x => result1.AllowedHosts.Contains(x)) && options.AllowedHosts.Count.Equals(result1.AllowedHosts.Count));
Microsoft.AspNetCore.Hosting (3)
GenericHost\GenericWebHostService.cs (1)
68if (addresses != null && !addresses.IsReadOnly && addresses.Count == 0)
Internal\WebHost.cs (1)
263if (addresses != null && !addresses.IsReadOnly && addresses.Count == 0)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (1)
253for (var i = 0; i < attributes.Count; i++)
Microsoft.AspNetCore.Hosting.Tests (1)
StartupManagerTests.cs (1)
757public int MethodsCalled => _configurationMethodCalledList.Count;
Microsoft.AspNetCore.Html.Abstractions (4)
HtmlContentBuilder.cs (4)
35public int Count => Entries.Count; 105var count = Entries.Count; 132var count = Entries.Count; 162var count = Entries.Count;
Microsoft.AspNetCore.Http (3)
Internal\ItemsDictionary.cs (1)
111int ICollection<KeyValuePair<object, object?>>.Count => _items?.Count ?? 0;
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
75return ReadDictionary.Count;
src\Shared\Debugger\DictionaryDebugView.cs (1)
23var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count];
Microsoft.AspNetCore.Http.Abstractions (42)
EndpointFilterInvocationContextOfT.Generated.cs (40)
64for (int i = 0; i < Arguments.Count; i++) 77for (int i = 0; i < Arguments.Count; i++) 85for (int i = 0; i < Arguments.Count; i++) 102for (int i = 0; i < Arguments.Count; i++) 192for (int i = 0; i < Arguments.Count; i++) 205for (int i = 0; i < Arguments.Count; i++) 213for (int i = 0; i < Arguments.Count; i++) 231for (int i = 0; i < Arguments.Count; i++) 327for (int i = 0; i < Arguments.Count; i++) 340for (int i = 0; i < Arguments.Count; i++) 348for (int i = 0; i < Arguments.Count; i++) 367for (int i = 0; i < Arguments.Count; i++) 469for (int i = 0; i < Arguments.Count; i++) 482for (int i = 0; i < Arguments.Count; i++) 490for (int i = 0; i < Arguments.Count; i++) 510for (int i = 0; i < Arguments.Count; i++) 618for (int i = 0; i < Arguments.Count; i++) 631for (int i = 0; i < Arguments.Count; i++) 639for (int i = 0; i < Arguments.Count; i++) 660for (int i = 0; i < Arguments.Count; i++) 774for (int i = 0; i < Arguments.Count; i++) 787for (int i = 0; i < Arguments.Count; i++) 795for (int i = 0; i < Arguments.Count; i++) 817for (int i = 0; i < Arguments.Count; i++) 937for (int i = 0; i < Arguments.Count; i++) 950for (int i = 0; i < Arguments.Count; i++) 958for (int i = 0; i < Arguments.Count; i++) 981for (int i = 0; i < Arguments.Count; i++) 1107for (int i = 0; i < Arguments.Count; i++) 1120for (int i = 0; i < Arguments.Count; i++) 1128for (int i = 0; i < Arguments.Count; i++) 1152for (int i = 0; i < Arguments.Count; i++) 1284for (int i = 0; i < Arguments.Count; i++) 1297for (int i = 0; i < Arguments.Count; i++) 1305for (int i = 0; i < Arguments.Count; i++) 1330for (int i = 0; i < Arguments.Count; i++) 1468for (int i = 0; i < Arguments.Count; i++) 1481for (int i = 0; i < Arguments.Count; i++) 1489for (int i = 0; i < Arguments.Count; i++) 1515for (int i = 0; i < Arguments.Count; i++)
HostString.cs (1)
244var count = patterns.Count;
src\Shared\Debugger\DictionaryDebugView.cs (1)
23var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count];
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
CookieBuilderTests.cs (2)
62Assert.Equal(2, options.Extensions.Count); 69Assert.Equal(2, cookie.Extensions.Count);
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
726var requestHeaders = new Dictionary<string, StringValues>(existingRequestFeature.Headers.Count, StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Http.Connections.Client (1)
Internal\WebSocketsTransport.cs (1)
114if (context.Options.Headers.Count > 0)
Microsoft.AspNetCore.Http.Connections.Common (2)
NegotiateProtocol.cs (2)
99var transportCount = response.AvailableTransports.Count; 117var formatCount = availableTransport.TransferFormats.Count;
Microsoft.AspNetCore.Http.Connections.Tests (10)
HttpConnectionDispatcherTests.cs (1)
819Assert.Equal(3, connectionHttpContext.Request.Headers.Count);
MapConnectionHandlerTests.cs (7)
40options => authCount += options.AuthorizationData.Count, 78options => authCount += options.AuthorizationData.Count)) 105options => authCount += options.AuthorizationData.Count)) 133options => authCount += options.AuthorizationData.Count)) 162authCount += options.AuthorizationData.Count; 192authCount += options.AuthorizationData.Count; 221authCount += options.AuthorizationData.Count;
NegotiateProtocolTests.cs (1)
35Assert.Equal(availableTransports?.Length, response.AvailableTransports?.Count);
WebSocketsTests.cs (1)
415Assert.Equal(2, messages.Received.Count);
Microsoft.AspNetCore.Http.Extensions (14)
DefaultProblemDetailsWriter.cs (2)
34if (acceptHeader.Count == 0) 38for (var i = 0; i < acceptHeader.Count; i++)
HeaderDictionaryTypeExtensions.cs (7)
70if (values == null || values.Count == 0) 74else if (values.Count == 1) 80var newValues = new string[values.Count]; 81for (var i = 0; i < values.Count; i++) 101switch (values.Count) 110var newValues = new string[values.Count]; 111for (var i = 0; i < values.Count; i++)
QueryBuilder.cs (1)
74for (var i = 0; i < _params.Count; i++)
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (4)
191for (var i = 0; i < props.Count; i++) 208for (var i = 0; i < props.Count; i++) 339for (var i = 0; i < properties.Count; i++) 439for (var i = 0; i < constructorParameters.Count; i++)
Microsoft.AspNetCore.Http.Extensions.Tests (10)
ProblemDetailsServiceCollectionExtensionsTest.cs (1)
234Assert.Equal(3, jsonOptions.Value.SerializerOptions.TypeInfoResolverChain.Count);
RequestDelegateFactoryTests.cs (5)
3350var currentMetadataCount = builder.Metadata.Count; 3361var currentMetadataCount = builder.Metadata.Count; 3372for (int i = builder.Metadata.Count - 1; i >= 0; i--) 3390for (int i = builder.Metadata.Count - 1; i >= 0; i--) 3408for (int i = builder.Metadata.Count - 1; i >= 0; i--)
RequestDelegateGenerator\SharedTypes.cs (4)
646for (int i = builder.Metadata.Count - 1; i >= 0; i--) 664for (int i = builder.Metadata.Count - 1; i >= 0; i--) 927var currentMetadataCount = builder.Metadata.Count; 960var currentMetadataCount = builder.Metadata.Count;
Microsoft.AspNetCore.Http.Microbenchmarks (4)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (4)
646for (int i = builder.Metadata.Count - 1; i >= 0; i--) 664for (int i = builder.Metadata.Count - 1; i >= 0; i--) 927var currentMetadataCount = builder.Metadata.Count; 960var currentMetadataCount = builder.Metadata.Count;
Microsoft.AspNetCore.Http.Results (3)
src\Shared\RangeHelper\RangeHelper.cs (2)
67Debug.Assert(rangeHeader.Ranges.Count == 1); 76if (ranges.Count == 0)
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
268if (etagHeader?.Count > 0)
Microsoft.AspNetCore.Http.Tests (2)
CookieOptionsTests.cs (2)
57Assert.Equal(original.Extensions.Count, copy.Extensions.Count);
Microsoft.AspNetCore.HttpLogging (2)
W3CLoggingMiddleware.cs (2)
75var additionalHeaderElements = new string[_additionalRequestHeaders.Count]; 178if (_additionalRequestHeaders.Count != 0)
Microsoft.AspNetCore.HttpOverrides (3)
ForwardedHeadersMiddleware.cs (3)
71if (_options.AllowedHosts == null || _options.AllowedHosts.Count == 0) 216var checkKnownIps = _options.KnownNetworks.Count > 0 || _options.KnownProxies.Count > 0;
Microsoft.AspNetCore.HttpsPolicy (1)
HstsMiddleware.cs (1)
84for (var i = 0; i < _excludedHosts.Count; i++)
Microsoft.AspNetCore.Identity (1)
SignInManager.cs (1)
808(await UserManager.GetValidTwoFactorProvidersAsync(user)).Count > 0;
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (21)
SqlStoreOnlyUsersTestBase.cs (8)
169Assert.Equal(2, (await manager.GetClaimsAsync(userById)).Count); 171Assert.Equal(2, (await manager.GetRolesAsync(userById)).Count); 184Assert.Equal(2, (await manager.GetClaimsAsync(userByName)).Count); 186Assert.Equal(2, (await manager.GetRolesAsync(userByName)).Count); 199Assert.Equal(2, (await manager.GetClaimsAsync(userByLogin)).Count); 201Assert.Equal(2, (await manager.GetRolesAsync(userByLogin)).Count); 215Assert.Equal(2, (await manager.GetClaimsAsync(userByEmail)).Count); 217Assert.Equal(2, (await manager.GetRolesAsync(userByEmail)).Count);
SqlStoreTestBase.cs (8)
275Assert.Equal(2, (await manager.GetClaimsAsync(userById)).Count); 277Assert.Equal(2, (await manager.GetRolesAsync(userById)).Count); 290Assert.Equal(2, (await manager.GetClaimsAsync(userByName)).Count); 292Assert.Equal(2, (await manager.GetRolesAsync(userByName)).Count); 305Assert.Equal(2, (await manager.GetClaimsAsync(userByLogin)).Count); 307Assert.Equal(2, (await manager.GetRolesAsync(userByLogin)).Count); 332Assert.Equal(2, (await manager.GetClaimsAsync(userByEmail)).Count); 334Assert.Equal(2, (await manager.GetRolesAsync(userByEmail)).Count);
UserStoreWithGenericsTest.cs (5)
110Assert.Equal(3, userClaims.Count); 115Assert.Equal(2, userClaims.Count); 139Assert.Equal(3, userClaims.Count); 142Assert.Equal(2, userClaims.Count); 150Assert.Equal(3, userClaims2.Count);
Microsoft.AspNetCore.Identity.FunctionalTests (6)
Infrastructure\ServerFactory.cs (1)
127for (var i = 0; i < manager.ApplicationParts.Count; i++)
LoginTests.cs (3)
251Assert.Equal(2, emailSender.SentEmails.Count); 351Assert.Equal(2, emailSender.SentEmails.Count); 381Assert.Equal(2, emailSender.SentEmails.Count);
ManagementTests.cs (2)
75Assert.Equal(2, emails.SentEmails.Count); 102Assert.Equal(2, emails.SentEmails.Count);
Microsoft.AspNetCore.Identity.Specification.Tests (21)
IdentitySpecificationTestBase.cs (8)
247Assert.Equal(3, roleClaims.Count); 248Assert.Equal(3, safeRoleClaims.Count); 252Assert.Equal(2, roleClaims.Count); 253Assert.Equal(3, safeRoleClaims.Count); 258Assert.Equal(3, safeRoleClaims.Count); 263Assert.Equal(3, safeRoleClaims.Count); 409Assert.Equal(roles.Count, rs.Count); 592Assert.Equal(3, (await manager.GetUsersInRoleAsync(await roleManager.GetRoleNameAsync(role))).Count);
UserManagerSpecificationTests.cs (13)
716Assert.Equal(3, userClaims.Count); 719Assert.Equal(2, userClaims.Count); 747Assert.Equal(3, userClaims.Count); 750Assert.Equal(2, userClaims.Count); 758Assert.Equal(3, userClaims2.Count); 775Claim oldClaim = userClaims.Count == 0 ? null : userClaims[0]; 779Claim newClaim = newUserClaims.Count == 0 ? null : newUserClaims[0]; 803Claim oldClaim = userClaims.Count == 0 ? null : userClaims[0]; 807Claim newClaim = newUserClaims.Count == 0 ? null : newUserClaims[0]; 812Claim oldClaim2 = userClaims2.Count == 0 ? null : userClaims2[0]; 1825Assert.Equal(2, factors.Count); 1834Assert.Equal(2, factors.Count); 1931Assert.Equal(3, (await manager.GetUsersForClaimAsync(new Claim("foo", "bar"))).Count);
Microsoft.AspNetCore.Identity.UI (2)
Areas\Identity\Pages\V4\Account\Manage\ExternalLogins.cshtml.cs (1)
103ShowRemoveButton = passwordHash != null || CurrentLogins.Count > 1;
Areas\Identity\Pages\V5\Account\Manage\ExternalLogins.cshtml.cs (1)
103ShowRemoveButton = passwordHash != null || CurrentLogins.Count > 1;
Microsoft.AspNetCore.JsonPatch.Tests (9)
IntegrationTests\DictionaryIntegrationTest.cs (7)
40Assert.Equal(3, model.DictionaryOfStringToInteger.Count); 96Assert.Equal(2, model.DictionaryOfStringToInteger.Count); 115Assert.Equal(2, model.DictionaryOfStringToInteger.Count); 195Assert.Equal(2, model.DictionaryOfStringToCustomer.Count); 264Assert.Equal(2, model.DictionaryOfStringToCustomer.Count); 288Assert.Equal(2, model.DictionaryOfStringToCustomer.Count); 312Assert.Equal(2, model.DictionaryOfStringToInteger.Count);
TestObjectModels\DynamicTestObject.cs (1)
19public int Count => ((IDictionary<string, object>)_dictionary).Count;
WriteOnceDynamicTestObject.cs (1)
33public int Count => ((IDictionary<string, object>)_dictionary).Count;
Microsoft.AspNetCore.Localization (1)
AcceptLanguageHeaderRequestCultureProvider.cs (1)
29if (acceptLanguageHeader == null || acceptLanguageHeader.Count == 0)
Microsoft.AspNetCore.MiddlewareAnalysis.Tests (1)
MiddlewareAnalysisTests.cs (1)
49Assert.Equal(2, listener.MiddlewareStarting.Count);
Microsoft.AspNetCore.Mvc.Abstractions (3)
Filters\FilterContext.cs (1)
84for (var i = Filters.Count - 1; i >= 0; i--)
ModelBinding\ModelPropertyCollection.cs (1)
39for (var i = 0; i < Items.Count; i++)
src\Shared\Debugger\DictionaryDebugView.cs (1)
23var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count];
Microsoft.AspNetCore.Mvc.Api.Analyzers (6)
AddResponseTypeAttributeCodeFixAction.cs (1)
59if (results.Count == 0)
ApiConventionAnalyzer.cs (2)
81for (var i = 0; i < declaredResponseMetadata.Count; i++) 97for (var i = 0; i < actualResponseMetadata.Count; i++)
DeclaredApiResponseMetadata.cs (1)
66for (var i = 0; i < declaredApiResponseMetadata.Count; i++)
SymbolApiResponseMetadataProvider.cs (2)
25if (metadataItems.Count != 0) 33if (metadataItems.Count == 0)
Microsoft.AspNetCore.Mvc.ApiExplorer (6)
ApiResponseTypeProvider.cs (1)
285if (apiResponse.ApiResponseFormats.Count > 0)
DefaultApiDescriptionProvider.cs (4)
126if (apiDescription.ParameterDescriptions.Count > 0) 214for (var i = context.Results.Count - 1; i >= 0; i--) 246for (var i = context.Results.Count - 1; i >= 0; i--) 365if (action.ActionConstraints != null && action.ActionConstraints.Count > 0)
EndpointMetadataApiDescriptionProvider.cs (1)
373else if (apiResponseType.ApiResponseFormats.Count == 0 && CreateDefaultApiResponseFormat(apiResponseType.Type) is { } defaultResponseFormat)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (34)
DefaultApiDescriptionProviderTest.cs (17)
699Assert.Equal(4, description.SupportedResponseTypes.Count); 809Assert.Equal(3, description.SupportedResponseTypes.Count); 872Assert.Equal(4, description.SupportedResponseTypes.Count); 942Assert.Equal(4, description.SupportedResponseTypes.Count); 1012Assert.Equal(4, description.SupportedResponseTypes.Count); 1324Assert.Equal(3, parameters.Count); 1422Assert.Equal(3, parameters.Count); 1524Assert.Equal(3, parameters.Count); 1551Assert.Equal(4, description.ParameterDescriptions.Count); 1715Assert.Equal(2, description.ParameterDescriptions.Count); 1739Assert.Equal(4, description.ParameterDescriptions.Count); 1770Assert.Equal(4, description.ParameterDescriptions.Count); 1802Assert.Equal(4, description.ParameterDescriptions.Count); 1833Assert.Equal(4, description.ParameterDescriptions.Count); 1861Assert.Equal(8, description.ParameterDescriptions.Count); 1950Assert.Equal(2, parameters.Count); 1995Assert.Equal(5, description.ParameterDescriptions.Count);
EndpointMetadataApiDescriptionProviderTest.cs (17)
34Assert.Equal(2, apiDescriptions.Count); 91Assert.Equal(2, apiDescription.SupportedRequestFormats.Count); 110Assert.Equal(2, apiDescription.SupportedRequestFormats.Count); 125Assert.Equal(2, apiDescription.SupportedRequestFormats.Count); 192Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 219Assert.Equal(3, apiDescription.SupportedResponseTypes.Count); 257Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 283Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 362Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 396Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 621Assert.Equal(3, apiDescription.ParameterDescriptions.Count); 701Assert.Equal(4, apiDescription.ParameterDescriptions.Count); 714Assert.Equal(4, apiDescription.ParameterDescriptions.Count); 731Assert.Equal(2, apiDescription.ParameterDescriptions.Count); 743Assert.Equal(2, apiDescription.ParameterDescriptions.Count); 788Assert.Equal(2, apiDescription.ParameterDescriptions.Count); 1275Assert.Equal(2, apiDescription.SupportedRequestFormats.Count);
Microsoft.AspNetCore.Mvc.Core (89)
ActionConstraints\ActionConstraintCache.cs (3)
54if (action.ActionConstraints == null || action.ActionConstraints.Count == 0) 59var items = new List<ActionConstraintItem>(action.ActionConstraints.Count); 60for (var i = 0; i < action.ActionConstraints.Count; i++)
ActionConstraints\DefaultActionConstraintProvider.cs (1)
24for (var i = 0; i < context.Results.Count; i++)
ApplicationModels\ActionAttributeRouteModel.cs (6)
23if (actionModel.Controller.Selectors.Count > 0) 37for (var i = additionalSelector.ActionConstraints.Count - 1; i >= 0; i--) 45for (var i = additionalSelector.EndpointMetadata.Count - 1; i >= 0; i--) 122for (var i = 0; i < actionConstraints.Count; i++) 136for (var i = 0; i < controllerMetadata.Count; i++) 167for (var i = 0; i < actionModel.Controller.Selectors.Count; i++)
ApplicationModels\ApiBehaviorApplicationModelProvider.cs (1)
105for (var i = 0; i < selectorModel.Count; i++)
ApplicationModels\ControllerActionDescriptorBuilder.cs (3)
64var parameterDescriptors = new List<ParameterDescriptor>(action.Parameters.Count); 183if (selectorModel.ActionConstraints?.Count > 0) 191if (selectorModel.EndpointMetadata?.Count > 0)
ApplicationModels\ControllerActionDescriptorProvider.cs (2)
53for (var i = 0; i < context.Results.Count; i++) 62for (var i = 0; i < context.Results.Count; i++)
ApplicationModels\InferParameterBindingInfoConvention.cs (1)
81for (var i = 0; i < action.Parameters.Count; i++)
Authorization\AuthorizeFilter.cs (2)
123for (var i = 0; i < context.Filters.Count; i++) 213for (var i = 0; i < filters.Count; i++)
ChallengeResult.cs (1)
100if (AuthenticationSchemes != null && AuthenticationSchemes.Count > 0)
Controllers\ControllerBinderDelegateProvider.cs (6)
122if (parameters.Count == 0) 127var parameterBindingInfo = new BinderItem[parameters.Count]; 128for (var i = 0; i < parameters.Count; i++) 168if (properties.Count == 0) 173var propertyBindingInfo = new BinderItem[properties.Count]; 175for (var i = 0; i < properties.Count; i++)
DependencyInjection\ApplicationModelConventionExtensions.cs (1)
37for (var i = list.Count - 1; i >= 0; i--)
Filters\DefaultFilterProvider.cs (1)
22var resultsCount = results.Count;
Filters\FilterFactory.cs (1)
19var staticFilterItems = new FilterItem[actionDescriptor.FilterDescriptors.Count];
ForbidResult.cs (2)
101if (AuthenticationSchemes != null && AuthenticationSchemes.Count > 0) 103for (var i = 0; i < AuthenticationSchemes.Count; i++)
Formatters\AcceptHeaderParser.cs (1)
23for (var i = 0; i < acceptHeaders.Count; i++)
Formatters\TextInputFormatter.cs (2)
77if (SupportedEncodings.Count == 0) 93for (int i = 0; i < SupportedEncodings.Count; i++)
Formatters\TextOutputFormatter.cs (8)
67if (SupportedEncodings.Count == 0) 87for (var i = 0; i < SupportedEncodings.Count; i++) 111if (SupportedEncodings.Count > 0) 194if (acceptCharsetHeaders != null && acceptCharsetHeaders.Count > 0) 197for (var i = 0; i < acceptValues.Count; i++) 202for (var j = 0; j < SupportedEncodings.Count; j++) 224for (var i = 0; i < values.Count; i++) 243for (var i = 0; i < values.Count; i++)
Infrastructure\ControllerActionInvoker.cs (2)
517if (actionDescriptor.BoundProperties.Count == 0 && 518actionDescriptor.Parameters.Count == 0)
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (1)
132if (context.Results.Count == 0)
Infrastructure\DefaultOutputFormatterSelector.cs (6)
58if (formatters.Count == 0) 61if (formatters.Count == 0) 193for (var i = 0; i < sortedAcceptHeaders.Count; i++) 200for (var j = 0; j < formatters.Count; j++) 241for (var i = 0; i < sortedAcceptableContentTypes.Count; i++) 249for (var k = 0; k < formatters.Count; k++)
Infrastructure\ResourceInvoker.Log.cs (1)
27var count = action.RouteValues.Count;
ModelBinding\Binders\BodyModelBinder.cs (1)
117for (var i = 0; i < _formatters.Count; i++)
ModelBinding\Binders\BodyModelBinderProvider.cs (1)
75if (_formatters.Count == 0)
ModelBinding\Binders\DictionaryModelBinder.cs (2)
120if (result.Model is IDictionary<TKey, TValue?> { Count: > 0 }) 145if (keys.Count == 0)
ModelBinding\Binders\FormFileModelBinder.cs (6)
69if (postedFiles.Count == 0 && 82if (postedFiles.Count == 0) 93if (postedFiles.Count == 0 && !bindingContext.IsTopLevelObject) 159if (postedFiles.Count == 0) 181for (var i = 0; i < Items.Count; i++) 196for (var i = 0; i < Items.Count; i++)
ModelBinding\CompositeValueProvider.cs (3)
70for (var i = 0; i < factories.Count; i++) 113var itemCount = Items.Count; 135if (result != null && result.Count > 0)
ModelBinding\Metadata\HasValidatorsValidationMetadataProvider.cs (1)
18if (modelValidatorProviders.Count > 0 && modelValidatorProviders.All(p => p is IMetadataBasedModelValidatorProvider))
ModelBinding\Metadata\MetadataDetailsProviderExtensions.cs (1)
35for (var i = list.Count - 1; i >= 0; i--)
ModelBinding\ModelBinderProviderExtensions.cs (1)
35for (var i = list.Count - 1; i >= 0; i--)
ModelBinding\PrefixContainer.cs (2)
30if (_originalValues.Count == 0) 36_sortedValues = new string[_originalValues.Count];
ModelBinding\Validation\CompositeModelValidatorProvider.cs (1)
35for (var i = 0; i < ValidatorProviders.Count; i++)
ModelBinding\Validation\DefaultModelValidatorProvider.cs (2)
21for (var i = 0; i < context.Results.Count; i++) 41for (var i = 0; i < validatorMetadata.Count; i++)
ModelBinding\Validation\ModelValidatorProviderExtensions.cs (1)
35for (var i = list.Count - 1; i >= 0; i--)
ModelBinding\ValueProviderFactoryExtensions.cs (1)
35for (var i = list.Count - 1; i >= 0; i--)
ProducesAttribute.cs (1)
78for (var i = 0; i < context.Filters.Count; i++)
Routing\ActionConstraintMatcherPolicy.cs (2)
42if (action?.ActionConstraints is IList<IActionConstraintMetadata> { Count: > 0 } constraints && HasSignificantActionConstraint(constraints)) 55for (var i = 0; i < constraints.Count; i++)
Routing\ActionEndpointFactory.cs (4)
401if (action.FilterDescriptors != null && action.FilterDescriptors.Count > 0) 409if (action.ActionConstraints != null && action.ActionConstraints.Count > 0) 456if (builder.FilterFactories.Count > 0 && controllerActionDescriptor is not null) 475for (var i = routeHandlerFilters.Count - 1; i >= 0; i--)
Routing\UrlHelper.cs (1)
39if (routers.Count == 0)
SignOutResult.cs (2)
117if (AuthenticationSchemes.Count == 0) 123for (var i = 0; i < AuthenticationSchemes.Count; i++)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
75return ReadDictionary.Count;
src\Shared\RangeHelper\RangeHelper.cs (2)
67Debug.Assert(rangeHeader.Ranges.Count == 1); 76if (ranges.Count == 0)
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
268if (etagHeader?.Count > 0)
Microsoft.AspNetCore.Mvc.Core.Test (29)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (13)
66Assert.Equal(3, descriptor.FilterDescriptors.Count); 371Assert.Equal(3, descriptorWithValue.RouteValues.Count); 388Assert.Equal(2, descriptorWithoutValue.RouteValues.Count); 903Assert.Equal(3, indexAction.RouteValues.Count); 1192Assert.Equal(2, action.ActionConstraints.Count); 1198Assert.Equal(2, action.ActionConstraints.Count); 1217Assert.Equal(3, action.ActionConstraints.Count); 1223Assert.Equal(3, action.ActionConstraints.Count); 1244Assert.Equal(3, action.ActionConstraints.Count); 1250Assert.Equal(3, action.ActionConstraints.Count); 1256Assert.Equal(3, action.ActionConstraints.Count); 1262Assert.Equal(3, action.ActionConstraints.Count); 1283Assert.Equal(2, action.ActionConstraints.Count);
ApplicationModels\DefaultApplicationModelProviderTest.cs (2)
443Assert.Equal(2, attributeRoutes.Count); 465Assert.Equal(2, attributeRoutes.Count);
ApplicationModels\EndpointMetadataProviderTest.cs (4)
441for (int i = builder.Metadata.Count - 1; i >= 0; i--) 460for (int i = builder.Metadata.Count - 1; i >= 0; i--) 480for (int i = builder.Metadata.Count - 1; i >= 0; i--) 498for (int i = builder.Metadata.Count - 1; i >= 0; i--)
Formatters\InputFormatterTest.cs (1)
446return SupportedTypes.Count == 0 ? true : SupportedTypes.Contains(type);
Formatters\TextInputFormatterTest.cs (1)
218return SupportedTypes.Count == 0 ? true : SupportedTypes.Contains(type);
Infrastructure\ControllerActionInvokerTest.cs (1)
223Assert.Equal(2, controllerContext.ValueProviderFactories.Count);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (1)
1252var lastIndex = options.Value.ModelBinderProviders.Count - 1;
ModelBinding\Binders\DictionaryModelBinderTest.cs (1)
47Assert.Equal(2, dictionary.Count);
ModelBinding\Binders\FormFileModelBinderTest.cs (1)
244Assert.Equal(2, files.Count);
ModelBinding\Validation\ClientValidatorCacheTest.cs (1)
126for (var i = 0; i < context.Results.Count; i++)
ModelBinding\Validation\DefaultModelValidatorProviderTest.cs (2)
92Assert.Equal(2, validatorItems.Count); 137Assert.Equal(2, validatorItems.Count);
ModelBinding\Validation\ValidatorCacheTest.cs (1)
78for (var i = 0; i < context.Results.Count; i++)
Microsoft.AspNetCore.Mvc.Cors (2)
CorsApplicationModelProvider.cs (2)
89var selectorsCount = selectors.Count; 97var actionConstraintsCount = actionConstraints.Count;
Microsoft.AspNetCore.Mvc.DataAnnotations (5)
DataAnnotationsClientModelValidatorProvider.cs (1)
62var resultsCount = results.Count;
DataAnnotationsModelValidatorProvider.cs (2)
56var resultsCount = results.Count; 105var validatorMetadataCount = validatorMetadata.Count;
DefaultClientModelValidatorProvider.cs (1)
24var resultsCount = results.Count;
NumericClientModelValidatorProvider.cs (1)
28var resultsCount = results.Count;
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (5)
DataAnnotationsModelValidatorProviderTest.cs (1)
54Assert.Equal(4, providerContext.Results.Count);
DefaultModelClientValidatorProviderTest.cs (4)
94Assert.Equal(2, validatorItems.Count); 118Assert.Equal(2, validatorItems.Count); 162Assert.Equal(2, validatorItems.Count); 185Assert.Equal(2, validatorItems.Count);
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
ValidationProblemDetailsWrapper.cs (1)
82if (ProblemDetails.Errors.Count == 0)
Microsoft.AspNetCore.Mvc.FunctionalTests (4)
ApiExplorerTest.cs (2)
858Assert.Equal(4, responseType.ResponseFormats.Count); 884Assert.Equal(2, responseType.ResponseFormats.Count);
BasicTests.cs (2)
486Assert.True(assemblyParts.Count > 2); 488for (var i = 1; i < assemblyParts.Count; i++)
Microsoft.AspNetCore.Mvc.IntegrationTests (5)
ActionParametersIntegrationTest.cs (1)
1016get { return _original.Count; }
DictionaryModelBinderIntegrationTest.cs (2)
1537return _data.Count; 1642return _data.Count;
ExcludeBindingMetadataProviderIntegrationTest.cs (1)
74for (var i = options.ModelMetadataDetailsProviders.Count - 1; i >= 0; i--)
TryUpdateModelIntegrationTest.cs (1)
1307get { return _original.Count; }
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
BsonTempDataSerializer.cs (1)
126if (values?.Count > 0)
Microsoft.AspNetCore.Mvc.Razor (8)
Compilation\DefaultViewCompiler.cs (1)
53viewsFeature.ViewDescriptors.Count,
RazorPage.cs (1)
212if (PreviousSectionWriters != null && PreviousSectionWriters.Count > 0)
RazorViewEngine.cs (6)
59if (_options.ViewLocationFormats.Count == 0) 66if (_options.AreaViewLocationFormats.Count == 0) 241var expandersCount = expanders.Count; 345var expandersCount = expanders.Count; 403var viewExpirationTokensCount = viewExpirationTokens.Count; 437for (var i = 0; i < viewDescriptor.ExpirationTokens.Count; i++)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (8)
PageDirectiveFeature.cs (3)
18for (var i = builder.Phases.Count - 1; i >= 0; i--) 124var messages = new string[diagnostics.Count]; 125for (var i = 0; i < diagnostics.Count; i++)
RazorReferenceManager.cs (1)
54var referencePaths = new List<string>(_options.AdditionalReferencePaths.Count);
RuntimeCompilationFileProvider.cs (2)
37if (fileProviders.Count == 0) 45else if (fileProviders.Count == 1)
RuntimeViewCompiler.cs (2)
64precompiledViews.Count, 139for (var i = 0; i < item.ExpirationTokens.Count; i++)
Microsoft.AspNetCore.Mvc.Razor.Test (24)
RazorPageTest.cs (24)
288Assert.Equal(2, bufferScope.CreatedBuffers.Count); 300Assert.Equal(2, bufferScope.CreatedBuffers.Count); 303Assert.Equal(2, bufferScope.CreatedBuffers.Count); 307Assert.Equal(2, bufferScope.CreatedBuffers.Count); 310Assert.Equal(2, bufferScope.CreatedBuffers.Count); 317Assert.Equal(2, bufferScope.CreatedBuffers.Count); 320Assert.Equal(3, bufferScope.CreatedBuffers.Count); 333Assert.Equal(3, bufferScope.CreatedBuffers.Count); 336Assert.Equal(4, bufferScope.CreatedBuffers.Count); 348Assert.Equal(4, bufferScope.CreatedBuffers.Count); 351Assert.Equal(4, bufferScope.CreatedBuffers.Count); 352Assert.Equal(2, bufferScope.ReturnedBuffers.Count); 355Assert.Equal(4, bufferScope.CreatedBuffers.Count); 356Assert.Equal(2, bufferScope.ReturnedBuffers.Count); 358Assert.Equal(4, bufferScope.CreatedBuffers.Count); 359Assert.Equal(2, bufferScope.ReturnedBuffers.Count); 364Assert.Equal(4, bufferScope.CreatedBuffers.Count); 365Assert.Equal(2, bufferScope.ReturnedBuffers.Count); 367Assert.Equal(4, bufferScope.CreatedBuffers.Count); 368Assert.Equal(3, bufferScope.ReturnedBuffers.Count); 371Assert.Equal(4, bufferScope.CreatedBuffers.Count); 372Assert.Equal(3, bufferScope.ReturnedBuffers.Count); 374Assert.Equal(4, bufferScope.CreatedBuffers.Count); 375Assert.Equal(3, bufferScope.ReturnedBuffers.Count);
Microsoft.AspNetCore.Mvc.RazorPages (27)
ApplicationModels\CompiledPageActionDescriptorBuilder.cs (3)
78var handlerDescriptors = new HandlerMethodDescriptor[handlerModels.Count]; 100var parameters = new HandlerParameterDescriptor[methodParameters.Count]; 123for (var i = 0; i < properties.Count; i++)
Infrastructure\CompiledPageActionDescriptorProvider.cs (1)
57var lookup = new Dictionary<string, CompiledViewDescriptor>(feature.ViewDescriptors.Count, StringComparer.Ordinal);
Infrastructure\DefaultPageHandlerMethodSelector.cs (2)
89for (var i = 0; i < handlers.Count; i++) 105for (var i = 0; i < handlers.Count; i++)
Infrastructure\PageActionDescriptorProvider.cs (1)
49for (var i = 0; i < pageRouteModels.Count; i++)
Infrastructure\PageActionInvoker.cs (6)
182if (_actionDescriptor.BoundProperties.Count == 0 && (_handler == null || _handler.Parameters.Count == 0)) 204for (var i = 0; i < _actionDescriptor.HandlerMethods.Count; i++) 222if (handler.Parameters.Count == 0) 227var arguments = new object?[handler.Parameters.Count]; 258for (var i = 0; i < _actionDescriptor.HandlerMethods.Count; i++)
Infrastructure\PageActionInvokerCache.cs (6)
131if (actionDescriptor.HandlerMethods == null || actionDescriptor.HandlerMethods.Count == 0) 136var results = new PageHandlerExecutorDelegate[actionDescriptor.HandlerMethods.Count]; 138for (var i = 0; i < actionDescriptor.HandlerMethods.Count; i++) 148if (actionDescriptor.HandlerMethods == null || actionDescriptor.HandlerMethods.Count == 0) 153var results = new PageHandlerBinderDelegate[actionDescriptor.HandlerMethods.Count]; 155for (var i = 0; i < actionDescriptor.HandlerMethods.Count; i++)
Infrastructure\PageBinderFactory.cs (6)
23if (properties == null || properties.Count == 0) 29var propertyBindingInfo = new BinderItem[properties.Count]; 30for (var i = 0; i < properties.Count; i++) 54for (var i = 0; i < properties.Count; i++) 89if (handler.Parameters == null || handler.Parameters.Count == 0) 95var parameterBindingInfo = new BinderItem[handler.Parameters.Count];
Infrastructure\PageResultExecutor.cs (2)
63var viewStarts = new IRazorPage[pageContext.ViewStartFactories.Count]; 64for (var i = 0; i < pageContext.ViewStartFactories.Count; i++)
Microsoft.AspNetCore.Mvc.RazorPages.Test (3)
ApplicationModels\CompiledPageRouteModelProviderTest.cs (1)
481for (var i = 0; i < items.Count; i++)
Infrastructure\PageActionInvokerTest.cs (2)
111Assert.Equal(2, pageContext.ValueProviderFactories.Count); 1531handlers = new PageHandlerExecutorDelegate[actionDescriptor.HandlerMethods.Count];
Microsoft.AspNetCore.Mvc.TagHelpers (15)
AnchorTagHelper.cs (2)
180(_routeValues != null && _routeValues.Count > 0)) 219if (_routeValues != null && _routeValues.Count > 0)
Cache\CacheTagKey.cs (6)
298if (values == null || values.Count == 0) 309for (var i = 0; i < values.Count; i++) 336for (var i = 0; i < values.Count; i++) 352if (values1 == null || values2 == null || values1.Count != values2.Count) 357for (var i = 0; i < values1.Count; i++)
ComponentTagHelper.cs (1)
98var parameters = _parameters is null || _parameters.Count == 0 ? ParameterView.Empty : ParameterView.FromDictionary(_parameters);
FormActionTagHelper.cs (2)
193(_routeValues != null && _routeValues.Count > 0)) 231if (_routeValues != null && _routeValues.Count > 0)
FormTagHelper.cs (2)
166(_routeValues != null && _routeValues.Count > 0); 238if (_routeValues != null && _routeValues.Count > 0)
OptionTagHelper.cs (1)
78if (currentValues?.Values != null && currentValues.Values.Count != 0)
RenderAtEndOfFormTagHelper.cs (1)
55for (var i = 0; i < formContext.EndOfFormContent.Count; i++)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
OptionTagHelperTest.cs (1)
358entry => (entry[1] != null || entry[3] == null || ((ICollection<string>)(entry[3])).Count == 0));
Microsoft.AspNetCore.Mvc.Test (2)
MvcServiceCollectionExtensionsTest.cs (2)
315Assert.Equal(2, manager.ApplicationParts.Count); 343Assert.Equal(2, manager.ApplicationParts.Count);
Microsoft.AspNetCore.Mvc.ViewFeatures (11)
CookieTempDataProvider.cs (1)
109var hasValues = (values != null && values.Count > 0);
DefaultHtmlGenerator.cs (4)
1563var count = itemsList.Count; 1593var optionGenerated = new bool[itemsList.Count]; 1594for (var i = 0; i < itemsList.Count; i++) 1615for (var j = i; j < itemsList.Count; j++)
Filters\SaveTempDataFilter.cs (1)
135for (var i = 0; i < filters.Count; i++)
Infrastructure\DefaultTempDataSerializer.cs (1)
130if (values == null || values.Count == 0)
Rendering\MultiSelectList.cs (1)
230for (var index = 0; index < _groups.Count; index++)
Rendering\TagBuilder.cs (1)
308if (attributes != null && attributes.Count > 0)
SessionStateTempDataProvider.cs (1)
54var hasValues = (values != null && values.Count > 0);
ViewDataDictionary.cs (1)
322get { return _data.Count; }
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (5)
AttributeDictionaryTest.cs (2)
199Assert.Equal(3, keys.Count); 351Assert.Equal(3, values.Count);
Buffers\PagedBufferedTextWriterTest.cs (1)
260Assert.Equal(3, pool.Returned.Count);
CookieTempDataProviderTest.cs (1)
324if (responseCookies.Count > 0)
ExpressionHelperTest.cs (1)
120(Expression<Func<IList<TestModel>, int>>)(model => model.FirstOrDefault().PreferredCategories.Count),
Microsoft.AspNetCore.OpenApi (12)
Services\OpenApiDocumentService.cs (3)
338if (description.SupportedResponseTypes.Count == 0) 500if (supportedRequestFormats.Count == 0) 651if (supportedRequestFormats.Count == 0)
Services\Schemas\OpenApiSchemaService.cs (9)
151if (schema.AnyOf is { Count: > 0 }) 153for (var i = 0; i < schema.AnyOf.Count; i++) 168if (schema.AllOf is { Count: > 0 }) 170for (var i = 0; i < schema.AllOf.Count; i++) 176if (schema.OneOf is { Count: > 0 }) 178for (var i = 0; i < schema.OneOf.Count; i++) 267if (schema.AnyOf is { Count: > 0 } && jsonTypeInfo.PolymorphismOptions is not null) 273if (schema.AnyOf.Count <= anyOfIndex) 288if (schema.Properties is { Count: > 0 })
Microsoft.AspNetCore.OpenApi.Tests (14)
Services\OpenApiGeneratorTests.cs (8)
109Assert.Equal(2, content.Count); 120Assert.Equal(2, request.Content.Count); 450Assert.Equal(2, operation.Parameters.Count); 510Assert.Equal(2, operation.Parameters.Count); 531Assert.Equal(2, operation.Parameters.Count); 816Assert.Equal(2, content.Count); 985Assert.Equal(4, operation.Parameters?.Count); 1005Assert.Equal(2, operation.Parameters.Count);
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (5)
109Assert.Equal(4, effectiveSchema.Properties.Count); 266Assert.Equal(4, requestBodySchema.Items.Properties.Count); 357Assert.Equal(4, itemsSchema.Properties.Count); 500Assert.Equal(3, document.Components.Schemas.Count); 577Assert.Equal(2, document.Components.Schemas.Count);
Transformers\SchemaTransformerTests.cs (1)
704Assert.Equal(2, requestSchema.AllOf.Count);
Microsoft.AspNetCore.OutputCaching (4)
OutputCacheEntry.cs (1)
86var count = headers.Count;
OutputCacheKeyProvider.cs (1)
342if (dictionary == null || dictionary.Count == 0)
OutputCacheMiddleware.cs (1)
539for (var i = 0; i < ifNoneMatchETags?.Count; i++)
RecyclableReadOnlySequenceSegment.cs (1)
85int count = segments.Count;
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
EndToEndBenchmarks.cs (1)
217if (value.Headers.Length != _headers.Count - 2)
Microsoft.AspNetCore.Owin (6)
DictionaryStringArrayWrapper.cs (1)
32int ICollection<KeyValuePair<string, string[]>>.Count => Inner.Count;
DictionaryStringValuesWrapper.cs (1)
77int ICollection<KeyValuePair<string, StringValues>>.Count => Inner.Count;
OwinEnvironment.cs (4)
259if (arrayIndex + _entries.Count + _context.Items.Count > array.Length) 273get { return _entries.Count + _context.Items.Count; }
Microsoft.AspNetCore.Owin.Tests (1)
OwinEnvironmentTests.cs (1)
143var length = collection.Count;
Microsoft.AspNetCore.Razor (5)
TagHelpers\ReadOnlyTagHelperAttributeList.cs (3)
52var itemsCount = items.Count; 122var itemsCount = items.Count; 155var itemsCount = items.Count;
TagHelpers\TagHelperAttributeList.cs (2)
95for (var i = 0; i < Items.Count; i++) 185for (var i = Items.Count - 1; i >= 0; i--)
Microsoft.AspNetCore.Razor.Runtime (2)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
75return ReadDictionary.Count;
src\Shared\Debugger\DictionaryDebugView.cs (1)
23var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count];
Microsoft.AspNetCore.RequestDecompression.Tests (1)
RequestDecompressionOptionsTests.cs (1)
19Assert.Equal(defaultProviderCount, providers.Count);
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
446for (var i = 0; i < ifNoneMatchEtags.Count; i++)
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
88if (!StringWithQualityHeaderValue.TryParseList(accept, out var encodings) || encodings.Count == 0)
Microsoft.AspNetCore.Rewrite (6)
ApacheModRewrite\FileParser.cs (3)
27if (tokens.Count > 4) 46if (tokens.Count == 4) 65if (tokens.Count == 4)
ApacheModRewrite\RuleBuilder.cs (2)
23if (_actions.Count == 0 || _match == null) 37if (tokens.Count == 4)
ApacheModRewrite\Tokenizer.cs (1)
105for (var i = 0; i < tokens.Count; i++)
Microsoft.AspNetCore.Rewrite.Tests (3)
IISUrlRewrite\FileParserTests.cs (3)
199Assert.Equal(actual.Count, expected.Count); 200for (var i = 0; i < actual.Count; i++)
Microsoft.AspNetCore.Routing (31)
Builder\EndpointRouteBuilderExtensions.cs (1)
208if (options.EndpointBuilder?.FilterFactories.Count > 0)
CompositeEndpointDataSource.cs (1)
81if (_dataSources.Count is 0)
Matching\NegotiationMatcherPolicy.cs (4)
86!StringWithQualityHeaderValue.TryParseList(header, out var values) || values.Count == 0) 117for (var j = 0; j < values.Count; j++) 404!StringWithQualityHeaderValue.TryParseList(header, out var values) || values.Count == 0) 415for (var i = 0; i < values.Count; i++)
RequestDelegateFilterPipelineBuilder.cs (1)
42for (var i = options.EndpointBuilder.FilterFactories.Count - 1; i >= 0; i--)
RouteConstraintMatcher.cs (1)
56if (constraints == null || constraints.Count == 0)
RouteEndpointBuilder.cs (2)
67if (metadata.Count > 0) 75for (var i = 0; i < metadata.Count; i++)
RouteEndpointDataSource.cs (1)
238if (isRouteHandler || builder.FilterFactories.Count > 0)
RouteValuesAddressScheme.cs (2)
43var matchCount = matchResults.Count; 46if (matchResults.Count == 1)
Template\RoutePrecedence.cs (4)
37ValidateSegementLength(template.Segments.Count); 43for (var i = 0; i < template.Segments.Count; i++) 91ValidateSegementLength(template.Segments.Count); 97for (var i = 0; i < template.Segments.Count; i++)
Template\RouteTemplate.cs (3)
39for (var i = 0; i < Segments.Count; i++) 105return index >= Segments.Count ? null : Segments[index]; 120for (var i = 0; i < Parameters.Count; i++)
Template\TemplateMatcher.cs (3)
36_hasDefaultValue = new bool[Template.Segments.Count]; 37_defaultValues = new object[Template.Segments.Count]; 39for (var i = 0; i < Template.Segments.Count; i++)
Tree\LinkGenerationDecisionTree.cs (5)
70if (_root.Matches.Count > 0 || _root.Criteria.Count > 0 || _conventionalEntries.Count > 0) 118var matchesCount = matches.Count; 126var criteriaCount = criteria.Count; 239if (node.Criteria.Count == 0)
Tree\TreeRouter.cs (1)
158for (var i = 0; i < matches.Count; i++)
Tree\UrlMatchingTree.cs (2)
77for (var i = 0; i < entry.RouteTemplate.Segments.Count; i++) 252for (var i = currentParameterIndex; i < segments.Count; i++)
Microsoft.AspNetCore.Routing.Abstractions (3)
RouteData.cs (3)
277for (; i < snapshotRouters.Count && i < routers.Count; i++) 282for (; i < snapshotRouters.Count; i++) 288for (i = routers.Count - 1; i >= snapshotRouters.Count; i--)
Microsoft.AspNetCore.Routing.Tests (11)
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (1)
377Assert.Equal(2, endpointBuilder1.Metadata.Count);
Patterns\RoutePatternMatcherTest.cs (1)
1121Assert.Equal(expected.Count, values.Count);
RouteTest.cs (2)
1578Assert.Equal(expectedDictionary.Count, templateRoute.DataTokens.Count); 1642Assert.Equal(2, constraints.Count);
Template\TemplateMatcherTests.cs (1)
1120Assert.Equal(expected.Count, values.Count);
Template\TemplateParserTests.cs (6)
828if (x.Segments.Count != y.Segments.Count) 833for (var i = 0; i < x.Segments.Count; i++) 849if (x.Parameters.Count != y.Parameters.Count) 854for (var i = 0; i < x.Parameters.Count; i++)
Microsoft.AspNetCore.Server.HttpSys (8)
AuthenticationManager.cs (1)
183if (challenges.Count > 0)
HttpSysListener.cs (3)
322if (authChallenges != null && authChallenges.Count > 0) 337var nativeHeaderValues = allocator.AllocAsPointer<HTTP_KNOWN_HEADER>(authChallenges.Count); 340for (var headerValueIndex = 0; headerValueIndex < authChallenges.Count; headerValueIndex++)
MessagePump.cs (1)
67var hostingUrlsPresent = _serverAddresses.Addresses.Count > 0;
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
105get { return Store.Count; }
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
120count += _extra != null ? _extra.Count : _requestMemoryBlob.CountUnknownHeaders();
UrlPrefixCollection.cs (1)
38return _prefixes.Count;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (11)
RequestHeaderTests.cs (11)
44Assert.Equal(4, requestHeaders.Count); 187Assert.Equal(3, requestHeaders.Count); 188Assert.Equal(requestHeaders.Keys.Count, requestHeaders.Count); 189Assert.Equal(requestHeaders.Count, requestHeaders.Values.Count); 214Assert.Equal(4, requestHeaders.Count); 215Assert.Equal(requestHeaders.Keys.Count, requestHeaders.Count); 216Assert.Equal(requestHeaders.Count, requestHeaders.Values.Count);
Microsoft.AspNetCore.Server.IIS (3)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
105get { return Store.Count; }
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
120count += _extra != null ? _extra.Count : _requestMemoryBlob.CountUnknownHeaders();
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (1)
253for (var i = 0; i < attributes.Count; i++)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
TestMatrix.cs (1)
205if (ApplicationTypes.Count == 1)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
KestrelServerOptions.cs (1)
380var cert = certs.Count > 0 ? certs[0] : null;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (7)
Http1\Http1ConnectionTests.cs (1)
1202public int Count => _innerHeaders.Count;
HttpRequestHeadersTests.cs (4)
63Assert.Equal(3, headers.Count); 316Assert.Equal(3, headers.Count); 338Assert.Equal(3, headers.Count); 346Assert.Equal(2, headers.Count);
src\Servers\Kestrel\shared\KnownHeaders.cs (2)
403var useVarForFirstTerm = values.Count > 1 && values.Select(h => h.FirstNameIgnoreCaseSegment()).Distinct().Count() == 1; 1476if (values.Count == 1 && values[0].Field.Value.Length == 0)
Microsoft.AspNetCore.Shared.Tests (9)
CopyOnWriteDictionaryTest.cs (1)
21.SetupGet(d => d.Count)
PropertyHelperTest.cs (3)
682Assert.Equal(2, dictValues.Count); 698Assert.Equal(2, dictValues.Count); 714Assert.Equal(3, dictValues.Count);
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
75return ReadDictionary.Count;
src\Shared\Debugger\DictionaryDebugView.cs (1)
23var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count];
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
105get { return Store.Count; }
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
120count += _extra != null ? _extra.Count : _requestMemoryBlob.CountUnknownHeaders();
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (1)
253for (var i = 0; i < attributes.Count; i++)
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Internal\Protocol\Utf8BufferTextWriterTests.cs (1)
207Assert.Equal(6, segments.Count);
Microsoft.AspNetCore.SignalR.Core (2)
HubConnectionHandler.cs (1)
114if (supportedProtocols == null || supportedProtocols.Count == 0)
Internal\DefaultHubDispatcher.cs (1)
668if (descriptor.Policies.Count == 0)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
581if (message.Headers != null && message.Headers.Count > 0)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Protocol\MessagePackHubProtocolWorker.cs (3)
326if (source != null && source.Count > 0) 596writer.WriteMapHeader(headers.Count); 597if (headers.Count > 0)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Protocol\NewtonsoftJsonHubProtocol.cs (1)
578if (message.Headers != null && message.Headers.Count > 0)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
Internal\DefaultHubMessageSerializer.cs (1)
16_hubProtocols = new List<IHubProtocol>(supportedProtocols.Count);
Microsoft.AspNetCore.SignalR.Tests (9)
HubConnectionHandlerTests.cs (3)
2025Assert.Equal(5, messages.Count); 4433Assert.Equal(phrases.Length + 1, messages.Count); 4492Assert.Equal(2, messages.Count);
MapSignalRTests.cs (6)
79authCount += options.AuthorizationData.Count; 110authCount += options.AuthorizationData.Count; 151authCount += options.AuthorizationData.Count; 180authCount += options.AuthorizationData.Count; 209authCount += options.AuthorizationData.Count; 239authCount += options.AuthorizationData.Count;
Microsoft.AspNetCore.StaticAssets (4)
src\Shared\RangeHelper\RangeHelper.cs (2)
67Debug.Assert(rangeHeader.Ranges.Count == 1); 76if (ranges.Count == 0)
StaticAssetsInvoker.cs (2)
305if (ifMatch?.Count > 0) 321if (ifNoneMatch?.Count > 0)
Microsoft.AspNetCore.StaticFiles (5)
DefaultFilesMiddleware.cs (1)
60for (int matchIndex = 0; matchIndex < _options.DefaultFileNames.Count; matchIndex++)
src\Shared\RangeHelper\RangeHelper.cs (2)
67Debug.Assert(rangeHeader.Ranges.Count == 1); 76if (ranges.Count == 0)
StaticFileContext.cs (2)
149if (ifMatch?.Count > 0) 164if (ifNoneMatch?.Count > 0)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (2)
src\Shared\RangeHelper\RangeHelper.cs (2)
67Debug.Assert(rangeHeader.Ranges.Count == 1); 76if (ranges.Count == 0)
Microsoft.AspNetCore.Testing (2)
ServiceFakesHostExtensions.cs (1)
73if (feature is null || feature.Addresses.Count == 0)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
3114if (_urls.Count == 0)
Microsoft.AspNetCore.WebSockets (1)
WebSocketMiddleware.cs (1)
43_anyOriginAllowed = _options.AllowedOrigins.Count == 0 || _options.AllowedOrigins.Contains("*", StringComparer.Ordinal);
Microsoft.Build (182)
BackEnd\BuildManager\BuildManager.cs (3)
1960ProjectErrorUtilities.VerifyThrowInvalidProject(entryPointNode.ProjectInstance.Targets.Count > 0, entryPointNode.ProjectInstance.ProjectFileLocation, "NoTargetSpecified"); 2646if (newNodes?.Count != response.NumberOfNodesToCreate || newNodes.Any(n => n == null)) 2971if (loggingService.Loggers.Count == 0)
BackEnd\BuildManager\BuildParameters.cs (1)
467_globalProperties = new PropertyDictionary<ProjectPropertyInstance>(value.Count);
BackEnd\BuildManager\BuildRequestData.cs (1)
150GlobalPropertiesDictionary = new PropertyDictionary<ProjectPropertyInstance>(globalProperties.Count);
BackEnd\BuildManager\GlobalPropertiesLookup.cs (1)
42public int Count => _backingProperties.Count;
BackEnd\Components\Caching\ConfigCache.cs (4)
214ErrorUtilities.VerifyThrow(_configurations.Count > 0, "No configurations exist from which to obtain the smallest configuration id."); 263return _configurations.Count > _sweepThreshhold; 279int remainingToRelease = _configurations.Count; 283remainingToRelease = Convert.ToInt32(Math.Max(1, Math.Floor(_configurations.Count * 0.1)));
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (1)
104if (nodeContexts.Count > 0)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (2)
232if (possibleRunningNodesList.Count > 0) 234CommunicationsUtilities.Trace("Attempting to connect to {1} existing processes '{0}'...", expectedProcessName, possibleRunningNodesList.Count);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
565return nodeContexts.Count == 1;
BackEnd\Components\Logging\LoggingService.cs (3)
1202ErrorUtilities.VerifyThrow(descriptions.Count > 0, "loggerDescriptions was null"); 1999if ((WarningsAsErrors.Count == 0 && WarningAsErrorNotOverriden(warningEvent)) || WarningsAsErrors.Contains(warningEvent.Code)) 2018((codesByProject.Count == 0 && (codesToIgnoreByProject is null || !codesToIgnoreByProject.Contains(warningEvent.Code)))
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
512string? targetNames = buildRequest.TargetNames != null && buildRequest.TargetNames.Count > 0
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (2)
300if (group == null || group.Count == 0) 552if (items.Count == 0 || specification.Length == 0)
BackEnd\Components\RequestBuilder\Lookup.cs (9)
482if (adds.Count != 0) 484allAdds ??= new List<ProjectItemInstance>(adds.Count); 493if (removes.Count != 0) 495allRemoves ??= new List<ProjectItemInstance>(removes.Count); 524if (groupFound.Count != 0 || scope.Items.HasEmptyMarker(itemType)) 550int itemsCount = groupFound?.Count ?? 0; // Start with initial set 602ErrorUtilities.VerifyThrow(existing.Count == 0, "Cannot add an itemgroup of this type."); 604if (group.Count > 0) 652if (group.Count == 0)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (3)
1402if (warningsAsErrors?.Count > 0) 1410if (warningsNotAsErrors?.Count > 0) 1417if (warningsAsMessages?.Count > 0)
BackEnd\Components\RequestBuilder\TargetBuilder.cs (4)
436if ((afterTargets.Count != 0) && didPushTargets) 454if (beforeTargets.Count != 0 && pushedTargets) 657List<TargetEntry> targetsToPush = new List<TargetEntry>(targets.Count); 660for (int i = targets.Count - 1; i >= 0; i--)
BackEnd\Components\RequestBuilder\TargetEntry.cs (2)
702List<TargetSpecification> allErrorTargets = new List<TargetSpecification>(_target.OnErrorChildren.Count); 827for (; (currentTask < _target.Children.Count) && !_cancellationToken.IsCancellationRequested; ++currentTask)
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (13)
616if (inputItems.Count > 0) 633if (upToDateInputItems.Count == outputItems.Count) 665itemsChanged = inputItems.Count; 676if (itemsChanged == inputItems.Count) 684if (itemsChanged < inputItems.Count) 823if (itemVectorContents.Count > 0) 963ErrorUtilities.VerifyThrow((inputs.Count > 0) && (outputs.Count > 0), "Need to specify inputs and outputs."); 964if (inputs.Count > 0) 969if (outputs.Count > 0) 1005for (int i = 1; i < outputs.Count; i++) 1084if (inputs.Count > 0) 1089if (outputs.Count > 0)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (4)
247List<string> taskParameters = new List<string>(_taskNode.ParametersForBuild.Count + _taskNode.Outputs.Count); 1030var declaredProjects = new HashSet<string>(projectReferenceItems.Count + 1, FileUtilities.PathComparer); 1050undeclaredProjects ??= new List<string>(projectReferenceItems.Count);
BackEnd\Components\RequestBuilder\TaskHost.cs (3)
299ErrorUtilities.VerifyThrow(targetOutputsPerProject.Length == result.TargetOutputsPerProject.Count, "{0} != {1}", targetOutputsPerProject.Length, result.TargetOutputsPerProject.Count); 777return (WarningsAsErrors.Count == 0 && WarningAsErrorNotOverriden(warningCode)) || WarningsAsErrors.Contains(warningCode);
BackEnd\Components\SdkResolution\SdkResult.cs (7)
110_additionalPaths?.Count == result._additionalPaths?.Count && 111_propertiesToAdd?.Count == result._propertiesToAdd?.Count && 112_itemsToAdd?.Count == result._propertiesToAdd?.Count && 117for (int i = 0; i < _additionalPaths.Count; i++)
BackEnd\Shared\BuildRequest.cs (1)
191_targets = new List<string>(escapedTargets.Count);
BackEnd\Shared\BuildRequestConfiguration.cs (1)
833if (items.Count == 0 || items.All(i => string.IsNullOrWhiteSpace(i.EvaluatedInclude)))
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (4)
732ArrayList finalTaskInputs = new ArrayList(taskItems.Count); 1150if (finalTaskItems.Count == 0) 1156if (finalTaskItems.Count != 1) 1274if ((finalTaskItems.Count > 0) || isRequired)
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (2)
52if (availableTypes.Count != checkTypes.Count)
Collections\CopyOnWritePropertyDictionary.cs (1)
224if (thisBacking.Count != otherDict.Count)
Collections\ItemDictionary.cs (1)
510while (_listEnumerator.Current == null || _listEnumerator.Current.Count == 0);
Collections\PropertyDictionary.cs (2)
156return ((ICollection<T>)_properties).Count; 522var dictionary = new Dictionary<string, string>(((ICollection<T>)_properties).Count, MSBuildNameIgnoreCaseComparer.Default);
Collections\ReadOnlyConvertingDictionary.cs (2)
68public int Count => _backing.Count; 158ErrorUtilities.VerifyThrow(array.Length - arrayIndex >= _backing.Count, "Specified array size insufficient to hold the contents of the collection.");
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (1)
179suggestedCapacity = coll.Count;
Definition\ProjectCollection.cs (3)
342_globalProperties = new PropertyDictionary<ProjectPropertyInstance>(globalProperties.Count); 1357if (_hostServices != null && _loadedProjects.GetMatchingProjectsIfAny(project.FullPath).Count == 0) 2620if (project.GlobalPropertiesCount != globalProperties.Count)
Definition\ProjectItem.cs (2)
277{ return Link != null ? Link.DirectMetadata.Count : _directMetadata != null ? _directMetadata.Count : 0; } 306{ return Metadata.Count + FileUtilities.ItemSpecModifiers.All.Length; }
Definition\ProjectItemDefinition.cs (1)
104get { return Link != null ? Link.Metadata.Count : (_metadata == null) ? 0 : _metadata.Count; }
Definition\Toolset.cs (2)
922int count = _environmentProperties.Count + reservedProperties.Count + Properties.Values.Count + _globalProperties.Count + 1; 935count += subToolsetProperties.Count;
Evaluation\Conditionals\FunctionCallExpressionNode.cs (3)
130if (items.Count == 0) 134else if (items.Count == 1) 161var expandedCount = expanded.Count;
Evaluation\Evaluator.cs (4)
502List<ProjectItemGroupTaskMetadataInstance> metadata = itemElement.Metadata.Count > 0 ? new List<ProjectItemGroupTaskMetadataInstance>() : null; 2541for (int i = 0; i < strings.Count - 1; i++) 2551if (strings.Count > 1) 2556sb.Append('\"').Append(strings[strings.Count - 1]).Append('\"');
Evaluation\Expander.cs (3)
586if ((itemsToAdd == null /* broke out early non empty */ || (itemsToAdd.Count > 0)) && (options & ExpanderOptions.BreakOnNotEmpty) != 0) 2015if (itemsOfType.Count == 0) 2034itemsFromCapture = new List<KeyValuePair<string, S>>(itemsOfType.Count);
Evaluation\ItemDataCollectionValue.cs (1)
38int count = (_value is IList<I> list) ? list.Count : (_value is null ? 0 : 1);
Evaluation\Preprocessor.cs (3)
64_importTable = new Dictionary<XmlElement, IList<ProjectRootElement>>(imports.Count); 298for (int i = 0; i < resolvedList.Count; i++) 319if (i < resolvedList.Count - 1)
FileMatcher.cs (2)
857excludeNextSteps = new RecursiveStepResult[searchesToExclude.Count]; 858for (int i = 0; i < searchesToExclude.Count; i++)
Graph\GraphBuilder.cs (1)
635propertyDictionary = new PropertyDictionary<ProjectPropertyInstance>(properties.Count);
Graph\ProjectGraph.cs (2)
619if (entryProjectTargets == null || entryProjectTargets.Count == 0) 788if (targetNames == null || targetNames.Count == 0)
Graph\ProjectGraphNode.cs (3)
56$"{truncatedProjectFile}, #GlobalProps={ProjectInstance.GlobalProperties.Count}, #Props={ProjectInstance.Properties.Count}, #Items={ProjectInstance.Items.Count}, #in={ReferencingProjects.Count}, #out={ProjectReferences.Count}";
Instance\ImmutableProjectCollections\ImmutableElementCollectionConverter.cs (3)
121public int Count => _projectElements.Count; 141CopyTo(array, arrayIndex, _projectElements.Count); 168ErrorUtilities.VerifyCollectionCopyToArguments(array, nameof(array), arrayIndex, nameof(arrayIndex), _projectElements.Count);
Instance\ImmutableProjectCollections\ImmutableGlobalPropertiesCollectionConverter.cs (5)
60public int Count => _globalProperties.Count; 90ErrorUtilities.VerifyCollectionCopyToArguments(array, nameof(array), arrayIndex, nameof(arrayIndex), _globalProperties.Count); 171public int Count => _parent._globalProperties.Count; 200CopyTo(array, arrayIndex, _parent._globalProperties.Count); 205ErrorUtilities.VerifyCollectionCopyToArguments(array, nameof(array), arrayIndex, nameof(arrayIndex), _parent._globalProperties.Count);
Instance\ImmutableProjectCollections\ImmutableItemDefinitionsListConverter.cs (3)
50if (index > _itemList.Count) 55if (index == _itemList.Count) 69public int Count => (_itemList == null ? 0 : _itemList.Count) + (_itemTypeDefinition == null ? 0 : 1);
Instance\ImmutableProjectCollections\ImmutableItemDictionary.cs (5)
61public int Count => _allCachedItems.Count; 101if (kvp.Value == null || kvp.Value.Count == 0) 162public bool HasEmptyMarker(string itemType) => _itemsByType.Values.Any(list => list.Count == 0); 192public int Count => _list.Count; 222ErrorUtilities.VerifyCollectionCopyToArguments(array, nameof(array), arrayIndex, nameof(arrayIndex), _list.Count);
Instance\ImmutableProjectCollections\ImmutablePropertyCollectionConverter.cs (1)
39if (other == null || Count != other.Count)
Instance\ImmutableProjectCollections\ImmutableStringValuedListConverter.cs (3)
29public int Count => _itemList.Count; 50ErrorUtilities.VerifyCollectionCopyToArguments(array, nameof(array), arrayIndex, nameof(arrayIndex), _itemList.Count); 74for (int i = 0; i < _itemList.Count; ++i)
Instance\ProjectInstance.cs (15)
385var projectItemToInstanceMap = this.CreateItemsSnapshot(project.Items, project.ItemTypes.Count, keepEvaluationCache); 405this.EvaluatedItemElements = new List<ProjectItemElement>(project.Items.Count); 481EvaluatedItemElements = new List<ProjectItemElement>(linkedProject.Items.Count); 535_globalProperties = new PropertyDictionary<ProjectPropertyInstance>(globalProperties.Count); 659var projectItemToInstanceMap = this.CreateItemsSnapshot(new ReadOnlyCollection<ProjectItem>(data.Items), data.ItemTypes.Count, keepEvaluationCache); 811_items = new ItemDictionary<ProjectItemInstance>(that.Items.Count); 1592get { return _targets.Count; } 2506int typeCount = _items.ItemTypes.Count; 2512int itemCount = itemList.Count; 3098_globalProperties = new PropertyDictionary<ProjectPropertyInstance>((globalProperties == null) ? 0 : globalProperties.Count); 3233var importPaths = new List<string>(Math.Max(0, importClosure.Count - 1) /* outer project */); 3246var importPathsIncludingDuplicates = new List<string>(Math.Max(0, importClosureWithDuplicates.Count - 1) /* outer project */); 3312var projectItemToInstanceMap = keepEvaluationCache ? new Dictionary<ProjectItem, ProjectItemInstance>(items.Count) : null; 3434_itemDefinitions = new RetrievableEntryHashSet<ProjectItemDefinitionInstance>(itemDefinitions.Count, MSBuildNameIgnoreCaseComparer.Default); 3447_properties = new PropertyDictionary<ProjectPropertyInstance>(properties.Count);
Instance\ProjectItemDefinitionInstance.cs (1)
119get { return (_metadata == null) ? 0 : _metadata.Count; }
Instance\ProjectItemInstance.cs (17)
841_directMetadata = (directMetadata == null || directMetadata.Count == 0) ? null : directMetadata; // If the metadata was all removed, toss the dictionary 947List<string> names = new List<string>(capacity: metadataCollection.Count + FileUtilities.ItemSpecModifiers.All.Length); 1043get { return (_directMetadata == null) ? 0 : _directMetadata.Count; } 1096var result = new List<KeyValuePair<string, string>>(list.Count); 1155for (int i = _itemDefinitions.Count - 1; i >= 0; i--) 1440for (int i = 0; i < _itemDefinitions.Count; i++) 1497Dictionary<string, string> clonedMetadata = new Dictionary<string, string>(metadata.Count, MSBuildNameIgnoreCaseComparer.Default); 1552if (_itemDefinitions?.Count == 0) 1558if (_directMetadata?.Count == 0) 1628int capacity = _itemDefinitions?.Count ?? 0 + _directMetadata?.Count ?? 0; 1633for (int i = 0; i < _itemDefinitions.Count; i++) 1649if (otherMetadata.Count != thisNames.Count) 1769int count = temp.Count; 1836if (metadata.Count == 0) 1948for (int i = 0; i < _itemDefinitions.Count; i++) 2092itemDefinitionsClone ??= new List<ProjectItemDefinitionInstance>(source._taskItem._itemDefinitions.Count + 1);
Instance\TaskFactories\AssemblyTaskFactory.cs (8)
330if ((_factoryIdentityParameters?.Count > 0) || (taskIdentityParameters?.Count > 0)) 474if (identityParameters?.Count > 0) 520if (taskIdentityParameters == null || taskIdentityParameters.Count == 0 || factoryIdentityParameters == null || factoryIdentityParameters.Count == 0) 556if (factoryIdentityParameters == null || factoryIdentityParameters.Count == 0) 560else if (taskIdentityParameters == null || taskIdentityParameters.Count == 0) 613if (mergedParameters == null || mergedParameters.Count == 0)
Instance\TaskRegistry.cs (2)
991if (x.Count != y.Count)
Logging\BaseConsoleLogger.cs (1)
477if (environment == null || environment.Count == 0)
Logging\BinaryLogger\BuildEventArgsReader.cs (4)
1438if (properties == null || properties.Count == 0) 1443int count = properties.Count; 1574if (list.Count == 0) 1601if (list.Count == 0)
Logging\BinaryLogger\BuildEventArgsWriter.cs (1)
888count = genericList.Count;
ObjectModelRemoting\DefinitionObjectsLinks\ProjectLink.cs (1)
276public virtual int GlobalPropertiesCount() => GlobalProperties.Count;
ReadOnlyCollection.cs (1)
50return BackingCollection.Count;
Utilities\Utilities.cs (1)
472var envPropertiesHashSet = new RetrievableValuedEntryHashSet<ProjectPropertyInstance>(environmentVariablesBag.Count + 2, MSBuildNameIgnoreCaseComparer.Default);
Microsoft.Build.Engine.OM.UnitTests (112)
Construction\ProjectItemElement_Tests.cs (1)
99Assert.Equal(2, item.Metadata.Count);
Construction\ProjectRootElement_Tests.cs (1)
1054Assert.Equal(iterations, collection.LoadedProjects.Count);
Definition\Project_Tests.cs (3)
2297project.Items.Count.ShouldBe(2); 2318project.Items.Count.ShouldBe(3); 4425items.Count.ShouldBe(3);
Definition\ProjectCollection_Tests.cs (4)
593Assert.Equal(2, project1.GlobalProperties.Count); 621Assert.Equal(2, project1.GlobalProperties.Count); 649Assert.Equal(2, project1.GlobalProperties.Count); 652Assert.Equal(2, project2.GlobalProperties.Count);
Definition\ProjectItem_Tests.cs (15)
418Assert.Equal(3, items.Count); 494Assert.Equal(9, items.Count); 522Assert.Equal(7, items.Count); 2220Assert.Equal(4, items.Count); 2234Assert.Equal(2, metadata.Count); 2247Assert.Equal(2, metadataElements.Count); 2280Assert.Equal(4, items.Count); 2331Assert.Equal(2, items.Count); 2342Assert.Equal(2, items.Count); 2354Assert.Equal(2, items.Count); 2951Assert.Equal(2, items.Count); 2972Assert.Equal(2, items.Count); 3026Assert.Equal(3, items.Count); 3450Assert.Equal(4, items.Count); 3499Assert.Equal(3, items.Count);
Instance\ProjectInstance_Tests.cs (4)
67Assert.Equal(3, items.Count); 444Assert.Equal(projAInstanceItem.MetadataCount, projAInstanceItem.MetadataNames.Count); 486Assert.Equal(projAInstanceItem.MetadataCount, projAInstanceItem.MetadataNames.Count); 521Assert.Equal(projAInstanceItem.MetadataCount, projAInstanceItem.MetadataNames.Count);
Instance\ProjectItemInstance_Tests.cs (4)
372Assert.Equal(3, taskItem2Metadata.Count); 393Assert.Equal(3, taskItem2MetadataEscaped.Count); 585Assert.Equal(9, items.Count); 613Assert.Equal(7, items.Count);
Instance\ProjectTaskInstance_Tests.cs (1)
33Assert.Equal(2, parameters.Count);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (4)
133Assert.Equal(expectedCount, result.Count); 141Assert.Equal(expectedCount, result.Count); 664Assert.Equal(realParams.Count, viewParams.Count);
ObjectModelRemoting\Helpers\ViewValidation.cs (2)
325Assert.Equal(realCollection.Count, viewCollection.Count);
ObjectModelRemoting\Helpers\ViewValidation.evaluation.cs (3)
30Assert.Equal(1, added.Count); 72if (viewItems == null || viewItems.Count == 0) 77Assert.Equal(1, viewItems.Count);
ObjectModelRemoting\LinkedConstructionModify_Tests.cs (45)
198Assert.Equal(1, newTarget1.View.Tasks.Count); 226Assert.Equal(0, newTask.View.Outputs.Count); 249Assert.Equal(8, newTask.View.Outputs.Count); 259Assert.Equal(0, newTask.View.Parameters.Count); 269Assert.Equal(5, newTask.View.Parameters.Count); 278Assert.Equal(3, newTask.View.Parameters.Count); 292Assert.Equal(0, newTask.View.Parameters.Count); 297Assert.Equal(7, newTask.View.Outputs.Count); 301Assert.Equal(6, newTask.View.Outputs.Count); 304Assert.Equal(5, newTask.View.Outputs.Count); 306Assert.Equal(4, newTask.View.Outputs.Count); 385Assert.Equal(2, choose.View.WhenElements.Count); 398Assert.Equal(1, choose.View.WhenElements.Count); 419Assert.Equal(2, when.View.ChooseElements.Count); 423Assert.Equal(2, when.View.ItemGroups.Count); 427Assert.Equal(2, when.View.PropertyGroups.Count); 432Assert.Equal(1, when.View.ChooseElements.Count); 437Assert.Equal(1, when.View.ItemGroups.Count); 440Assert.Equal(1, when.View.PropertyGroups.Count); 457Assert.Equal(2, otherwise.View.ChooseElements.Count); 461Assert.Equal(2, otherwise.View.ItemGroups.Count); 465Assert.Equal(2, otherwise.View.PropertyGroups.Count); 470Assert.Equal(1, otherwise.View.ChooseElements.Count); 475Assert.Equal(1, otherwise.View.ItemGroups.Count); 478Assert.Equal(1, otherwise.View.PropertyGroups.Count); 545Assert.Equal(2, taskParamGroup.View.Parameters.Count); 547Assert.Equal(4, taskParamGroup.View.Parameters.Count); 603Assert.Equal(2, importGroup.View.Imports.Count); 617Assert.Equal(2, itemDef.View.Metadata.Count); 619Assert.Equal(4, itemDef.View.Metadata.Count); 622Assert.Equal(6, itemDef.View.Metadata.Count); 634Assert.Equal(2, itemDefGrp.View.ItemDefinitions.Count); 673Assert.Equal(2, item.View.Metadata.Count); 675Assert.Equal(4, item.View.Metadata.Count); 677Assert.Equal(6, item.View.Metadata.Count); 698Assert.Equal(2, itemGrp.View.Items.Count); 706Assert.Equal(4, itemGrp.View.Items.Count); 735Assert.Equal(2, propGrp.View.Properties.Count); 736Assert.Equal(2, propGrp.View.PropertiesReversed.Count); 739Assert.Equal(4, propGrp.View.Properties.Count); 740Assert.Equal(4, propGrp.View.PropertiesReversed.Count); 743Assert.Equal(6, propGrp.View.Properties.Count); 744Assert.Equal(6, propGrp.View.PropertiesReversed.Count); 749Assert.Equal(6, propGrp.View.Properties.Count); 750Assert.Equal(6, propGrp.View.PropertiesReversed.Count);
ObjectModelRemoting\LinkedProjectCollection_Tests.cs (25)
44Assert.Equal(1, loadedLocal.Count); 45Assert.Equal(1, loadedRemote.Count); 52Assert.Equal(2, loadedLocal.Count); 88Assert.Equal(2, loadedLocal.Count); 89Assert.Equal(2, loadedRemote0.Count); 90Assert.Equal(2, loadedRemote1.Count); 95Assert.Equal(6, loadedWithExternal.Count); 98Assert.Equal(1, prj0Coll.Count); 102Assert.Equal(2, prj1Coll.Count); 107Assert.Equal(2, prj2Coll.Count); 116Assert.Equal(1, prj3Coll.Count); 132Assert.Equal(0, pcLocal.Collection.LoadedProjects.Count); 133Assert.Equal(0, pcRemote.Collection.LoadedProjects.Count); 136Assert.Equal(1, pcLocal.Collection.LoadedProjects.Count); 137Assert.Equal(1, pcLocal.Collection.GetLoadedProjects(proj0Path).Count); 140Assert.Equal(2, pcLocal.Collection.LoadedProjects.Count); 141Assert.Equal(1, pcLocal.Collection.GetLoadedProjects(proj1Path).Count); 144Assert.Equal(3, pcLocal.Collection.LoadedProjects.Count); 145Assert.Equal(1, pcLocal.Collection.GetLoadedProjects(proj2Path).Count); 148Assert.Equal(2, pcLocal.Collection.LoadedProjects.Count); 149Assert.Equal(0, pcLocal.Collection.GetLoadedProjects(proj1Path).Count); 150Assert.Equal(1, pcLocal.Collection.GetLoadedProjects(proj2Path).Count); 159Assert.Equal(0, this.StdGroup.Local.Collection.LoadedProjects.Count); 160Assert.Equal(0, this.StdGroup.Remote[0].Collection.LoadedProjects.Count); 161Assert.Equal(0, this.StdGroup.Remote[1].Collection.LoadedProjects.Count);
Microsoft.Build.Engine.UnitTests (119)
BackEnd\BuildManager_Tests.cs (2)
529result.ProjectStateAfterBuild.Items.Count.ShouldBe(4); 538result.ProjectStateAfterBuild.GetItems("AnItem").Count.ShouldBe(3);
BackEnd\BuildRequestConfiguration_Tests.cs (4)
377int fooCount = instance.ItemsToBuildWith["Foo"].Count; 386Assert.Equal(fooCount, lookup.GetItems("Foo").Count); 404Assert.Equal(fooCount, instance.ItemsToBuildWith["Foo"].Count); 412Assert.Equal(fooCount, lookup.GetItems("Foo").Count);
BackEnd\BuildResult_Tests.cs (1)
259int countFound = result.ResultsByTarget?.Count ?? 0;
BackEnd\IntrinsicTask_Tests.cs (17)
294Assert.Equal(2, group.Count); 376Assert.Equal(2, group.Count); 397Assert.Equal(2, group.Count); 425Assert.Equal(2, group.Count); 1065Assert.Equal(2, i2Group.Count); 2054items.Count.ShouldBe(3); 2149Assert.Equal(3, i0Group.Count); 2273Assert.Equal(4, linkGroup.Count); 2374Assert.Equal(3, p.ItemsToBuildWith["i0"].Count); 2376Assert.Equal(2, p.ItemsToBuildWith.ItemTypes.Count); 2379Assert.Equal(2, p.ItemsToBuildWith["i0"].Count); 2381Assert.Equal(2, p.ItemsToBuildWith.ItemTypes.Count); 2448Assert.Equal(2, p.ItemsToBuildWith["i0"].Count); 2449Assert.Equal(2, p.ItemsToBuildWith["i1"].Count); 2450Assert.Equal(2, p.ItemsToBuildWith.ItemTypes.Count); 3117Assert.Equal(4, i0Group.Count); 3545Assert.Equal(2, instance.Items.Count);
BackEnd\KnownTelemetry_Tests.cs (1)
79properties.Count.ShouldBe(11);
BackEnd\LoggingService_Tests.cs (12)
276Assert.Equal(3, _initializedService.RegisteredLoggerTypeNames.Count); 300Assert.Equal(3, _initializedService.RegisteredLoggerTypeNames.Count); 366Assert.Equal(4, _initializedService.RegisteredLoggerTypeNames.Count); 374Assert.Equal(2, _initializedService.RegisteredSinkNames.Count); 375Assert.Equal(2, _initializedService.LoggerDescriptions.Count); 445Assert.Equal(2, _initializedService.RegisteredLoggerTypeNames.Count); 471Assert.Equal(4, _initializedService.RegisteredLoggerTypeNames.Count); 489Assert.Equal(2, _initializedService.RegisteredSinkNames.Count); 490Assert.Equal(2, _initializedService.LoggerDescriptions.Count); 569Assert.Equal(6, _initializedService.RegisteredLoggerTypeNames.Count); 599Assert.Equal(2, _initializedService.RegisteredSinkNames.Count); 623Assert.Equal(2, _initializedService.RegisteredLoggerTypeNames.Count);
BackEnd\Lookup_Tests.cs (8)
113Assert.Equal(2, lookup.GetItems("i1").Count); 125Assert.Equal(2, lookup.GetItems("i1").Count); 137Assert.Equal(2, lookup.GetItems("i1").Count); 142Assert.Equal(2, table1["i1"].Count); 175Assert.Equal(3, group.Count); 187Assert.Equal(3, group.Count); 227Assert.Equal(5, group.Count); 240Assert.Equal(5, group.Count);
BackEnd\RequestedProjectState_Tests.cs (1)
62clone.ItemFilters.Count.Should().NotBe(items.Count);
BackEnd\ResultsCache_Tests.cs (2)
539return a.Count == b.Count;
BackEnd\SdkResolverService_Tests.cs (2)
406result.PropertiesToAdd.Count.ShouldBe(1); 409result.ItemsToAdd.Count.ShouldBe(1);
BackEnd\TargetEntry_Tests.cs (4)
189Assert.Equal(2, deps.Count); 337Assert.Equal(2, entry.Lookup.GetItems("Compile").Count); 363Assert.Equal(2, entry.Lookup.GetItems("Compile").Count); 374Assert.Equal(2, entry.Lookup.GetItems("Compile").Count);
BackEnd\TaskExecutionHost_Tests.cs (2)
1326Assert.Equal(values.Length, _bucket.Lookup.GetItems("output").Count); 1341Assert.Equal(values.Length, _bucket.Lookup.GetItems("output").Count);
BackEnd\TaskRegistry_Tests.cs (5)
198Assert.Equal(2, registry.TaskRegistrations.Count); // "Expected only two buckets since two of three tasks have the same name!" 299Assert.Equal(2, registry.TaskRegistrations.Count); // "Expected only two buckets since two of three tasks have the same name!" 337Assert.Equal(3, registry.TaskRegistrations.Count); // "Should have three buckets, since two of the tasks are the same." 1322Assert.Equal(2, inlineTaskRecord.UsingTaskParameters.Count); 1695Assert.Equal(2, inlineTaskRecord.UsingTaskParameters.Count);
BackEnd\TranslationHelpers.cs (2)
67if (left.Count != right.Count)
Definition\Toolset_Tests.cs (6)
120Assert.Equal(t.Properties.Count, t2.Properties.Count); 128Assert.Equal(t.SubToolsets.Count, t2.SubToolsets.Count); 138Assert.Equal(subToolset1.Properties.Count, subToolset2.Properties.Count);
Evaluation\Evaluator_Tests.cs (12)
960Assert.Equal(3, imports.Count); 961Assert.Equal(5, importsIncludingDuplicates.Count); 1965Assert.Equal(allEvaluatedPropertiesWithNoBackingXmlAndNoDuplicates.Count, nonImportedProperties.Count()); 2057Assert.Equal(6, project.AllEvaluatedItems.Count); 2073Assert.Equal(6, project.AllEvaluatedItems.Count); 2078Assert.Equal(7, project.AllEvaluatedItems.Count); 2129Assert.Equal(allEvaluatedPropertiesWithNoBackingXmlAndNoDuplicates.Count, nonImportedProperties.Count()); 2175int initial = project.AllEvaluatedProperties.Count; 2179Assert.Equal(initial, project.AllEvaluatedProperties.Count); 2183Assert.Equal(initial + 1, project.AllEvaluatedProperties.Count); 2212Assert.Equal(4, project.AllEvaluatedItemDefinitionMetadata.Count); 2218Assert.Equal(4, project.AllEvaluatedItemDefinitionMetadata.Count);
Evaluation\Expander_Tests.cs (15)
150Assert.Equal(5, itemsOut.Count); 181Assert.Equal(2, items.Count); 201Assert.Equal(2, items.Count); 285Assert.Equal(10, itemsTrue.Count); 291Assert.Equal(10, itemsTrue.Count); 297Assert.Equal(10, itemsTrue.Count); 658Assert.Equal(10, itemsTrue.Count); 664Assert.Equal(10, itemsTrue.Count); 676Assert.Equal(10, itemsTrue.Count); 696Assert.Equal(10, itemsTrue.Count); 716Assert.Equal(20, items.Count); 736Assert.Equal(10, items.Count); 1693Assert.Equal(9, expanded.Count); 1707ITaskItem[] items = new ITaskItem[list.Count]; 1708for (int i = 0; i < list.Count; ++i)
Evaluation\ItemEvaluation_Tests.cs (1)
545Assert.Equal(INCLUDE_COUNT, items.Count);
Evaluation\ProjectSdkImplicitImport_Tests.cs (10)
117Assert.Equal(expectImportInLogicalProject ? 7 : 6, children.Count); 138Assert.Equal(expectImportInLogicalProject ? 2 : 0, projectRootElement.Imports.Count); 141Assert.Equal(2, project.Imports.Count); 205Assert.Equal(expectImportInLogicalProject ? 6 : 0, projectRootElement.Imports.Count); 208Assert.Equal(sdkNames.Count * 2, project.Imports.Count); 446project.Imports.Count.ShouldBe(2); 522project.Imports.Count.ShouldBe(2); 691project.Imports.Count.ShouldBe(2); 704project.Imports.Count.ShouldBe(0);
Evaluation\SdkResultEvaluation_Tests.cs (4)
82itemsFromResolver.Count.ShouldBe(expectedItemCount); 224items.Count.ShouldBe(1); 324items.Count.ShouldBe(1); 403itemsFromBody.Count.ShouldBe(1);
Graph\ProjectGraph_Tests.cs (1)
413GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First().ProjectInstance.GlobalProperties.Count.ShouldBeGreaterThan(1);
Instance\ProjectInstance_Internal_Tests.cs (2)
73project.TaskRegistry.TaskRegistrations.Count.ShouldBe(3); 789projectInstance.Targets.Count.ShouldBe(2);
Instance\ProjectTaskInstance_Internal_Tests.cs (1)
72var parametersCopy = new Dictionary<string, (string, ElementLocation)>(parameters.Count);
Instance\TaskItem_Tests.cs (1)
198metadata.Count.ShouldBe(2);
TestComparers\ProjectInstanceModelTestComparers.cs (3)
343Assert.Equal(x.Count, y.Count); 345for (var i = 0; i < x.Count; i++)
Microsoft.Build.Framework (20)
BinaryTranslator.cs (6)
1088int count = list.Count; 1113_writer.Write(collection.Count); 1396int count = dictionary.Count; 1419int count = dictionary.Count; 1474int count = dictionary.Count; 1503int count = dictionary.Count;
BuildException\BuildExceptionBase.cs (1)
104writer.Write(customKeyedSerializedData.Count);
ICollectionDebugView`1.cs (1)
31var items = new T[_collection.Count];
IDictionaryDebugView`2.cs (3)
32var items = new KeyValuePair<K, V>[_dict.Count]; 53var items = new TKey[_collection.Count]; 74var items = new TValue[_collection.Count];
ImmutableSegmentedList`1.cs (1)
163if (items is ICollection<T> { Count: 0 })
ProjectStartedEventArgs.cs (1)
488writer.Write(collection.Count);
ReuseableStringBuilder.cs (1)
147var separatorsRemaining = strings.Count - 1;
SegmentedDictionary`2.cs (2)
106: this(dictionary != null ? dictionary.Count : 0, comparer) 144: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
SegmentedList`1.cs (2)
85var count = c.Count; 755var count = c.Count;
TaskItemData.cs (1)
55public int MetadataCount => Metadata.Count;
TelemetryEventArgs.cs (1)
32int count = Properties?.Count ?? 0;
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
85var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 101for (int i = 0; i < args.Count; ++i)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (2)
TargetTests.cs (2)
832Assert.Equal(expectedItemCount, items.Count); 841Assert.Equal(expectedItemCount, items.Count);
Microsoft.Build.Tasks.Core (13)
AssemblyDependency\ReferenceTable.cs (2)
1416if (!assemblyReference.IsPrimary || (assemblyReference.IsPrimary && isMarkedForExclusion && (dependees?.Count > 1))) 2038if (referenceAssemblyDirectories?.Count > 0)
FileMatcher.cs (2)
857excludeNextSteps = new RecursiveStepResult[searchesToExclude.Count]; 858for (int i = 0; i < searchesToExclude.Count; i++)
GetInstalledSDKLocations.cs (2)
157if (installedSDKs?.Count > 0) 159Log.LogMessageFromResources(MessageImportance.Low, "GetInstalledSDKs.FoundSDKs", installedSDKs.Count);
GetReferenceAssemblyPaths.cs (4)
62var pathsToReturn = new string[_tfmPaths.Count]; 84string[] pathsToReturn = new string[_tfmPathsNoProfile.Count]; 199if (_tfmPaths?.Count > 0) 251if (pathsToReturn.Count == 0)
ManifestUtil\DeployManifest.cs (1)
142if (referenceAssemblyPaths?.Count > 0)
ReadOnlyCollection.cs (1)
50return BackingCollection.Count;
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (1)
184if (taskInfo.CodeType == RoslynCodeTaskFactoryCodeType.Class && parameterGroup.Count == 0)
Microsoft.Build.Tasks.UnitTests (5)
GetSDKReference_Tests.cs (5)
284readInfo.DirectoryToFileList.Count.ShouldBe(2); 289readInfo.PathToReferenceMetadata.Count.ShouldBe(2); 299Assert.Equal(2, sdkFolders.Count); 305Assert.Equal(2, sdkFolders.Count); 311Assert.Equal(4, sdkFolders.Count);
Microsoft.Build.UnitTests.Shared (12)
ObjectModelHelpers.cs (12)
283if (items.Count != 0 || expectedDirectMetadataPerItem.Length != 0) 289int minimumLength = Math.Min(expectedItems.Length, items.Count); 306items.Count.ShouldBe(expectedItems.Length, 1245Assert.Equal(one.Count, two.Count); 1247for (int i = 0; i < one.Count; i++) 1258Assert.Equal(one.Count, two.Count); 1279Assert.Equal(x.Count, y.Count); 1281for (var i = 0; i < x.Count; i++) 1304a.Count.ShouldBe(b.Count);
Microsoft.Build.Utilities.Core (11)
FileMatcher.cs (2)
857excludeNextSteps = new RecursiveStepResult[searchesToExclude.Count]; 858for (int i = 0; i < searchesToExclude.Count; i++)
SDKManifest.cs (1)
246private bool IsFrameworkExtensionSdkManifest => _frameworkIdentities?.Count > 0
ToolLocationHelper.cs (8)
2182if (pathsList?.Count > 0) 2192if (pathsList?.Count > 0) 2234&& dotNetFrameworkReferenceAssemblies.Count == 0) 2248for (int i = 0; i < dotNetFrameworkReferenceAssemblies.Count; i++) 3685if (frameworkVersions.Count > 0) 3687Version targetFrameworkVersion = ConvertTargetFrameworkVersionToVersion(frameworkVersions[frameworkVersions.Count - 1]); 3843if (versions.Count > 0) 3916if (refAssemblyPaths?.Count > 0)
Microsoft.Build.Utilities.UnitTests (53)
PlatformManifest_Tests.cs (12)
112manifest.Manifest.DependentPlatforms.Count.ShouldBe(0); 113manifest.Manifest.ApiContracts.Count.ShouldBe(0); 133manifest.Manifest.DependentPlatforms.Count.ShouldBe(0); 134manifest.Manifest.ApiContracts.Count.ShouldBe(0); 153manifest.Manifest.ApiContracts.Count.ShouldBe(0); 154manifest.Manifest.DependentPlatforms.Count.ShouldBe(1); 178manifest.Manifest.ApiContracts.Count.ShouldBe(0); 179manifest.Manifest.DependentPlatforms.Count.ShouldBe(3); 209manifest.Manifest.DependentPlatforms.Count.ShouldBe(1); 214manifest.Manifest.ApiContracts.Count.ShouldBe(1); 239manifest.Manifest.DependentPlatforms.Count.ShouldBe(0); 240manifest.Manifest.ApiContracts.Count.ShouldBe(3);
ToolLocationHelper_Tests.cs (41)
377installedIdentifiers.Count.ShouldBe(0); 1695directories.Count.ShouldBe(3); // "Expected the method to return three paths." 1813directories.Count.ShouldBe(2); // "Expected the method to return two paths." 1924directories.Count.ShouldBe(1); // "Expected the method to return one path." 1945directories.Count.ShouldBe(0); // "Expected the method to return no paths." 1993list.Count.ShouldBe(1); 2007list.Count.ShouldBe(0); 2023list.Count.ShouldBe(3); 2040list.Count.ShouldBe(0); 2054list.Count.ShouldBe(0); 2070list.Count.ShouldBe(2); 2090list.Count.ShouldBe(5); 2109list.Count.ShouldBe(0); 2123list.Count.ShouldBe(0); 2197if (referencePaths.Count == 0) 2280if (referencePaths.Count == 0) 2315list.Count.ShouldBe(4); 2336list.Count.ShouldBe(2); 2351list.Count.ShouldBe(0); 2365list.Count.ShouldBe(0); 2379list.Count.ShouldBe(0); 2686stdLibPaths.Count.ShouldBe(1); 2994sdks.Count.ShouldBe(0); 2999sdks.Count.ShouldBe(1); 3007sdks.Count.ShouldBe(2); 3011sdks.Count.ShouldBe(0); 3031sdks.Count.ShouldBe(0); 3167sdkManifest.FrameworkIdentities.Count.ShouldBeGreaterThan(0); 3192sdkManifest2.FrameworkIdentities.Count.ShouldBeGreaterThan(0); 3264sdkManifest5.FrameworkIdentities.Count.ShouldBeGreaterThan(0); 3496sdkList.Count.ShouldBe(7); 3497filteredSdkList.Count.ShouldBe(7); 3498filteredSdkList1.Count.ShouldBe(2); 3499filteredSdkList2.Count.ShouldBe(3); 3500filteredSdkList3.Count.ShouldBe(4); 3501filteredSdkList4.Count.ShouldBe(5); 3502filteredSdkList5.Count.ShouldBe(5); 3503filteredSdkList6.Count.ShouldBe(7); 3530filteredExtensionSDKs1.Count.ShouldBe(2); 3531filteredExtensionSDKs2.Count.ShouldBe(1); 3532filteredExtensionSDKs3.Count.ShouldBe(0);
Microsoft.CodeAnalysis (39)
Collections\CachingDictionary.cs (1)
95return this.EnsureFullyPopulated().Count;
Collections\CollectionsExtensions.cs (1)
15return collection == null || collection.Count == 0;
Collections\IdentifierCollection.Collection.cs (1)
45_count = this.IdentifierCollection._map.Values.Sum(o => o is string ? 1 : ((ISet<string>)o).Count);
Collections\UnionCollection.cs (4)
35if (coll1.Count == 0) 40if (coll2.Count == 0) 102index += collection.Count; 112_count = _collections.Sum(c => c.Count);
InternalUtilities\EnumerableExtensions.cs (5)
50for (int i = 0, count = list.Count; i < count; i++) 93if (items is ICollection<T> collection && collection.Count == 0) 286return genericCollection.Count == 0; 314return source.Count == 0; 814return (list.Count == 1) ? list[0] : default;
InternalUtilities\SpecializedCollections.cs (3)
95return collection == null || collection.Count == 0 102return set == null || set.Count == 0 109return set == null || set.Count == 0
InternalUtilities\SpecializedCollections.ReadOnly.Collection.cs (1)
46return this.Underlying.Count;
PEWriter\Miscellaneous.cs (2)
34return asIListT.Count != 0; 68return (uint)asIListT.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (1)
163if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
31var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
32var items = new KeyValuePair<K, V>[_dict.Count]; 53var items = new TKey[_collection.Count]; 74var items = new TValue[_collection.Count];
src\Dependencies\Collections\SegmentedDictionary`2.cs (2)
122: this(dictionary?.Count ?? 0, comparer) 138: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\SegmentedHashSet`1.cs (7)
120var count = coll.Count; 446if (otherAsCollection.Count == 0) 586if (otherAsCollection.Count == 0) 594return otherAsCollection.Count > 0; 635if (otherAsCollection.Count == 0) 679if (otherAsCollection.Count == 0) 770otherAsCollection.Count > 0)
src\Dependencies\Collections\SegmentedList`1.cs (3)
87var count = c.Count; 304var count = c.Count; 904var count = c.Count;
Syntax\LineDirectiveMap.cs (2)
141var entries = ArrayBuilder<LineMappingEntry>.GetInstance(directives.Count + 1); 146if (directives.Count > 0)
Syntax\SyntaxList`1.cs (1)
87var builder = (collection != null) ? new SyntaxListBuilder<TNode>(collection.Count) : SyntaxListBuilder<TNode>.Create();
Syntax\SyntaxTriviaList.cs (1)
331if (triviaCollection != null && triviaCollection.Count == 0)
Microsoft.CodeAnalysis.CodeStyle (43)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
124return (missingCases: missingEnumMembers.Count > 0, missingDefaultCase: !HasDefaultCase(operation));
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (5)
50for (int i = 0, count = list.Count; i < count; i++) 93if (items is ICollection<T> collection && collection.Count == 0) 286return genericCollection.Count == 0; 314return source.Count == 0; 814return (list.Count == 1) ? list[0] : default;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.cs (3)
95return collection == null || collection.Count == 0 102return set == null || set.Count == 0 109return set == null || set.Count == 0
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.ReadOnly.Collection.cs (1)
46return this.Underlying.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (1)
163if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
31var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
32var items = new KeyValuePair<K, V>[_dict.Count]; 53var items = new TKey[_collection.Count]; 74var items = new TValue[_collection.Count];
src\Dependencies\Collections\SegmentedDictionary`2.cs (2)
122: this(dictionary?.Count ?? 0, comparer) 138: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\SegmentedHashSet`1.cs (7)
120var count = coll.Count; 446if (otherAsCollection.Count == 0) 586if (otherAsCollection.Count == 0) 594return otherAsCollection.Count > 0; 635if (otherAsCollection.Count == 0) 679if (otherAsCollection.Count == 0) 770otherAsCollection.Count > 0)
src\Dependencies\Collections\SegmentedList`1.cs (3)
87var count = c.Count; 304var count = c.Count; 904var count = c.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (3)
465if (t1.Count != t2.Count) 474for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
91for (var i = 0; i < list.Count; i++) 108for (var i = 0; i < list.Count; i++) 119for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
52for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
57return this.GetTextChanges(CancellationToken.None).Count > 0; 83if (_formattingResults.Count == 1) 89var count = _formattingResults.Sum(r => r.GetTextChanges(cancellationToken).Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (3)
235if (tokenData.Count == 0) 303for (var i = 0; i < list.Count; i++) 382for (var i = 0; i < tokenWithIndices.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
44for (uint i = 1; i <= existingConstants.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
151if (collection.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
184.Skip(reservedNames.Count)];
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
102if (commonTypes.Count == 0) 107if (commonTypes.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 199Contract.ThrowIfTrue(availableIndices != null && availableIndices.Count != declarationList.Count + 1);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (1)
15var result = new FixedSizeArrayBuilder<IParameterSymbol>(parameters.Count);
Microsoft.CodeAnalysis.Collections.Package (17)
ImmutableSegmentedList`1.cs (1)
163if (items is ICollection<T> { Count: 0 })
Internal\ICollectionDebugView`1.cs (1)
31var items = new T[_collection.Count];
Internal\IDictionaryDebugView`2.cs (3)
32var items = new KeyValuePair<K, V>[_dict.Count]; 53var items = new TKey[_collection.Count]; 74var items = new TValue[_collection.Count];
SegmentedDictionary`2.cs (2)
122: this(dictionary?.Count ?? 0, comparer) 138: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
SegmentedHashSet`1.cs (7)
120var count = coll.Count; 446if (otherAsCollection.Count == 0) 586if (otherAsCollection.Count == 0) 594return otherAsCollection.Count > 0; 635if (otherAsCollection.Count == 0) 679if (otherAsCollection.Count == 0) 770otherAsCollection.Count > 0)
SegmentedList`1.cs (3)
87var count = c.Count; 304var count = c.Count; 904var count = c.Count;
Microsoft.CodeAnalysis.CSharp (10)
Compilation\SyntaxAndDeclarationManager.cs (3)
182ordinalMapBuilder.Add(tree, ordinalMapBuilder.Count); 574Debug.Assert(oldLoadDirectives.Length == newLoadDirectivesSyntax.Count); 713ordinalMapBuilder.Add(tree, ordinalMapBuilder.Count);
Declarations\DeclarationTreeBuilder.cs (2)
307if (directiveNodes.Count == 0) 312var directives = ArrayBuilder<ReferenceDirective>.GetInstance(directiveNodes.Count);
Symbols\Metadata\PE\PEEventSymbol.cs (1)
391if (implementedEvents.Count != 0)
Symbols\Source\TypeParameterBuilder.cs (2)
56var arrayBuilder = ArrayBuilder<Location>.GetInstance(builders.Count); 67var arrayBuilder = ArrayBuilder<SyntaxReference>.GetInstance(builders.Count);
Syntax\SyntaxFactory.cs (2)
1362if (collection != null && collection.Count == 0) 1381var builder = new SeparatedSyntaxListBuilder<TNode>(collection != null ? collection.Count : 3);
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (1)
365if (result.GetTextChanges(cancellationToken).Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.FormattedComplexTrivia.cs (1)
55get { return _textChanges.Count > 0; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (4)
62for (var i = 0; i < xNameParts.Count && i < yNameParts.Count; i++) 71return xNameParts.Count - yNameParts.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
163for (var i = 0; i < list.Count - 1; i++) 176for (var i = 1; i < list.Count; i++)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BaseNamespaceDeclarationSyntaxExtensions.cs (1)
19if (usingDirectives.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
106if (usingDirectives.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (1)
23return parts[parts.Count - 1];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
73.Skip(reservedNames.Count)];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (2)
152if (usingsToRemove.Count == 0) 206if (usingsToRemove.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
646if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (9)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
143if (workspace.Projects.Count == 2)
Completion\ArgumentProviders\ArgumentProviderOrderTests.cs (2)
64for (var i = 0; i < orderedCSharpArgumentProviders.Count; i++) 71else if (i == orderedCSharpArgumentProviders.Count - 1) // last one
Completion\CompletionProviders\CompletionProviderOrderTests.cs (2)
96for (var i = 0; i < orderedCSharpCompletionProviders.Count; i++) 103else if (i == orderedCSharpCompletionProviders.Count - 1) // last one
SplitStringLiteral\SplitStringLiteralCommandHandlerTests.cs (1)
106history.Undo(count: originalSelections.Count);
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (3)
161Assert.Equal(6, list.Count); 349Assert.Equal(5, list.Count); 433Assert.Equal(2, list.Count);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
CodeGen\CodeGenCapturing.cs (6)
75for (int varDepth = 0; varDepth < varsToCapture.Count; varDepth++) 88int numVarsAvailable = variablesByScope[varDepth].Count; 208Assert.Equal(expectedCtx.Count, ctx.VariablesByScope.Count); 209for (int depth = 0; depth < expectedCtx.Count; depth++) 252for (int depth = startingDepth; depth < layout.Count; depth++) 260newCurrent = (layout.Count, 0);
Microsoft.CodeAnalysis.CSharp.Features (6)
Organizing\Organizers\MemberDeclarationsOrganizer.cs (4)
44Debug.Assert(originalList.Count == finalList.Count); 46if (originalList.Count >= 2) 112if (members.Count > 1)
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
171for (var i = 0; i < namedParameters.Count; i++)
Snippets\CSharpConstructorSnippetProvider.cs (1)
46precedingModifiers.Count == 1 && precedingModifiers.Single() == SyntaxKind.StaticKeyword))
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\GetSemanticInfoTests.cs (1)
2393for (int i = 0; i < exprs.Count; i++)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (50)
IncrementalParsing\IncrementalParsingTests.cs (4)
362Assert.Equal(4, oldDirectives.Count); 374Assert.Equal(3, newDirectives.Count); 407Assert.Equal(3, oldDirectives.Count); 416Assert.Equal(4, newDirectives.Count);
LexicalAndXml\PreprocessorTests.cs (3)
123Assert.Equal(expected.Length, directives.Count); 146Assert.Equal(expected.Length, directives.Count); 296Assert.Equal(1, directives.Count);
LexicalAndXml\RawStringLiteralLexingTests.cs (4)
185Assert.True(spans.Count == 0 || spans.Count == 1); 199if (spans.Count == 0) 217Assert.Equal(1, spans.Count);
Syntax\StructuredTriviaTests.cs (4)
110Assert.Equal(3, directives.Count); 124Assert.Equal(1, directives.Count); 135Assert.Equal(0, directives.Count); 148Assert.Equal(3, directives.Count);
Syntax\SyntaxDiffingTests.cs (28)
27Assert.Equal(1, spans.Count); 32Assert.Equal(1, changes.Count); 46Assert.Equal(1, spans.Count); 52Assert.Equal(1, changes.Count); 66Assert.Equal(2, spans.Count); 74Assert.Equal(2, changes.Count); 89Assert.Equal(1, spans.Count); 94Assert.Equal(1, changes.Count); 107Assert.Equal(1, spans.Count); 112Assert.Equal(1, changes.Count); 126Assert.Equal(1, spans.Count); 131Assert.Equal(1, changes.Count); 146Assert.Equal(1, spans.Count); 151Assert.Equal(1, changes.Count); 164Assert.Equal(1, spans.Count); 169Assert.Equal(1, changes.Count); 182Assert.Equal(1, spans.Count); 187Assert.Equal(1, changes.Count); 200Assert.Equal(0, spans.Count); 204Assert.Equal(1, changes.Count); 217Assert.Equal(0, spans.Count); 221Assert.Equal(1, changes.Count); 234Assert.Equal(0, spans.Count); 238Assert.Equal(1, changes.Count); 251Assert.Equal(1, spans.Count); 256Assert.Equal(1, changes.Count); 324Assert.Equal(1, changes.Count); 386Assert.Equal(1, changes.Count);
Syntax\SyntaxNodeTests.cs (7)
339Assert.Equal(directives.Count, descendantDirectives.Count); 340for (int i = 0; i < directives.Count; i++) 3657Assert.Equal(0, ChangesForDifferentTrees.Count); 3668Assert.Equal(2, ChangesFromTransform.Count); 3675Assert.Equal(2, changes2UsingCommonSyntax.Count); 3707Assert.Equal(0, ChangesForDifferentTrees.Count); 3740Assert.Equal(0, ChangesForDifferentTrees.Count);
Microsoft.CodeAnalysis.CSharp.Workspaces (18)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (1)
365if (result.GetTextChanges(cancellationToken).Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.FormattedComplexTrivia.cs (1)
55get { return _textChanges.Count > 0; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (4)
62for (var i = 0; i < xNameParts.Count && i < yNameParts.Count; i++) 71return xNameParts.Count - yNameParts.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
163for (var i = 0; i < list.Count - 1; i++) 176for (var i = 1; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BaseNamespaceDeclarationSyntaxExtensions.cs (1)
19if (usingDirectives.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
106if (usingDirectives.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
325if (modifierTokens.Count >= 2) 328if (modifierTokens.Count == 1) 351if (modifierTokens.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (1)
23return parts[parts.Count - 1];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
73.Skip(reservedNames.Count)];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (2)
152if (usingsToRemove.Count == 0) 206if (usingsToRemove.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
646if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Microsoft.CodeAnalysis.EditorFeatures (7)
Editor\TextBufferAssociatedViewService.cs (1)
121if (views.Count == 0)
Formatting\FormatCommandHandler.cs (1)
172if (textChanges == null || textChanges.Count == 0)
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (2)
95if (e.Changes.Count != 1 || ShouldClearTrackingSession(e.Changes.Single())) 267var index = _committedSessions.Count;
Shared\Extensions\IProjectionBufferFactoryServiceExtensions.cs (1)
323if (snapshotSpans.Count > 0)
Shared\Tagging\EventSources\TaggerEventSources.TextChangedEventSource.cs (1)
30if (e.Changes.Count == 0)
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
94if (e.Changes.Count == 0)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (6)
BracePairs\AbstractBracePairsTests.cs (1)
40Assert.Equal(expected.Count, bracePairs.Count);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (2)
70for (var j = 0; j < Math.Max(highlightSpans.Count, expectedHighlightSpans.Count); j++) 72if (j >= expectedHighlightSpans.Count)
RefactoringHelpers\RefactoringHelpersTestBase.cs (2)
75if (spans.Count != 1 || 89if (spans.Count != 2 ||
TaskList\AbstractTaskListTests.cs (1)
43Assert.Equal(items.Length, expectedLists.Count);
Microsoft.CodeAnalysis.EditorFeatures.Text (5)
ITextImageHelpers.cs (5)
38if (oldVersion.Changes.Count != 0) 57var builder = new FixedSizeArrayBuilder<TextChangeRange>(changes.Count); 58for (var i = 0; i < changes.Count; i++) 91var changes = ArrayBuilder<TextChangeRange>.GetInstance(version.Changes.Count); 92for (var i = 0; i < version.Changes.Count; i++)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
Adornments\AbstractAdornmentManager.cs (1)
237if (viewLines == null || viewLines.Count == 0)
SignatureHelp\Model.cs (1)
49Contract.ThrowIfFalse(items.Count != 0, "Must have at least one item.");
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (3)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\AttributeHelpers.cs (3)
47if (arguments.Count == 0) 51else if (arguments.Count == 1) 75if (arguments.Count == 1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (3)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\AttributeHelpers.cs (3)
47if (arguments.Count == 0) 51else if (arguments.Count == 1) 75if (arguments.Count == 1)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
SignatureHelp\FSharpSignatureHelpItems.cs (2)
69Contract.ThrowIfTrue(selectedItem.HasValue && selectedItem.Value >= items.Count); 83if (selectedItem.HasValue && items.Count != distinctItems.Count)
Microsoft.CodeAnalysis.Features (20)
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (2)
181if (textChanges.Count == 0) 193textChanges.RemoveAt(textChanges.Count - 1);
Completion\CompletionService.cs (1)
344if (builder.Count == 0)
Debugging\AbstractBreakpointResolver.cs (1)
127switch (nameParts.Count)
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
242for (var i = 0; i < lines.Count; i++)
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
244if (finalFieldName != field.Name && constructorLocations.Count > 0)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
548public bool HasMultipleDocuments => _solutionId != null || _projectOrDocumentIds?.Count > 1;
ExtractMethod\MethodExtractor.Analyzer.cs (1)
249var variableMapStatus = failedVariables.Count == 0
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
253if (folders != null && folders.Count != 0)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (2)
139if (_state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface || argumentList.Count == 0) 199for (var i = 0; i < parameterNames.Count; i++)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AnonymousTypes.cs (1)
35if (info.TypesParts.Count > 0)
SignatureHelp\AbstractSignatureHelpProvider.cs (2)
42if (items is null || items.Count == 0 || state == null) 197if (info.TypesParts.Count > 0)
SignatureHelp\SignatureHelpItems.cs (2)
71Contract.ThrowIfTrue(selectedItem.HasValue && selectedItem.Value >= items.Count); 78if (selectedItem.HasValue && items.Count != distinctItems.Count)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
124return (missingCases: missingEnumMembers.Count > 0, missingDefaultCase: !HasDefaultCase(operation));
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
184.Skip(reservedNames.Count)];
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
102if (commonTypes.Count == 0) 107if (commonTypes.Count == 0)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
48var expectedSortedResults = workspace.Documents.Where(d => d.SelectedSpans.Count > 0).Select(d => d.Id).OrderBy(d => d.Id);
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\CodeFixes\CodeFixService.cs (2)
933var builder = new FixedSizeArrayBuilder<IConfigurationFixProvider>(orderedLanguageKindAndFixers.Count); 951for (var i = 0; i < fixers.Count; i++)
Protocol\Extensions\Converters\VSExtensionUtilities.cs (1)
32var existingConvertersCount = converters.Count;
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (1)
30var existingConvertersCount = converters.Count;
Microsoft.CodeAnalysis.Test.Utilities (8)
Assert\DiffUtil.cs (2)
57foreach (var edit in GetEdits(sequenceA, sequenceA.Count, sequenceB, sequenceB.Count).Reverse())
Syntax\TokenUtilities.cs (6)
23var max = Math.Min(expectedTokens.Count, actualTokens.Count); 53if (expectedTokens.Count != actualTokens.Count) 58expectedTokens.Count, actualTokens.Count, expectedDisplay, actualDisplay);
Microsoft.CodeAnalysis.UnitTests (105)
Collections\HashSet\ISet_Generic_Tests`1.cs (12)
57while (set.Count < numberOfItemsToAdd) 97Assert.Equal(count + 1, set.Count); 117Assert.Equal(count + 1, collection.Count); 128if (set.Count == 0 || enumerable == set) 131Assert.Equal(0, set.Count); 139Assert.Equal(expected.Count, set.Count); 146if (set.Count == 0 || !Enumerable.Any(enumerable)) 149Assert.Equal(0, set.Count); 165Assert.Equal(expected.Count, set.Count); 290Assert.Equal(expected.Count, set.Count); 302Assert.Equal(expected.Count, set.Count); 661Assert.Equal(expected.Count, set.Count);
Collections\IdentifierCollectionTests.cs (2)
40Assert.Equal(strings.Length, idcol.Count); 57Assert.Equal(strings.Length, idcol.Count);
Collections\ImmutableDictionaryBuilderTestBase.cs (5)
47Assert.Equal(1, builder.Count); 92Assert.Equal(1, builder.Count); 102Assert.Equal(1, builder.Count); 245var array = new object[builder.Count + 1]; 250var entryArray = new DictionaryEntry[builder.Count + 1];
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (1)
300var array = new T[collection.Count + 1];
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (13)
40Assert.Equal(2, builder.Count); 46Assert.Equal(builder.Count, set.Count); 48Assert.Equal(3, builder.Count); 62Assert.Equal(3, builder.Count); 68Assert.Equal(builder.Count, set2.Count); 71Assert.Equal(4, builder.Count); 141Assert.Equal(2, builder.Count); 153Assert.Equal(3, builder.Count); 155Assert.Equal(1, builder.Count); 164Assert.Equal(1, builder.Count); 166Assert.Equal(0, builder.Count); 189Assert.Equal(2, builder.Count); 208Assert.Equal(1, builder.Count);
Collections\ImmutableSegmentedHashSetBuilderTest.cs (10)
38Assert.Equal(2, builder.Count); 44Assert.Equal(builder.Count, set.Count); 46Assert.Equal(3, builder.Count); 61Assert.Equal(3, builder.Count); 67Assert.Equal(builder.Count, set2.Count); 70Assert.Equal(4, builder.Count); 126Assert.Equal(0, builder.Count); 139Assert.Equal(2, builder.Count); 152Assert.Equal(1, builder.Count); 306Assert.Equal(1, builder.Count);
Collections\ImmutableSegmentedListBuilderTest.cs (12)
39Assert.Equal(3, builder.Count); 45Assert.Equal(builder.Count, list.Count); 47Assert.Equal(4, builder.Count); 62Assert.Equal(4, builder.Count); 68Assert.Equal(builder.Count, list2.Count); 71Assert.Equal(5, builder.Count); 155Assert.Throws<ArgumentOutOfRangeException>(() => mutable.InsertRange(mutable.Count + 1, new int[0])); 239Assert.Equal(0, mutable.Count); 243Assert.Equal(0, mutable.Count); 287(b, v, eq) => b.LastIndexOf(v, b.Count > 0 ? b.Count - 1 : 0, b.Count, eq),
Collections\ImmutablesTestBase.cs (4)
46Assert.Equal(expected.Count, actual.Count); 147T[] manualArray = new T[expectedResults.Count]; 162Assert.Equal(expectedResults.Count, i); //, "Enumeration did not produce enough elements.");
Collections\List\CollectionAsserts.cs (2)
53Assert.Equal(expected.Count, actual!.Count);
Collections\List\ICollection.Generic.Tests.cs (22)
59while (collection.Count < numberOfItemsToAdd) 142Assert.Equal(count, collection.Count); 157Assert.Equal(count + 1, collection.Count); 173Assert.Equal(count * 2, collection.Count); 190Assert.Equal(count, collection.Count); 205Assert.Equal(count, collection.Count); 220Assert.Equal(count + 2, collection.Count); 233Assert.Equal(5, collection.Count); 273Assert.Equal(1, collection.Count); 285Assert.Equal(count, collection.Count); 318Assert.Equal(count, collection.Count); 323Assert.Equal(0, collection.Count); 337Assert.Equal(count, collection.Count); 344Assert.Equal(0, collection.Count); 381Assert.Equal(0, collection.Count); 446Assert.Equal(count + 2, collection.Count); 579Assert.Equal(count, collection.Count); 595Assert.Equal(count, collection.Count); 614Assert.Equal(count - 1, collection.Count); 633Assert.Equal(count - 1, collection.Count); 651Assert.Equal(count - 1, collection.Count); 679Assert.Equal(count, collection.Count);
Collections\List\IList.Generic.Tests.cs (19)
58if (casted.Count > 0) 71if (casted.Count > 0) 84if (casted.Count > 0) 151Assert.Equal(count, list.Count); 165Assert.Equal(count, list.Count); 408Assert.Equal(count, list.Count); 421Assert.Equal(count + 1, list.Count); 434Assert.Equal(count, list.Count); 448Assert.Equal(count + 1, list.Count); 462Assert.Equal(count + 1, list.Count); 477Assert.Equal(count + 1, list.Count); 492Assert.Equal(count + 1, list.Count); 514Assert.Equal(count + 2, list.Count); 547Assert.Equal(count, list.Count); 561Assert.Equal(count, list.Count); 573Assert.Equal(count, list.Count); 584Assert.Equal(count, list.Count); 588Assert.Equal(index, list.Count); 603Assert.Equal(count - index - 1, list.Count);
Collections\SegmentedArrayTests.cs (2)
60Assert.Equal(0, ((ICollection<IntPtr>)data).Count); 132Assert.Equal(length, ((ICollection<IntPtr>)data).Count);
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1341Assert.True(pos != null || spans.Count > 0, "Must specify a position or spans marking expected symbols for resolution");
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (3)
AutomaticEndConstructCorrection\AutomaticEndConstructCorrector.vb (2)
83If e.Changes.Count = 0 Then 130If changes.Count <> 1 Then
LineCommit\CommitBufferManager.vb (1)
274If e.Changes.Count = 0 Then
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (7)
TestSyntaxNodes.vb (7)
2875Assert.Equal(0, ChangesForDifferentTrees.Count) 2886Assert.Equal(1, ChangesFromTransform.Count) 2893Assert.Equal(1, changes2UsingCommonSyntax.Count) 3370Assert.Equal(4, x.Count) 3395Assert.Equal(0, x.Count) 3419Assert.Equal(1, x.Count) 3463Assert.Equal(1, x.Count)
Microsoft.CodeAnalysis.Workspaces (50)
Diagnostics\HostDiagnosticAnalyzers.cs (1)
248using var _ = ArrayBuilder<KeyValuePair<object, AnalyzerReference>>.GetInstance(source.Count, out var builder);
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (1)
161var result = ArrayBuilder<ISymbol>.GetInstance(array.Count);
Log\AggregateLogger.cs (1)
103if (set.Count == 1)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (5)
50for (int i = 0, count = list.Count; i < count; i++) 93if (items is ICollection<T> collection && collection.Count == 0) 286return genericCollection.Count == 0; 314return source.Count == 0; 814return (list.Count == 1) ? list[0] : default;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.cs (3)
95return collection == null || collection.Count == 0 102return set == null || set.Count == 0 109return set == null || set.Count == 0
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.ReadOnly.Collection.cs (1)
46return this.Underlying.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (1)
163if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
31var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
32var items = new KeyValuePair<K, V>[_dict.Count]; 53var items = new TKey[_collection.Count]; 74var items = new TValue[_collection.Count];
src\Dependencies\Collections\SegmentedDictionary`2.cs (2)
122: this(dictionary?.Count ?? 0, comparer) 138: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\SegmentedHashSet`1.cs (7)
120var count = coll.Count; 446if (otherAsCollection.Count == 0) 586if (otherAsCollection.Count == 0) 594return otherAsCollection.Count > 0; 635if (otherAsCollection.Count == 0) 679if (otherAsCollection.Count == 0) 770otherAsCollection.Count > 0)
src\Dependencies\Collections\SegmentedList`1.cs (3)
87var count = c.Count; 304var count = c.Count; 904var count = c.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (3)
465if (t1.Count != t2.Count) 474for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
91for (var i = 0; i < list.Count; i++) 108for (var i = 0; i < list.Count; i++) 119for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
52for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
57return this.GetTextChanges(CancellationToken.None).Count > 0; 83if (_formattingResults.Count == 1) 89var count = _formattingResults.Sum(r => r.GetTextChanges(cancellationToken).Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (3)
235if (tokenData.Count == 0) 303for (var i = 0; i < list.Count; i++) 382for (var i = 0; i < tokenWithIndices.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
44for (uint i = 1; i <= existingConstants.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
151if (collection.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 199Contract.ThrowIfTrue(availableIndices != null && availableIndices.Count != declarationList.Count + 1);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (1)
15var result = new FixedSizeArrayBuilder<IParameterSymbol>(parameters.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
112if (referencingStatements.Count == 0)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (28)
Build\ProjectBuildManager.cs (2)
89if (loadedProjects != null && loadedProjects.Count > 0) 91Debug.Assert(loadedProjects.Count == 1);
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (5)
50for (int i = 0, count = list.Count; i < count; i++) 93if (items is ICollection<T> collection && collection.Count == 0) 286return genericCollection.Count == 0; 314return source.Count == 0; 814return (list.Count == 1) ? list[0] : default;
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.cs (3)
95return collection == null || collection.Count == 0 102return set == null || set.Count == 0 109return set == null || set.Count == 0
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.ReadOnly.Collection.cs (1)
46return this.Underlying.Count;
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (1)
163if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
31var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
32var items = new KeyValuePair<K, V>[_dict.Count]; 53var items = new TKey[_collection.Count]; 74var items = new TValue[_collection.Count];
src\Dependencies\Collections\SegmentedDictionary`2.cs (2)
122: this(dictionary?.Count ?? 0, comparer) 138: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\SegmentedHashSet`1.cs (7)
120var count = coll.Count; 446if (otherAsCollection.Count == 0) 586if (otherAsCollection.Count == 0) 594return otherAsCollection.Count > 0; 635if (otherAsCollection.Count == 0) 679if (otherAsCollection.Count == 0) 770otherAsCollection.Count > 0)
src\Dependencies\Collections\SegmentedList`1.cs (3)
87var count = c.Count; 304var count = c.Count; 904var count = c.Count;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Formatting\FormattingTestBase.cs (1)
101if (changes.Count == 0)
Workspaces\TestWorkspace`1.cs (1)
670for (var i = 1; i < submissions.Count; i++)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
UtilityTest\IntervalTreeTests.cs (1)
337Assert.Equal(spans.Count, tree.Count());
Microsoft.CSharp (6)
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (4)
87if (results == null || results.Count == 0) 90if (results == null || results.Count == 0) 95DynamicProperty[] pairArray = new DynamicProperty[results.Count]; 96for (int i = 0; i < results.Count; i++)
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (2)
345return (da.TransformFlags.Count == 0 || (da.TransformFlags.Count == 1 && da.TransformFlags[0]));
Microsoft.Data.Analysis (177)
DataFrame.cs (3)
424for (int b = 0; b < buffers.Count; b++) 444for (int b = 0; b < buffers.Count; b++) 483if (values.Count != Columns.Count)
DataFrame.IO.cs (1)
123var columnsCount = columnInfos.Count;
DataFrameColumns\ArrowStringDataFrameColumn.cs (9)
83Debug.Assert(_nullBitMapBuffers.Count > bitMapIndex); 99Debug.Assert(_nullBitMapBuffers.Count > bitMapIndex); 143for (int i = 0; i < _dataBuffers.Count; i++) 157for (int i = 0; i < _nullBitMapBuffers.Count; i++) 171for (int i = 0; i < _offsetsBuffers.Count; i++) 183if (_dataBuffers.Count == 0) 189DataFrameBuffer<int> mutableOffsetsBuffer = (DataFrameBuffer<int>)_offsetsBuffers[_offsetsBuffers.Count - 1]; 201DataFrameBuffer<byte> mutableDataBuffer = (DataFrameBuffer<byte>)_dataBuffers[_dataBuffers.Count - 1]; 229int numBuffers = _offsetsBuffers.Count;
DataFrameColumns\StringDataFrameColumn.cs (3)
346for (int b = 0; b < mapIndices.ColumnContainer.Buffers.Count; b++) 368for (int b = 0; b < mapIndices.ColumnContainer.Buffers.Count; b++) 391counts.Append(keyValuePair.Value.Count);
DataFrameColumns\VBufferDataFrameColumn.cs (2)
232for (int b = 0; b < mapIndices.ColumnContainer.Buffers.Count; b++) 254for (int b = 0; b < mapIndices.ColumnContainer.Buffers.Count; b++)
DateTimeComputation.cs (4)
33for (int b = 0; b < column.Buffers.Count; b++) 105for (int b = 0; b < column.Buffers.Count; b++) 199for (int b = 0; b < column.Buffers.Count; b++) 256for (int b = 0; b < column.Buffers.Count; b++)
GroupBy.cs (2)
300int numberOfValues = values.Count; 486retColumn[rowIndex] = (double)Convert.ChangeType(_dataFrame.Columns[columnIndex].Sum(rowEnumerable), typeof(double)) / rowEnumerable.Count;
PrimitiveColumnContainer.BinaryOperations.cs (6)
20for (int i = 0; i < this.Buffers.Count; i++) 61for (int i = 0; i < this.Buffers.Count; i++) 74for (int i = 0; i < this.Buffers.Count; i++) 98for (int i = 0; i < this.Buffers.Count; i++) 115for (int i = 0; i < this.Buffers.Count; i++) 157for (int i = 0; i < this.Buffers.Count; i++)
PrimitiveColumnContainer.cs (15)
115if (Buffers.Count == 0) 121if (Buffers[Buffers.Count - 1].Length == ReadOnlyDataFrameBuffer<T>.MaxCapacity) 127DataFrameBuffer<T> mutableLastBuffer = Buffers.GetOrCreateMutable(Buffers.Count - 1); 143if (Buffers.Count == 0) 149if (Buffers[Buffers.Count - 1].Length == ReadOnlyDataFrameBuffer<T>.MaxCapacity) 155DataFrameBuffer<T> mutableLastBuffer = Buffers.GetOrCreateMutable(Buffers.Count - 1); 156DataFrameBuffer<byte> lastNullBitMapBuffer = NullBitMapBuffers.GetOrCreateMutable(NullBitMapBuffers.Count - 1); 181for (int b = 0; b < Buffers.Count; b++) 199for (int b = 0; b < Buffers.Count; b++) 218for (int b = 0; b < Buffers.Count; b++) 242for (int b = 0; b < Buffers.Count; b++) 315Debug.Assert(NullBitMapBuffers.Count > bitMapIndex); 335Debug.Assert(NullBitMapBuffers.Count > bitMapIndex); 469for (int b = 0; b < mapIndices.Buffers.Count; b++) 473index = mapIndices.Buffers.Count - 1 - b;
PrimitiveDataFrameColumn.cs (5)
64for (int i = 0; i < _columnContainer.Buffers.Count; i++) 77for (int i = 0; i < _columnContainer.NullBitMapBuffers.Count; i++) 365for (int b = 0; b < ColumnContainer.NullBitMapBuffers.Count; b++) 389counts.Append(keyValuePair.Value.Count); 619for (int b = 0; b < _columnContainer.Buffers.Count; b++)
PrimitiveDataFrameColumn.Sort.cs (3)
25List<List<int>> bufferSortIndices = new List<List<int>>(_columnContainer.Buffers.Count); 29for (int b = 0; b < _columnContainer.Buffers.Count; b++) 83for (int i = 0; i < buffers.Count; i++)
PrimitiveDataFrameColumnComputations.cs (122)
125for (int b = 0; b < column.Buffers.Count; b++) 143for (int b = 0; b < column.Buffers.Count; b++) 248for (int b = 0; b < column.Buffers.Count; b++) 274for (int b = 0; b < column.Buffers.Count; b++) 338for (int b = 0; b < column.Buffers.Count; b++) 402for (int b = 0; b < column.Buffers.Count; b++) 466for (int b = 0; b < column.Buffers.Count; b++) 531for (int b = 0; b < column.Buffers.Count; b++) 579for (int b = 0; b < column.Buffers.Count; b++) 626for (int b = 0; b < column.Buffers.Count; b++) 671for (int b = 0; b < column.Buffers.Count; b++) 717for (int b = 0; b < column.Buffers.Count; b++) 735for (int b = 0; b < column.Buffers.Count; b++) 761for (int b = 0; b < column.Buffers.Count; b++) 825for (int b = 0; b < column.Buffers.Count; b++) 889for (int b = 0; b < column.Buffers.Count; b++) 953for (int b = 0; b < column.Buffers.Count; b++) 1018for (int b = 0; b < column.Buffers.Count; b++) 1066for (int b = 0; b < column.Buffers.Count; b++) 1113for (int b = 0; b < column.Buffers.Count; b++) 1158for (int b = 0; b < column.Buffers.Count; b++) 1204for (int b = 0; b < column.Buffers.Count; b++) 1222for (int b = 0; b < column.Buffers.Count; b++) 1248for (int b = 0; b < column.Buffers.Count; b++) 1312for (int b = 0; b < column.Buffers.Count; b++) 1376for (int b = 0; b < column.Buffers.Count; b++) 1440for (int b = 0; b < column.Buffers.Count; b++) 1505for (int b = 0; b < column.Buffers.Count; b++) 1553for (int b = 0; b < column.Buffers.Count; b++) 1600for (int b = 0; b < column.Buffers.Count; b++) 1645for (int b = 0; b < column.Buffers.Count; b++) 1691for (int b = 0; b < column.Buffers.Count; b++) 1709for (int b = 0; b < column.Buffers.Count; b++) 1735for (int b = 0; b < column.Buffers.Count; b++) 1799for (int b = 0; b < column.Buffers.Count; b++) 1863for (int b = 0; b < column.Buffers.Count; b++) 1927for (int b = 0; b < column.Buffers.Count; b++) 1992for (int b = 0; b < column.Buffers.Count; b++) 2040for (int b = 0; b < column.Buffers.Count; b++) 2087for (int b = 0; b < column.Buffers.Count; b++) 2132for (int b = 0; b < column.Buffers.Count; b++) 2178for (int b = 0; b < column.Buffers.Count; b++) 2196for (int b = 0; b < column.Buffers.Count; b++) 2222for (int b = 0; b < column.Buffers.Count; b++) 2286for (int b = 0; b < column.Buffers.Count; b++) 2350for (int b = 0; b < column.Buffers.Count; b++) 2414for (int b = 0; b < column.Buffers.Count; b++) 2479for (int b = 0; b < column.Buffers.Count; b++) 2527for (int b = 0; b < column.Buffers.Count; b++) 2574for (int b = 0; b < column.Buffers.Count; b++) 2619for (int b = 0; b < column.Buffers.Count; b++) 2665for (int b = 0; b < column.Buffers.Count; b++) 2683for (int b = 0; b < column.Buffers.Count; b++) 2709for (int b = 0; b < column.Buffers.Count; b++) 2773for (int b = 0; b < column.Buffers.Count; b++) 2837for (int b = 0; b < column.Buffers.Count; b++) 2901for (int b = 0; b < column.Buffers.Count; b++) 2966for (int b = 0; b < column.Buffers.Count; b++) 3014for (int b = 0; b < column.Buffers.Count; b++) 3061for (int b = 0; b < column.Buffers.Count; b++) 3106for (int b = 0; b < column.Buffers.Count; b++) 3152for (int b = 0; b < column.Buffers.Count; b++) 3170for (int b = 0; b < column.Buffers.Count; b++) 3196for (int b = 0; b < column.Buffers.Count; b++) 3260for (int b = 0; b < column.Buffers.Count; b++) 3324for (int b = 0; b < column.Buffers.Count; b++) 3388for (int b = 0; b < column.Buffers.Count; b++) 3453for (int b = 0; b < column.Buffers.Count; b++) 3501for (int b = 0; b < column.Buffers.Count; b++) 3548for (int b = 0; b < column.Buffers.Count; b++) 3593for (int b = 0; b < column.Buffers.Count; b++) 3639for (int b = 0; b < column.Buffers.Count; b++) 3657for (int b = 0; b < column.Buffers.Count; b++) 3683for (int b = 0; b < column.Buffers.Count; b++) 3747for (int b = 0; b < column.Buffers.Count; b++) 3811for (int b = 0; b < column.Buffers.Count; b++) 3875for (int b = 0; b < column.Buffers.Count; b++) 3940for (int b = 0; b < column.Buffers.Count; b++) 3988for (int b = 0; b < column.Buffers.Count; b++) 4035for (int b = 0; b < column.Buffers.Count; b++) 4080for (int b = 0; b < column.Buffers.Count; b++) 4126for (int b = 0; b < column.Buffers.Count; b++) 4144for (int b = 0; b < column.Buffers.Count; b++) 4170for (int b = 0; b < column.Buffers.Count; b++) 4234for (int b = 0; b < column.Buffers.Count; b++) 4298for (int b = 0; b < column.Buffers.Count; b++) 4362for (int b = 0; b < column.Buffers.Count; b++) 4427for (int b = 0; b < column.Buffers.Count; b++) 4475for (int b = 0; b < column.Buffers.Count; b++) 4522for (int b = 0; b < column.Buffers.Count; b++) 4567for (int b = 0; b < column.Buffers.Count; b++) 4613for (int b = 0; b < column.Buffers.Count; b++) 4631for (int b = 0; b < column.Buffers.Count; b++) 4657for (int b = 0; b < column.Buffers.Count; b++) 4721for (int b = 0; b < column.Buffers.Count; b++) 4785for (int b = 0; b < column.Buffers.Count; b++) 4849for (int b = 0; b < column.Buffers.Count; b++) 4914for (int b = 0; b < column.Buffers.Count; b++) 4962for (int b = 0; b < column.Buffers.Count; b++) 5009for (int b = 0; b < column.Buffers.Count; b++) 5054for (int b = 0; b < column.Buffers.Count; b++) 5100for (int b = 0; b < column.Buffers.Count; b++) 5118for (int b = 0; b < column.Buffers.Count; b++) 5144for (int b = 0; b < column.Buffers.Count; b++) 5208for (int b = 0; b < column.Buffers.Count; b++) 5272for (int b = 0; b < column.Buffers.Count; b++) 5336for (int b = 0; b < column.Buffers.Count; b++) 5401for (int b = 0; b < column.Buffers.Count; b++) 5449for (int b = 0; b < column.Buffers.Count; b++) 5496for (int b = 0; b < column.Buffers.Count; b++) 5541for (int b = 0; b < column.Buffers.Count; b++) 5587for (int b = 0; b < column.Buffers.Count; b++) 5605for (int b = 0; b < column.Buffers.Count; b++) 5631for (int b = 0; b < column.Buffers.Count; b++) 5695for (int b = 0; b < column.Buffers.Count; b++) 5759for (int b = 0; b < column.Buffers.Count; b++) 5823for (int b = 0; b < column.Buffers.Count; b++) 5888for (int b = 0; b < column.Buffers.Count; b++) 5936for (int b = 0; b < column.Buffers.Count; b++) 5983for (int b = 0; b < column.Buffers.Count; b++) 6028for (int b = 0; b < column.Buffers.Count; b++) 6074for (int b = 0; b < column.Buffers.Count; b++)
StringDataFrameColumn.BinaryOperations.cs (2)
46int bufferLen = buffer.Count; 61int bufferLen = buffer.Count;
Microsoft.DotNet.Build.Tasks.Packaging (1)
CreateTrimDependencyGroups.cs (1)
128if (newDependencyGroup.Packages.Count == 0)
Microsoft.DotNet.Build.Tasks.Workloads (1)
Swix\SwixPackageBase.cs (1)
19public bool HasDependencies => Dependencies.Count > 0;
Microsoft.DotNet.GenFacades (1)
SourceGenerator.cs (1)
79else if (seedTypes.Count > 1)
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\DiffUtil.cs (2)
54foreach (var edit in GetEdits(sequenceA, sequenceA.Count, sequenceB, sequenceB.Count).Reverse())
Microsoft.DotNet.SignCheck (2)
SignCheck.cs (2)
355if (result.NestedResults.Count > 0) 371if (result.NestedResults.Count > 0)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (2)
Modeler\ServiceClientModelFactory.cs (2)
302if (enumeration.Count == 1) 348bool hasProperties = schema.Properties?.Count > 0;
Microsoft.Extensions.AI (17)
ChatCompletion\ChatCompletion{T}.cs (2)
119var choice = Choices.Count == 1 ? Choices[0] : null; 120var content = choice?.Contents.Count == 1 ? choice.Contents[0] : null;
ChatCompletion\FunctionInvokingChatClient.cs (9)
234|| options.Tools is not { Count: > 0 } 235|| response.Choices.Count == 0 245if (response.Choices.Count > 1) 269if (functionCallContents.Length == response.Message.Contents.Count) 360update.Contents = addedFccs == update.Contents.Count ? 380|| options.Tools is not { Count: > 0 } 457for (int m = messages.Count - 1; m >= 0; m--) 463for (int c = message.Contents.Count - 1; c >= 0; c--) 472if (messages.Count == 0 || messagesToRemove.Contains(messages[m]))
ChatCompletion\OpenTelemetryChatClient.cs (1)
483int choiceCount = completion.Choices.Count;
Embeddings\CachingEmbeddingGenerator.cs (1)
36switch (valuesList.Count)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.AI.Abstractions (17)
ChatCompletion\ChatCompletion.cs (4)
52if (choices.Count == 0) 91if (Choices.Count == 1) 97for (int i = 0; i < Choices.Count; i++) 128int choicesCount = Choices.Count;
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (1)
148if (completion.Choices.Count == 1 &&
Contents\AIContentExtensions.cs (2)
21int count = contents.Count; 36int count = contents.Count;
Embeddings\EmbeddingGeneratorExtensions.cs (1)
139int inputsCount = inputs.Count;
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (1)
125if (parentPolymorphicTypeInfo is null && typeInfo.PolymorphismOptions is { DerivedTypes.Count: > 0 } polyOptions)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (1)
150if (typeInfo.Properties.Count > 0 &&
src\Shared\JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (3)
52attribute.ConstructorArguments.Count == 1) 307attribute.ConstructorArguments.Count == 1) 399attribute.ConstructorArguments.Count == 1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.AI.Abstractions.Tests (21)
AssertExtensions.cs (2)
38if (expected.Count != actual.Count)
ChatCompletion\ChatCompletionTests.cs (2)
150Assert.Equal(4, result.Choices.Count); 152for (int i = 0; i < original.Choices.Count; i++)
ChatCompletion\ChatMessageTests.cs (8)
87Assert.Equal(messageCount, message.Contents.Count); 170Assert.Equal(3, message.Contents.Count); 174Assert.Equal(4, message.Contents.Count); 178Assert.Equal(4, message.Contents.Count); 181Assert.Equal(3, message.Contents.Count); 185Assert.Equal(4, message.Contents.Count); 302Assert.Equal(items.Count, deserializedMessage.Contents.Count);
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (2)
69Assert.Equal(3, completion.Choices.Count); 182Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), message.Contents.Count);
ChatCompletion\StreamingChatCompletionUpdateTests.cs (6)
144Assert.Equal(3, update.Contents.Count); 148Assert.Equal(4, update.Contents.Count); 152Assert.Equal(4, update.Contents.Count); 155Assert.Equal(3, update.Contents.Count); 159Assert.Equal(4, update.Contents.Count); 190Assert.Equal(5, result.Contents.Count);
Contents\FunctionCallContentTests..cs (1)
284Assert.Equal(5, content.Arguments.Count);
Microsoft.Extensions.AI.AzureAIInference (7)
AzureAIInferenceChatClient.cs (3)
306if (options.StopSequences is { Count: > 0 } stopSequences) 339if (options.Tools is { Count: > 0 } tools) 476Debug.Assert(contents is { Count: > 0 }, "Expected non-empty contents");
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.AI.AzureAIInference.Tests (3)
AzureAIInferenceChatClientTests.cs (1)
240Assert.Equal(i is < 10 or 11 ? 1 : 0, updates[i].Contents.Count);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
38if (expected.Count != actual.Count)
Microsoft.Extensions.AI.Integration.Tests (8)
PromptBasedFunctionCallingChatClient.cs (2)
44if (options?.Tools is { Count: > 0 }) 61for (var itemIndex = 0; itemIndex < message.Contents.Count; itemIndex++)
ReducingChatClientTests.cs (5)
32Assert.Equal(2, messages.Count); 146if (chatMessages.Count > 1) 148int totalCount = CountTokens(chatMessages[chatMessages.Count - 1]); 152for (int i = chatMessages.Count - 2; i >= 0; i--) 175for (int i = chatMessages.Count - 2; i >= 0; i--)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.AI.Ollama (7)
OllamaChatClient.cs (3)
177if (message.Content?.Length > 0 || update.Contents.Count == 0) 298Tools = options?.Tools is { Count: > 0 } tools ? tools.OfType<AIFunction>().Select(ToOllamaTool) : null, 342if (options.StopSequences is { Count: > 0 })
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.AI.Ollama.Tests (4)
OllamaChatClientTests.cs (2)
189Assert.Equal(i < updates.Count - 1 ? 1 : 2, updates[i].Contents.Count); 197Assert.Equal(2, updates[updates.Count - 1].Contents.Count);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
38if (expected.Count != actual.Count)
Microsoft.Extensions.AI.OpenAI (12)
OpenAIModelMapper.ChatCompletion.cs (8)
32if (chatCompletion.Choices.Count > 1) 94if (options?.Tools is { Count: > 0 }) 167if (options.StopSequences is { Count: > 0 } stopSequences) 182if (options.LogitBiases is { Count: > 0 } logitBiases) 197if (options.Metadata is IDictionary<string, string> { Count: > 0 } metadata) 207if (options.Tools is { Count: > 0 } tools) 257if (options.StopSequences is { Count: > 0 } stopSequences) 309if (options.Tools is { Count: > 0 } tools)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.AI.OpenAI.Tests (3)
OpenAIChatClientTests.cs (1)
276Assert.Equal(i == 10 ? 0 : 1, updates[i].Contents.Count);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
38if (expected.Count != actual.Count)
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\FunctionInvokingChatClientTests.cs (8)
669return new ChatCompletion(new ChatMessage(ChatRole.Assistant, [.. plan[contents.Count].Contents])) { Usage = usage }; 690Assert.Equal(expectedMessage.Contents.Count, chatMessage.Contents.Count); 691for (int j = 0; j < expectedMessage.Contents.Count; j++) 759return YieldAsync(new ChatCompletion(new ChatMessage(ChatRole.Assistant, [.. plan[contents.Count].Contents])).ToStreamingChatCompletionUpdates()); 780Assert.Equal(expectedMessage.Contents.Count, chatMessage.Contents.Count); 781for (int j = 0; j < expectedMessage.Contents.Count; j++)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
38if (expected.Count != actual.Count)
Microsoft.Extensions.AmbientMetadata.Application (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.AsyncState (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Caching.Abstractions (5)
CacheEntryExtensions.cs (1)
187for (int i = 0; i < options.PostEvictionCallbacks.Count; i++)
Hybrid\HybridCache.cs (4)
79null or ICollection<string> { Count: 0 } => default, 80ICollection<string> { Count: 1 } => RemoveAsync(keys.First(), cancellationToken), 103null or ICollection<string> { Count: 0 } => default, 104ICollection<string> { Count: 1 } => RemoveByTagAsync(tags.Single(), cancellationToken),
Microsoft.Extensions.Caching.Hybrid (3)
Internal\TagSet.cs (2)
106switch (collection.Count) 118arr = new string[collection.Count];
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Compliance.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Compliance.Redaction (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Compliance.Testing (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Configuration (3)
ConfigurationRoot.cs (3)
32_changeTokenRegistrations = new List<IDisposable>(providers.Count); 116for (int i = providers.Count - 1; i >= 0; i--) 131if (providers.Count == 0)
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
1126if (attributeData.ConstructorArguments.Count != 1)
Microsoft.Extensions.Configuration.CommandLine (1)
CommandLineConfigurationProvider.cs (1)
140var switchMappingsCopy = new Dictionary<string, string>(switchMappings.Count, StringComparer.OrdinalIgnoreCase);
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\CallSiteFactory.cs (2)
27_descriptors = new ServiceDescriptor[descriptors.Count]; 134attributeData.ConstructorArguments.Count == 1 &&
Microsoft.Extensions.DependencyInjection.Abstractions (5)
Extensions\ServiceCollectionDescriptorExtensions.cs (4)
66int count = collection.Count; 471int count = services.Count; 532int count = collection.Count; 566for (int i = collection.Count - 1; i >= 0; i--)
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (1)
401for (int i = collection.Count - 1; i >= 0; i--)
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Diagnostics (4)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
34int count = sortedTags.Count; 40if (tagsCol.Count != count) 84if (listCount > sortedTags.Count) 113return listCount == sortedTags.Count;
Microsoft.Extensions.Diagnostics.ExceptionSummarization (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
51var tasks = new Task<HealthReportEntry>[registrations.Count];
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (1)
TelemetryHealthChecksPublisherTests.cs (1)
118for (int i = 0; i < healthStatuses.Count; i++)
Microsoft.Extensions.Diagnostics.Probes (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Diagnostics.Testing (3)
Logging\FakeLogCollector.cs (2)
111if (_options.FilteredLevels.Count > 0 && !_options.FilteredLevels.Contains(record.Level)) 117if (_options.FilteredCategories.Count > 0)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.FileSystemGlobbing (15)
Internal\PatternContexts\PatternContextLinear.cs (2)
83return Frame.SegmentIndex == Pattern.Segments.Count - 1; 88if (Frame.SegmentIndex >= Pattern.Segments.Count)
Internal\PatternContexts\PatternContextLinearInclude.cs (1)
28if (Frame.SegmentIndex < Pattern.Segments.Count)
Internal\PatternContexts\PatternContextRagged.cs (9)
68frame.SegmentIndex = Frame.SegmentGroup.Count; 83frame.SegmentIndex == frame.SegmentGroup.Count && 84frame.SegmentGroupIndex != Pattern.Contains.Count) 88if (frame.SegmentGroupIndex < Pattern.Contains.Count) 107if (Frame.StemItems.Count > 0) 109Frame.StemItems.RemoveAt(Frame.StemItems.Count - 1); 143return Frame.SegmentGroupIndex == Pattern.Contains.Count; 148if (Frame.SegmentIndex >= Frame.SegmentGroup.Count) 157int groupLength = Frame.SegmentGroup.Count;
Internal\PatternContexts\PatternContextRaggedExclude.cs (2)
34if (Pattern.EndsWith.Count == 0 && 35Frame.SegmentGroupIndex == Pattern.Contains.Count - 1 &&
Internal\PatternContexts\PatternContextRaggedInclude.cs (1)
29if (IsStartingGroup() && Frame.SegmentIndex < Frame.SegmentGroup.Count)
Microsoft.Extensions.Hosting.Testing (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Http (3)
DefaultHttpClientFactory.cs (2)
111for (int i = 0; i < options.HttpClientActions.Count; i++) 172for (int i = 0; i < options.HttpMessageHandlerBuilderActions.Count; i++)
DependencyInjection\DefaultHttpClientBuilderServiceCollection.cs (1)
64public int Count => _services.Count;
Microsoft.Extensions.Http.Diagnostics (9)
Logging\Internal\HttpClientLogger.cs (2)
63_logResponseHeaders = options.ResponseHeadersDataClasses.Count > 0; 64_logRequestHeaders = options.RequestHeadersDataClasses.Count > 0;
Logging\Internal\HttpRequestReader.cs (4)
83_logRequestBody = options.RequestBodyContentTypes.Count > 0; 84_logResponseBody = options.ResponseBodyContentTypes.Count > 0; 87_logRequestHeaders = options.RequestHeadersDataClasses.Count > 0; 88_logResponseHeaders = options.ResponseHeadersDataClasses.Count > 0;
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
Microsoft.Extensions.Http.Resilience (5)
Resilience\ResilienceHttpClientBuilderExtensions.Resilience.cs (1)
91for (int i = handlers.Count - 1; i >= 0; i--)
Routing\Internal\OrderedGroups\OrderedGroupsRoutingStrategy.cs (1)
60if (_lastUsedIndex >= _groups!.Count)
Routing\Internal\RoutingHelper.cs (2)
17for (int i = 0; i < endpoints.Count; i++) 23for (int i = 0; i < endpoints.Count; i++)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Http.Resilience.Tests (1)
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (1)
94var count = builder.Services.Count;
Microsoft.Extensions.Logging (4)
LoggerFilterOptions.cs (2)
58if (Rules.Count > 0) 60debugText += $", Rules = {Rules.Count}";
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (2)
19for (int i = 0; i < attributes.Count; i++) 23attributeData.ConstructorArguments.Count > 0)
Microsoft.Extensions.Logging.AzureAppServices (2)
AzureAppServicesLoggerFactoryExtensions.cs (2)
92var beforeCount = collection.Count; 94return beforeCount != collection.Count;
Microsoft.Extensions.Logging.Configuration (2)
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (2)
19for (int i = 0; i < attributes.Count; i++) 23attributeData.ConstructorArguments.Count > 0)
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Options.Contextual (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Options.SourceGeneration (3)
Emitter.cs (3)
128for (var i = 0; i < vt.ModelsToValidate.Count; i++) 166for (var j = 0; j < attributeInstance.InstantiationLines.Count; j++) 170if (j != attributeInstance.InstantiationLines.Count - 1)
Microsoft.Extensions.Resilience (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Resilience.Tests (3)
Resilience\ResilienceServiceCollectionExtensionsTests.cs (3)
34var count = _services.Count; 56var count = _services.Count; 60_services.Count.Should().Be(count);
Microsoft.Extensions.ServiceDiscovery (4)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
57if (endpoints.Endpoints.Count != 0)
Configuration\ConfigurationServiceEndpointProvider.Log.cs (2)
33for (var i = endpoints.Count - added; i < endpoints.Count; i++)
PassThrough\PassThroughServiceEndpointProvider.cs (1)
16if (endpoints.Endpoints.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
DnsServiceEndpointProviderBase.cs (1)
64if (endpoints.Endpoints.Count != 0)
Microsoft.Extensions.Telemetry (3)
Logging\Import\ProviderAliasUtilities.cs (2)
22for (int i = 0; i < attributes.Count; i++) 26attributeData.ConstructorArguments.Count > 0)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.Telemetry.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Extensions.TimeProvider.Testing (1)
src\Shared\Throw\Throw.cs (1)
267if (collection.Count == 0)
Microsoft.Gen.ComplianceReports (1)
ComplianceReportsGenerator.cs (1)
53if (receiver == null || receiver.TypeDeclarations.Count == 0)
Microsoft.Gen.ComplianceReports.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
Microsoft.Gen.Logging.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
Microsoft.Gen.MetadataExtractor (4)
MetadataReportsGenerator.cs (2)
62((TypeDeclarationSyntaxReceiver)context.SyntaxReceiver).TypeDeclarations.Count == 0 || 68if ((context.SyntaxReceiver is not TypeDeclarationSyntaxReceiver || ((TypeDeclarationSyntaxReceiver)context.SyntaxReceiver).TypeDeclarations.Count == 0))
src\Generators\Microsoft.Gen.ComplianceReports\ComplianceReportsGenerator.cs (1)
53if (receiver == null || receiver.TypeDeclarations.Count == 0)
src\Generators\Microsoft.Gen.MetricsReports\MetricsReportsGenerator.cs (1)
41receiver.ClassDeclarations.Count == 0 ||
Microsoft.Gen.MetadataExtractor.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
Microsoft.Gen.Metrics.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
Microsoft.Gen.MetricsReports (1)
MetricsReportsGenerator.cs (1)
41receiver.ClassDeclarations.Count == 0 ||
Microsoft.Gen.MetricsReports.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
Microsoft.Interop.SourceGeneration (5)
Marshalling\MarshallerHelpers.cs (5)
124Dictionary<U, int> elementIndexToEdgeMapNodeId = new(elements.Count); 125List<T> nodeIdToElement = new(elements.Count); 126EdgeMap edgeMap = new(elements.Count); 151List<T> L = new(elements.Count); 153List<T> S = new(elements.Count);
Microsoft.Maui (24)
Extensions\EnumerableExtensions.cs (1)
182 public static T Last<T>(this IList<T> self) => self[self.Count - 1];
Handlers\Layout\LayoutExtensions.cs (1)
12 var count = layout.Count;
Layouts\AbsoluteLayoutManager.cs (2)
27 for (int n = 0; n < AbsoluteLayout.Count; n++) 68 for (int n = 0; n < AbsoluteLayout.Count; n++)
Layouts\GridLayoutManager.cs (1)
121 var gridChildCount = _grid.Count;
Layouts\HorizontalStackLayoutManager.cs (3)
20 for (int n = 0; n < Stack.Count; n++) 49 var childCount = Stack.Count; 58 for (int n = 0; n < Stack.Count; n++)
Layouts\VerticalStackLayoutManager.cs (2)
21 for (int n = 0; n < Stack.Count; n++) 54 for (int n = 0; n < Stack.Count; n++)
Platform\iOS\MauiSwipeView.cs (7)
289 if (items == null || items.Count == 0) 297 swipeItemsWidth = items.Count * SwipeViewExtensions.SwipeItemWidth; 329 if (items == null || items.Count == 0) 615 actionSize = Element.RightItems.Count * SwipeViewExtensions.SwipeItemWidth; 620 actionSize = Element.LeftItems.Count * SwipeViewExtensions.SwipeItemWidth; 835 actionSize = Element.RightItems.Count * SwipeViewExtensions.SwipeItemWidth; 840 actionSize = Element.LeftItems.Count * SwipeViewExtensions.SwipeItemWidth;
Platform\iOS\MenuExtensions.cs (4)
74 UIMenuElement[] platformMenuElements = new UIMenuElement[menuElements.Count]; 76 for (int i = 0; i < menuElements.Count; i++) 119 UIMenuElement[] platformMenuElements = new UIMenuElement[menuElements.Count]; 121 for (int i = 0; i < menuElements.Count; i++)
Platform\iOS\SwipeViewExtensions.cs (3)
23 return new Size(items.Mode == SwipeMode.Execute ? (threshold > 0 ? threshold : contentWidth) / items.Count : (threshold < SwipeItemWidth ? SwipeItemWidth : threshold), contentHeight); 45 return new Size(contentWidth / items.Count, (threshold > 0 && threshold < swipeItemHeight) ? threshold : swipeItemHeight); 59 return new Size(contentWidth / items.Count, swipeItemHeight);
Microsoft.Maui.Controls (88)
Compatibility\Handlers\ListView\iOS\ContextActionCell.cs (5)
320 for (var i = 0; i < _cell.ContextActions.Count; i++) 373 if (needMoreButton && _cell.ContextActions.Count - _buttons.Count == 1) 514 for (var i = 0; i < _cell.ContextActions.Count; i++) 543 var needMore = _cell.ContextActions.Count > _buttons.Count; 545 if (_cell.ContextActions.Count > 2)
Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs (2)
302 if (Page.ToolbarItems.Count > 0) // Display toolbar items defined on the current page 309 else if (shellToolbarItems != null && shellToolbarItems.Count > 0) // If the page has no toolbar items use the ones defined for the shell
Element\Element.cs (1)
267 for (int i = LogicalChildrenInternalBackingStore.Count - 1; i >= 0; i--)
FormattedString.cs (1)
25 for (int i = 0; i < Spans.Count; i++)
Handlers\Items\iOS\TemplatedCell.cs (3)
244 for (var groupIndex = 0; groupIndex < groups.Count; groupIndex++) 247 for (var stateIndex = 0; stateIndex < group.States.Count; stateIndex++) 255 for (var setterIndex = 0; setterIndex < state.Setters.Count; setterIndex++)
Handlers\Items2\iOS\TemplatedCell2.cs (3)
153 for (var groupIndex = 0; groupIndex < groups.Count; groupIndex++) 156 for (var stateIndex = 0; stateIndex < group.States.Count; stateIndex++) 164 for (var setterIndex = 0; setterIndex < state.Setters.Count; setterIndex++)
IndicatorView\IndicatorStackLayout.cs (1)
104 var childrenCount = Children.Count;
Interactivity\TriggerBase.cs (1)
168 get { return _actual.Count; }
Internals\NotifyCollectionChangedEventArgsExtensions.cs (1)
19 for (var i = 0; i < from.Count; i++)
Items\SelectableItemsView.cs (5)
94 if (newSelection?.Count > 0) 96 for (int n = 0; n < newSelection.Count; n++) 219 if (previousSelection.Count == newSelection.Count) 221 if (previousSelection.Count == 0 || (previousSelection[0] == newSelection[0]))
Items\SelectionList.cs (2)
32 public int Count => _internal.Count; 119 for (int n = 0; n < _internal.Count; n++)
Label\Label.cs (4)
388 => (FormattedText?.Spans?.Count ?? 0) > 0; 393 if (FormattedText?.Spans == null || FormattedText?.Spans.Count == 0) 397 for (int i = 0; i < FormattedText.Spans.Count; i++) 400 if (span.GestureRecognizers.Count > 0 && (((ISpatialElement)span).Region.Contains(point) || point.IsEmpty))
Layout\FlexLayout.cs (1)
608 for (var i = 0; i < Children.Count; i++)
LegacyLayouts\StackLayout.cs (2)
128 layout.Plots = new Rect[Children.Count]; 129 layout.Requests = new SizeRequest[Children.Count];
Menu\MenuBar.cs (2)
46 for (int i = 0; i < menuBarItems.Count; i++) 58 while (this.Count > menuBarItems.Count)
Menu\MenuBarTracker.cs (1)
50 if (menuBarItems.Count == 0)
MultiBinding.cs (3)
58 var bindingsclone = new List<BindingBase>(Bindings.Count); 154 _bpProxies = new BindableProperty[Bindings.Count]; 157 for (var i = 0; i < Bindings.Count; i++)
MultiPage.cs (2)
229 for (int i = e.NewStartingIndex; i < Children.Count; i++) 248 for (int i = removeIndex + e.OldItems.Count; i < Children.Count; i++)
ObservableList.cs (1)
21 int index = Items.Count;
OrderedDictionary.cs (1)
74 public OrderedDictionary(ICollection<KeyValuePair<TKey, TValue>> dictionary, IEqualityComparer<TKey> equalityComparer) : this(dictionary != null ? dictionary.Count : 0, equalityComparer)
Picker\Picker.cs (9)
240 return picker.Items == null ? -1 : ((int)value).Clamp(-1, picker.Items.Count - 1); 309 int insertIndex = e.NewStartingIndex < 0 ? Items.Count : e.NewStartingIndex; 323 if (e.OldStartingIndex < Items.Count) 332 removeStart = Items.Count - e.OldItems.Count; 333 index = Items.Count - 1; 372 var newIndex = SelectedIndex.Clamp(-1, Items.Count - 1); 442 int IItemDelegate<string>.GetCount() => Items?.Count ?? ItemsSource?.Count ?? 0; 448 if (index < Items?.Count) 457 if (index < Items?.Count)
Platform\iOS\Extensions\FormattedStringExtensions.cs (2)
46 for (int i = 0; i < formattedString.Spans.Count; i++) 147 || element.FormattedText.Spans.Count == 0)
ReadOnlyCastingList.cs (2)
30 get { return _list.Count; } 86 public int Count => _list.Count;
Shell\Shell.cs (1)
1774 if (Items.Count <= 1)
Shell\ShellUriHandler.cs (3)
830 for (int i = itemIndex; i < Shell.Items.Count; i++) 832 for (int j = sectionIndex; j < Shell.Items[i].Items.Count; j++) 834 for (int k = contentIndex; k < Shell.Items[i].Items[j].Items.Count;)
ShellToolbar.cs (1)
117 _toolbarTracker.ToolbarItems.Count > 0 ||
TemplateUtilities.cs (4)
62 while (self.InternalChildren.Count > 0) 64 self.InternalChildren.RemoveAt(self.InternalChildren.Count - 1); 108 while (self.InternalChildren.Count > 0) 110 self.InternalChildren.RemoveAt(self.InternalChildren.Count - 1);
VisualElement\VisualElement.cs (2)
1457 if (groups.Count == 0) 1540 if (groups.Count == 0)
VisualElement\VisualElement_StyleSheet.cs (1)
21 for (int i = 0; i < attrList.Count; i++)
VisualStateManager.cs (21)
160 var groupCount = groups.Count; 191 var stateCount = group.States.Count; 223 if (groups.Count > 0) 290 public int Count => _internalList.Count; 435 if (state.StateTriggers.Count > 0) 451 for (var stateIndex = 0; stateIndex < States.Count; stateIndex++) 454 for (var triggerIndex = 0; triggerIndex < state.StateTriggers.Count; triggerIndex++) 579 if (States.Count != other.States.Count) 581 for (var i = 0; i < States.Count; i++) 592 for (var i = 0; i < States.Count; i++) 663 if (Setters.Count != other.Setters.Count) 665 if (StateTriggers.Count != other.StateTriggers.Count) 667 for (var i = 0; i < Setters.Count; i++) 670 for (var i = 0; i < StateTriggers.Count; i++) 681 for (var i = 0; i < Setters.Count; i++) 683 for (var i = 0; i < StateTriggers.Count; i++) 711 for (var i = 0; i < list.Count; i++) 714 for (var j = 0; j < group.States.Count; j++)
Microsoft.Maui.Controls.Build.Tasks (8)
SetPropertiesVisitor.cs (8)
528 if (properties != null && properties.Count > 0) 530 var lastProp = properties[properties.Count - 1]; 790 if (properties == null || properties.Count == 0) 849 if (properties == null || properties.Count == 0) 897 il.Append(DigProperties(properties.Take(properties.Count - 1), locs, () => 990 if (properties == null || properties.Count == 0) 996 for (int i = 0; i < properties.Count; i++) 1069 for (int i = 0; i < properties.Count; i++)
Microsoft.Maui.Controls.Compatibility (17)
iOS\CollectionView\SelectableItemsViewController.cs (1)
168 for (int n = 0; n < selectedItems.Count; n++)
iOS\CollectionView\TemplatedCell.cs (3)
209 for (var groupIndex = 0; groupIndex < groups.Count; groupIndex++) 212 for (var stateIndex = 0; stateIndex < group.States.Count; stateIndex++) 220 for (var setterIndex = 0; setterIndex < state.Setters.Count; setterIndex++)
iOS\ContextActionCell.cs (5)
325 for (var i = 0; i < _cell.ContextActions.Count; i++) 378 if (needMoreButton && _cell.ContextActions.Count - _buttons.Count == 1) 518 for (var i = 0; i < _cell.ContextActions.Count; i++) 547 var needMore = _cell.ContextActions.Count > _buttons.Count; 549 if (_cell.ContextActions.Count > 2)
iOS\Extensions\LabelExtensions.cs (2)
32 || element.FormattedText.Spans.Count == 0) 64 for (int i = 0; i < element.FormattedText.Spans.Count; i++)
iOS\Renderers\CarouselPageRenderer.cs (1)
323 _scrollView.ContentSize = new SizeF(bounds.Width * ((CarouselPage)Element).Children.Count, bounds.Height);
iOS\Renderers\PickerRenderer.cs (5)
93 if (s.SelectedIndex == -1 && Element.Items != null && Element.Items.Count > 0) 255 Control.Text = selectedIndex == -1 || items == null || selectedIndex >= items.Count ? "" : items[selectedIndex]; 258 if (items == null || items.Count == 0) 375 return _renderer.Element.Items != null ? _renderer.Element.Items.Count : 0; 385 if (_renderer.Element.Items.Count == 0)
Microsoft.Maui.Controls.Maps (6)
HandlerImpl\Polygon.Impl.cs (3)
34 public int Count => Geopath.Count; 48 var index = Geopath.Count; 58 for (int i = Geopath.Count - 1; i >= 0; i--)
HandlerImpl\Polyline.Impl.cs (3)
32 public int Count => Geopath.Count; 46 var index = Geopath.Count; 56 for (int i = Geopath.Count - 1; i >= 0; i--)
Microsoft.Maui.Controls.SourceGen (2)
CodeBehindGenerator.cs (1)
550 if (types.Count == 0)
src\Controls\src\Xaml\XmlTypeXamlExtensions.cs (1)
75 name += "`" + typeArguments.Count; //this will return an open generic Type
Microsoft.Maui.Controls.Xaml (2)
ApplyPropertiesVisitor.cs (1)
292 if (contentAttribute == null || contentAttribute.ConstructorArguments.Count != 1)
XmlTypeXamlExtensions.cs (1)
75 name += "`" + typeArguments.Count; //this will return an open generic Type
Microsoft.ML.AutoML (7)
Experiment\Experiment.cs (3)
171= _runner.Run(pipeline, _modelDirectory, _history.Count + 1); 217} while (_history.Count < _experimentSettings.MaxModels && 253_logger.Trace($"{_history.Count}\t{runResult.Score}\t{stopwatch.Elapsed}\t{pipeline.ToString()}");
TrainerExtensions\TrainerExtensionCatalog.cs (4)
72columnInfo.ImagePathColumnNames.Count == 1 && 73columnInfo.CategoricalColumnNames.Count == 0 && 74columnInfo.NumericColumnNames.Count == 0 && 75columnInfo.TextColumnNames.Count == 0)
Microsoft.ML.CodeGenerator (10)
CodeGenerator\CSharp\TrainerGeneratorBase.cs (2)
112if (NamedParameters != null && NamedParameters.Count > 0) 137if (arguments.Count == 0)
Templates\Azure\Console\AzureModelBuilder.cs (2)
80if(PreTrainerTransforms.Count >0 ) { 85for(int i=0;i<PreTrainerTransforms.Count;i++)
Templates\Console\ModelBuilder.cs (5)
102if(PreTrainerTransforms.Count >0 ) { 105for(int i=0;i<PreTrainerTransforms.Count;i++) 128for(int i=0;i<PostTrainerTransforms.Count;i++) 137if(PreTrainerTransforms.Count >0 && Trainer != String.Empty ) { 140else if (PreTrainerTransforms.Count >0 && Trainer == String.Empty) {
Utils.cs (1)
308for (int i = 1; i < result.Count; i += 3)
Microsoft.ML.Core (20)
Utilities\BinFinder.cs (7)
32var numValues = values.Count + ((numZeroes > 0) ? 1 : 0); 51Contracts.Assert(numValues == values.Count + 1); 52_valuesSng[values.Count] = 0; 110var numValues = values.Count + ((numZeroes > 0) ? 1 : 0); 129Contracts.Assert(numValues == values.Count + 1); 130_valuesDbl[values.Count] = 0; 187Contracts.Check(counts.Count >= numValues);
Utilities\Contracts.cs (1)
81return c == null ? 0 : c.Count;
Utilities\SupervisedBinFinder.cs (4)
65_valueCount = values.Count; 69Contracts.Assert(_valueCount == labels.Count); 143_valueCount = values.Count; 147Contracts.Assert(_valueCount == labels.Count);
Utilities\Utils.cs (8)
81return x == null ? 0 : x.Count; 209return FindIndexSorted(input, 0, input.Count, value); 221return FindIndexSorted(input, 0, input.Count, value); 288Contracts.Assert(0 <= min && min <= lim && lim <= input.Count); 322Contracts.Assert(0 <= min && min <= lim && lim <= input.Count); 605var listLength = values.Count; 631var listLength = values.Count; 657var listLength = values.Count;
Microsoft.ML.Core.Tests (2)
UnitTests\TestEntryPoints.cs (2)
2245for (int i = 0; i < kvps.Count; i++) 2252for (int j = 0; j < list.Count; j++)
Microsoft.ML.CpuMath (1)
src\Microsoft.ML.Core\Utilities\Contracts.cs (1)
81return c == null ? 0 : c.Count;
Microsoft.ML.Data (8)
DataView\DataViewConstructionUtils.cs (6)
617return _data.Count; 643_permutation = Utils.GetRandomPermutation(rand, dataView._data.Count); 670Ch.Check(0 <= Position && Position < _data.Count, RowCursorUtils.FetchValueStateError); 676Ch.Assert(Position < _data.Count); 677return Position + 1 < _data.Count; 701=> (_data as ICollection<TRow>)?.Count;
Prediction\Calibrator.cs (2)
1832PlattCalibrator newCal = new PlattCalibrator(_host, a / calibrators.Count, b / calibrators.Count);
Microsoft.ML.Ensemble (9)
Selector\DiversityMeasure\BaseDisagreementDiversityMeasure.cs (4)
17Contracts.Assert(models.Count > 1); 18Contracts.Assert(predictions.Count == models.Count); 22for (int i = 0; i < (models.Count - 1); i++) 24for (int j = i + 1; j < models.Count; j++)
Selector\SubModelSelector\BaseBestPerformanceSelector.cs (1)
38int modelCountToBeSelected = (int)(models.Count * LearnersSelectionProportion);
Selector\SubModelSelector\BaseDiverseSelector.cs (2)
71if (models.Count <= 1) 81var modelCountToBeSelected = (int)(models.Count * LearnersSelectionProportion);
Selector\SubModelSelector\BestDiverseSelectorMulticlass.cs (2)
45Host.Assert(models.Count > 1); 46Host.Assert(predictions.Count == models.Count);
Microsoft.ML.FastTree (3)
TreeEnsemble\InternalTreeEnsemble.cs (3)
401if (trees.Count == 0) 405for (int iteration = 0; iteration < trees.Count; iteration++) 415this[k] = this[k] / trees.Count;
Microsoft.ML.IntegrationTests (2)
Common.cs (2)
333for (int i = 0; i < array.Count; i++) 348for (int i = 0; i < array.Count; i++)
Microsoft.ML.ResultProcessor (5)
ResultProcessor.cs (5)
894while (i < lines.Count) 896if (lines[i] == FoldSeparatorString && (i + 1) < lines.Count && lines[i + 1].StartsWith("FOLD")) 900while (endLineIdx < lines.Count && lines[endLineIdx] != FoldSeparatorString) 902if (endLineIdx == lines.Count) 986for (int i = 1; i < lines.Count; i++)
Microsoft.ML.SearchSpace (2)
Option\NestOption.cs (1)
86public int Count => ((ICollection<KeyValuePair<string, OptionBase>>)_options).Count;
SearchSpace.cs (1)
89public int Count => ((ICollection<KeyValuePair<string, OptionBase>>)_options).Count;
Microsoft.ML.StandardTrainers (3)
Standard\LinearModelParameters.cs (3)
338for (int i = 1; i < models.Count; i++) 348VectorUtils.ScaleBy(ref weights, (float)1 / models.Count); 349bias /= models.Count;
Microsoft.ML.Tests (2)
OnnxSequenceTypeWithAttributesTest.cs (2)
65Assert.True(onnxOut.Count == 3, "Output missing data."); 67for (var i = 0; i < onnxOut.Count; ++i)
Microsoft.ML.Tokenizers (11)
Model\BertTokenizer.cs (9)
301int capacity = c1.Count + 2; // Add 2 for [CLS] and two [SEP] tokens. 305capacity += additionalTokenIds is ICollection<int> c2 ? c2.Count + 1 : c1.Count + 1; 412int capacity = c1.Count + 2; 416capacity += additionalTokenIds is ICollection<int> c2 ? c2.Count + 1 : c1.Count + 1; 568int capacity = c1.Count + 2; // Add 2 for [CLS] and [SEP] tokens. 572capacity += additionalTokenIds is ICollection<int> c2 ? c2.Count + 1 : c1.Count + 1;
Tokenizer.cs (1)
374idCount = c.Count;
Utils\IListExtensions.cs (1)
19int count = listToAdd.Count;
Microsoft.ML.TorchSharp (2)
Utils\DataUtils.cs (2)
24var res = values[0].new_full(values.Count, size, padIndex, device: device); 26for (var i = 0; i < values.Count; ++i)
Microsoft.Net.Http.Headers (22)
CacheControlHeaderValue.cs (7)
343if ((_noCacheHeaders != null) && (_noCacheHeaders.Count > 0)) 385if ((_privateHeaders != null) && (_privateHeaders.Count > 0)) 456if ((_noCacheHeaders != null) && (_noCacheHeaders.Count > 0)) 464if ((_privateHeaders != null) && (_privateHeaders.Count > 0)) 472if ((_extensions != null) && (_extensions.Count > 0)) 731var originalValueCount = destination == null ? 0 : destination.Count; 762if ((destination != null) && (destination.Count > originalValueCount))
HeaderUtilities.cs (6)
93return (y == null) || (y.Count == 0); 98return (x.Count == 0); 101if (x.Count != y.Count) 106if (x.Count == 0) 113var alreadyFound = new bool[x.Count];
HttpHeaderParser.cs (1)
68for (var i = 0; i < values.Count; i++)
NameValueHeaderValue.cs (7)
286if ((values == null) || (values.Count == 0)) 291for (var i = 0; i < values.Count; i++) 309if ((values == null) || (values.Count == 0)) 323if ((values == null) || (values.Count == 0)) 329for (var i = 0; i < values.Count; i++) 438if ((values == null) || (values.Count == 0)) 443for (var i = 0; i < values.Count; i++)
RangeItemHeaderValue.cs (1)
109Contract.Ensures((Contract.Result<int>() == 0) || (rangeCollection.Count > 0),
Microsoft.Net.Http.Headers.Tests (13)
ContentDispositionHeaderValueTest.cs (1)
659Assert.Equal(2, contentDisposition.Parameters.Count);
CookieHeaderValueTest.cs (1)
294Assert.Equal(cookies?.Count > 0, result);
MediaTypeHeaderValueTest.cs (10)
134Assert.Equal(mediaType0.Parameters.Count, mediaType1.Parameters.Count); 145Assert.Equal(mediaType0.Parameters.Count, mediaType1.Parameters.Count); 161Assert.Equal(mediaType0.Parameters.Count, mediaType1.Parameters.Count); 183Assert.Equal(mediaType0.Parameters.Count, mediaType1.Parameters.Count); 210Assert.Equal(mediaType2.Parameters.Count, mediaType1.Parameters.Count);
SetCookieHeaderValueTest.cs (1)
463Assert.Equal(cookies?.Count > 0, result);
Microsoft.VisualStudio.LanguageServices (16)
InheritanceMargin\InheritanceGlyphManager.cs (1)
165if (lines.Count > 0)
NavigationBar\NavigationBarClient.cs (2)
101pcEntries = (uint)_projectItems.Count; 105pcEntries = (uint)_currentTypeItems.Count;
Preview\FileChange.cs (1)
91if (diff.Differences.Count == 0)
Progression\GraphProvider.cs (1)
332=> ((IList<SymbolKey>)node[RoslynGraphProperties.ExplicitInterfaceImplementations]).Count > 0;
Utilities\VsEnumBSTR.cs (3)
31pceltCount = (uint)_values.Count; 38for (; i < celt && _currentIndex < _values.Count; i++, _currentIndex++) 58return _currentIndex < _values.Count
Utilities\VsEnumDebugName.cs (3)
31pceltCount = (uint)_values.Count; 38for (; i < celt && _currentIndex < _values.Count; i++, _currentIndex++) 62return _currentIndex < _values.Count
Venus\CodeBlockEnumerator.cs (3)
45pceltFetched = Math.Min(celt, (uint)(_codeBlocks.Count - _currentElement)); 71if (_currentElement > _codeBlocks.Count) 73_currentElement = _codeBlocks.Count;
Venus\ContainedDocument.cs (2)
733while (currentVisibleSpanIndex < visibleSpansInOriginal.Count && 740if (currentVisibleSpanIndex >= visibleSpansInOriginal.Count)
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (4)
1224for (var i = triviaList.Count - 1; i >= 0; i--) 1248if (commentList.Count == 0) 1297if (commentList.Count > 0) 1301var lastIndex = leadingTriviaList.FindIndex(t => t == commentList[commentList.Count - 1]);
Microsoft.Web.Xdt.Extensions (1)
InsertOrAppendAttribute.cs (1)
51if (Arguments != null && Arguments.Count > 0)
MSBuild (3)
OutOfProcTaskHostNode.cs (1)
304return (WarningsAsErrors.Count == 0 && WarningAsErrorNotOverriden(warningCode)) || WarningsAsMessages.Contains(warningCode);
XMake.cs (2)
1622nodeResultKvp.Key.ProjectInstance.GlobalProperties.Count == entryPoint.GlobalProperties.Count &&
MSBuildTaskHost (8)
BinaryTranslator.cs (6)
1088int count = list.Count; 1113_writer.Write(collection.Count); 1396int count = dictionary.Count; 1419int count = dictionary.Count; 1474int count = dictionary.Count; 1503int count = dictionary.Count;
BuildExceptionBase.cs (1)
104writer.Write(customKeyedSerializedData.Count);
OutOfProcTaskHostNode.cs (1)
304return (WarningsAsErrors.Count == 0 && WarningAsErrorNotOverriden(warningCode)) || WarningsAsMessages.Contains(warningCode);
PresentationBuildTasks (11)
src\Microsoft.DotNet.Wpf\src\PresentationCore\MS\Internal\Media\ParserStreamGeometryContext.cs (2)
670_bw.Write(points.Count); 673for(int i = 0; i < points.Count; i++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (1)
4933for( int i = 0; i < attributes.Count; i++ )
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsCache.cs (3)
217for(int i=0; i<allAttributes.Count; i++) 238for (int i = 0; i<constructorArguments.Count; i++) 258for (int i=0; i<constructorArguments.Count; i++)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (5)
255for (int j = 0; j < list.Count; j++) 288for (int j = 0; j < list.Count && !attributeDataFound; j++) 332if (constructorArguments.Count == 1 && !noArgs) 351else if (constructorArguments.Count == 0) 491for (int j = 0; j < list.Count; j++)
PresentationCore (150)
MS\Internal\FontCache\FamilyCollection.cs (1)
675return _fontCollection.FamilyCount + (UseSystemFonts ? SystemCompositeFonts.NumOfSystemCompositeFonts : checked((uint)UserCompositeFonts.Count));
MS\Internal\FontCache\FontSourceCollection.cs (1)
108fontSources = new List<Text.TextInterface.IFontSource>(files.Count);
MS\Internal\FontFace\FontDriver.cs (2)
256if (glyphs == null || glyphs.Count == 0) 260glyphArray = new ushort[glyphs.Count];
MS\Internal\IListConverters.cs (9)
117StringBuilder builder = new StringBuilder(EstimatedCharCountPerItem * list.Count); 118for (int i = 0; i < list.Count; i++) 158StringBuilder builder = new StringBuilder(EstimatedCharCountPerItem * list.Count); 159for (int i = 0; i < list.Count; i++) 199StringBuilder builder = new StringBuilder(EstimatedCharCountPerItem * list.Count); 200for (int i = 0; i < list.Count; i++) 241StringBuilder builder = new StringBuilder(EstimatedCharCountPerItem * list.Count); 242for (int i = 0; i < list.Count; i++) 281char[] chars = new char[list.Count];
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (1)
196count = (uint)collection.Count;
MS\Internal\Media\ParserStreamGeometryContext.cs (2)
670_bw.Write(points.Count); 673for(int i = 0; i < points.Count; i++)
MS\Internal\Shaping\TypefaceMap.cs (3)
443for(i = 0; i < _cachedScaledTypefaces.Count; i++) 449if(i == _cachedScaledTypefaces.Count) 452i = _cachedScaledTypefaces.Count;
MS\Internal\TextFormatting\Bidi.cs (2)
1760Invariant.Assert(levels != null && levels.Count >= cchText); 1761Invariant.Assert(characterClass != null && characterClass.Count >= cchText);
MS\Internal\TextFormatting\FormattedTextSymbols.cs (3)
72Debug.Assert(shapeables != null && shapeables.Count > 0); 75_glyphs = new Glyphs[shapeables.Count]; 83while (i < shapeables.Count)
MS\Internal\TextFormatting\FullTextLine.cs (1)
2042return boundsList.Count > 0 ? boundsList : null;
MS\Internal\TextFormatting\FullTextState.cs (4)
184int lsTbdCount = pap.Tabs != null ? pap.Tabs.Count : 0; 189if (pap.Tabs != null && pap.Tabs.Count > 0) 191lsTbdCount = pap.Tabs.Count + 1; 211if (pap.Tabs != null && pap.Tabs.Count > 0)
MS\Internal\TextFormatting\LineServicesRun.cs (1)
253for (int i = 0; i < _textEffects.Count; i++)
MS\Internal\TextFormatting\SimpleTextLine.cs (3)
872(boundsList == null || boundsList.Count == 0 ? null : boundsList) 914for (int i = 0; i < displayGlyphAdvances.Count; i++) 1760for (int i = 0; i < displayGlyphAdvances.Count; i++)
MS\Internal\TextFormatting\TextStore.cs (1)
1703int shapeablesCount = shapeables.Count;
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (1)
44InitArrays(realValues.Count);
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (1)
38InitArrays(emSize, pointValues.Count);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\PartialList.cs (2)
41_count = list.Count; 47Debug.Assert(initialIndex >= 0 && initialIndex + count <= list.Count);
System\Windows\BinaryFormat\MemberTypeInfo.cs (1)
30public readonly int Count => _info.Count;
System\Windows\FreezableCollection.cs (1)
662return enumerableAsICollectionT.Count;
System\Windows\Ink\Stroke.cs (1)
1151return icol.Count;
System\Windows\Input\ManipulationLogic.cs (3)
364int numManipulators = manipulators.Count; 391int count = parameters.Count; 392for (int i = 0; i < parameters.Count; i++)
System\Windows\Media\Animation\AnimationLayer.cs (10)
30|| (newAnimationClocks.Count > 0 106int count = _animationClocks.Count; 120Debug.Assert(animationClocks.Count > 0); 126int count = animationClocks.Count; 147&& _animationClocks.Count > 0, 170if (_animationClocks.Count == 0) 187Debug.Assert(newAnimationClocks.Count > 0); 191int newClocksCount = newAnimationClocks.Count; 197int oldClocksCount = (_animationClocks == null) ? 0 : _animationClocks.Count; 260int count = _animationClocks.Count;
System\Windows\Media\Animation\AnimationStorage.cs (5)
591Debug.Assert(animationClocks.Count > 0, 646storage._animationClocks = new FrugalObjectList<AnimationClock>(animationClocks.Count); 648for (int i = 0; i < animationClocks.Count; i++) 662FrugalObjectList<AnimationClock> newClockCollection = new FrugalObjectList<AnimationClock>(storage._animationClocks.Count + animationClocks.Count); 671for (int i = 0; i < animationClocks.Count; i++)
System\Windows\Media\ByteStreamGeometryContext.cs (1)
636int count = points.Count;
System\Windows\Media\CultureSpecificStringDictionary.cs (4)
66get { return _innerDictionary.Count; } 116if (_innerDictionary.Count > array.Length - index) 150if (_innerDictionary.Count > array.Length - index) 440get { return _innerDictionary.Count; }
System\Windows\Media\FamilyTypefaceCollection.cs (1)
36_count = innerList.Count;
System\Windows\Media\GlyphRun.cs (59)
338(glyphIndices.Count > 0) && 339(glyphIndices.Count <= MaxGlyphCount) && 340(advanceWidths.Count == glyphIndices.Count) && 341((glyphOffsets == null) || ((glyphOffsets != null) && (glyphOffsets.Count != 0) && (glyphOffsets.Count == glyphIndices.Count)))) 361if (characters != null && characters.Count != 0) 363if (clusterMap != null && clusterMap.Count != 0) 365if (clusterMap.Count == characters.Count) 372int mapCount = clusterMap.Count; 399throw new ArgumentException(SR.Format(SR.CollectionNumberOfElementsShouldBeEqualTo, characters.Count), nameof(clusterMap)); 404if (GlyphCount != characters.Count) 409if (caretStops != null && caretStops.Count != 0) 411if (caretStops.Count != CodepointCount + 1) 433if (glyphIndices.Count <= 0) 436if (glyphIndices.Count > MaxGlyphCount) 443if (advanceWidths.Count != glyphIndices.Count) 444throw new ArgumentException(SR.Format(SR.CollectionNumberOfElementsShouldBeEqualTo, glyphIndices.Count), nameof(advanceWidths)); 446if (glyphOffsets != null && glyphOffsets.Count != 0 && glyphOffsets.Count != glyphIndices.Count) 447throw new ArgumentException(SR.Format(SR.CollectionNumberOfElementsShouldBeEqualTo, glyphIndices.Count), nameof(glyphOffsets)); 481IList<bool> caretStops = CaretStops != null && CaretStops.Count != 0 ? CaretStops : new DefaultCaretStopList(CodepointCount); 521if (currentCodepoint >= clusterMap.Count || clusterMap[currentCodepoint] != clusterMap[clusterCodepointStart]) 529if (currentCodepoint >= clusterMap.Count) 530clusterGlyphEnd = advances.Count; 537if (caretCodePoint < currentCodepoint || currentCodepoint >= clusterMap.Count) 573IList<bool> caretStops = CaretStops != null && CaretStops.Count != 0 ? CaretStops : new DefaultCaretStopList(CodepointCount); 593for (int i = 1; i < caretStops.Count; ++i) 595if (i < clusterMap.Count && clusterMap[i] == clusterMap[currentClusterStart]) 601ushort lastGlyphInCluster = i < clusterMap.Count ? clusterMap[i] : (ushort)advances.Count; 640if (caretStops[caretStops.Count - 1]) 643secondStopIndex = caretStops.Count - 1; 656if (caretStops[caretStops.Count - 1]) 657return new CharacterHit(caretStops.Count - 1, 0); 679return new CharacterHit(firstStopIndex, caretStops.Count - 1 - firstStopIndex); 707IList<bool> caretStops = CaretStops != null && CaretStops.Count != 0 ? CaretStops : new DefaultCaretStopList(CodepointCount); 754IList<bool> caretStops = CaretStops != null && CaretStops.Count != 0 ? CaretStops : new DefaultCaretStopList(CodepointCount); 997if (CaretStops == null || CaretStops.Count == 0) 1084if (value.Count <= 0) 1114if (value.Count <= 0) 1191if (_glyphOffsets == null || _glyphOffsets.Count == 0) 1200return _glyphIndices.Count; 1209if (_characters != null && _characters.Count != 0) 1210return _characters.Count; 1211if (_clusterMap != null && _clusterMap.Count != 0) 1212return _clusterMap.Count; 1213return _glyphIndices.Count; 1236int glyphIndicesCount = _glyphIndices.Count; 1898if (_glyphOffsets != null && _glyphOffsets.Count != 0) 1962if (_glyphOffsets != null && _glyphOffsets.Count != 0) 2006if (_glyphOffsets != null && _glyphOffsets.Count != 0) 2032if (characterIndex < 0 || characterIndex >= caretStops.Count) 2049for (int i = characterIndex + 1; i < caretStops.Count; ++i) 2065for (int lastStop = caretStopIndex + 1; lastStop < caretStops.Count; ++lastStop)
System\Windows\Media\GlyphsSerializer.cs (14)
54(_characters == null ? 0 : _characters.Count), 55_indices.Count 77for (characterIndex = 0; characterIndex < _clusters.Count; ++characterIndex) 101Debug.Assert(_indices.Count > glyphClusterStart - _glyphClusterInitialOffset); 102AddCluster(glyphClusterStart - _glyphClusterInitialOffset, _indices.Count, charClusterStart, characterIndex); 107Debug.Assert(_characters == null || _characters.Count == 0 || _indices.Count == _characters.Count); 108for (int i = 0; i < _indices.Count; ++i) 116if (_characters == null || _characters.Count == 0) 122StringBuilder builder = new StringBuilder(_characters.Count); 247if (_characters != null && _characters.Count != 0) 268for (int i = _caretStops.Count - 1; i >= 0; --i) 275lastCaretStop = Math.Min(i | 3, _caretStops.Count - 1);
System\Windows\Media\GlyphTypeface.cs (3)
228if (glyphs.Count <= 0) 231if (glyphs.Count > ushort.MaxValue) 387IDictionary<XmlLanguage, string> adjustedLanguageFaceNames = new Dictionary<XmlLanguage, string>(adjustedFaceNames.Count);
System\Windows\Media\Imaging\BitmapEncoder.cs (4)
336int count = _frames.Count; 378if (_palette != null && _palette.Colors.Count > 0) 658if (colorContexts != null && colorContexts.Count > 0) 660int count = colorContexts.Count;
System\Windows\Media\Imaging\BitmapPalette.cs (2)
33int count = colors.Count; 268int numColors = Math.Min(256, _colors.Count);
System\Windows\Media\Imaging\FormatConvertedBitmap.cs (1)
184else if ((1 << DestinationFormat.BitsPerPixel) < DestinationPalette.Colors.Count)
System\Windows\Media\PathStreamGeometryContext.cs (1)
313int count = points.Count;
System\Windows\ReverseInheritProperty.cs (1)
70int otherCount = (otherOrigins != null) ? otherOrigins.Count : 0;
PresentationFramework (128)
Microsoft\Win32\CommonItemDialog.cs (1)
416if (places != null && places.Count != 0)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (6)
109int firstPage = pageEl.Count; 117if (pageEl.Count > 0 && ((FixedPageProxy)pageEl[pageEl.Count - 1]).Page == startPage) 197if (fp.Segments.Count == 0) 204part.NameValuePairs.Add(TextSelectionProcessor.CountAttribute, fp.Segments.Count.ToString(NumberFormatInfo.InvariantInfo)); 206for (int i = 0; i < fp.Segments.Count; i++)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (13)
266if (locators.Count > 0) 284ContentLocator[] lists = new ContentLocator[locators.Count]; 667if (newLocators != null && newLocators.Count > 0) 715if (locatorParts != null && locatorParts.Count > 0) 717List<ContentLocatorBase> tempLocators = new List<ContentLocatorBase>(locatorsToReturn.Count * locatorParts.Count); 760if (tempLocators != null && tempLocators.Count > 0) 941if (locators.Count > 0) 949if (locators.Count == 1) 957if (locators.Count > 2) 961for (int i = 1; i < locators.Count - 1; i++) 981data = ResolveSingleLocator(ref selection, ref attachmentLevel, AttachmentLevel.EndPortion, locators[locators.Count - 1], offset, startNode, skipStartNode); 1208if (additionalLocators == null || additionalLocators.Count == 0) 1216for (int i = 1; i < additionalLocators.Count; i++)
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (2)
155for (int i = 0; i < textSegments.Count; i++) 162part.NameValuePairs.Add(CountAttribute, textSegments.Count.ToString(NumberFormatInfo.InvariantInfo));
MS\Internal\Annotations\Anchoring\TextViewSelectionProcessor.cs (2)
231if (segments != null && segments.Count > 0) 234ITextPointer end = segments[segments.Count - 1].End;
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (9)
371ind = ind + res.Count - 1; 623_owners = new List<IHighlightRange>(owners.Count); 639Debug.Assert(owners.Count > 0, "empty owners list"); 640for (int i = 0; i < owners.Count; i++) 824for (int i = 0; i < r1.Count; i++) 829for (int j = 0; j < r2.Count; j++) 848if ((res != null) && (res.Count > 0) && (newOwner != null)) 851if (res.Count == 3) 866Debug.Assert(res.Count == 2, "unexpected resulting segment count after split");
MS\Internal\Annotations\TextAnchor.cs (1)
594List<TextSegment> orderedList = new List<TextSegment>(textSegments.Count);
MS\Internal\Data\DifferencingCollection.cs (1)
50int n = list.Count;
MS\Internal\Documents\TextBoxLine.cs (5)
267Invariant.Assert(textBounds.Count > 0); 269for (int boundIndex = 0; boundIndex < textBounds.Count; boundIndex++) 378return (((TextSpan<TextRun>)runs[runs.Count - 1]).Value is TextEndOfParagraph); 504Invariant.Assert(textBounds != null && textBounds.Count == 1, "Expecting exactly one TextBounds for a single text position."); 509Invariant.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
MS\Internal\Documents\TextBoxView.cs (2)
2052for (int i = 0; i < bounds.Count; i++) 2131for (int i = 0; i < bounds.Count; i++)
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
268Hashtable uidSubstitutions = new Hashtable(newChildren.Count); 329while (nodeIndex < newChildren.Count) 366for (; nodeIndex < newChildren.Count; nodeIndex++)
MS\Internal\Ink\InkCanvasSelection.cs (3)
559if ( elements.Count > 0 ) 1030if ( elements1.Count != elements2.Count )
MS\Internal\PtsHost\Line.cs (10)
508Invariant.Assert(textBounds.Count > 0); 510for (int boundIndex = 0; boundIndex < textBounds.Count; boundIndex++) 634Invariant.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 698cchGlyphRuns -= (glyphRun.Characters == null ? 0 : glyphRun.Characters.Count); 713int characterCount = (run.Characters == null ? 0 : run.Characters.Count); 853return (((TextSpan<TextRun>)_runs[_runs.Count-1]).Value is ParagraphBreakRun); 929TextRun run = ((TextSpan<TextRun>)_runs[_runs.Count - 1]).Value as TextRun; 1002Invariant.Assert(textBounds != null && textBounds.Count == 1, "Expecting exactly one TextBounds for a single text position."); 1006Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position."); 1074cchGlyphRuns += (glyphRun.Characters == null ? 0 : glyphRun.Characters.Count);
MS\Internal\PtsHost\PtsHost.cs (2)
1518for(int breakIndex = 0; breakIndex < Math.Min(textBreakpoints.Count, nLineVariantsAlloc); breakIndex++) 1563nLineVariantsActual = textBreakpoints.Count;
MS\Internal\PtsHost\TextParaClient.cs (2)
1903for (int i = 0, count = rectangles.Count; i < count; ++i) 2015for (int i = 0, count = rectangles.Count; i < count; ++i)
MS\Internal\Text\Line.cs (6)
177Invariant.Assert(textBounds.Count > 0); 180for (int boundIndex = 0; boundIndex < textBounds.Count; boundIndex++) 313Debug.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 419return (((TextSpan<TextRun>)runs[runs.Count-1]).Value is TextEndOfParagraph); 471Invariant.Assert(textBounds != null && textBounds.Count == 1, "Expecting exactly one TextBounds for a single text position."); 476Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
System\Windows\Annotations\AnnotationDocumentPaginator.cs (2)
369if (locators.Count > 0) 372ContentLocator[] lists = new ContentLocator[locators.Count];
System\Windows\Annotations\AnnotationHelper.cs (7)
245if (attachedAnnotations.Count > 0) 625Debug.Assert((textSegments != null) && (textSegments.Count > 0), "Invalid selection TextSegments"); 627if ((attachedAnnotations != null) && (attachedAnnotations.Count > 0)) 635for (int i = attachedAnnotations.Count - 1; i >= 0; i--) 679Invariant.Assert(locators != null && locators.Count > 0); 777List<IAttachedAnnotation> attachedAnnotations = new List<IAttachedAnnotation>(annotations.Count); 1058Invariant.Assert(locators != null && locators.Count > 0, "No locators generated for selection.");
System\Windows\Annotations\AnnotationService.cs (7)
865List<AttachedAnnotationChangedEventArgs> eventsToFire = new List<AttachedAnnotationChangedEventArgs>(attachedAnnotations.Count); 1009if ((attachedAnnotations != null) && (attachedAnnotations.Count > 0)) 1313if (annotations.Count > 0) 1316IAttachedAnnotation[] list = new IAttachedAnnotation[annotations.Count]; 1376if (annotations.Count > 0) 1379IAttachedAnnotation[] list = new IAttachedAnnotation[annotations.Count]; 1416IAttachedAnnotation[] list = new IAttachedAnnotation[annotations.Count];
System\Windows\Annotations\LocatorPart.cs (1)
101if (part.NameValuePairs.Count != _nameValues.Count)
System\Windows\Annotations\LocatorPartList.cs (3)
353if (additionalLocatorParts == null || additionalLocatorParts.Count == 0) 360results = new List<ContentLocatorBase>(additionalLocatorParts.Count); 362for (int i = 1; i < additionalLocatorParts.Count; i++)
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (4)
329this.OwningDataGrid.SelectedCells.Count == 1 && e.AddedCells.Count == 1) 339for (i = 0; i < e.AddedCells.Count; i++) 348for (i = 0; i < e.RemovedCells.Count; i++)
System\Windows\Automation\Peers\DataGridCellItemAutomationPeer.cs (1)
701this.OwningDataGrid.SelectedCells.Count > 0)
System\Windows\Automation\Peers\DataGridItemAutomationPeer.cs (4)
143if (columns != null && columns.Count > 0) 164if (startIndex == 0 || startIndex == columns.Count) 168if (propertyId == 0 && startIndex < columns.Count) 175for (int i = startIndex; i < columns.Count; i++)
System\Windows\Controls\CustomDictionarySources.cs (1)
279get { return ((IList<Uri>)this).Count; }
System\Windows\Controls\TextBlock.cs (2)
2317if (aryTextBounds.Count > 0) 2320int c = aryTextBounds.Count;
System\Windows\Controls\Validation.cs (1)
369for (int groupIndex = 0; groupIndex < groups.Count; ++groupIndex)
System\Windows\Data\BindingGroup.cs (2)
855for (int i=newItems.Count-1; i>=0; --i) 1270for (int i=0, n=list.Count; i<n; ++i)
System\Windows\Documents\DocumentReferenceCollection.cs (2)
64int count = _InternalList.Count; 90return _InternalList.Count;
System\Windows\Documents\FixedHighlight.cs (1)
136int chrct = (run.Characters == null ? 0 : run.Characters.Count);
System\Windows\Documents\FixedSOMElement.cs (1)
88endIndex = glyphRun.Characters == null ? 0 : glyphRun.Characters.Count;
System\Windows\Documents\FixedSOMPageConstructor.cs (6)
153for (int i = 0; i <points.Count; i ++) 161_lastPoint = points[points.Count - 1]; 166for (int i = 0; i < points.Count; i++) 175_lastPoint = points[points.Count - 1]; 181_lastPoint = points[points.Count - 1]; 435if (glyphRun.ClusterMap != null && glyphRun.ClusterMap.Count > 0)
System\Windows\Documents\FixedTextView.cs (3)
514int characterCount = (run.Characters == null) ? 0 : run.Characters.Count; 965int characterCount = (run.Characters == null) ? 0 : run.Characters.Count; 991charCount = run.Characters.Count;
System\Windows\Documents\PageContentCollection.cs (2)
59int index = InternalList.Count - 1; 107get { return InternalList.Count; }
System\Windows\Documents\RubberbandSelector.cs (1)
469int characterCount = (run.Characters == null) ? 0 : run.Characters.Count;
System\Windows\ResourceDictionary.cs (5)
1121else if (keys.Count > 0) 1199_numDefer = keyCollection.Count; 1205for (int i = 0; i < keyCollection.Count; i++) 1268Debug.Assert(staticResources != null && staticResources.Count > 0); 1269for (int i = 0; i < staticResources.Count; i++)
System\Windows\Shell\JumpList.cs (2)
61|| (rejectedItems != null && reasons != null && rejectedItems.Count != reasons.Count))
System\Windows\Standard\Utilities.cs (1)
142for (int i = 0; i < frames.Count && bestScore != 0; ++i)
System\Windows\VisualStateManager.cs (1)
169for (int groupIndex = 0; groupIndex < groups.Count; ++groupIndex)
PresentationUI (8)
MS\Internal\Documents\RightsManagementManager.cs (4)
1076if (newGrants == null || newGrants.Count == 0) 1092if (newGrants.Count != allRights.Count) 1299if (licenses != null && licenses.Count > 0)
MS\Internal\Documents\RightsManagementProvider.cs (2)
548grantDictionary.Count); 672if (licenses.Count > 0)
MS\Internal\Documents\RMPermissions.cs (1)
130string[] stringArray = new string[rightsStrings.Count];
MS\Internal\Documents\RMPublishingDialog.cs (1)
56if (grantDictionary != null && grantDictionary.Count != 0)
ReachFramework (35)
AlphaFlattener\PrimitiveList.cs (1)
173for (int i = 0; i < chars.Count; i ++)
AlphaFlattener\Utility.cs (5)
2725_count += points.Count; 2729for (int index = 0; index < points.Count && IsRectangle; index++) 2735AddLineSegments(points.Count); 2743_count += (points.Count + 1) / 2 * 3; 2751_count += (points.Count + 2) / 3 * 3;
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (2)
308if (paperSizes.Count > 0) 337if (0 <= defaultPaperSizeIndex && defaultPaperSizeIndex < paperSizes.Count)
MS\Internal\Printing\MostFrequentlyUsedCache.cs (2)
28while(this._dictionary.Count >= this._maxEntries) 33Debug.Assert(this._dictionary.Count <= this._maxEntries);
Packaging\XpsFixedDocumentReaderWriter.cs (1)
862if (linkTargetStream.Count != 0)
PrintConfig\PrintCapabilitesWriter.cs (16)
169if (nUps.Count > 0) 260if (bins.Count > 0) 267for (int i = 0; i < bins.Count; i++) 311string optionDisplayName = (i < binDisplayNames.Count) ? binDisplayNames[i] : null; 329if (paperSizeCodes.Count > 0) 336for (int i = 0; i < paperSizeCodes.Count; i++) 354((i < paperSizeDisplayNames.Count) || (i < paperSizes.Count))) 356string optionDisplayName = (i < paperSizeDisplayNames.Count) ? paperSizeDisplayNames[i] : null; 359if (i < paperSizes.Count) 387if (mediaTypes.Count > 0 && mediaTypeDisplayNames.Count > 0) 394for (int i = 0; i < mediaTypes.Count; i++) 419optionDisplayName = (i < mediaTypeDisplayNames.Count) ? mediaTypeDisplayNames[i] : null; 495if(resolutions.Count > 0) 502for (int i = 0; i < resolutions.Count; i++)
PrintConfig\PrintSchemaShim.cs (4)
411if (bins.Count < 1) 425if (mediaTypes.Count < 1) 439if (papers.Count < 1) 472for (int i = 0; i < points.Count; i++)
Serialization\ImageSourceTypeConverter.cs (1)
355&& bitmapSource.Palette.Colors.Count > 0)
Serialization\VisualSerializer.cs (3)
1604for (int i = 0; i < glyphRun.Characters.Count; i++) 2136if (serializeGlyphRun.Characters.Count > MaxGlyphCount) 2146if (serializeGlyphRun.GlyphIndices.Count > MaxGlyphCount)
Replay (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
85var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 101for (int i = 0; i < args.Count; ++i)
Shared (9)
EmptyCollections\EmptyCollectionExtensions.cs (3)
48=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 78=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 112if (enumerable is ICollection<T> c && c.Count == 0)
JsonSchemaExporter\JsonSchemaExporter.cs (1)
125if (parentPolymorphicTypeInfo is null && typeInfo.PolymorphismOptions is { DerivedTypes.Count: > 0 } polyOptions)
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (1)
150if (typeInfo.Properties.Count > 0 &&
JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (3)
52attribute.ConstructorArguments.Count == 1) 307attribute.ConstructorArguments.Count == 1) 399attribute.ConstructorArguments.Count == 1)
Throw\Throw.cs (1)
267if (collection.Count == 0)
Swaggatherer (4)
SwaggathererApplication.cs (4)
171for (var i = 0; i < entry.Template.Segments.Count; i++) 191for (var k = 0; k < entry.Template.Segments.Count; k++) 236if (template.Segments.Count == 0) 242for (var i = 0; i < template.Segments.Count; i++)
System.CodeDom (1)
System\CodeDom\Compiler\CompilerInfo.cs (1)
51if (_providerOptions.Count > 0)
System.Collections (13)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
37int count = ic.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ICollectionDebugView.cs (1)
31T[] items = new T[_collection.Count];
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IDictionaryDebugView.cs (3)
22var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count]; 48TKey[] items = new TKey[_collection.Count]; 69TValue[] items = new TValue[_collection.Count];
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (1)
49ValidateCopyToArguments(collection.Count, array, index);
System\Collections\Generic\OrderedDictionary.cs (2)
167this(dictionary?.Count ?? 0, comparer) 201this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
System\Collections\Generic\PriorityQueue.cs (2)
408if (collection is not null && (count = collection.Count) > _nodes.Length - _size) 471(count = collection.Count) > _nodes.Length - _size)
System\Collections\Generic\SortedList.cs (2)
150: this(dictionary?.Count ?? throw new ArgumentNullException(nameof(dictionary)), comparer) 152int count = dictionary.Count;
System\Collections\Generic\SortedSet.cs (1)
1326if (other is ICollection<T> c && c.Count == 0)
System.Collections.Concurrent (6)
System\Collections\Concurrent\ConcurrentDictionary.cs (2)
288ICollection<KeyValuePair<TKey, TValue>> c => Math.Max(DefaultCapacity, c.Count), 2743var keyValuePairs = new KeyValuePair<TKey, TValue>[_dictionary.Count];
System\Collections\Concurrent\OrderablePartitioner.cs (1)
169if (orderablePartitions.Count != partitionCount)
System\Collections\Concurrent\PartitionerStatic.cs (3)
1206get { return _sharedReader.Count; } 1493get { return _list.Count; } 1514Debug.Assert(startIndex >= 0 && endIndex <= list.Count - 1);
System.Collections.Immutable (13)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IDictionaryDebugView.cs (3)
22var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count]; 48TKey[] items = new TKey[_collection.Count]; 69TValue[] items = new TValue[_collection.Count];
System\Collections\Frozen\FrozenSetInternalBase.cs (3)
37int otherCount = otherAsCollection.Count; 64int otherCount = otherAsCollection.Count; 108int otherCount = otherAsCollection.Count;
System\Collections\Immutable\ImmutableArray_1.Builder.cs (2)
1076if (indicesToRemove.Count == 0) 1096_count -= indicesToRemove.Count;
System\Collections\Immutable\ImmutableArray_1.cs (2)
1483if (indicesToRemove.Count == 0) 1489var newArray = new T[self.Length - indicesToRemove.Count];
System\Collections\Immutable\ImmutableExtensions.cs (2)
130get { return _collection.Count; } 210return _collection.Count;
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (1)
43count = collectionOfT.Count;
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (2)
148if (leftParams.Count != rightParams.Count)
System.ComponentModel.Composition (7)
Microsoft\Internal\Collections\CollectionServices.cs (5)
83if (second == null || (second.Count == 0)) 88if (source == null || (source.Count == 0)) 247if (thisList.Count != thatList.Count) 252for (int i = 0; i < thisList.Count; i++)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
83if (specifiedContractType.GetPureGenericArity() == memberGenericParameters.Count)
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (1)
150var genericParameters = (definition.Metadata.Count > 0) ? definition.Metadata.GetValue<IEnumerable<object>>(CompositionConstants.GenericParametersMetadataName) : null;
System.Composition.Hosting (1)
System\Composition\Hosting\Core\CycleBreakingMetadataDictionary.cs (1)
97get { return ActualMetadata.Count; }
System.Composition.Runtime (4)
System\Composition\Hosting\Core\CompositionContract.cs (4)
48if (metadataConstraints?.Count == 0) throw new ArgumentOutOfRangeException(nameof(metadataConstraints)); 161if (_metadataConstraints.Count == 1) 183if (first.Count != second.Count)
System.Composition.TypedParts (2)
System\Composition\TypedParts\Discovery\TypeInspector.cs (2)
68if (metadata.Count == 0) 94if (metadata.Count == 0)
System.Configuration.ConfigurationManager (4)
System\Configuration\ConfigurationErrorsException.cs (2)
89if (coll.Count > 1) 91_errors = new ConfigurationException[coll.Count];
System\Configuration\ErrorsHelper.cs (2)
33if (col.Count == 1) errors.Add(e); 40if ((coll == null) || (coll.Count == 0))
System.Data.Common (1)
System\Data\Common\DbConnectionStringBuilder.cs (1)
246object[] values = new object[keys.Count];
System.Diagnostics.DiagnosticSource (5)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
34int count = sortedTags.Count; 40if (tagsCol.Count != count) 84if (listCount > sortedTags.Count) 113return listCount == sortedTags.Count;
System\Diagnostics\Metrics\Measurement.cs (1)
113int items = collection.Count;
System.Diagnostics.Process (1)
System\Diagnostics\Process.Unix.cs (1)
613var envp = new string[psi.Environment.Count];
System.IO.Packaging (1)
System\IO\Packaging\Package.cs (1)
1064PackUriHelper.ValidatedPartUri[] partKeys = new PackUriHelper.ValidatedPartUri[_partList.Keys.Count];
System.Linq (42)
System\Linq\AnyAll.cs (1)
20return gc.Count != 0;
System\Linq\AppendPrepend.SpeedOpt.cs (2)
23result = new TSource[c.Count + 1]; 189var result = new TSource[checked(_prependCount + c.Count + _appendCount)];
System\Linq\Concat.SpeedOpt.cs (7)
47int firstCount = firstCollection.Count; 48TSource[] result = new TSource[checked(firstCount + secondCollection.Count)]; 67int firstCount = firstCollection.Count; 75int secondCount = secondCollection.Count; 174int sourceCount = collection?.Count ?? source.Count(); 243int sourceCount = source.Count; 257int secondCount = second.Count;
System\Linq\Count.cs (2)
20return collectionoft.Count; 112count = collectionoft.Count;
System\Linq\ElementAt.cs (1)
118return (found = (uint)index < (uint)list.Count) ?
System\Linq\First.cs (1)
81if (list.Count > 0)
System\Linq\Last.cs (2)
80int count = list.Count; 127for (int i = list.Count - 1; i >= 0; --i)
System\Linq\Reverse.SpeedOpt.cs (3)
35int count = list.Count; 64int count = list.Count; 100if (list.Count > 0)
System\Linq\SegmentedArrayBuilder.cs (1)
131int collectionCount = collection.Count;
System\Linq\Select.cs (1)
261private int CountForDebugger => _source.Count;
System\Linq\Select.SpeedOpt.cs (11)
469int count = _source.Count; 484int count = _source.Count; 505int count = _source.Count; 532if ((uint)index < (uint)_source.Count) 544if (_source.Count != 0) 556int len = _source.Count; 813if ((uint)index <= (uint)(_maxIndexInclusive - _minIndexInclusive) && index < _source.Count - _minIndexInclusive) 843if ((uint)index <= (uint)(_maxIndexInclusive - _minIndexInclusive) && index < _source.Count - _minIndexInclusive) 855if (_source.Count > _minIndexInclusive) 867int lastIndex = _source.Count - 1; 882int count = _source.Count;
System\Linq\SequenceEqual.cs (3)
32if (firstCol.Count != secondCol.Count) 41int count = firstCol.Count;
System\Linq\Single.cs (1)
74switch (list.Count)
System\Linq\SkipTake.SpeedOpt.cs (5)
41if ((uint)index <= (uint)(_maxIndexInclusive - _minIndexInclusive) && index < _source.Count - _minIndexInclusive) 69if ((uint)index <= (uint)(_maxIndexInclusive - _minIndexInclusive) && index < _source.Count - _minIndexInclusive) 81if (_source.Count > _minIndexInclusive) 93int lastIndex = _source.Count - 1; 108int count = _source.Count;
System\Linq\ToCollection.cs (1)
47int count = collection.Count;
System.Linq.AsyncEnumerable (1)
System\Linq\ToAsyncEnumerable.cs (1)
55int count = source.Count;
System.Linq.Expressions (34)
System\Dynamic\ExpandoObject.cs (3)
340string[] items = new string[_collection.Count]; 479object[] items = new object[_collection.Count]; 720ContractUtils.RequiresArrayRange(array, arrayIndex, _count, nameof(arrayIndex), nameof(ICollection<KeyValuePair<string, object>>.Count));
System\Dynamic\Utils\ContractUtils.cs (3)
90if (collection.Count == 0) 113for (int i = 0, n = array.Count; i < n; i++) 143ArgumentOutOfRangeException.ThrowIfLessThan(array.Count - offset, count, offsetName);
System\Dynamic\Utils\ExpressionUtils.cs (1)
290if (replacement.Count != count)
System\Linq\Expressions\BlockExpression.cs (6)
107variables == null || variables.Count == 0; 211if (expressions.Count == 2) 264if (expressions.Count == 3) 331if (expressions.Count == 4) 415if (expressions.Count == 5) 555if (expressions.Count == 1)
System\Linq\Expressions\Compiler\TypeInfoExtensions.cs (2)
23Type[] paramTypes = new Type[args.Count + 2]; 26for (int i = 0; i < args.Count; i++)
System\Linq\Expressions\DynamicExpression.cs (4)
555if (arguments != null && arguments.Count == 1) 615if (arguments != null && arguments.Count == 2) 686if (arguments != null && arguments.Count == 3) 763if (arguments != null && arguments.Count == 4)
System\Linq\Expressions\LambdaExpression.cs (4)
366parameters == null || parameters.Count == 0; 405if (parameters != null && parameters.Count == 1) 457if (parameters != null && parameters.Count == 2) 522if (parameters != null && parameters.Count == 3)
System\Linq\Expressions\MethodCallExpression.cs (10)
249arguments == null || arguments.Count == 0; 286if (arguments != null && arguments.Count == 1) 338if (arguments != null && arguments.Count == 2) 405if (arguments != null && arguments.Count == 3) 478if (arguments != null && arguments.Count == 4) 557if (arguments != null && arguments.Count == 5) 629arguments == null || arguments.Count == 0; 663if (arguments != null && arguments.Count == 1) 719if (arguments != null && arguments.Count == 2) 786if (arguments != null && arguments.Count == 3)
System\Runtime\CompilerServices\ReadOnlyCollectionBuilder.cs (1)
54int count = c.Count;
System.Linq.Parallel (8)
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (3)
416_elementCount = data.Count; 519int smallerChunkSize = data.Count / partitionCount; 520int biggerChunkCount = data.Count % partitionCount;
System\Linq\Parallel\QueryOperators\ListQueryResults.cs (1)
44get { return _source.Count; }
System\Linq\Parallel\QueryOperators\PartitionerQueryOperator.cs (2)
156if (partitionerPartitions.Count != partitionCount) 182if (partitionerPartitions.Count != partitionCount)
System\Linq\ParallelEnumerable.cs (2)
1857return sourceAsCollection.Count; 1928return sourceAsCollection.Count;
System.Net.Http (3)
System\Net\Http\Headers\HttpHeaders.cs (1)
174int count = valuesList.Count;
System\Net\Http\HttpRequestOptions.cs (1)
97var items = new KeyValuePair<string, object?>[dictionary.Count];
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (1)
73if (contentEncodings.Count > 0)
System.Net.Quic (2)
System\Net\Quic\Internal\MsQuicBuffers.cs (2)
70Reserve(inputs.Count); 71for (int i = 0; i < inputs.Count; ++i)
System.Net.Security (1)
System\Security\Authentication\ExtendedProtection\ServiceNameCollection.cs (1)
151return c != null ? c.Count : 1;
System.Net.Sockets (9)
System\Net\Sockets\Socket.cs (2)
1146if (buffers.Count == 0) 1633if (buffers.Count == 0)
System\Net\Sockets\Socket.Tasks.cs (1)
839if (buffers.Count == 0)
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
166int bufferCount = value.Count;
System\Net\Sockets\SocketPal.Unix.cs (5)
292int maxBuffers = checked(buffers.Count - startIndex); 354for (; endIndex < buffers.Count && unconsumed > 0; endIndex++, endOffset = 0) 384int maxBuffers = buffers.Count; 545int buffersCount = buffers.Count; 1016(buffers != null && bufferIndex == buffers.Count);
System.ObjectModel (1)
System\Collections\Generic\DebugView.cs (1)
24T[] items = new T[_collection.Count];
System.Private.CoreLib (56)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
37int count = ic.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (1)
94int count = c.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (2)
88this(dictionary?.Count ?? 0, comparer) 101this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (8)
105int count = coll.Count; 834if (otherAsCollection.Count == 0) 939if (Count > otherAsCollection.Count) 975if (otherAsCollection.Count <= Count) 1020if (otherAsCollection.Count == 0) 1064if (otherAsCollection.Count == 0) 1141return otherAsCollection.Count == 0; 1160if (Count > otherAsCollection.Count)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ICollectionDebugView.cs (1)
31T[] items = new T[_collection.Count];
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IDictionaryDebugView.cs (3)
22var keyValuePairs = new KeyValuePair<TKey, TValue>[_dict.Count]; 48TKey[] items = new TKey[_collection.Count]; 69TValue[] items = new TValue[_collection.Count];
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (3)
68int count = c.Count; 252int count = c.Count; 823int count = c.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (6)
32public int Count => items.Count; 46if ((uint)index >= (uint)items.Count) 62int index = items.Count; 103if ((uint)index > (uint)items.Count) 131if ((uint)index >= (uint)items.Count) 226int count = items.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (1)
49ValidateCopyToArguments(collection.Count, array, index);
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (3)
33public int Count => list.Count; 48list.Count == 0 ? SZGenericArrayEnumerator<T>.Empty : 157int count = list.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyDictionary.cs (3)
71public int Count => m_dictionary.Count; 278public int Count => _collection.Count; 331public int Count => _collection.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlySet.cs (2)
34public int Count => _set.Count; 38_set.Count == 0 ? ((IEnumerable<T>)Array.Empty<T>()).GetEnumerator() :
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (5)
3034Debug.Assert(data.ConstructorArguments.Count <= 1); 3036if (data.ConstructorArguments.Count == 1) 3040else if (data.ConstructorArguments.Count == 0) 3424if ((flags & EventManifestOptions.Strict) != 0 && (manifest?.Errors.Count > 0 || exception != null)) 3428if (manifest?.Errors.Count > 0)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
87for (int i = 0; i < Keys.Count; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeData.cs (2)
58int constructorArgumentsCount = constructorArguments.Count; 67int namedArgumentsCount = namedArguments.Count;
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeTypedArgument.cs (1)
66int count = array.Count;
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (3)
46attribute.ConstructorArguments.Count == 1) 321attribute.ConstructorArguments.Count == 1) 413attribute.ConstructorArguments.Count == 1)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (3)
5953count = taskCollection.Count; 6250int count = taskCollection.Count; 6736int count = tasksAsCollection.Count;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (2)
2318int numTasks = tasks.Count; 2346int numTasks = tasks.Count;
src\System\Reflection\RuntimeCustomAttributeData.cs (2)
102CustomAttributeData[] pca = new CustomAttributeData[customAttributes.Count + pseudoAttributes.Count]; 225for (int i = 0; i < attrs.Count; i++)
src\System\Reflection\RuntimeParameterInfo.cs (2)
378Debug.Assert(args.Count == 5); 398Debug.Assert(attr.ConstructorArguments.Count == 1);
src\System\RuntimeType.CoreCLR.cs (1)
1588for (int i = 0; i < attrs.Count; i++)
System.Private.DataContractSerialization (21)
System\Runtime\Serialization\DataContract.cs (1)
1898if (nestedParameterCounts.Count > 1 || !genericNameProvider.ParametersFromBuiltInNamespaces)
System\Runtime\Serialization\DataContractSet.cs (3)
487genericParameters = new object[genInfo.Parameters.Count]; 488DataContract[] structureCheckContracts = new DataContract[genInfo.Parameters.Count]; 489for (int i = 0; i < genInfo.Parameters.Count; i++)
System\Runtime\Serialization\ExtensionDataReader.cs (6)
538if (dataNode.Members != null && _element.childElementIndex < dataNode.Members.Count) 541_context.IncrementItemCount(-dataNode.Members.Count); 557if (dataNode.Items != null && _element.childElementIndex < dataNode.Items.Count) 560_context.IncrementItemCount(-dataNode.Items.Count); 576if (dataNode.Members != null && _element.childElementIndex < dataNode.Members.Count) 579_context.IncrementItemCount(-dataNode.Members.Count);
System\Runtime\Serialization\XmlObjectSerializerContext.cs (1)
195for (int i = 0; i < knownTypeList.Count; i++)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (5)
844else if (dataNode.Size != dataNode.Items.Count) 845throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ArraySizeAttributeIncorrect, arraySize, dataNode.Items.Count)); 851dataNode.Size = dataNode.Items.Count; 1056for (int i = 0; i < xmlAttributes.Count; i++) 1063for (int i = 0; i < xmlChildNodes.Count; i++)
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (5)
428IncrementCollectionCount(xmlWriter, collection.Count); 666for (int i = 0; i < members.Count; i++) 764for (int i = 0; i < members.Count; i++) 785for (int i = 0; i < items.Count; i++) 809for (int i = 0; i < members.Count; i++)
System.Private.Xml (118)
System\Xml\Schema\XdrValidator.cs (1)
304for (int i = 0; i < context.ElementDecl.DefaultAttDefs!.Count; ++i)
System\Xml\Schema\XmlSchemaValidator.cs (1)
1024for (int i = 0; i < currentElementDecl.DefaultAttDefs!.Count; ++i)
System\Xml\Schema\XsdValidator.cs (1)
537for (int i = 0; i < context.ElementDecl.DefaultAttDefs!.Count; ++i)
System\Xml\Serialization\XmlSerializerNamespaces.cs (1)
54_namespaces = new Dictionary<string, XmlQualifiedName>(namespaces.Count);
System\Xml\XPath\Internal\FunctionQuery.cs (5)
25Query[] tmp = new Query[other._args.Count]; 49XPathResultType[] argTypes = new XPathResultType[_args.Count]; 50for (int i = 0; i < _args.Count; i++) 71object[] argVals = new object[_args.Count]; 72for (int i = 0; i < _args.Count; i++)
System\Xml\XPath\Internal\StringFunctions.cs (13)
29Query[] tmp = new Query[other._argList.Count]; 41for (int i = 0; i < _argList.Count; i++) 75if (_argList.Count > 0) 122while (count < _argList.Count) 131Debug.Assert(_argList.Count > 1); 139Debug.Assert(_argList.Count > 1); 147Debug.Assert(_argList.Count > 1); 157Debug.Assert(_argList.Count > 1); 167Debug.Assert(_argList.Count > 0); 175if (_argList.Count == 3) 208if (_argList.Count > 0) 219if (_argList.Count > 0) 257Debug.Assert(_argList.Count > 2);
System\Xml\Xsl\IlGen\StaticDataManager.cs (2)
114prefixMappings = new StringPair[list.Count]; 115for (int i = 0; i < list.Count; i++)
System\Xml\Xsl\ListBase.cs (2)
247if (_index > _sequence.Count) 259if (_index < _sequence.Count)
System\Xml\Xsl\QIL\QilNode.cs (1)
162for (int i = 0; i < list.Count; i++)
System\Xml\Xsl\QIL\QilPatternFactory.cs (1)
461switch (args.Count)
System\Xml\Xsl\QIL\QilXmlWriter.cs (1)
203if (fdecls != null && fdecls.Count > 0)
System\Xml\Xsl\Runtime\DodSequenceMerge.cs (3)
41if (sequence.Count == 0) 54_nodeCount = _firstSequence.Count; 58_nodeCount += sequence.Count;
System\Xml\Xsl\Runtime\WhitespaceRuleLookup.cs (1)
41for (int i = rules.Count - 1; i >= 0; i--)
System\Xml\Xsl\Runtime\XmlILStorageConverter.cs (2)
103XmlQueryNodeSequence seq = new XmlQueryNodeSequence(listItems.Count); 104for (int i = 0; i < listItems.Count; i++)
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (8)
79wsRules = (data.WhitespaceRules != null && data.WhitespaceRules.Count != 0) ? new WhitespaceRuleLookup(data.WhitespaceRules) : null; 510XPathNavigator[] navArray = new XPathNavigator[seq.Count]; 512for (int i = 0; i < seq.Count; i++) 530if (seq.Count == 1) 705XmlQueryCardinality card = seq.Count switch 716for (int i = 0; i < seq.Count; i++) 738if (seq.Count != 1) 860if (seq.Count <= 1)
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (2)
545public XmlQueryNodeSequence(IList<XPathNavigator> list) : base(list.Count) 547for (int idx = 0; idx < list.Count; idx++)
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (1)
209dataWriter.Write(_whitespaceRules.Count);
System\Xml\Xsl\Runtime\XslNumber.cs (3)
186if (val.Count == 1 && val[0].ValueType == typeof(double)) 201for (int idx = 0; idx < val.Count; idx++) 233int valCount = val.Count;
System\Xml\Xsl\Runtime\XsltConvert.cs (6)
58if (listItems.Count == 0) 102if (listItems.Count == 0) 138if (listItems.Count == 1) 158if (listItems.Count == 1) 189if (listItems.Count == 0) 327if (listItems.Count == 1)
System\Xml\Xsl\Runtime\XsltFunctions.cs (2)
270if (value.Count != 1) 315if (value.Count == 0)
System\Xml\Xsl\Runtime\XsltLibrary.cs (8)
92string[] arr = new string[args.Count]; 403return CompareNumbers(op, (nodeset.Count != 0) ? 1 : 0, XsltConvert.ToBoolean(val) ? 1 : 0); 407int length = nodeset.Count; 421int leftLen = left.Count; 422int rightLen = right.Count; 560if (val.Count == 1) 568int count = val.Count; 587if (val.Count == 1)
System\Xml\Xsl\XPath\XPathBuilder.cs (12)
575case FuncId.LocalName: return args.Count == 0 ? _f.LocalNameOf(GetCurrentNode()) : LocalNameOfFirstNode(args[0]); 576case FuncId.NamespaceUri: return args.Count == 0 ? _f.NamespaceUriOf(GetCurrentNode()) : NamespaceOfFirstNode(args[0]); 577case FuncId.Name: return args.Count == 0 ? NameOf(GetCurrentNode()) : NameOfFirstNode(args[0]); 578case FuncId.String: return args.Count == 0 ? _f.XPathNodeValue(GetCurrentNode()) : _f.ConvertToString(args[0]); 579case FuncId.Number: return args.Count == 0 ? _f.XsltConvert(_f.XPathNodeValue(GetCurrentNode()), T.DoubleX) : _f.ConvertToNumber(args[0]); 590return args.Count == 2 ? _f.InvokeSubstring(args[0], args[1]) : _f.InvokeSubstring(args[0], args[1], args[2]); 592return _f.XsltConvert(_f.StrLength(args.Count == 0 ? _f.XPathNodeValue(GetCurrentNode()) : args[0]), T.DoubleX); 594return _f.InvokeNormalizeSpace(args.Count == 0 ? _f.XPathNodeValue(GetCurrentNode()) : args[0]); 1033CheckArity(this.minArgs, this.maxArgs, name, args.Count); 1039for (int i = 0; i < args.Count; i++) 1046Debug.Assert(args.Count == 0 || argTypes != null); 1047for (int i = 0; i < args.Count; i++)
System\Xml\Xsl\Xslt\QilGenerator.cs (12)
512for (int i = 0; i < tmpl.Content.Count; i++) 701for (int i = from; i < instructions.Count; i++) 767i = instructions.Count; 1174for (int i = 0; i < content.Count; i++) 1260if (content.Count > 0) 1414for (int i = cases.Count - 1; 0 <= i; i--) 1485else if (content.Count != 0) 1525while (i < content.Count) 2530if (args.Count <= pos || args[pos].Name != name) 2568if (actualArgs.Count != formalArgs.Count) 2579for (int actArg = 0; actArg < actualArgs.Count; actArg++) 2660for (int i = 0; i < actualArgs!.Count; i++)
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (19)
126case FuncId.Document: return CompileFnDocument(args[0], args.Count > 1 ? args[1] : null); 127case FuncId.FormatNumber: return CompileFormatNumber(args[0], args[1], args.Count > 2 ? args[2] : null); 129case FuncId.GenerateId: return CompileGenerateId(args.Count > 0 ? args[0] : env.GetCurrent()!); 151FunctionInfo.CheckArity(/*minArg:*/1, /*maxArg:*/1, name, args.Count); 156FunctionInfo.CheckArity(/*minArg:*/2, /*maxArg:*/4, name, args.Count); 160/*lang: */2 < args.Count ? _f.ConvertToString(args[2]) : _f.String(string.Empty), 161/*options:*/3 < args.Count ? _f.ConvertToString(args[3]) : _f.String(string.Empty) 166FunctionInfo.CheckArity(/*minArg:*/1, /*maxArg:*/1, name, args.Count); 171FunctionInfo.CheckArity(/*minArg:*/1, /*maxArg:*/3, name, args.Count); 174/*format: */1 < args.Count ? _f.ConvertToString(args[1]) : _f.String(string.Empty), 175/*lang: */2 < args.Count ? _f.ConvertToString(args[2]) : _f.String(string.Empty), 181FunctionInfo.CheckArity(/*minArg:*/1, /*maxArg:*/1, name, args.Count); 186FunctionInfo.CheckArity(/*minArg:*/1, /*maxArg:*/1, name, args.Count); 191FunctionInfo.CheckArity(/*minArg:*/1, /*maxArg:*/1, name, args.Count); 200FunctionInfo.CheckArity(/*minArg:*/1, /*maxArg:*/1, name, args.Count); 205FunctionInfo.CheckArity(/*minArg:*/1, /*maxArg:*/1, name, args.Count); 213for (int i = 0; i < args.Count; i++) 218XmlExtensionFunction? scrFunc = _compiler.Scripts.ResolveFunction(name, ns, args.Count, (IErrorHelper)this); 241for (int i = 0; i < args.Count; i++)
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (2)
298args.Count == 1 && args[0].NodeType == QilNodeType.LiteralString, 307args.Count == 2 &&
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (8)
424VarPar?[] typeDonors = new VarPar[node.Content.Count]; 703if (node.Content.Count != 0) 720else if (node.Content.Count != 0) 1080if (args.Count == 0 && ( 1101else if (funcId == QilGenerator.FuncId.GenerateId && args.Count == 0) 1139XmlExtensionFunction? scrFunc = _compiler.Scripts.ResolveFunction(name, ns, args.Count, default(NullErrorHelper)); 1352int last = content.Count - 1; 1478Debug.Assert(parent.Content.Count == split + 1);
System.Private.Xml.Linq (1)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
37int count = ic.Count;
System.Reflection.Context (3)
System\Reflection\Context\Projection\Projector.cs (3)
15if (values == null || values.Count == 0) 126Debug.Assert(values != null && values.Count > 0); 128var projected = new T[values.Count];
System.Reflection.MetadataLoadContext (9)
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (3)
31int count = cats.Count; 45int count = cans.Count; 65int count = cats.Count;
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeHelpers.cs (2)
108int count = catgs.Count; 139int count = cangs.Count;
System\Reflection\TypeLoading\General\Ecma\EcmaDefaultValueProcessing.cs (2)
94if (cats.Count != 1) 110if (cats.Count != 5)
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (1)
136if (ctas.Count != 1)
System\Reflection\TypeLoading\Types\RoType.cs (1)
306if (fixedArguments.Count == 1 && fixedArguments[0].Value is string memberName)
System.Runtime.Caching (2)
System\Runtime\Caching\HostFileChangeMonitor.cs (2)
167if (filePaths.Count == 0) 180List<string> newList = new List<string>(filePaths.Count);
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (1)
140Debug.Assert(elementNames != null && elementNames.Count > 0);
System.Security.Cryptography.Pkcs (1)
System\Security\Cryptography\Pkcs\RecipientInfoCollection.cs (1)
25_recipientInfos = new RecipientInfo[recipientInfos.Count];
System.ServiceModel.Federation.Tests (1)
WSTrustChannelSecurityTokenProviderTest.cs (1)
73Assert.Equal(2, trustRequest.AdditionalXmlElements.Count);
System.ServiceModel.Syndication (3)
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (2)
35for (int i = 0; i < source.Items.Count; ++i) 150for (int i = 0; i < Items.Count; ++i)
System\ServiceModel\Syndication\SyndicationFeed.cs (1)
94for (int i = 0; i < srcList.Count; ++i)
System.Text.Json (4)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
108int count = children.Count;
System\Text\Json\Nodes\JsonObject.cs (1)
38int capacity = properties is ICollection<KeyValuePair<string, JsonNode?>> propertiesCollection ? propertiesCollection.Count : 0;
System\Text\Json\Schema\JsonSchemaExporter.cs (1)
97if (parentPolymorphicTypeInfo is null && typeInfo.PolymorphismOptions is { DerivedTypes.Count: > 0 } polyOptions)
System\Text\Json\Serialization\JsonSerializerContext.cs (1)
61options.Converters.Count == 0 &&
System.Text.Json.SourceGeneration (1)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
108int count = children.Count;
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\CollectionDebuggerProxy.cs (1)
24var items = new T[_collection.Count];
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (1)
172static T Choose<T>(Random random, IList<T> elems) => elems[random.Next(elems.Count)];
System.Threading.Tasks.Dataflow (3)
Blocks\TransformManyBlock.cs (2)
372UpdateBoundingCountWithOutputCount(count: itemAsTrustedList.Count); 440if (_target.IsBounded) UpdateBoundingCountWithOutputCount(count: ((ICollection<TOutput>)outputItems).Count);
Blocks\WriteOnceBlock.cs (1)
179if (exceptions != null && exceptions.Count > 0)
System.Threading.Tasks.Parallel (5)
System\Threading\Tasks\Parallel.cs (5)
17680, list.Count, parallelOptions, (i) => body(list[i]), null, null, null, null); 17730, list.Count, parallelOptions, null, (i, state) => bodyWithState(list[i], state), null, null, null); 17780, list.Count, parallelOptions, null, (i, state) => bodyWithStateAndIndex(list[i], state, i), null, null, null); 17830, list.Count, parallelOptions, null, null, (i, state, local) => bodyWithStateAndLocal(list[i], state, local), localInit, localFinally); 17880, list.Count, parallelOptions, null, null, (i, state, local) => bodyWithEverything!(list[i], state, i, local), localInit, localFinally);
System.Windows.Forms (2)
misc\CollectionHelper.cs (1)
24if (target.Length - index < source.Count)
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (1)
511Index = properties.Count,
System.Windows.Forms.Design (5)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (2)
588defaultPropList ??= new(data.Members.Count); 628defaultPropList ??= new(data.Members.Count);
System\Windows\Forms\Design\FlowPanelDesigner.cs (1)
20for (int i = snapLines.Count - 1; i >= 0; i--)
System\Windows\Forms\Design\FormDocumentDesigner.cs (1)
201for (int i = 0; i < snapLines.Count; i++)
System\Windows\Forms\Design\LabelDesigner.cs (1)
77for (int i = 0; i < snapLines.Count; i++)
System.Windows.Forms.Primitives (1)
System\Windows\Forms\FileDialogCustomPlacesCollection.cs (1)
12for (int i = Items.Count - 1; i >= 0; --i)
System.Windows.Forms.Tests (31)
System\Windows\Forms\CursorConverterTests.cs (1)
195Assert.Equal(28, values.Count);
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (21)
247Assert.Equal(2, neighboringToolsRectangles.Count); 265Assert.Equal(3, neighboringToolsRectangles.Count); 284Assert.Equal(2, neighboringToolsRectangles.Count); 302Assert.Equal(3, neighboringToolsRectangles.Count); 321Assert.Equal(4, neighboringToolsRectangles.Count); 341Assert.Equal(3, neighboringToolsRectangles.Count); 360Assert.Equal(2, neighboringToolsRectangles.Count); 378Assert.Equal(3, neighboringToolsRectangles.Count); 397Assert.Equal(2, neighboringToolsRectangles.Count); 416Assert.Equal(2, neighboringToolsRectangles.Count); 436Assert.Equal(3, neighboringToolsRectangles.Count); 457Assert.Equal(2, neighboringToolsRectangles.Count); 477Assert.Equal(3, neighboringToolsRectangles.Count); 498Assert.Equal(4, neighboringToolsRectangles.Count); 520Assert.Equal(3, neighboringToolsRectangles.Count); 541Assert.Equal(2, neighboringToolsRectangles.Count); 560Assert.Equal(3, neighboringToolsRectangles.Count); 580Assert.Equal(2, neighboringToolsRectangles.Count); 597Assert.Equal(2, neighboringToolsRectangles.Count); 614Assert.Equal(3, neighboringToolsRectangles.Count); 632Assert.Equal(2, neighboringToolsRectangles.Count);
System\Windows\Forms\ScrollBarTests.cs (1)
2493Assert.Equal(expected.Count, callCount);
System\Windows\Forms\TreeNode.IKeyboardToolTipTests.cs (8)
142Assert.Equal(2, neighboringRectangles.Count); 177Assert.Equal(2, neighboringRectangles.Count); 196Assert.Equal(2, neighboringRectangles.Count); 215Assert.Equal(2, neighboringRectangles.Count); 236Assert.Equal(2, neighboringRectangles.Count); 255Assert.Equal(2, neighboringRectangles.Count); 276Assert.Equal(2, neighboringRectangles.Count); 296Assert.Equal(2, neighboringRectangles.Count);
System.Xaml (43)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (2)
1305_count = collection.Count; 1991int count = collection.Count;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (4)
255for (int j = 0; j < list.Count; j++) 288for (int j = 0; j < list.Count && !attributeDataFound; j++) 332if (constructorArguments.Count == 1 && !noArgs) 351else if (constructorArguments.Count == 0)
System\Xaml\Context\XamlContext.cs (1)
386XamlType[] typeArgArray = new XamlType[typeArguments.Count];
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1250int paramTypesCount = paramTypes.Count;
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
441string[] keys = new string[dict.Count];
System\Xaml\Schema\Reflector.cs (6)
445if (cad.ConstructorArguments.Count == 1) 460if (cad.ConstructorArguments.Count != count) 495if (cad.ConstructorArguments.Count == 0) 500if (cad.ConstructorArguments.Count > 1 || 520for (int i = 0; i < _attributeData.Count; i++) 534for (int i = 0; i < _attributeData.Count; i++)
System\Xaml\Schema\XamlTypeInvoker.cs (1)
151(_xamlType.AllowedContentTypes.Count == 1 && contentType.CanAssignTo(_xamlType.ItemType)))
System\Xaml\Schema\XamlTypeTypeConverter.cs (2)
105typeArgs = new XamlType[typeName.TypeArguments.Count]; 106for (int i = 0; i < typeName.TypeArguments.Count; i++)
System\Xaml\XamlMember.cs (1)
213if (namespaces.Count > 0)
System\Xaml\XamlObjectReader.cs (5)
728for(int i = 0; i < itemsList.Count; i++) 766bool isLastElementOfCollection = (i == (itemsList.Count - 1)); 1096if (property.XamlNode.Member.DependsOn.Count > 0) 1181if (types is null || types.Count == 0) 1686if (constructorArguments.Count == properties.Count)
System\Xaml\XamlSchemaContext.cs (7)
291typeArgs = new XamlType[xamlTypeName.TypeArguments.Count]; 292for (int i = 0; i < xamlTypeName.TypeArguments.Count; i++) 786if (friends.Count == 0) 835for (int i = _unexaminedAssemblies.Count - 1; i >= 0; i--) 1125for (int i = 0; i < unexaminedAssembliesCopy.Count; i++) 1153for (int j = i; j < unexaminedAssembliesCopy.Count; j++) 1188int xmlnsDefsCount = xmlnsDefs.Count;
System\Xaml\XamlType.cs (12)
136if (namespaces.Count > 0) 729List<XamlType> result = new List<XamlType>(contentWrappers.Count + 1); 1473for (int i = 0; i < TypeArguments.Count; i++) 1476if (i < TypeArguments.Count - 1) 1569if (list.Count > 0) 1579if (typeArguments is null || typeArguments.Count == 0) 1665List<XamlMember> result = new List<XamlMember>(excludedMembers.Count); 1666for (int i = 0; i < excludedMembers.Count; i++) 1852if (_typeArguments is not null && _typeArguments.Count > 0) 1943if (xamlType1._typeArguments.Count != xamlType2._typeArguments.Count) 1948for (int i = 0; i < xamlType1._typeArguments.Count; i++)
System.Xaml.Tests (2)
System\Xaml\XamlTypeTests.cs (2)
37Assert.Equal(typeArguments != null && typeArguments.Count > 0 ? typeArguments : null, type.TypeArguments); 67Assert.Equal(typeArguments != null && typeArguments.Count > 0 ? typeArguments : null, type.TypeArguments);
vbc (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
85var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 101for (int i = 0; i < args.Count; ++i)
VBCSCompiler (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
85var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 101for (int i = 0; i < args.Count; ++i)
WindowsBase.Tests (16)
System\Windows\NameScopeTests.cs (16)
133Assert.Equal(1, nameScope.Keys.Count); 136Assert.Equal(1, nameScope.Values.Count); 146Assert.Equal(1, nameScope.Keys.Count); 149Assert.Equal(1, nameScope.Values.Count); 254Assert.Equal(1, nameScope.Keys.Count); 257Assert.Equal(1, nameScope.Values.Count); 267Assert.Equal(1, nameScope.Keys.Count); 270Assert.Equal(1, nameScope.Values.Count); 348Assert.Equal(1, nameScope.Keys.Count); 351Assert.Equal(1, nameScope.Values.Count); 361Assert.Equal(1, nameScope.Keys.Count); 364Assert.Equal(1, nameScope.Values.Count); 851Assert.Equal(1, nameScope.Keys.Count); 854Assert.Equal(1, nameScope.Values.Count); 864Assert.Equal(1, nameScope.Keys.Count); 867Assert.Equal(1, nameScope.Values.Count);
XmlFileLogger (1)
LogProcessNode.cs (1)
126if (Properties.Properties.Count > 0)
xunit.assert (2)
Sdk\CollectionTracker.cs (2)
359 if (setX.Count != setY.Count)
xunit.console (1)
ConsoleRunner.cs (1)
47if (commandLine.Project.Assemblies.Count == 0)