796 implementations of Count
Analyzer.Utilities.UnitTests (1)
Extensions\IEnumerableExensionsTests.cs (1)
117public int Count { get; }
aspire (1)
src\Shared\CircularBuffer.cs (1)
48public int Count => _buffer.Count;
Aspire.Dashboard (1)
src\Shared\CircularBuffer.cs (1)
48public int Count => _buffer.Count;
Aspire.Hosting (2)
ApplicationModel\ResourceCollection.cs (1)
20public 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; } }
GenerateDocumentationAndConfigFiles (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
InMemory.FunctionalTests (2)
Http2\Http2ConnectionTests.cs (1)
297public int Count => _innerHeaders.Count;
Http3\Http3ConnectionTests.cs (1)
914public int Count => _innerHeaders.Count;
Metrics (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
Metrics.Legacy (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
Microsoft.AspNetCore.Components (1)
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
312public int Count => _count;
Microsoft.AspNetCore.Components.Endpoints (1)
TempData\TempData.cs (1)
117int ICollection<KeyValuePair<string, object?>>.Count => Data.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)
1390public 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.HttpOverrides (2)
DualIPNetworkList.cs (2)
32int ICollection<IPNetwork>.Count => _system.Count; 33int ICollection<AspNetIPNetwork>.Count => _aspnet.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)
193int 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)
1198public 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.CodeAnalysis (26)
Collections\IdentifierCollection.Collection.cs (1)
39public int Count
Collections\UnionCollection.cs (1)
107public int Count
InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.Analyzers (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
Microsoft.CodeAnalysis.AnalyzerUtilities (26)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DictionaryAnalysisData.cs (1)
67public int Count
Microsoft.CodeAnalysis.BannedApiAnalyzers (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
Microsoft.CodeAnalysis.CodeStyle (24)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.Collections.Package (23)
Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.Debugging.Package (1)
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.Extensions.Package (23)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.InteractiveHost (23)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
Microsoft.CodeAnalysis.PooledObjects.Package (1)
ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.PublicApiAnalyzers (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
Microsoft.CodeAnalysis.ResxSourceGenerator (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
Microsoft.CodeAnalysis.Scripting (1)
Hosting\SynchronizedList.cs (1)
36public int Count
Microsoft.CodeAnalysis.Threading.Package (23)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public 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\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (24)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public 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 (5)
AdditionalPropertiesDictionary{TValue}.cs (1)
74public int Count => _dictionary.Count;
Embeddings\GeneratedEmbeddings.cs (1)
56public int Count => _embeddings.Count;
Functions\AIFunctionArguments.cs (1)
111public int Count => _arguments.Count;
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.BuildMetadata.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.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;
PresentationCore (41)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
734public int Count
MS\Internal\FontFace\TypefaceCollection.cs (1)
77public int Count
MS\Internal\PartialArray.cs (1)
113public int Count
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (1)
55public int Count
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (1)
50public int Count
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (1)
119public abstract int Count
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\PartialList.cs (1)
113public int Count
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SequentialUshortCollection.cs (1)
54public int Count
System\Windows\FreezableCollection.cs (1)
344public int Count
System\Windows\Generated\TextDecorationCollection.cs (1)
256public int Count
System\Windows\Media\Animation\Generated\TimelineCollection.cs (1)
255public int Count
System\Windows\Media\Animation\TimelineClockCollection.cs (1)
23public int Count
System\Windows\Media\CharacterMetricsDictionary.cs (1)
59public int Count
System\Windows\Media\CultureSpecificStringDictionary.cs (1)
63public int Count
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (1)
258public int Count
System\Windows\Media\FamilyMapCollection.cs (1)
135public int Count
System\Windows\Media\FamilyTypefaceCollection.cs (1)
122public int Count
System\Windows\Media\Fonts.cs (1)
330public int Count
System\Windows\Media\Generated\DoubleCollection.cs (1)
217public int Count
System\Windows\Media\Generated\DrawingCollection.cs (1)
277public int Count
System\Windows\Media\Generated\GeneralTransformCollection.cs (1)
265public int Count
System\Windows\Media\Generated\GeometryCollection.cs (1)
277public int Count
System\Windows\Media\Generated\GradientStopCollection.cs (1)
265public int Count
System\Windows\Media\Generated\Int32Collection.cs (1)
217public int Count
System\Windows\Media\Generated\PathFigureCollection.cs (1)
266public int Count
System\Windows\Media\Generated\PathSegmentCollection.cs (1)
265public int Count
System\Windows\Media\Generated\PointCollection.cs (1)
217public int Count
System\Windows\Media\Generated\TextEffectCollection.cs (1)
265public int Count
System\Windows\Media\Generated\TransformCollection.cs (1)
277public int Count
System\Windows\Media\Generated\VectorCollection.cs (1)
217public int Count
System\Windows\Media\GlyphRun.cs (2)
2142public int Count 2244public int Count
System\Windows\Media\GlyphTypeface.cs (2)
1827public int Count 1912public int Count
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (1)
263public int Count
System\Windows\Media3D\Generated\MaterialCollection.cs (1)
275public int Count
System\Windows\Media3D\Generated\Model3DCollection.cs (1)
275public int Count
System\Windows\Media3D\Generated\Point3DCollection.cs (1)
215public int Count
System\Windows\Media3D\Generated\Transform3DCollection.cs (1)
275public int Count
System\Windows\Media3D\Generated\Vector3DCollection.cs (1)
215public int Count
System\Windows\Media3D\Visual3DCollection.cs (1)
259public int Count
PresentationFramework (19)
MS\Internal\Annotations\ObservableDictionary.cs (1)
218public int Count
MS\Internal\Data\RBTree.cs (1)
579public int Count
MS\Internal\Documents\ContentElementCollection.cs (1)
536public int Count
MS\Internal\ListOfObject.cs (1)
74int ICollection<object>.Count
MS\Internal\WeakDictionary.cs (3)
55public int Count 142public int Count 309public int Count
MS\Internal\WeakHashSet.cs (1)
56public int Count
System\Windows\Controls\ColumnDefinition.cs (1)
371public int Count // int ICollection.Count {get;}; int ICollection<T>.Count {get;}
System\Windows\Controls\CustomDictionarySources.cs (1)
168int ICollection<Uri>.Count
System\Windows\Controls\RowDefinition.cs (1)
366public int Count // int ICollection.Count {get;}; int ICollection<T>.Count {get;}
System\Windows\Controls\VirtualizedCellInfoCollection.cs (1)
396public int Count
System\Windows\Data\XmlNamespaceMappingCollection.cs (1)
170public int Count
System\Windows\Documents\TableCellCollection.cs (1)
350public int Count
System\Windows\Documents\TableColumnCollection.cs (1)
357public int Count
System\Windows\Documents\TableRowCollection.cs (1)
350public int Count
System\Windows\Documents\TableRowGroupCollection.cs (1)
350public int Count
System\Windows\Documents\TextElementCollection.cs (1)
149public int Count
System\Windows\TriggerActionCollection.cs (1)
48public int Count
Roslyn.Diagnostics.Analyzers (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.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)
237public int Count => _count; 1476public int Count => _dictionary.Count; 1671public int Count => _dictionary.Count;
System\Collections\Generic\SortedDictionary.cs (3)
137public int Count 587public int Count 748public 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)
366public 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)
136public int Count
System\Collections\Immutable\ImmutableDictionary_2.cs (1)
133public 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)
66public int Count
System\Collections\Immutable\ImmutableList_1.cs (1)
142public int Count => _root.Count;
System\Collections\Immutable\ImmutableSortedDictionary_2.Builder.cs (1)
114public int Count
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
108public int Count
System\Collections\Immutable\ImmutableSortedSet_1.Builder.cs (1)
72public 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)
131public 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\net11.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)
726public 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)
40public int Count => int.CreateTruncating(_endExclusive - _start);
System\Linq\Repeat.SpeedOpt.cs (1)
34public int Count => _count;
System\Linq\SkipTake.SpeedOpt.cs (1)
104public int Count => GetAdjustedCount(_minIndexInclusive, _maxIndexInclusive, _source.Count);
System.Linq.AsyncEnumerable (2)
System\Linq\GroupBy.cs (1)
437int ICollection<TElement>.Count => _count;
System\Linq\ToLookupAsync.cs (1)
226public int Count => 0;
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 (14)
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (1)
71public int Count => _count;
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (1)
1136public int Count
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (3)
209public int Count => _count - _freeCount; 1927public int Count => _dictionary.Count; 2122public 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\net11.0\System.Security.Principal.Windows.notsupported.cs (1)
46public int Count { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } }
System.ServiceModel.Primitives (4)
System\ServiceModel\Channels\MessageProperties.cs (1)
97public int Count
System\ServiceModel\ServiceChannelManager.cs (1)
348public int Count
System\ServiceModel\SynchronizedCollection.cs (1)
55public int Count
System\ServiceModel\SynchronizedReadOnlyCollection.cs (1)
73public int Count
System.Speech (1)
artifacts\obj\System.Speech\Debug\net11.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)
129public int Count => Dictionary.Count;
System\Text\Json\Serialization\ConfigurationList.cs (1)
46public 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)
579public int Count => throw new NotImplementedException();
System.Xaml (2)
System\Xaml\NameScope.cs (1)
106public int Count => _nameMap?.Count ?? 0;
System\Xaml\NameScopeDictionary.cs (1)
244int 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();
Test.Utilities (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
Text.Analyzers (25)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (1)
58public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
126int ICollection<T>.Count => Length;
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\Dependencies\Collections\Specialized\SpecializedCollections.Empty.Collection.cs (1)
43public int Count => 0;
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
44public int Count
src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (1)
54public int Count => _dictionary.Count;
4070 references to Count
aspire (7)
Commands\ExecCommand.cs (1)
108if (commandTokens is null || commandTokens.Count == 0)
Commands\GroupedHelpWriter.cs (1)
263if (cmd.Arguments.Count == 0)
Commands\LogsCommand.cs (4)
209if (tail.HasValue && entries.Count > tail.Value) 211entries = entries.Skip(entries.Count - tail.Value).ToList(); 262var tailedEntries = entries.Count > tail.Value 263? entries.Skip(entries.Count - tail.Value)
Commands\TelemetryCommandHelpers.cs (1)
173if (resources is null || resources.Count == 0)
Aspire.Cli.EndToEnd.Tests (1)
McpDocsE2ETests.cs (1)
308if (result.Content is not { Count: > 0 })
Aspire.Cli.Tests (1)
Mcp\E2E\McpDocsE2ETests.cs (1)
271if (result.Content is not { Count: > 0 })
Aspire.Dashboard (9)
Components\Controls\Chart\ChartBase.cs (2)
229for (var i = dimensionValues.Count - 1; i >= 0; i--) 446for (var i = dimensionValues.Count - 1; i >= 0; i--)
Components\Controls\Chart\MetricTable.razor.cs (1)
70if (xValuesToAnnounce.Count == 0)
Components\Controls\LogViewer.razor.cs (1)
96return ValueTask.FromResult(new ItemsProviderResult<LogEntry>(entries.Skip(r.StartIndex).Take(r.Count), entries.Count));
Model\Assistant\AIHelpers.cs (2)
329if (newMessages.Count > 0) 354if (contentsList.Count > 0)
Model\GenAI\GenAISchemaHelpers.cs (1)
200if (itemTypeNames.Count == 1)
ServiceClient\DashboardClient.cs (2)
734var resourceLogLines = new ResourceLogLine[logLines.Count]; 736for (var i = 0; i < logLines.Count; i++)
Aspire.Dashboard.Tests (9)
Model\GenAISchemaHelpersTests.cs (2)
72Assert.Equal(2, typeNames.Count); 191Assert.Equal(2, schema.Properties.Count);
Model\GenAIVisualizerDialogViewModelTests.cs (6)
1166Assert.Equal(2, tool.ToolDefinition.Parameters.Properties.Count); 1177Assert.Equal(2, unitProp.Enum.Count); 1182Assert.Equal(2, tool.ToolDefinition.Parameters.Required.Count); 1528Assert.Equal(3, tool.ToolDefinition.Parameters.Properties.Count); 1634Assert.Equal(3, tool.ToolDefinition.Parameters.Properties.Count); 2118Assert.Equal(2, tool.ToolDefinition.Parameters.Properties.Count);
TelemetryRepositoryTests\MetricsTests.cs (1)
1249Assert.Equal(valueCount, scope.Values.Count);
Aspire.Hosting (9)
Ats\CollectionExports.cs (6)
83=> dict.Count; 123=> index >= 0 && index < list.Count ? list[index] : null; 134if (index >= 0 && index < list.Count) 158if (index >= 0 && index < list.Count) 173=> list.Count; 192if (index >= 0 && index <= list.Count)
DistributedApplication.cs (1)
609var results = new List<ResourceStateDebugView>(app._model.Resources.Count);
Orchestrator\ParameterProcessor.cs (2)
457while (unresolvedParameters.Count > 0) 558if (unresolvedParameters.Count == 0)
Aspire.Hosting.Azure (2)
AzureProvisioningResource.cs (1)
92Debug.Assert(compilation.Count == 1);
AzurePublishingContext.cs (1)
88if (model.Resources.Count == 0)
Aspire.Hosting.Docker (1)
DockerComposePublishingContext.cs (1)
55if (model.Resources.Count == 0)
Aspire.Hosting.Kubernetes (1)
KubernetesPublishingContext.cs (1)
56if (model.Resources.Count == 0)
Aspire.Hosting.RemoteHost.Tests (2)
AtsMarshallerTests.cs (2)
495Assert.Equal(3, list.Count); 521Assert.Equal(2, dict.Count);
Aspire.Hosting.Tests (21)
ApplicationModel\Docker\DockerfileBuilderCallbackAnnotationTests.cs (2)
117Assert.Equal(3, context.Builder.Stages[0].Statements.Count); // FROM + WORKDIR + RUN 230Assert.Equal(4, context.Builder.Stages[0].Statements.Count); // FROM + WORKDIR + RUN + COPY
ApplicationModel\Docker\DockerfileBuilderCallbackContextTests.cs (1)
102Assert.Equal(3, context.Builder.Stages[0].Statements.Count); // FROM + WORKDIR + RUN
ApplicationModel\Docker\DockerfileBuilderEdgeCasesTests.cs (3)
58Assert.Equal(2, stage.Statements.Count); 155Assert.Equal(3, stage.Statements.Count); // FROM + 2 RUN 161Assert.Equal(2, stage.Statements.Count); // FROM + 1 RUN
ApplicationModel\Docker\DockerfileBuilderIntegrationTests.cs (3)
73Assert.Equal(4, stage.Statements.Count); // FROM + WORKDIR + RUN + ENV 79Assert.Equal(3, stage.Statements.Count); 155Assert.Equal(8, stage.Statements.Count); // FROM + WORKDIR + COPY + RUN + COPY + ENV + EXPOSE + CMD
ApplicationModel\Docker\DockerfileStageTests.cs (12)
25Assert.Equal(2, stage.Statements.Count); // FROM + WORKDIR 52Assert.Equal(2, stage.Statements.Count); // FROM + RUN 79Assert.Equal(2, stage.Statements.Count); // FROM + COPY 108Assert.Equal(2, stage.Statements.Count); // FROM + COPY --from 139Assert.Equal(2, stage.Statements.Count); // FROM + ENV 177Assert.Equal(2, stage.Statements.Count); // FROM + EXPOSE 205Assert.Equal(2, stage.Statements.Count); // FROM + CMD 242Assert.Equal(2, stage.Statements.Count); // FROM + USER 273Assert.Equal(7, stage.Statements.Count); // FROM + WORKDIR + COPY + RUN + ENV + EXPOSE + CMD 290Assert.Equal(5, stage.Statements.Count); // FROM + WORKDIR + COPY + USER + CMD 305Assert.Equal(2, stage.Statements.Count); // FROM + COMMENT 499Assert.Equal(8, stage.Statements.Count); // FROM + COMMENT + WORKDIR + COPY + RUN + COMMENT + COPY + CMD
Aspire.RabbitMQ.Client (1)
src\Components\Aspire.RabbitMQ.Client\RabbitMQEventSourceLogForwarder.cs (1)
111Debug.Assert(exData is not null && exData.Count == 4);
aspire-managed (1)
NuGet\Commands\LayoutCommand.cs (1)
118Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "Libraries: {0}", target.Libraries.Count));
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\Shared\BuildProtocol.cs (2)
87var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 103for (int i = 0; i < args.Count; ++i)
dotnet-dev-certs (1)
Program.cs (1)
309if (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)
878Dictionary<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)
808LockFileTarget 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));
GenerateDocumentationAndConfigFiles (52)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 200Contract.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)
HostFilteringSample (1)
Startup.cs (1)
28if (options.AllowedHosts == null || options.AllowedHosts.Count == 0)
IdentitySample.Mvc (5)
artifacts\obj\IdentitySample.Mvc\Release\net11.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Views\Manage\Index_cshtml.g.cs (1)
203Model.Logins.Count
artifacts\obj\IdentitySample.Mvc\Release\net11.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Views\Manage\ManageLogins_cshtml.g.cs (3)
134if (Model.CurrentLogins.Count > 0) 144for (var index = 0; index < Model.CurrentLogins.Count; index++) 308if (Model.OtherLogins.Count > 0)
Controllers\ManageController.cs (1)
309ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1;
illink (6)
InMemory.FunctionalTests (4)
Http2\Http2ConnectionTests.cs (3)
297public int Count => _innerHeaders.Count; 3655Assert.Equal(4, settings.Count); 3712Assert.Equal(5, settings.Count);
Http3\Http3ConnectionTests.cs (1)
914public int Count => _innerHeaders.Count;
Interop.FunctionalTests (1)
Http3\Http3RequestTests.cs (1)
1506Logger.LogInformation($"Server trailer count: {feature.Trailers.Count}");
Metrics (47)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
Metrics.Legacy (47)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
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)
268if (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 (5)
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)
WebApplicationBuilder.cs (2)
416if (_builtApplication.DataSources.Count > 0) 460if (_builtApplication.DataSources.Count > 0)
WebHost.cs (1)
260if (options.AllowedHosts == null || options.AllowedHosts.Count == 0)
Microsoft.AspNetCore.AsyncState (1)
src\Shared\Throw\Throw.cs (1)
268if (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.BearerToken (1)
BearerTokenJsonSerializerContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
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)
457Assert.Equal(2, transaction.SetCookie.Count);
GoogleTests.cs (8)
567Assert.Equal(2, transaction.SetCookie.Count); 730Assert.Equal(2, transaction.SetCookie.Count); 770Assert.Equal(2, transaction.SetCookie.Count); 891Assert.Equal(2, transaction.SetCookie.Count); 935Assert.Equal(2, transaction.SetCookie.Count); 979Assert.Equal(2, transaction.SetCookie.Count); 1016Assert.Equal(2, transaction.SetCookie.Count); 1090Assert.Equal(2, transaction.SetCookie.Count);
MicrosoftAccountTests.cs (2)
252Assert.Equal(2, transaction.SetCookie.Count); 357Assert.Equal(2, transaction.SetCookie.Count);
OpenIdConnect\OpenIdConnectChallengeTests.cs (1)
456Assert.Equal(2, challengeCookies.Count);
OpenIdConnect\OpenIdConnectTests.cs (1)
541Assert.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.Authentication.Twitter (1)
TwitterJsonContext.g.cs (1)
58for (int i = 0; i < options.Converters.Count; i++)
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 (6)
ParameterView.cs (1)
305var builder = new ParameterViewBuilder(parameters.Count);
PersistentComponentState.cs (1)
247if (_existingState == null || _existingState.Count > 0)
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 (13)
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++)
ImportMapSerializerContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
JsonTempDataSerializerContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
PrerenderComponentApplicationStoreSerializerContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
Rendering\EndpointHtmlRenderer.cs (1)
269var result = new List<StringValues>(form.Keys.Count);
ResourceCollectionSerializerContext.g.cs (1)
62for (int i = 0; i < options.Converters.Count; i++)
TempData\CookieTempDataProvider.cs (1)
126if (values.Count == 0)
TempData\JsonTempDataSerializer.cs (2)
14var dataDict = new Dictionary<string, object?>(data.Count); 144var normalizedData = new Dictionary<string, object?>(data.Count);
TempData\SessionStorageTempDataProvider.cs (1)
67if (values.Count == 0)
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)
350_ariaBodyRowCount = _currentNonVirtualizedViewItems.Count;
Microsoft.AspNetCore.Components.Server (12)
Builder\ServerRazorComponentsEndpointConventionBuilderExtensions.cs (1)
50for (var i = 0; i < b.Metadata.Count; i++)
CircuitPersistenceManagerSerializerContext.g.cs (1)
58for (int i = 0; i < options.Converters.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)
82for (var i = 0; i < c.Metadata.Count; i++)
PrerenderComponentApplicationStoreSerializerContext.g.cs (1)
56for (int i = 0; i < options.Converters.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.Server.Tests (2)
Circuits\CircuitHostTest.cs (1)
891for (var i = 0; i < parameterValues.Count; i++)
Circuits\RemoteRendererTest.cs (1)
692for (var i = 0; i < parameterValues.Count; i++)
Microsoft.AspNetCore.Components.Tests (9)
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 (4)
81Assert.Equal(2, batch.DiffsByComponentId.Count); 2982Assert.Equal(4, batch.DiffsInOrder.Count); 3436Assert.Equal(2, batch2.DiffsInOrder.Count); // Parent and first child 5198builder.AddContent(0, $"Count: {items.Count}");
RouteViewTest.cs (1)
92Assert.Equal(4, batch.DiffsInOrder.Count);
Microsoft.AspNetCore.Components.Web (2)
Virtualization\Virtualize.cs (1)
460Items!.Count));
WebRendererSerializerContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
Microsoft.AspNetCore.Components.WebAssembly (7)
PrerenderComponentApplicationStoreSerializerContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
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++)
WebAssemblyJsonSerializerContext.g.cs (1)
61for (int i = 0; i < options.Converters.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 (1)
SourceGenerationContext.g.cs (1)
60for (int i = 0; i < options.Converters.Count; i++)
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)
501Assert.Equal(2, httpsCertificateList.Count);
Microsoft.AspNetCore.Diagnostics (3)
DeveloperExceptionPage\Views\CompilationErrorPage.Designer.cs (1)
334for (var i = 0; i < Model.ErrorDetails.Count; i++)
ExtensionsExceptionJsonContext.g.cs (1)
56for (int i = 0; i < options.Converters.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)
152|| (!logContext.IsAnyEnabled(HttpLoggingFields.Response) && logContext.Parameters.Count == 0))
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Buffering\PerRequestLogBufferingOptionsConfigureOptionsTests.cs (1)
120Assert.Equal(2, options.Rules.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)
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Internal\Binding\JsonTranscodingProviderServiceBinder.cs (1)
259for (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)
268if (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 (4)
GenericHost\GenericWebHostService.cs (1)
68if (addresses != null && !addresses.IsReadOnly && addresses.Count == 0)
Internal\WebHost.cs (1)
264if (addresses != null && !addresses.IsReadOnly && addresses.Count == 0)
SourceGenerationContext.g.cs (1)
60for (int i = 0; i < options.Converters.Count; i++)
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 (19)
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++)
ProblemDetailsJsonContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
QueryBuilder.cs (1)
74for (var i = 0; i < _params.Count; i++)
RequestDelegateFactory.cs (4)
352if (factoryContext.EndpointBuilder.FilterFactories.Count > 0) 423Debug.Assert(factoryContext.EndpointBuilder.FilterFactories.Count > 0); 495for (var i = factoryContext.EndpointBuilder.FilterFactories.Count - 1; i >= 0; i--) 998if (factoryContext.EndpointBuilder.FilterFactories.Count > 0)
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.Microbenchmarks (5)
SharedTestJsonContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (4)
651for (int i = builder.Metadata.Count - 1; i >= 0; i--) 669for (int i = builder.Metadata.Count - 1; i >= 0; i--) 932var currentMetadataCount = builder.Metadata.Count; 965var 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.Results.Tests (3)
ObjectJsonContext.g.cs (1)
58for (int i = 0; i < options.Converters.Count; i++)
StringJsonContext.g.cs (1)
58for (int i = 0; i < options.Converters.Count; i++)
TestJsonContext.g.cs (1)
58for (int i = 0; i < options.Converters.Count; i++)
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.KnownIPNetworks.Count > 0 || _options.KnownProxies.Count > 0;
Microsoft.AspNetCore.HttpOverrides.Tests (4)
DualIPNetworkListTests.cs (4)
34Assert.Equal(2, obsoleteList.Count); 46Assert.Equal(2, options.KnownIPNetworks.Count); 245Assert.Equal(options.KnownIPNetworks.Count, options.KnownNetworks.Count);
Microsoft.AspNetCore.HttpsPolicy (1)
HstsMiddleware.cs (1)
84for (var i = 0; i < _excludedHosts.Count; i++)
Microsoft.AspNetCore.Identity (14)
GeneratedRouteBuilderExtensions.g.cs (11)
97if (options.EndpointBuilder.FilterFactories.Count > 0) 217if (options.EndpointBuilder.FilterFactories.Count > 0) 401if (options.EndpointBuilder.FilterFactories.Count > 0) 517if (options.EndpointBuilder.FilterFactories.Count > 0) 664if (options.EndpointBuilder.FilterFactories.Count > 0) 782if (options.EndpointBuilder.FilterFactories.Count > 0) 898if (options.EndpointBuilder.FilterFactories.Count > 0) 1015if (options.EndpointBuilder.FilterFactories.Count > 0) 1131if (options.EndpointBuilder.FilterFactories.Count > 0) 1237if (options.EndpointBuilder.FilterFactories.Count > 0) 1351for (var i = routeHandlerFilters.Count - 1; i >= 0; i--)
IdentityEndpointsJsonSerializerContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
IdentityJsonSerializerContext.g.cs (1)
60for (int i = 0; i < options.Converters.Count; i++)
SignInManager.cs (1)
1208(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)
276Assert.Equal(2, (await manager.GetClaimsAsync(userById)).Count); 278Assert.Equal(2, (await manager.GetRolesAsync(userById)).Count); 291Assert.Equal(2, (await manager.GetClaimsAsync(userByName)).Count); 293Assert.Equal(2, (await manager.GetRolesAsync(userByName)).Count); 306Assert.Equal(2, (await manager.GetClaimsAsync(userByLogin)).Count); 308Assert.Equal(2, (await manager.GetRolesAsync(userByLogin)).Count); 333Assert.Equal(2, (await manager.GetClaimsAsync(userByEmail)).Count); 335Assert.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)
128for (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 (22)
IdentitySpecificationTestBase.cs (9)
248Assert.Equal(3, roleClaims.Count); 249Assert.Equal(3, safeRoleClaims.Count); 253Assert.Equal(2, roleClaims.Count); 254Assert.Equal(3, safeRoleClaims.Count); 259Assert.Equal(3, safeRoleClaims.Count); 264Assert.Equal(3, safeRoleClaims.Count); 410Assert.Equal(roles.Count, rs.Count); 593Assert.Equal(3, (await manager.GetUsersInRoleAsync(await roleManager.GetRoleNameAsync(role))).Count); 732Assert.Equal(2, all.Count);
UserManagerSpecificationTests.cs (13)
717Assert.Equal(3, userClaims.Count); 720Assert.Equal(2, userClaims.Count); 748Assert.Equal(3, userClaims.Count); 751Assert.Equal(2, userClaims.Count); 759Assert.Equal(3, userClaims2.Count); 776Claim oldClaim = userClaims.Count == 0 ? null : userClaims[0]; 780Claim newClaim = newUserClaims.Count == 0 ? null : newUserClaims[0]; 804Claim oldClaim = userClaims.Count == 0 ? null : userClaims[0]; 808Claim newClaim = newUserClaims.Count == 0 ? null : newUserClaims[0]; 813Claim oldClaim2 = userClaims2.Count == 0 ? null : userClaims2[0]; 1826Assert.Equal(2, factors.Count); 1835Assert.Equal(2, factors.Count); 1932Assert.Equal(3, (await manager.GetUsersForClaimAsync(new Claim("foo", "bar"))).Count);
Microsoft.AspNetCore.Identity.UI (6)
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;
ExternalLogins_cshtml.g.cs (2)
109if (Model.CurrentLogins?.Count > 0) 302if (Model.OtherLogins?.Count > 0)
Login_cshtml.g.cs (1)
421if ((Model.ExternalLogins?.Count ?? 0) == 0)
Register_cshtml.g.cs (1)
372if ((Model.ExternalLogins?.Count ?? 0) == 0)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.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.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)
286if (apiResponse.ApiResponseFormats.Count > 0)
DefaultApiDescriptionProvider.cs (4)
130if (apiDescription.ParameterDescriptions.Count > 0) 218for (var i = context.Results.Count - 1; i >= 0; i--) 250for (var i = context.Results.Count - 1; i >= 0; i--) 381if (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 (37)
DefaultApiDescriptionProviderTest.cs (17)
728Assert.Equal(4, description.SupportedResponseTypes.Count); 838Assert.Equal(3, description.SupportedResponseTypes.Count); 901Assert.Equal(4, description.SupportedResponseTypes.Count); 971Assert.Equal(4, description.SupportedResponseTypes.Count); 1041Assert.Equal(4, description.SupportedResponseTypes.Count); 1353Assert.Equal(3, parameters.Count); 1451Assert.Equal(3, parameters.Count); 1567Assert.Equal(3, parameters.Count); 1594Assert.Equal(4, description.ParameterDescriptions.Count); 1758Assert.Equal(2, description.ParameterDescriptions.Count); 1782Assert.Equal(4, description.ParameterDescriptions.Count); 1813Assert.Equal(4, description.ParameterDescriptions.Count); 1845Assert.Equal(4, description.ParameterDescriptions.Count); 1876Assert.Equal(4, description.ParameterDescriptions.Count); 1904Assert.Equal(8, description.ParameterDescriptions.Count); 1993Assert.Equal(2, parameters.Count); 2038Assert.Equal(5, description.ParameterDescriptions.Count);
EndpointMetadataApiDescriptionProviderTest.cs (20)
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); 314Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 447Assert.Equal(3, apiDescription.SupportedResponseTypes.Count); 498Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 577Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 611Assert.Equal(2, apiDescription.SupportedResponseTypes.Count); 864Assert.Equal(3, apiDescription.ParameterDescriptions.Count); 944Assert.Equal(4, apiDescription.ParameterDescriptions.Count); 957Assert.Equal(4, apiDescription.ParameterDescriptions.Count); 974Assert.Equal(2, apiDescription.ParameterDescriptions.Count); 986Assert.Equal(2, apiDescription.ParameterDescriptions.Count); 1031Assert.Equal(2, apiDescription.ParameterDescriptions.Count); 1518Assert.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)
519if (actionDescriptor.BoundProperties.Count == 0 && 520actionDescriptor.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 (42)
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 (14)
444Assert.Equal(2, attributeRoutes.Count); 466Assert.Equal(2, attributeRoutes.Count); 959Assert.Equal(2, action.Selectors.Count); 1036Assert.Equal(2, action.Selectors.Count); 1085Assert.Equal(2, actions.Selectors.Count); 1109Assert.Equal(3, action.Selectors.Count); 1136Assert.Equal(2, action.Selectors.Count); 1160Assert.Equal(2, action.Selectors.Count); 1186Assert.Equal(2, actionModel.Selectors.Count); 1191Assert.Equal(2, selectorModel.ActionConstraints.Count); 1198Assert.Equal(2, selectorModel.ActionConstraints.Count); 1216Assert.Equal(2, actions.Selectors.Count); 1238Assert.Equal(2, action.Selectors.Count); 1281Assert.Equal(2, selector.EndpointMetadata.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++)
TestJsonContext.g.cs (1)
58for (int i = 0; i < options.Converters.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)
58var referencePaths = new List<string>(_options.AdditionalReferencePaths.Count);
RuntimeCompilationFileProvider.cs (2)
43if (fileProviders.Count == 0) 53else 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)
184if (_actionDescriptor.BoundProperties.Count == 0 && (_handler == null || _handler.Parameters.Count == 0)) 206for (var i = 0; i < _actionDescriptor.HandlerMethods.Count; i++) 224if (handler.Parameters.Count == 0) 229var arguments = new object?[handler.Parameters.Count]; 260for (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.Testing (2)
CustomJsonSerializerContext.g.cs (1)
58for (int i = 0; i < options.Converters.Count; i++)
WebApplicationFactory.cs (1)
333if (serverAddressFeature?.Addresses.Count > 0)
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)
126for (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 (16)
GeneratedRouteBuilderExtensions.g.cs (2)
93if (options.EndpointBuilder.FilterFactories.Count > 0) 189for (var i = routeHandlerFilters.Count - 1; i >= 0; i--)
OpenApiJsonSchemaContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
Services\OpenApiDocumentService.cs (4)
228server?.Features.Get<IServerAddressesFeature>()?.Addresses is { Count: > 0 } addresses) 386if (description.SupportedResponseTypes.Count == 0) 566if (supportedRequestFormats.Count == 0) 728if (supportedRequestFormats.Count == 0)
Services\Schemas\OpenApiSchemaService.cs (9)
283if (schema.AnyOf is { Count: > 0 }) 285for (var i = 0; i < schema.AnyOf.Count; i++) 309if (schema.AllOf is { Count: > 0 }) 311for (var i = 0; i < schema.AllOf.Count; i++) 317if (schema.OneOf is { Count: > 0 }) 319for (var i = 0; i < schema.OneOf.Count; i++) 409if (schema.AnyOf is { Count: > 0 } && jsonTypeInfo.PolymorphismOptions is not null) 415if (schema.AnyOf.Count <= anyOfIndex) 431if (schema.Properties is { Count: > 0 })
Microsoft.AspNetCore.OpenApi.Tests (58)
Services\OpenApiGeneratorTests.cs (8)
108Assert.Equal(2, content.Count); 119Assert.Equal(2, request.Content.Count); 451Assert.Equal(2, operation.Parameters.Count); 511Assert.Equal(2, operation.Parameters.Count); 532Assert.Equal(2, operation.Parameters.Count); 817Assert.Equal(2, content.Count); 986Assert.Equal(4, operation.Parameters?.Count); 1006Assert.Equal(2, operation.Parameters.Count);
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (2)
926Assert.Equal(2, todoSchema.OneOf.Count); 955Assert.Equal(2, accountSchema.OneOf.Count);
Services\OpenApiSchemaService\OpenApiSchemaService.PropertySchemas.cs (16)
37Assert.Equal(2, nullableIntProperty.OneOf.Count); 59Assert.Equal(2, nullableStringProperty.OneOf.Count); 76Assert.Equal(2, nullableBoolProperty.OneOf.Count); 93Assert.Equal(2, nullableDateTimeProperty.OneOf.Count); 115Assert.Equal(2, nullableGuidProperty.OneOf.Count); 137Assert.Equal(2, nullableUriProperty.OneOf.Count); 178Assert.Equal(2, nullableTodoProperty.OneOf.Count); 186Assert.Equal(2, nullableAccountProperty.OneOf.Count); 221Assert.Equal(2, nullableTodoListProperty.OneOf.Count); 243Assert.Equal(2, nullableTodoArrayProperty.OneOf.Count); 265Assert.Equal(2, nullableDictionaryProperty.OneOf.Count); 306Assert.Equal(2, nullableStatusProperty.OneOf.Count); 314Assert.Equal(2, nullableTaskStatusProperty.OneOf.Count); 345Assert.Equal(2, nullableNameProperty.OneOf.Count); 369Assert.Equal(2, nullableAgeProperty.OneOf.Count); 395Assert.Equal(2, nullableDescriptionProperty.OneOf.Count);
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (9)
489Assert.Equal(2, todoSchema.OneOf.Count); 532Assert.Equal(2, pointSchema.OneOf.Count); 588Assert.Equal(2, arraySchema.OneOf.Count); 610Assert.Equal(2, listSchema.OneOf.Count); 632Assert.Equal(2, enumerableSchema.OneOf.Count); 877Assert.Equal(2, resultSchema.OneOf.Count); 888Assert.Equal(2, listSchema.OneOf.Count); 904Assert.Equal(2, dictSchema.OneOf.Count); 988Assert.Equal(3, statusReference.RecursiveTarget.Enum.Count);
Services\OpenApiSchemaService\OpenApiSchemaService.ResponseSchemas.cs (8)
187Assert.Equal(2, schema.OneOf.Count); 368Assert.Equal(2, pointSchema.OneOf.Count); 401Assert.Equal(2, coordinateSchema.OneOf.Count); 461Assert.Equal(2, listSchema.OneOf.Count); 477Assert.Equal(2, arraySchema.OneOf.Count); 493Assert.Equal(2, enumerableSchema.OneOf.Count); 529Assert.Equal(2, statusSchema.OneOf.Count); 544Assert.Equal(2, taskStatusSchema.OneOf.Count);
Transformers\CustomSchemaTransformerTests.cs (3)
131Assert.Equal(4, todoSchema.Properties.Count); 221Assert.Equal(2, document.Components.Schemas.Count); 234Assert.Equal(4, operation.Parameters.Count);
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (11)
111Assert.Equal(4, effectiveSchema.Properties.Count); 268Assert.Equal(4, requestBodySchema.Items.Properties.Count); 360Assert.Equal(4, itemsSchema.Properties.Count); 476Assert.Equal(3, document.Components.Schemas.Count); 547Assert.Equal(2, document.Components.Schemas.Count); 667Assert.Equal(3, document.Components.Schemas.Count); 693Assert.Equal(2, requestSchema.Properties.Count); 887Assert.Equal(2, requestSchema.Properties!.Count); 903Assert.True(itemSchema.Properties?.Count > 0, "ConfigItem schema should not be empty"); 950Assert.True(citySchema.Properties?.Count > 0, "CityResponse schema should not be empty"); 993Assert.True(userSchemaContent.Properties?.Count > 0, "RefUser schema should not be empty");
Transformers\SchemaTransformerTests.cs (1)
710Assert.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)
547for (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)
181if (arrayIndex + _owinEntries.Count + _context.Items.Count > array.Length) 195get { return _owinEntries.Count + _context.Items.Count; } 500return _contextEntries.Count; 503return _entries.Count + _contextDependentEntries.Count - (_deletedKeys?.Count ?? 0);
Microsoft.AspNetCore.Owin.Tests (4)
OwinEnvironmentTests.cs (4)
144var length = collection.Count; 168var initialEnv1Count = env1.Count; 171Assert.Equal(initialEnv1Count, env1.Count + 1); 207Assert.True(owinEnvironment2.Count != 0);
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)
89if (!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 (10)
ApacheModRewrite\TestStringParserTests.cs (3)
126Assert.Equal(p1.PatternSegments.Count, p2.PatternSegments.Count); 128for (int i = 0; i < p1.PatternSegments.Count; i++)
IISUrlRewrite\FileParserTests.cs (6)
144Assert.Equal(2, rules.Count); 199Assert.Equal(actual.Count, expected.Count); 200for (var i = 0; i < actual.Count; i++) 222Assert.Equal(c1.Input.PatternSegments.Count, c2.Input.PatternSegments.Count);
IISUrlRewrite\InputParserTests.cs (1)
33Assert.Equal(expected, result.PatternSegments.Count);
Microsoft.AspNetCore.Routing (34)
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 (2)
244var hasValidationResolvers = builder.ApplicationServices.GetService<IOptions<ValidationOptions>>() is { Value: { } options } && options.Resolvers.Count > 0; 255if (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++)
ValidationEndpointFilterFactory.cs (2)
27if (options is null || options.Resolvers.Count == 0) 66if (entry.Index >= context.Arguments.Count)
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)
312if (authChallenges != null && authChallenges.Count > 0) 327var nativeHeaderValues = allocator.AllocAsPointer<HTTP_KNOWN_HEADER>(authChallenges.Count); 330for (var headerValueIndex = 0; headerValueIndex < authChallenges.Count; headerValueIndex++)
MessagePump.cs (1)
75var 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); 220Assert.Equal(3, requestHeaders.Count); 221Assert.Equal(requestHeaders.Keys.Count, requestHeaders.Count); 222Assert.Equal(requestHeaders.Count, requestHeaders.Values.Count); 247Assert.Equal(4, requestHeaders.Count); 248Assert.Equal(requestHeaders.Keys.Count, requestHeaders.Count); 249Assert.Equal(requestHeaders.Count, requestHeaders.Values.Count);
Microsoft.AspNetCore.Server.HttpSys.Tests (10)
RequestHeaderTests.cs (10)
33Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 54Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 74Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 95Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 116Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 135Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 154Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 178Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 200Assert.Equal(requestHeaders.Count, requestHeaders.Keys.Count); 285Assert.Equal(requestHeaders.Count, requestHeaders.Keys.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)
384var cert = certs.Count > 0 ? certs[0] : null;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (15)
Http1\Http1ConnectionTests.cs (9)
874await WaitForCondition(TestConstants.DefaultTimeout, () => _http1Connection.RequestHeaders.Count >= header0Count); 875Assert.Equal(header0Count, _http1Connection.RequestHeaders.Count); 878await WaitForCondition(TestConstants.DefaultTimeout, () => _http1Connection.RequestHeaders.Count >= header0Count + header1Count); 879Assert.Equal(header0Count + header1Count, _http1Connection.RequestHeaders.Count); 910await WaitForCondition(TestConstants.DefaultTimeout, () => _http1Connection.RequestHeaders.Count >= header0Count); 912Assert.Equal(header0Count, _http1Connection.RequestHeaders.Count); 915await WaitForCondition(TestConstants.DefaultTimeout, () => _http1Connection.RequestHeaders.Count >= header0Count + header1Count); 917Assert.Equal(header0Count + header1Count, _http1Connection.RequestHeaders.Count); 1198public 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.Server.Kestrel.Tests (1)
ConfigurationReaderTests.cs (1)
57Assert.Equal(2, certificates.Count);
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 (10)
AppJsonSerializerContext.g.cs (1)
58for (int i = 0; i < options.Converters.Count; i++)
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 (5)
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)
StaticAssetsManifestJsonContext.g.cs (1)
56for (int i = 0; i < options.Converters.Count; i++)
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)
268if (collection.Count == 0)
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (2)
2796Assert.Equal(3, debugView.Middleware.Count); 3116if (_urls.Count == 0)
Microsoft.AspNetCore.WebSockets (1)
WebSocketMiddleware.cs (1)
43_anyOriginAllowed = _options.AllowedOrigins.Count == 0 || _options.AllowedOrigins.Contains("*", StringComparer.Ordinal);
Microsoft.Build.Framework (15)
BinaryTranslator.cs (9)
1268int count = list.Count; 1286int count = list.Count; 1311_writer.Write(collection.Count); 1524(dictionary is null ? 0 : dictionary.Count); 1569int count = dictionary.Count; 1592int count = dictionary.Count; 1617int count = dictionary.Count; 1660int count = dictionary.Count; 1682int count = dictionary.Count;
BuildException\BuildExceptionBase.cs (1)
104writer.Write(customKeyedSerializedData.Count);
ProjectStartedEventArgs.cs (1)
488writer.Write(collection.Count);
ReuseableStringBuilder.cs (1)
147var separatorsRemaining = strings.Count - 1;
TaskItemData.cs (2)
52bool IMetadataContainer.HasCustomMetadata => Metadata.Count > 0; 61public int MetadataCount => Metadata.Count;
TelemetryEventArgs.cs (1)
32int count = Properties?.Count ?? 0;
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Compilers\Shared\BuildProtocol.cs (2)
87var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 103for (int i = 0; i < args.Count; ++i)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (2)
src\Compilers\Shared\BuildProtocol.cs (2)
87var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 103for (int i = 0; i < args.Count; ++i)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (2)
TargetTests.cs (2)
833Assert.Equal(expectedItemCount, items.Count); 842Assert.Equal(expectedItemCount, items.Count);
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)
36if (coll1.Count == 0) 41if (coll2.Count == 0) 103index += collection.Count; 113_count = _collections.Sum(c => c.Count);
PEWriter\Miscellaneous.cs (2)
34return asIListT.Count != 0; 68return (uint)asIListT.Count;
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
Syntax\LineDirectiveMap.cs (2)
141var entries = ArrayBuilder<LineMappingEntry>.GetInstance(directives.Count + 1); 146if (directives.Count > 0)
Syntax\SyntaxList`1.cs (1)
88var builder = (collection != null) ? new SyntaxListBuilder<TNode>(collection.Count) : SyntaxListBuilder<TNode>.Create();
Syntax\SyntaxTriviaList.cs (1)
332if (triviaCollection != null && triviaCollection.Count == 0)
Microsoft.CodeAnalysis.Analyzers (52)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 200Contract.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.AnalyzerUtilities (49)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2093=> dict1.Count == dict2.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
Microsoft.CodeAnalysis.BannedApiAnalyzers (52)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 200Contract.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.CodeStyle (44)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
127return (missingCases: missingEnumMembers.Count > 0, missingDefaultCase: !HasDefaultCase(operation));
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
Microsoft.CodeAnalysis.CodeStyle.Fixes (9)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
176if (documentsUpdated.Count != 1)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
186.Skip(reservedNames.Count)];
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
100if (commonTypes.Count == 0) 105if (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++) 200Contract.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.Collections.Package (26)
Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
Microsoft.CodeAnalysis.CSharp (13)
BoundTree\VariablePendingInference.cs (1)
96Debug.Assert(inferenceDiagnostics.DependenciesBag.Count == 0);
Compilation\CSharpCompilation.cs (1)
2796if (_lazyUsedAssemblyReferences?.IsEmpty == false || diagnostics.DependenciesBag.Count != 0)
Compilation\SyntaxAndDeclarationManager.cs (3)
182ordinalMapBuilder.Add(tree, ordinalMapBuilder.Count); 574Debug.Assert(oldLoadDirectives.Length == newLoadDirectivesSyntax.Count); 713ordinalMapBuilder.Add(tree, ordinalMapBuilder.Count);
Declarations\DeclarationTreeBuilder.cs (2)
308if (directiveNodes.Count == 0) 313var directives = ArrayBuilder<ReferenceDirective>.GetInstance(directiveNodes.Count);
Symbols\Metadata\PE\PEEventSymbol.cs (1)
432if (implementedEvents.Count != 0)
Symbols\Source\TypeParameterBuilder.cs (2)
56var arrayBuilder = ArrayBuilder<Location>.GetInstance(builders.Count); 67var arrayBuilder = ArrayBuilder<SyntaxReference>.GetInstance(builders.Count);
Symbols\Symbol.cs (1)
1045if (diagnostics.DiagnosticBag?.IsEmptyWithoutResolution == false || diagnostics.DependenciesBag?.Count > 0)
Syntax\SyntaxFactory.cs (2)
1391if (collection != null && collection.Count == 0) 1410var 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)
375if (result.GetTextChanges(cancellationToken).Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.FormattedComplexTrivia.cs (1)
54get { return _textChanges.Count > 0; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (4)
60for (var i = 0; i < xNameParts.Count && i < yNameParts.Count; i++) 69return xNameParts.Count - yNameParts.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
165for (var i = 0; i < list.Count - 1; i++) 178for (var i = 1; i < list.Count; i++)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
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)
326if (modifierTokens.Count >= 2) 329if (modifierTokens.Count == 1) 352if (modifierTokens.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (1)
21return parts[parts.Count - 1];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
74.Skip(reservedNames.Count)];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (2)
151if (usingsToRemove.Count == 0) 205if (usingsToRemove.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
650if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
StringCopyPaste\UnknownSourcePasteProcessor.cs (1)
245for (int changeIndex = 0, lastChangeIndex = Changes.Count; changeIndex < lastChangeIndex; changeIndex++)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (10)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
142if (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)
102for (var i = 0; i < orderedCSharpCompletionProviders.Count; i++) 109else if (i == orderedCSharpCompletionProviders.Count - 1) // last one
Debugging\ProximityExpressionsGetterTests.cs (1)
112Assert.True(actualTerms is null or { Count: > 0 });
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 (7)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
177if (conflictReferences.Count == 0)
Organizing\Organizers\MemberDeclarationsOrganizer.cs (4)
44Debug.Assert(originalList.Count == finalList.Count); 46if (originalList.Count >= 2) 112if (members.Count > 1)
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
169for (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)
2394for (int i = 0; i < exprs.Count; i++)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (51)
IncrementalParsing\IncrementalParsingTests.cs (4)
363Assert.Equal(4, oldDirectives.Count); 375Assert.Equal(3, newDirectives.Count); 408Assert.Equal(3, oldDirectives.Count); 417Assert.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)
186Assert.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 (8)
47Assert.Equal(2, directives.Count); 413Assert.Equal(directives.Count, descendantDirectives.Count); 414for (int i = 0; i < directives.Count; i++) 3731Assert.Equal(0, ChangesForDifferentTrees.Count); 3742Assert.Equal(2, ChangesFromTransform.Count); 3749Assert.Equal(2, changes2UsingCommonSyntax.Count); 3781Assert.Equal(0, ChangesForDifferentTrees.Count); 3814Assert.Equal(0, ChangesForDifferentTrees.Count);
Microsoft.CodeAnalysis.CSharp.Workspaces (18)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (1)
375if (result.GetTextChanges(cancellationToken).Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.FormattedComplexTrivia.cs (1)
54get { return _textChanges.Count > 0; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (4)
60for (var i = 0; i < xNameParts.Count && i < yNameParts.Count; i++) 69return xNameParts.Count - yNameParts.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
165for (var i = 0; i < list.Count - 1; i++) 178for (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)
326if (modifierTokens.Count >= 2) 329if (modifierTokens.Count == 1) 352if (modifierTokens.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (1)
21return parts[parts.Count - 1];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
74.Skip(reservedNames.Count)];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (2)
151if (usingsToRemove.Count == 0) 205if (usingsToRemove.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
650if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Microsoft.CodeAnalysis.EditorFeatures (10)
Adornments\AbstractAdornmentManager.cs (1)
236if (viewLines == null || viewLines.Count == 0)
Editor\TextBufferAssociatedViewService.cs (1)
121if (views.Count == 0)
Formatting\FormatCommandHandler.cs (1)
170if (textChanges == null || textChanges.Count == 0)
Preview\SolutionPreviewResult.cs (1)
31public bool IsEmpty => _previews.Count == 0;
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (2)
93if (e.Changes.Count != 1 || ShouldClearTrackingSession(e.Changes.Single())) 265var index = _committedSessions.Count;
Shared\Extensions\IProjectionBufferFactoryServiceExtensions.cs (1)
323if (snapshotSpans.Count > 0)
Shared\Tagging\EventSources\TaggerEventSources.TextChangedEventSource.cs (1)
39if (e.Changes.Count == 0)
SignatureHelp\Model.cs (1)
48Contract.ThrowIfFalse(items.Count != 0, "Must have at least one item.");
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
95if (e.Changes.Count == 0)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (8)
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 ||
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
178Assert.True(expectedTestItems.Count() == actualSignatureHelpItems.Items.Count, $"Expected {expectedTestItems.Count()} items, but got {actualSignatureHelpItems.Items.Count}");
TaskList\AbstractTaskListTests.cs (1)
43Assert.Equal(items.Length, expectedLists.Count);
Microsoft.CodeAnalysis.EditorFeatures.Text (5)
ITextImageHelpers.cs (5)
36if (oldVersion.Changes.Count != 0) 55var builder = new FixedSizeArrayBuilder<TextChangeRange>(changes.Count); 56for (var i = 0; i < changes.Count; i++) 89var changes = ArrayBuilder<TextChangeRange>.GetInstance(version.Changes.Count); 90for (var i = 0; i < version.Changes.Count; i++)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (4)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\AttributeHelpers.cs (3)
47if (arguments.Count == 0) 51else if (arguments.Count == 1) 75if (arguments.Count == 1)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\InlineArrayHelpers.cs (1)
40attribute.ConstructorArguments.Count == 1 && attribute.ConstructorArguments[0].Value is int length)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (4)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\AttributeHelpers.cs (3)
47if (arguments.Count == 0) 51else if (arguments.Count == 1) 75if (arguments.Count == 1)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\InlineArrayHelpers.cs (1)
40attribute.ConstructorArguments.Count == 1 && attribute.ConstructorArguments[0].Value is int length)
Microsoft.CodeAnalysis.Extensions.Package (29)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
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 (27)
CodeFixes\Service\CodeFixService.cs (2)
958var builder = new FixedSizeArrayBuilder<IConfigurationFixProvider>(orderedLanguageKindAndFixers.Count); 976for (var i = 0; i < fixers.Count; i++)
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (2)
165if (textChanges.Count == 0) 175textChanges.RemoveAt(textChanges.Count - 1);
Completion\CompletionService.cs (1)
337if (builder.Count == 0)
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
81inferredTypes.Count > 0 &&
Debugging\AbstractBreakpointResolver.cs (1)
127switch (nameParts.Count)
Diagnostics\Service\DiagnosticAnalyzerService_CompilationWithAnalyzersPair.cs (2)
134if (projectAnalyzers.Count == 0) 139if (projectAnalyzers.Count == analyzers.Length)
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
232for (var i = 0; i < lines.Count; i++)
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
245if (finalFieldName != field.Name && constructorLocations.Count > 0)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
591public bool HasMultipleDocuments => _solutionId != null || _projectOrDocumentIds?.Count > 1;
ExtractMethod\MethodExtractor.Analyzer.cs (1)
249var variableMapStatus = failedVariables.Count == 0
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
252if (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)
41if (typeDisplayInfo.TypesParts.Count > 0)
RQName\SimpleTree\SimpleGroupNode.cs (1)
20public int Count { get { return Children.Count; } }
SignatureHelp\AbstractSignatureHelpProvider.cs (2)
39if (items is null || items.Count == 0 || state == null) 195if (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)
127return (missingCases: missingEnumMembers.Count > 0, missingDefaultCase: !HasDefaultCase(operation));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
176if (documentsUpdated.Count != 1)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
186.Skip(reservedNames.Count)];
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
100if (commonTypes.Count == 0) 105if (commonTypes.Count == 0)
Microsoft.CodeAnalysis.InteractiveHost (26)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Protocol\Extensions\Converters\VSExtensionUtilities.cs (1)
32var existingConvertersCount = converters.Count;
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (1)
31var existingConvertersCount = converters.Count;
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (52)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 200Contract.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.PublicApiAnalyzers (47)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
Microsoft.CodeAnalysis.ResxSourceGenerator (47)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
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.Threading.Package (26)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
Microsoft.CodeAnalysis.UnitTests (71)
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\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");
InternalUtilities\SpecializedCollectionsTests.cs (1)
34Assert.Equal(0, emptySet.Count);
Microsoft.CodeAnalysis.Workspaces (51)
Diagnostics\HostDiagnosticAnalyzers.cs (1)
249using 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)
101if (set.Count == 1)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 200Contract.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)
93if (loadedProjects != null && loadedProjects.Count > 0) 95Debug.Assert(loadedProjects.Count == 1);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Formatting\FormattingTestBase.cs (1)
101if (changes.Count == 0)
Workspaces\TestWorkspace`1.cs (1)
673for (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)
89if (results == null || results.Count == 0) 92if (results == null || results.Count == 0) 97DynamicProperty[] pairArray = new DynamicProperty[results.Count]; 98for (int i = 0; i < results.Count; i++)
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (2)
346return (da.TransformFlags.Count == 0 || (da.TransformFlags.Count == 1 && da.TransformFlags[0]));
Microsoft.Data.Analysis (178)
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 (16)
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); 465if (Buffers.Count == 0) 475for (int b = 0; b < mapIndices.Buffers.Count; b++) 479index = 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.SignCheckTask (2)
src\SignCheck.cs (2)
373if (result.NestedResults.Count > 0) 390if (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 (44)
ChatCompletion\ChatResponse{T}.cs (2)
126var json = Messages.Count > 0 ? Messages[Messages.Count - 1].Text : string.Empty;
ChatCompletion\FunctionInvokingChatClient.cs (18)
536int contentsCount = contents.Count; 787if (toolList?.Count is int count && count > 0) 832if (toolList?.Count > 0) 852int count = messages.Count; 866int count = content.Count; 888int messageCount = messages.Count; 892int contentCount = contents.Count; 911int contentCount = contents.Count; 941int contentCount = contents.Count; 1017if (options?.Tools is not { Count: > 0 }) 1035if (remainingCount < options.Tools.Count) 1231if (messages is not { Count: > 0 }) 1588for (int j = 0; j < message.Contents.Count; j++) 1618if (keptContents?.Count != message.Contents.Count) 1833if (content is { Count: > 0 }) 1835for (int i = 0; i < content.Count; i++) 1863for (int i = 0; i < messages.Count; i++) 1866for (int j = 0; j < content.Count; j++)
ChatCompletion\ImageGeneratingChatClient.cs (7)
171for (int contentIndex = 0; contentIndex < message.Contents.Count; contentIndex++) 247if (options?.Tools is null || options.Tools.Count == 0) 254for (int i = 0; i < tools.Count; i++) 323for (int i = contents.Count - 1; i >= 0; i--) 388if (response.Contents.Count == 0) 451if (response.Contents.Count == 0) 477var newList = new List<T>(original.Count + additionalCapacity);
ChatCompletion\OpenTelemetryChatClient.cs (2)
602if (options.StopSequences is IList<string> { Count: > 0 } stopSequences) 635if (options.Tools is { Count: > 0 })
ChatCompletion\OpenTelemetryImageGenerator.cs (1)
246response.Contents is { Count: > 0 } contents &&
ChatReduction\SummarizingChatReducer.cs (2)
147var earliestAllowedIndex = unsummarizedMessages.Count - thresholdCount - targetCount; 155var indexOfFirstMessageToKeep = unsummarizedMessages.Count - targetCount;
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)
268if (collection.Count == 0)
ToolReduction\EmbeddingToolReductionStrategy.cs (6)
56for (var i = 0; i < contents.Count; i++) 159if (options?.Tools is not { Count: > 0 } tools) 169if (tools.Count <= _toolLimit) 177var toolRankingInfoArray = ArrayPool<AIToolRankingInfo>.Shared.Rent(tools.Count); 180var toolRankingInfoMemory = toolRankingInfoArray.AsMemory(start: 0, length: tools.Count); 248var nextOptionalToolIndex = tools.Count - 1;
ToolReduction\ToolReducingChatClient.cs (1)
66if (options?.Tools is not { Count: > 0 })
Microsoft.Extensions.AI.Abstractions (25)
ChatCompletion\ChatMessage.cs (2)
117_contents is { Count: > 0 } ? _contents[0] : 124private string EllipsesForDebuggerDisplay => _contents is { Count: > 1 } ? ", ..." : string.Empty;
ChatCompletion\ChatResponse.cs (1)
141int messageCount = _messages?.Count ?? 0;
ChatCompletion\ChatResponseExtensions.cs (12)
64if (updates is ICollection<ChatResponseUpdate> { Count: 0 }) 88if (contentsList.Count > 0) 197for (int i = 0; i < contents.Count; i++) 391while (start < contents.Count) 402while (i < contents.Count && TryAsCoalescable(contents[i], out TContent? next) && (canMerge is null || canMerge(prev, next))) 428if (content is TContent tmp && tmp.Annotations is not { Count: > 0 }) 454int contentsCount = contents.Count; 468Debug.Assert(nextSlot == contents.Count, "Expected final count to equal list length."); 475int count = response.Messages.Count; 490if (response.Messages.Count != 0) 492var lastMessage = response.Messages[response.Messages.Count - 1]; 508message = response.Messages[response.Messages.Count - 1];
ChatCompletion\ChatResponseUpdate.cs (2)
187_contents is { Count: > 0 } ? _contents[0] : 194private string EllipsesForDebuggerDisplay => _contents is { Count: > 1 } ? ", ..." : string.Empty;
Contents\AIContentExtensions.cs (2)
23int count = list.Count; 66int count = messages.Count;
Embeddings\EmbeddingGeneratorExtensions.cs (1)
186int inputsCount = inputs.Count;
HostedMcpServerToolRequireSpecificApprovalMode.cs (1)
61for (int i = 0; i < list.Count; i++)
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)
268if (collection.Count == 0)
Microsoft.Extensions.AI.Abstractions.Tests (59)
AssertExtensions.cs (5)
30Assert.Equal(expectedMessage.Contents.Count, chatMessage.Contents.Count); 31for (int j = 0; j < expectedMessage.Contents.Count; j++) 77if (expected.Count != actual.Count)
ChatCompletion\ChatMessageTests.cs (3)
105Assert.Equal(messageCount, message.Contents.Count); 294Assert.Equal(items.Count, deserializedMessage.Contents.Count);
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (14)
94Assert.Equal(9, response.Messages.Count); 158Assert.Equal(4, response.Messages.Count); 208Assert.Equal(5, response.Messages.Count); 295Assert.Equal(2, response.Messages.Count); 330Assert.Equal(2, response.Messages.Count); 398Assert.Equal(2, response.Messages.Count); 435Assert.Equal(3, response.Messages.Count); 471Assert.Equal(3, response.Messages.Count); 567Assert.Equal(4, response.Messages.Count); 672Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), message.Contents.Count); 709Assert.Equal(8, message.Contents.Count); 739Assert.Equal(5, message.Contents.Count); 784Assert.Equal(12, message.Contents.Count); 953Assert.Equal(4, message.Contents.Count);
ChatCompletion\ChatResponseUpdateTests.cs (3)
140Assert.Equal(5, result.Contents.Count); 326Assert.Equal(2, original.Contents.Count); 327Assert.Equal(2, clone.Contents.Count);
Contents\AIContentTests.cs (3)
88Assert.Equal(message.Contents.Count, deserialized.Contents.Count); 89for (int i = 0; i < message.Contents.Count; i++)
Contents\CodeInterpreterToolCallContentTests.cs (2)
62Assert.Equal(3, c.Inputs.Count); 87Assert.Equal(2, deserializedSut.Inputs.Count);
Contents\CodeInterpreterToolResultContentTests.cs (2)
63Assert.Equal(4, c.Outputs.Count); 89Assert.Equal(2, deserializedSut.Outputs.Count);
Contents\FunctionCallContentTests.cs (1)
353Assert.Equal(5, content.Arguments.Count);
Contents\ImageGenerationToolResultContentTests.cs (3)
62Assert.Equal(3, c.Outputs.Count); 87Assert.Equal(2, deserializedSut.Outputs.Count); 119Assert.Equal(2, imageResult.Outputs.Count);
Functions\AIFunctionArgumentsTests.cs (5)
115Assert.Equal(2, args.Count); 139Assert.Equal(3, args.Count); 144Assert.Equal(4, args.Count); 149Assert.Equal(3, args.Count); 164Assert.Equal(2, args.Count);
Image\ImageGenerationResponseTests.cs (3)
45Assert.Equal(contentCount, response.Contents.Count); 110Assert.Equal(2, deserialized.Contents.Count); 148Assert.Equal(3, deserialized.Contents.Count);
SpeechToText\SpeechToTextResponseTests.cs (4)
89Assert.Equal(contentCount, response.Contents.Count); 169Assert.Equal(4, result.Contents.Count); 171for (int i = 0; i < original.Contents.Count; i++) 235Assert.Equal(withUsage ? 4 : 3, update.Contents.Count);
SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (1)
124Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), response.Contents.Count);
SpeechToText\SpeechToTextResponseUpdateTests.cs (3)
106Assert.Equal(original.Contents.Count, result.Contents.Count); 107for (int i = 0; i < original.Contents.Count; i++)
Tools\HostedCodeInterpreterToolTests.cs (1)
53Assert.Equal(2, tool.Inputs.Count);
Tools\HostedFileSearchToolTests.cs (1)
55Assert.Equal(2, tool.Inputs.Count);
Tools\HostedMcpServerToolTests.cs (5)
104Assert.True(tool.Headers.Count == 2); 124Assert.Equal(2, tool.Headers.Count); 152Assert.Equal(2, tool1.Headers.Count); 162Assert.Equal(2, tool2.Headers.Count); 181Assert.Equal(2, tool.Headers.Count);
Microsoft.Extensions.AI.Evaluation (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Console (2)
Commands\ReportCommand.cs (1)
197[PropertyNames.MetricsCount] = metrics.Count.ToTelemetryPropertyValue()
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Integration.Tests (27)
AgentQualityEvaluatorTests.cs (4)
102Assert.Equal(2, result.Metrics.Count); 135Assert.Equal(2, result.Metrics.Count); 158Assert.Equal(3, result.Metrics.Count); 198Assert.Equal(3, result.Metrics.Count);
NLPEvaluatorTests.cs (4)
64Assert.Equal(3, result.Metrics.Count); 91Assert.Equal(3, result.Metrics.Count); 117Assert.Equal(3, result.Metrics.Count); 138Assert.Equal(3, result.Metrics.Count);
QualityEvaluatorTests.cs (8)
101Assert.Equal(6, result.Metrics.Count); 142Assert.Equal(6, result.Metrics.Count); 179Assert.Equal(4, result.Metrics.Count); 253Assert.Equal(4, result.Metrics.Count); 260groundedness.Context?.Count is 1 && 265equivalence.Context?.Count is 1 && 270completeness.Context?.Count is 1 && 275retrieval.Context?.Count is 1 &&
SafetyEvaluatorTests.cs (11)
216Assert.Equal(6, result.Metrics.Count); 225groundednessPro.Context?.Count is 1 && 230ungroundedAttributes.Context?.Count is 1 && 307Assert.Equal(6, result.Metrics.Count); 316groundednessPro.Context?.Count is 1 && 321ungroundedAttributes.Context?.Count is 1 && 352Assert.Equal(7, result.Metrics.Count); 388Assert.Equal(7, result.Metrics.Count); 437Assert.Equal(7, result.Metrics.Count); 499Assert.Equal(7, result.Metrics.Count); 609Assert.Equal(5, result.Metrics.Count);
Microsoft.Extensions.AI.Evaluation.NLP (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Quality (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Reporting (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (8)
ScenarioRunResultTests.cs (8)
233Assert.Equal(first!.Metrics.Count, second!.Metrics.Count); 269Assert.Equal(metric.Context.Count, deserializedMetric.Context.Count); 285Assert.Equal(metric.Metadata.Count, deserializedMetric.Metadata.Count); 339if (x?.Contents.Count != y?.Contents.Count)
Microsoft.Extensions.AI.Evaluation.Safety (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AI.Integration.Tests (10)
ChatClientIntegrationTests.cs (5)
1485Assert.Equal(2, secondTurnTools.Count); // Should have filled both slots with the two relevant domains. 1546Assert.Equal(2, captured!.Count); 1719Assert.True(selectedTools.Count <= 2, $"Expected at most 2 tools, got {selectedTools.Count}"); 1733if (!_used && options?.Tools is { Count: > 0 })
ImageGeneratorIntegrationTests.cs (1)
79Assert.Equal(2, response.Contents.Count);
PromptBasedFunctionCallingChatClient.cs (2)
47if (options?.Tools is { Count: > 0 }) 67for (var itemIndex = 0; itemIndex < message.Contents.Count; itemIndex++)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
ToolReductionTests.cs (1)
385Assert.Equal(2, observedTools!.Count);
Microsoft.Extensions.AI.OpenAI (18)
OpenAIAssistantsChatClient.cs (5)
284if (textUpdate.Contents.Count == 0) 362if (options.Tools is { Count: > 0 } tools) 370if (runOptions.ToolsOverride.Count == 0) 394if (codeInterpreterTool.Inputs?.Count is > 0) 419if (fileSearchTool.Inputs is { Count: > 0 } fileSearchInputs)
OpenAIChatClient.cs (4)
611if (options.StopSequences is { Count: > 0 } stopSequences) 619if (options.Tools is { Count: > 0 } tools) 629if (result.Tools.Count > 0) 634if (result.ToolChoice is null && result.Tools.Count > 0)
OpenAIResponsesChatClient.cs (8)
477case MessageResponseItem mri when mri.Content is { Count: > 0 } mriContent && mriContent.Any(c => c.OutputTextAnnotations is { Count: > 0 }): 648if (mcpTool.Headers.Count > 0) 678if (specificMode.AlwaysRequireApprovalToolNames is { Count: > 0 } alwaysRequireToolNames) 684if (specificMode.NeverRequireApprovalToolNames is { Count: > 0 } neverRequireToolNames) 796if (options.Tools is { Count: > 0 } tools) 806if (result.Tools.Count > 0) 811if (result.ToolChoice is null && result.Tools.Count > 0) 1410Outputs = cicri.Outputs is { Count: > 0 } outputs ? outputs.Select<CodeInterpreterCallOutput, AIContent?>(o =>
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AI.OpenAI.Tests (28)
OpenAIChatClientTests.cs (1)
255Assert.Equal(i == 10 ? 0 : 1, updates[i].Contents.Count);
OpenAIConversionTests.cs (6)
462Assert.Equal(2, tool.Headers.Count); 495Assert.Equal(3, tool.AllowedTools.ToolNames.Count); 554Assert.Equal(2, tool.ToolCallApprovalPolicy.CustomPolicy.ToolsAlwaysRequiringApproval.ToolNames.Count); 822Assert.Equal(3, message.Contents.Count); 853Assert.Equal(3, message.Contents.Count); 1568Assert.Equal(4, openAIResponse.OutputItems.Count);
OpenAIResponseClientIntegrationTests.cs (2)
209if (approvalResponse.Contents.Count == 0) 214approvalsCount += approvalResponse.Contents.Count;
OpenAIResponseClientTests.cs (14)
682Assert.Equal((i >= 4 && i <= 12) || i == 16 ? 1 : 0, updates[i].Contents.Count); 822Assert.Equal(2, responseMessage.Contents.Count); 920Assert.Equal(i >= 3 ? 1 : 0, updates[i].Contents.Count); 1285Assert.Equal(2, response.Messages.Count); 1542Assert.Equal(3, message.Contents.Count); 1797Assert.Equal(6, message.Contents.Count); 2210Assert.Equal(6, message.Contents.Count); 2654Assert.Equal((i >= 5 && i <= 13) || i == 17 ? 1 : 0, updates[i].Contents.Count); 2900Assert.Equal(3, message.Contents.Count); 3120Assert.Equal(3, message.Contents.Count); 3221if (content.Inputs is { Count: > 0 }) 3244Assert.Equal(2, message.Contents.Count); 5352var annotatedUpdate = updates.FirstOrDefault(u => u.Contents.Any(c => c.Annotations?.Count > 0)); 5743Assert.Equal(2, contents.Count);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (5)
30Assert.Equal(expectedMessage.Contents.Count, chatMessage.Contents.Count); 31for (int j = 0; j < expectedMessage.Contents.Count; j++) 77if (expected.Count != actual.Count)
Microsoft.Extensions.AI.Tests (18)
ChatCompletion\DistributedCachingChatClientTest.cs (6)
808Assert.Equal(expectedMessage.Contents.Count, actualMessage.Contents.Count); 810for (var itemIndex = 0; itemIndex < expectedMessage.Contents.Count; itemIndex++) 842Assert.Equal(expectedItem.Contents.Count, actualItem.Contents.Count); 844for (var itemIndex = 0; itemIndex < expectedItem.Contents.Count; itemIndex++)
ChatCompletion\FunctionInvokingChatClientTests.cs (4)
785Assert.Equal(2, capturedOptions[0]!.Tools!.Count); 1256Assert.Equal(5, response.Messages.Count); 1329Assert.Equal(messages.Count, context.Messages.Count); 2312var cloned = new List<AIContent>(contents.Count);
ChatCompletion\ImageGeneratingChatClientTests.cs (3)
95Assert.Equal(3, capturedOptions.Tools.Count); 143Assert.Equal(4, capturedOptions.Tools.Count); // DummyFunction + GenerateImage + EditImage + GetImagesForEdit 250Assert.Equal(3, capturedOptions.Tools.Count);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (5)
30Assert.Equal(expectedMessage.Contents.Count, chatMessage.Contents.Count); 31for (int j = 0; j < expectedMessage.Contents.Count; j++) 77if (expected.Count != actual.Count)
Microsoft.Extensions.AmbientMetadata.Application (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AmbientMetadata.Build (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.AsyncState (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Caching.Abstractions (4)
Hybrid\HybridCache.cs (4)
175null or ICollection<string> { Count: 0 } => default, 176ICollection<string> { Count: 1 } => RemoveAsync(keys.First(), cancellationToken), 199null or ICollection<string> { Count: 0 } => default, 200ICollection<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)
268if (collection.Count == 0)
Microsoft.Extensions.Compliance.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Compliance.Redaction (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Compliance.Testing (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Configuration (4)
ConfigurationRoot.cs (3)
32_changeTokenRegistrations = new List<IDisposable>(providers.Count); 116for (int i = providers.Count - 1; i >= 0; i--) 131if (providers.Count == 0)
InternalConfigurationRootExtensions.cs (1)
51for (int i = providers.Count - 1; i >= 0; i--)
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
1178if (attributeData.ConstructorArguments.Count != 1)
Microsoft.Extensions.Configuration.CommandLine (1)
CommandLineConfigurationProvider.cs (1)
140var switchMappingsCopy = new Dictionary<string, string>(switchMappings.Count, StringComparer.OrdinalIgnoreCase);
Microsoft.Extensions.DataIngestion (3)
Chunkers\SectionChunker.cs (2)
49List<IngestionDocumentElement> elements = new(section.Elements.Count); 52for (int i = 0; i < section.Elements.Count; i++)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.DataIngestion.Abstractions (3)
IngestionDocument.cs (2)
46for (int sectionIndex = Sections.Count - 1; sectionIndex >= 0; sectionIndex--) 61for (int i = nestedSection.Elements.Count - 1; i >= 0; i--)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.DataIngestion.Markdig (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.DataIngestion.MarkItDown (2)
MarkItDownMcpReader.cs (1)
94if (result.Content != null && result.Content.Count > 0)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.DataIngestion.Tests (2)
Processors\AlternativeTextEnricherTests.cs (2)
50Assert.Equal(2, materializedMessages[1].Contents.Count); 137Assert.Equal(batchSize, materializedMessages[1].Contents.Count);
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; 490int count = services.Count; 551int count = collection.Count; 585for (int i = collection.Count - 1; i >= 0; i--)
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (1)
420for (int i = collection.Count - 1; i >= 0; i--)
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
src\Shared\Throw\Throw.cs (1)
268if (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)
268if (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)
268if (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)
268if (collection.Count == 0)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Diagnostics.Testing (3)
Logging\FakeLogCollector.cs (2)
119if (_options.FilteredLevels.Count > 0 && !_options.FilteredLevels.Contains(record.Level)) 125if (_options.FilteredCategories.Count > 0)
src\Shared\Throw\Throw.cs (1)
268if (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)
268if (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 (10)
Logging\Internal\HttpClientLogger.cs (2)
62_logResponseHeaders = options.ResponseHeadersDataClasses.Count > 0; 63_logRequestHeaders = options.RequestHeadersDataClasses.Count > 0;
Logging\Internal\HttpRequestReader.cs (5)
86_logRequestBody = options.RequestBodyContentTypes.Count > 0; 87_logResponseBody = options.ResponseBodyContentTypes.Count > 0; 90_logRequestHeaders = options.RequestHeadersDataClasses.Count > 0; 91_logResponseHeaders = options.ResponseHeadersDataClasses.Count > 0; 92_logRequestQueryParameters = options.RequestQueryParametersDataClasses.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)
90for (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)
268if (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)
268if (collection.Count == 0)
Microsoft.Extensions.Options.Contextual (1)
src\Shared\Throw\Throw.cs (1)
268if (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)
268if (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 (5)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
56if (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)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Dns (5)
DnsServiceEndpointProviderBase.cs (1)
64if (endpoints.Endpoints.Count != 0)
Resolver\DnsResolver.cs (3)
35if (_options.Servers.Count == 0) 44if (_options.Servers.Count == 0) 362for (int index = 0; index < _options.Servers.Count; index++)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Yarp (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Telemetry (3)
Logging\Import\ProviderAliasUtilities.cs (2)
21for (int i = 0; i < attributes.Count; i++) 25attributeData.ConstructorArguments.Count > 0)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Telemetry.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Telemetry.Tests (1)
Buffering\GlobalLogBufferingConfigureOptionsTests.cs (1)
119Assert.Equal(2, options.Rules.Count);
Microsoft.Extensions.TimeProvider.Testing (1)
src\Shared\Throw\Throw.cs (1)
268if (collection.Count == 0)
Microsoft.Extensions.Validation.GeneratorTests (1)
ValidationsGenerator.ComplexType.cs (1)
924Assert.Equal(2, problemDetails.Errors.Count);
Microsoft.Gen.BuildMetadata.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.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 (10)
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++)
Microsoft.Maui.Controls (73)
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++)
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)
389 => (FormattedText?.Spans?.Count ?? 0) > 0; 394 if (FormattedText?.Spans == null || FormattedText?.Spans.Count == 0) 398 for (int i = 0; i < FormattedText.Spans.Count; i++) 401 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)
241 return picker.Items == null ? -1 : ((int)value).Clamp(-1, picker.Items.Count - 1); 310 int insertIndex = e.NewStartingIndex < 0 ? Items.Count : e.NewStartingIndex; 324 if (e.OldStartingIndex < Items.Count) 333 removeStart = Items.Count - e.OldItems.Count; 334 index = Items.Count - 1; 373 var newIndex = SelectedIndex.Clamp(-1, Items.Count - 1); 443 int IItemDelegate<string>.GetCount() => Items?.Count ?? ItemsSource?.Count ?? 0; 449 if (index < Items?.Count) 458 if (index < Items?.Count)
ReadOnlyCastingList.cs (2)
30 get { return _list.Count; } 86 public int Count => _list.Count;
Shell\Shell.cs (1)
1776 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)
1491 if (groups.Count == 0) 1575 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)
596 if (properties != null && properties.Count > 0) 598 var lastProp = properties[properties.Count - 1]; 858 if (properties == null || properties.Count == 0) 917 if (properties == null || properties.Count == 0) 965 il.Append(DigProperties(properties.Take(properties.Count - 1), locs, () => 1058 if (properties == null || properties.Count == 0) 1064 for (int i = 0; i < properties.Count; i++) 1137 for (int i = 0; i < properties.Count; i++)
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)
76 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)
76 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 (12)
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;
ModelSourceGenerationContext.g.cs (1)
51for (int i = 0; i < options.Converters.Count; i++)
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)
306Assert.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.Extensibility.Testing.Xunit (1)
src\VisualStudio\IntegrationTest\Harness\XUnitShared\Harness\EventLogCollector.cs (1)
275&& (eventLogRecord.Properties.Count >= WatsonEventLogEntryPropertyCount)
Microsoft.VisualStudio.LanguageServices (15)
InheritanceMargin\InheritanceGlyphManager.cs (1)
165if (lines.Count > 0)
NavigationBar\NavigationBarClient.cs (2)
101pcEntries = (uint)_projectItems.Count; 105pcEntries = (uint)_currentTypeItems.Count;
Preview\FileChange.cs (1)
90if (diff.Differences.Count == 0)
Utilities\VsEnumBSTR.cs (3)
29pceltCount = (uint)_values.Count; 36for (; i < celt && _currentIndex < _values.Count; i++, _currentIndex++) 56return _currentIndex < _values.Count
Utilities\VsEnumDebugName.cs (3)
29pceltCount = (uint)_values.Count; 36for (; i < celt && _currentIndex < _values.Count; i++, _currentIndex++) 60return _currentIndex < _values.Count
Venus\CodeBlockEnumerator.cs (3)
43pceltFetched = Math.Min(celt, (uint)(_codeBlocks.Count - _currentElement)); 69if (_currentElement > _codeBlocks.Count) 71_currentElement = _codeBlocks.Count;
Venus\ContainedDocument.cs (2)
733while (currentVisibleSpanIndex < visibleSpansInOriginal.Count && 740if (currentVisibleSpanIndex >= visibleSpansInOriginal.Count)
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (4)
1225for (var i = triviaList.Count - 1; i >= 0; i--) 1249if (commentList.Count == 0) 1298if (commentList.Count > 0) 1302var lastIndex = leadingTriviaList.FindIndex(t => t == commentList[commentList.Count - 1]);
Microsoft.VisualStudio.LanguageServices.Implementation (2)
ProjectSystem\CPS\TempPECompiler.cs (2)
31if (filesToInclude == null || filesToInclude.Count == 0) 47var syntaxTrees = new List<SyntaxTree>(capacity: filesToInclude.Count);
Microsoft.Web.Xdt.Extensions (1)
InsertOrAppendAttribute.cs (1)
51if (Arguments != null && Arguments.Count > 0)
PresentationBuildTasks (11)
src\Microsoft.DotNet.Wpf\src\PresentationCore\MS\internal\Media\ParserStreamGeometryContext.cs (2)
669_bw.Write(points.Count); 672for(int i = 0; i < points.Count; i++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (1)
4928for( int i = 0; i < attributes.Count; i++ )
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsCache.cs (3)
216for(int i=0; i<allAttributes.Count; i++) 237for (int i = 0; i<constructorArguments.Count; i++) 257for (int i=0; i<constructorArguments.Count; i++)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (5)
254for (int j = 0; j < list.Count; j++) 287for (int j = 0; j < list.Count && !attributeDataFound; j++) 331if (constructorArguments.Count == 1 && !noArgs) 350else if (constructorArguments.Count == 0) 490for (int j = 0; j < list.Count; j++)
PresentationCore (148)
MS\Internal\FontCache\FamilyCollection.cs (1)
675return _fontCollection.FamilyCount + (UseSystemFonts ? SystemCompositeFonts.NumOfSystemCompositeFonts : checked((uint)UserCompositeFonts.Count));
MS\Internal\FontCache\FontSourceCollection.cs (1)
107fontSources = new List<Text.TextInterface.IFontSource>(files.Count);
MS\Internal\FontFace\FontDriver.cs (2)
255if (glyphs == null || glyphs.Count == 0) 259glyphArray = new ushort[glyphs.Count];
MS\Internal\IListConverters.cs (9)
116StringBuilder builder = new StringBuilder(EstimatedCharCountPerItem * list.Count); 117for (int i = 0; i < list.Count; i++) 157StringBuilder builder = new StringBuilder(EstimatedCharCountPerItem * list.Count); 158for (int i = 0; i < list.Count; i++) 198StringBuilder builder = new StringBuilder(EstimatedCharCountPerItem * list.Count); 199for (int i = 0; i < list.Count; i++) 240StringBuilder builder = new StringBuilder(EstimatedCharCountPerItem * list.Count); 241for (int i = 0; i < list.Count; i++) 280char[] chars = new char[list.Count];
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (1)
195count = (uint)collection.Count;
MS\Internal\Media\ParserStreamGeometryContext.cs (2)
669_bw.Write(points.Count); 672for(int i = 0; i < points.Count; i++)
MS\Internal\Shaping\TypefaceMap.cs (3)
442for(i = 0; i < _cachedScaledTypefaces.Count; i++) 448if(i == _cachedScaledTypefaces.Count) 451i = _cachedScaledTypefaces.Count;
MS\Internal\TextFormatting\Bidi.cs (2)
1759Invariant.Assert(levels != null && levels.Count >= cchText); 1760Invariant.Assert(characterClass != null && characterClass.Count >= cchText);
MS\Internal\TextFormatting\FormattedTextSymbols.cs (3)
71Debug.Assert(shapeables != null && shapeables.Count > 0); 74_glyphs = new Glyphs[shapeables.Count]; 82while (i < shapeables.Count)
MS\Internal\TextFormatting\FullTextLine.cs (1)
2041return boundsList.Count > 0 ? boundsList : null;
MS\Internal\TextFormatting\FullTextState.cs (4)
183int lsTbdCount = pap.Tabs != null ? pap.Tabs.Count : 0; 188if (pap.Tabs != null && pap.Tabs.Count > 0) 190lsTbdCount = pap.Tabs.Count + 1; 210if (pap.Tabs != null && pap.Tabs.Count > 0)
MS\Internal\TextFormatting\LineServicesRun.cs (1)
252for (int i = 0; i < _textEffects.Count; i++)
MS\Internal\TextFormatting\SimpleTextLine.cs (3)
871(boundsList == null || boundsList.Count == 0 ? null : boundsList) 913for (int i = 0; i < displayGlyphAdvances.Count; i++) 1759for (int i = 0; i < displayGlyphAdvances.Count; i++)
MS\Internal\TextFormatting\TextStore.cs (1)
1702int shapeablesCount = shapeables.Count;
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (1)
43InitArrays(realValues.Count);
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (1)
37InitArrays(emSize, pointValues.Count);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\PartialList.cs (1)
35Debug.Assert(initialIndex >= 0 && initialIndex + count <= list.Count);
System\Windows\FreezableCollection.cs (1)
661return enumerableAsICollectionT.Count;
System\Windows\Ink\Stroke.cs (1)
1150return icol.Count;
System\Windows\Input\ManipulationLogic.cs (3)
360int numManipulators = manipulators.Count; 387int count = parameters.Count; 388for (int i = 0; i < parameters.Count; i++)
System\Windows\Media\Animation\AnimationLayer.cs (10)
29|| (newAnimationClocks.Count > 0 105int count = _animationClocks.Count; 119Debug.Assert(animationClocks.Count > 0); 125int count = animationClocks.Count; 146&& _animationClocks.Count > 0, 169if (_animationClocks.Count == 0) 186Debug.Assert(newAnimationClocks.Count > 0); 190int newClocksCount = newAnimationClocks.Count; 196int oldClocksCount = (_animationClocks == null) ? 0 : _animationClocks.Count; 259int count = _animationClocks.Count;
System\Windows\Media\Animation\AnimationStorage.cs (5)
590Debug.Assert(animationClocks.Count > 0, 645storage._animationClocks = new FrugalObjectList<AnimationClock>(animationClocks.Count); 647for (int i = 0; i < animationClocks.Count; i++) 661FrugalObjectList<AnimationClock> newClockCollection = new FrugalObjectList<AnimationClock>(storage._animationClocks.Count + animationClocks.Count); 670for (int i = 0; i < animationClocks.Count; i++)
System\Windows\Media\ByteStreamGeometryContext.cs (1)
635int count = points.Count;
System\Windows\Media\CultureSpecificStringDictionary.cs (4)
65get { return _innerDictionary.Count; } 115if (_innerDictionary.Count > array.Length - index) 149if (_innerDictionary.Count > array.Length - index) 439get { return _innerDictionary.Count; }
System\Windows\Media\FamilyTypefaceCollection.cs (1)
35_count = innerList.Count;
System\Windows\Media\GlyphRun.cs (59)
337(glyphIndices.Count > 0) && 338(glyphIndices.Count <= MaxGlyphCount) && 339(advanceWidths.Count == glyphIndices.Count) && 340((glyphOffsets == null) || ((glyphOffsets != null) && (glyphOffsets.Count != 0) && (glyphOffsets.Count == glyphIndices.Count)))) 360if (characters != null && characters.Count != 0) 362if (clusterMap != null && clusterMap.Count != 0) 364if (clusterMap.Count == characters.Count) 371int mapCount = clusterMap.Count; 398throw new ArgumentException(SR.Format(SR.CollectionNumberOfElementsShouldBeEqualTo, characters.Count), nameof(clusterMap)); 403if (GlyphCount != characters.Count) 408if (caretStops != null && caretStops.Count != 0) 410if (caretStops.Count != CodepointCount + 1) 432if (glyphIndices.Count <= 0) 435if (glyphIndices.Count > MaxGlyphCount) 442if (advanceWidths.Count != glyphIndices.Count) 443throw new ArgumentException(SR.Format(SR.CollectionNumberOfElementsShouldBeEqualTo, glyphIndices.Count), nameof(advanceWidths)); 445if (glyphOffsets != null && glyphOffsets.Count != 0 && glyphOffsets.Count != glyphIndices.Count) 446throw new ArgumentException(SR.Format(SR.CollectionNumberOfElementsShouldBeEqualTo, glyphIndices.Count), nameof(glyphOffsets)); 480IList<bool> caretStops = CaretStops != null && CaretStops.Count != 0 ? CaretStops : new DefaultCaretStopList(CodepointCount); 520if (currentCodepoint >= clusterMap.Count || clusterMap[currentCodepoint] != clusterMap[clusterCodepointStart]) 528if (currentCodepoint >= clusterMap.Count) 529clusterGlyphEnd = advances.Count; 536if (caretCodePoint < currentCodepoint || currentCodepoint >= clusterMap.Count) 572IList<bool> caretStops = CaretStops != null && CaretStops.Count != 0 ? CaretStops : new DefaultCaretStopList(CodepointCount); 592for (int i = 1; i < caretStops.Count; ++i) 594if (i < clusterMap.Count && clusterMap[i] == clusterMap[currentClusterStart]) 600ushort lastGlyphInCluster = i < clusterMap.Count ? clusterMap[i] : (ushort)advances.Count; 639if (caretStops[caretStops.Count - 1]) 642secondStopIndex = caretStops.Count - 1; 655if (caretStops[caretStops.Count - 1]) 656return new CharacterHit(caretStops.Count - 1, 0); 678return new CharacterHit(firstStopIndex, caretStops.Count - 1 - firstStopIndex); 706IList<bool> caretStops = CaretStops != null && CaretStops.Count != 0 ? CaretStops : new DefaultCaretStopList(CodepointCount); 753IList<bool> caretStops = CaretStops != null && CaretStops.Count != 0 ? CaretStops : new DefaultCaretStopList(CodepointCount); 996if (CaretStops == null || CaretStops.Count == 0) 1083if (value.Count <= 0) 1113if (value.Count <= 0) 1190if (_glyphOffsets == null || _glyphOffsets.Count == 0) 1199return _glyphIndices.Count; 1208if (_characters != null && _characters.Count != 0) 1209return _characters.Count; 1210if (_clusterMap != null && _clusterMap.Count != 0) 1211return _clusterMap.Count; 1212return _glyphIndices.Count; 1235int glyphIndicesCount = _glyphIndices.Count; 1897if (_glyphOffsets != null && _glyphOffsets.Count != 0) 1961if (_glyphOffsets != null && _glyphOffsets.Count != 0) 2005if (_glyphOffsets != null && _glyphOffsets.Count != 0) 2031if (characterIndex < 0 || characterIndex >= caretStops.Count) 2048for (int i = characterIndex + 1; i < caretStops.Count; ++i) 2064for (int lastStop = caretStopIndex + 1; lastStop < caretStops.Count; ++lastStop)
System\Windows\Media\GlyphsSerializer.cs (14)
53(_characters == null ? 0 : _characters.Count), 54_indices.Count 76for (characterIndex = 0; characterIndex < _clusters.Count; ++characterIndex) 100Debug.Assert(_indices.Count > glyphClusterStart - _glyphClusterInitialOffset); 101AddCluster(glyphClusterStart - _glyphClusterInitialOffset, _indices.Count, charClusterStart, characterIndex); 106Debug.Assert(_characters == null || _characters.Count == 0 || _indices.Count == _characters.Count); 107for (int i = 0; i < _indices.Count; ++i) 115if (_characters == null || _characters.Count == 0) 121StringBuilder builder = new StringBuilder(_characters.Count); 246if (_characters != null && _characters.Count != 0) 267for (int i = _caretStops.Count - 1; i >= 0; --i) 274lastCaretStop = Math.Min(i | 3, _caretStops.Count - 1);
System\Windows\Media\GlyphTypeface.cs (3)
227if (glyphs.Count <= 0) 230if (glyphs.Count > ushort.MaxValue) 386IDictionary<XmlLanguage, string> adjustedLanguageFaceNames = new Dictionary<XmlLanguage, string>(adjustedFaceNames.Count);
System\Windows\Media\Imaging\BitmapEncoder.cs (4)
335int count = _frames.Count; 377if (_palette != null && _palette.Colors.Count > 0) 657if (colorContexts != null && colorContexts.Count > 0) 659int 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)
183else if ((1 << DestinationFormat.BitsPerPixel) < DestinationPalette.Colors.Count)
System\Windows\Media\PathStreamGeometryContext.cs (1)
312int count = points.Count;
System\Windows\ReverseInheritProperty.cs (1)
69int otherCount = (otherOrigins != null) ? otherOrigins.Count : 0;
PresentationFramework (136)
Microsoft\Win32\CommonItemDialog.cs (1)
415if (places != null && places.Count != 0)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (6)
108int firstPage = pageEl.Count; 116if (pageEl.Count > 0 && ((FixedPageProxy)pageEl[pageEl.Count - 1]).Page == startPage) 196if (fp.Segments.Count == 0) 203part.NameValuePairs.Add(TextSelectionProcessor.CountAttribute, fp.Segments.Count.ToString(NumberFormatInfo.InvariantInfo)); 205for (int i = 0; i < fp.Segments.Count; i++)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (13)
265if (locators.Count > 0) 283ContentLocator[] lists = new ContentLocator[locators.Count]; 666if (newLocators != null && newLocators.Count > 0) 714if (locatorParts != null && locatorParts.Count > 0) 716List<ContentLocatorBase> tempLocators = new List<ContentLocatorBase>(locatorsToReturn.Count * locatorParts.Count); 759if (tempLocators != null && tempLocators.Count > 0) 940if (locators.Count > 0) 948if (locators.Count == 1) 956if (locators.Count > 2) 960for (int i = 1; i < locators.Count - 1; i++) 980data = ResolveSingleLocator(ref selection, ref attachmentLevel, AttachmentLevel.EndPortion, locators[locators.Count - 1], offset, startNode, skipStartNode); 1207if (additionalLocators == null || additionalLocators.Count == 0) 1215for (int i = 1; i < additionalLocators.Count; i++)
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (2)
154for (int i = 0; i < textSegments.Count; i++) 161part.NameValuePairs.Add(CountAttribute, textSegments.Count.ToString(NumberFormatInfo.InvariantInfo));
MS\Internal\Annotations\Anchoring\TextViewSelectionProcessor.cs (2)
230if (segments != null && segments.Count > 0) 233ITextPointer end = segments[segments.Count - 1].End;
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (9)
370ind = ind + res.Count - 1; 622_owners = new List<IHighlightRange>(owners.Count); 638Debug.Assert(owners.Count > 0, "empty owners list"); 639for (int i = 0; i < owners.Count; i++) 823for (int i = 0; i < r1.Count; i++) 828for (int j = 0; j < r2.Count; j++) 847if ((res != null) && (res.Count > 0) && (newOwner != null)) 850if (res.Count == 3) 865Debug.Assert(res.Count == 2, "unexpected resulting segment count after split");
MS\Internal\Annotations\TextAnchor.cs (1)
593List<TextSegment> orderedList = new List<TextSegment>(textSegments.Count);
MS\Internal\Data\DifferencingCollection.cs (1)
49int n = list.Count;
MS\Internal\Documents\TextBoxLine.cs (5)
260Invariant.Assert(textBounds.Count > 0); 262for (int boundIndex = 0; boundIndex < textBounds.Count; boundIndex++) 371return (((TextSpan<TextRun>)runs[runs.Count - 1]).Value is TextEndOfParagraph); 497Invariant.Assert(textBounds != null && textBounds.Count == 1, "Expecting exactly one TextBounds for a single text position."); 502Invariant.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
MS\Internal\Documents\TextBoxView.cs (2)
2045for (int i = 0; i < bounds.Count; i++) 2124for (int i = 0; i < bounds.Count; i++)
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
267Hashtable uidSubstitutions = new Hashtable(newChildren.Count); 328while (nodeIndex < newChildren.Count) 365for (; nodeIndex < newChildren.Count; nodeIndex++)
MS\Internal\Ink\InkCanvasSelection.cs (3)
558if ( elements.Count > 0 ) 1023if ( elements1.Count != elements2.Count )
MS\Internal\PtsHost\Line.cs (10)
507Invariant.Assert(textBounds.Count > 0); 509for (int boundIndex = 0; boundIndex < textBounds.Count; boundIndex++) 633Invariant.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 697cchGlyphRuns -= (glyphRun.Characters == null ? 0 : glyphRun.Characters.Count); 712int characterCount = (run.Characters == null ? 0 : run.Characters.Count); 852return (((TextSpan<TextRun>)_runs[_runs.Count-1]).Value is ParagraphBreakRun); 928TextRun run = ((TextSpan<TextRun>)_runs[_runs.Count - 1]).Value as TextRun; 1001Invariant.Assert(textBounds != null && textBounds.Count == 1, "Expecting exactly one TextBounds for a single text position."); 1005Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position."); 1073cchGlyphRuns += (glyphRun.Characters == null ? 0 : glyphRun.Characters.Count);
MS\Internal\PtsHost\PtsHost.cs (2)
1517for(int breakIndex = 0; breakIndex < Math.Min(textBreakpoints.Count, nLineVariantsAlloc); breakIndex++) 1562nLineVariantsActual = textBreakpoints.Count;
MS\Internal\PtsHost\TextParaClient.cs (2)
1902for (int i = 0, count = rectangles.Count; i < count; ++i) 2014for (int i = 0, count = rectangles.Count; i < count; ++i)
MS\Internal\Text\Line.cs (6)
173Invariant.Assert(textBounds.Count > 0); 176for (int boundIndex = 0; boundIndex < textBounds.Count; boundIndex++) 309Debug.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 415return (((TextSpan<TextRun>)runs[runs.Count-1]).Value is TextEndOfParagraph); 467Invariant.Assert(textBounds != null && textBounds.Count == 1, "Expecting exactly one TextBounds for a single text position."); 472Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
System\Windows\Annotations\AnnotationDocumentPaginator.cs (2)
368if (locators.Count > 0) 371ContentLocator[] lists = new ContentLocator[locators.Count];
System\Windows\Annotations\AnnotationHelper.cs (7)
244if (attachedAnnotations.Count > 0) 624Debug.Assert((textSegments != null) && (textSegments.Count > 0), "Invalid selection TextSegments"); 626if ((attachedAnnotations != null) && (attachedAnnotations.Count > 0)) 634for (int i = attachedAnnotations.Count - 1; i >= 0; i--) 678Invariant.Assert(locators != null && locators.Count > 0); 776List<IAttachedAnnotation> attachedAnnotations = new List<IAttachedAnnotation>(annotations.Count); 1057Invariant.Assert(locators != null && locators.Count > 0, "No locators generated for selection.");
System\Windows\Annotations\AnnotationService.cs (7)
855List<AttachedAnnotationChangedEventArgs> eventsToFire = new List<AttachedAnnotationChangedEventArgs>(attachedAnnotations.Count); 995if (attachedAnnotations?.Count > 0) 1299if (annotations.Count > 0) 1302IAttachedAnnotation[] list = new IAttachedAnnotation[annotations.Count]; 1362if (annotations.Count > 0) 1365IAttachedAnnotation[] list = new IAttachedAnnotation[annotations.Count]; 1402IAttachedAnnotation[] list = new IAttachedAnnotation[annotations.Count];
System\Windows\Annotations\LocatorPart.cs (1)
100if (part.NameValuePairs.Count != _nameValues.Count)
System\Windows\Annotations\LocatorPartList.cs (3)
352if (additionalLocatorParts == null || additionalLocatorParts.Count == 0) 359results = new List<ContentLocatorBase>(additionalLocatorParts.Count); 361for (int i = 1; i < additionalLocatorParts.Count; i++)
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (4)
328this.OwningDataGrid.SelectedCells.Count == 1 && e.AddedCells.Count == 1) 338for (i = 0; i < e.AddedCells.Count; i++) 347for (i = 0; i < e.RemovedCells.Count; i++)
System\Windows\Automation\Peers\DataGridCellItemAutomationPeer.cs (1)
700this.OwningDataGrid.SelectedCells.Count > 0)
System\Windows\Automation\Peers\DataGridItemAutomationPeer.cs (4)
142if (columns != null && columns.Count > 0) 163if (startIndex == 0 || startIndex == columns.Count) 167if (propertyId == 0 && startIndex < columns.Count) 174for (int i = startIndex; i < columns.Count; i++)
System\Windows\Controls\CustomDictionarySources.cs (1)
278get { return ((IList<Uri>)this).Count; }
System\Windows\Controls\TextBlock.cs (2)
2316if (aryTextBounds.Count > 0) 2319int c = aryTextBounds.Count;
System\Windows\Controls\Validation.cs (1)
368for (int groupIndex = 0; groupIndex < groups.Count; ++groupIndex)
System\Windows\Data\BindingGroup.cs (2)
851for (int i=newItems.Count-1; i>=0; --i) 1263for (int i=0, n=list.Count; i<n; ++i)
System\Windows\Documents\DocumentReferenceCollection.cs (2)
63int count = _InternalList.Count; 89return _InternalList.Count;
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (2)
73DocumentsTrace.FixedDocumentSequence.Highlights.Trace($"DSHL.RaiseHighlightChangedEvent ranges={ranges.Count}"); 74Debug.Assert(ranges.Count > 0);
System\Windows\Documents\DocumentSequenceTextContainer.cs (2)
695Debug.Assert(args.Ranges.Count > 0 && args.Ranges[0].Start.CompareTo(args.Ranges[0].End) < 0); 714while (idxScan < args.Ranges.Count)
System\Windows\Documents\FixedDocument.cs (2)
1035Debug.Assert(args.Ranges.Count > 0 && args.Ranges[0].Start.CompareTo(args.Ranges[0].End) < 0); 1138for (int i = 0; i < ranges.Count; i++)
System\Windows\Documents\FixedHighlight.cs (1)
135int chrct = (run.Characters == null ? 0 : run.Characters.Count);
System\Windows\Documents\FixedSOMElement.cs (1)
87endIndex = glyphRun.Characters == null ? 0 : glyphRun.Characters.Count;
System\Windows\Documents\FixedSOMPageConstructor.cs (6)
152for (int i = 0; i <points.Count; i ++) 160_lastPoint = points[points.Count - 1]; 165for (int i = 0; i < points.Count; i++) 174_lastPoint = points[points.Count - 1]; 180_lastPoint = points[points.Count - 1]; 434if (glyphRun.ClusterMap != null && glyphRun.ClusterMap.Count > 0)
System\Windows\Documents\FixedTextView.cs (3)
513int characterCount = (run.Characters == null) ? 0 : run.Characters.Count; 964int characterCount = (run.Characters == null) ? 0 : run.Characters.Count; 990charCount = run.Characters.Count;
System\Windows\Documents\FlowDocument.cs (2)
1395if (args.Ranges.Count > 0) 1407for (i = 0; i < args.Ranges.Count; i++)
System\Windows\Documents\PageContentCollection.cs (2)
58int index = InternalList.Count - 1; 106get { return InternalList.Count; }
System\Windows\Documents\RubberbandSelector.cs (1)
468int characterCount = (run.Characters == null) ? 0 : run.Characters.Count;
System\Windows\ResourceDictionary.cs (5)
1177else if (keys.Count > 0) 1255_numDefer = keyCollection.Count; 1261for (int i = 0; i < keyCollection.Count; i++) 1324Debug.Assert(staticResources != null && staticResources.Count > 0); 1325for (int i = 0; i < staticResources.Count; i++)
System\Windows\Shell\JumpList.cs (2)
60|| (rejectedItems != null && reasons != null && rejectedItems.Count != reasons.Count))
System\Windows\Standard\Utilities.cs (1)
141for (int i = 0; i < frames.Count && bestScore != 0; ++i)
System\Windows\VisualStateManager.cs (1)
168for (int groupIndex = 0; groupIndex < groups.Count; ++groupIndex)
PresentationFramework.Fluent.Tests (1)
ResourceTests\FluentResourceDictionaryTests.cs (1)
112int count = s_colorDictionarySourceList.Count;
PresentationUI (8)
MS\Internal\Documents\RightsManagementManager.cs (4)
1075if (newGrants == null || newGrants.Count == 0) 1091if (newGrants.Count != allRights.Count) 1298if (licenses != null && licenses.Count > 0)
MS\Internal\Documents\RightsManagementProvider.cs (2)
547grantDictionary.Count); 671if (licenses.Count > 0)
MS\Internal\Documents\RMPermissions.cs (1)
129string[] stringArray = new string[rightsStrings.Count];
MS\Internal\Documents\RMPublishingDialog.cs (1)
55if (grantDictionary != null && grantDictionary.Count != 0)
ReachFramework (35)
AlphaFlattener\PrimitiveList.cs (1)
172for (int i = 0; i < chars.Count; i ++)
AlphaFlattener\Utility.cs (5)
2724_count += points.Count; 2728for (int index = 0; index < points.Count && IsRectangle; index++) 2734AddLineSegments(points.Count); 2742_count += (points.Count + 1) / 2 * 3; 2750_count += (points.Count + 2) / 3 * 3;
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (2)
304if (paperSizes.Count > 0) 333if (0 <= defaultPaperSizeIndex && defaultPaperSizeIndex < paperSizes.Count)
MS\Internal\Printing\MostFrequentlyUsedCache.cs (2)
27while(this._dictionary.Count >= this._maxEntries) 32Debug.Assert(this._dictionary.Count <= this._maxEntries);
Packaging\XpsFixedDocumentReaderWriter.cs (1)
861if (linkTargetStream.Count != 0)
PrintConfig\PrintCapabilitesWriter.cs (16)
164if (nUps.Count > 0) 255if (bins.Count > 0) 262for (int i = 0; i < bins.Count; i++) 306string optionDisplayName = (i < binDisplayNames.Count) ? binDisplayNames[i] : null; 324if (paperSizeCodes.Count > 0) 331for (int i = 0; i < paperSizeCodes.Count; i++) 349((i < paperSizeDisplayNames.Count) || (i < paperSizes.Count))) 351string optionDisplayName = (i < paperSizeDisplayNames.Count) ? paperSizeDisplayNames[i] : null; 354if (i < paperSizes.Count) 382if (mediaTypes.Count > 0 && mediaTypeDisplayNames.Count > 0) 389for (int i = 0; i < mediaTypes.Count; i++) 414optionDisplayName = (i < mediaTypeDisplayNames.Count) ? mediaTypeDisplayNames[i] : null; 490if(resolutions.Count > 0) 497for (int i = 0; i < resolutions.Count; i++)
PrintConfig\PrintSchemaShim.cs (4)
410if (bins.Count < 1) 424if (mediaTypes.Count < 1) 438if (papers.Count < 1) 471for (int i = 0; i < points.Count; i++)
Serialization\ImageSourceTypeConverter.cs (1)
354&& bitmapSource.Palette.Colors.Count > 0)
Serialization\VisualSerializer.cs (3)
1603for (int i = 0; i < glyphRun.Characters.Count; i++) 2135if (serializeGlyphRun.Characters.Count > MaxGlyphCount) 2145if (serializeGlyphRun.GlyphIndices.Count > MaxGlyphCount)
Replay (2)
src\Compilers\Shared\BuildProtocol.cs (2)
87var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 103for (int i = 0; i < args.Count; ++i)
Roslyn.Diagnostics.Analyzers (52)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 200Contract.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)
Roslyn.Diagnostics.CSharp.Analyzers (18)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (1)
375if (result.GetTextChanges(cancellationToken).Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.FormattedComplexTrivia.cs (1)
54get { return _textChanges.Count > 0; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (4)
60for (var i = 0; i < xNameParts.Count && i < yNameParts.Count; i++) 69return xNameParts.Count - yNameParts.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
165for (var i = 0; i < list.Count - 1; i++) 178for (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)
326if (modifierTokens.Count >= 2) 329if (modifierTokens.Count == 1) 352if (modifierTokens.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\NameSyntaxExtensions.cs (1)
21return parts[parts.Count - 1];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
74.Skip(reservedNames.Count)];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (2)
151if (usingsToRemove.Count == 0) 205if (usingsToRemove.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
650if (map.Count > 0 && (bestMap == null || map.Count > bestMap.Count))
Sample (52)
artifacts\obj\Sample\Release\net11.0\generated\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Microsoft.AspNetCore.Http.RequestDelegateGenerator.RequestDelegateGenerator\GeneratedRouteBuilderExtensions.g.cs (52)
94if (options.EndpointBuilder.FilterFactories.Count > 0) 205if (options.EndpointBuilder.FilterFactories.Count > 0) 326if (options.EndpointBuilder.FilterFactories.Count > 0) 448if (options.EndpointBuilder.FilterFactories.Count > 0) 586if (options.EndpointBuilder.FilterFactories.Count > 0) 671if (options.EndpointBuilder.FilterFactories.Count > 0) 756if (options.EndpointBuilder.FilterFactories.Count > 0) 839if (options.EndpointBuilder.FilterFactories.Count > 0) 926if (options.EndpointBuilder.FilterFactories.Count > 0) 1013if (options.EndpointBuilder.FilterFactories.Count > 0) 1105if (options.EndpointBuilder.FilterFactories.Count > 0) 1280if (options.EndpointBuilder.FilterFactories.Count > 0) 1404if (options.EndpointBuilder.FilterFactories.Count > 0) 1513if (options.EndpointBuilder.FilterFactories.Count > 0) 1655if (options.EndpointBuilder.FilterFactories.Count > 0) 1777if (options.EndpointBuilder.FilterFactories.Count > 0) 1878if (options.EndpointBuilder.FilterFactories.Count > 0) 1963if (options.EndpointBuilder.FilterFactories.Count > 0) 2066if (options.EndpointBuilder.FilterFactories.Count > 0) 2185if (options.EndpointBuilder.FilterFactories.Count > 0) 2304if (options.EndpointBuilder.FilterFactories.Count > 0) 2423if (options.EndpointBuilder.FilterFactories.Count > 0) 2542if (options.EndpointBuilder.FilterFactories.Count > 0) 2661if (options.EndpointBuilder.FilterFactories.Count > 0) 2780if (options.EndpointBuilder.FilterFactories.Count > 0) 2899if (options.EndpointBuilder.FilterFactories.Count > 0) 3022if (options.EndpointBuilder.FilterFactories.Count > 0) 3148if (options.EndpointBuilder.FilterFactories.Count > 0) 3274if (options.EndpointBuilder.FilterFactories.Count > 0) 3376if (options.EndpointBuilder.FilterFactories.Count > 0) 3483if (options.EndpointBuilder.FilterFactories.Count > 0) 3606if (options.EndpointBuilder.FilterFactories.Count > 0) 3729if (options.EndpointBuilder.FilterFactories.Count > 0) 3832if (options.EndpointBuilder.FilterFactories.Count > 0) 3921if (options.EndpointBuilder.FilterFactories.Count > 0) 4024if (options.EndpointBuilder.FilterFactories.Count > 0) 4147if (options.EndpointBuilder.FilterFactories.Count > 0) 4270if (options.EndpointBuilder.FilterFactories.Count > 0) 4373if (options.EndpointBuilder.FilterFactories.Count > 0) 4460if (options.EndpointBuilder.FilterFactories.Count > 0) 4553if (options.EndpointBuilder.FilterFactories.Count > 0) 4692if (options.EndpointBuilder.FilterFactories.Count > 0) 4801if (options.EndpointBuilder.FilterFactories.Count > 0) 4922if (options.EndpointBuilder.FilterFactories.Count > 0) 5004if (options.EndpointBuilder.FilterFactories.Count > 0) 5112if (options.EndpointBuilder.FilterFactories.Count > 0) 5235if (options.EndpointBuilder.FilterFactories.Count > 0) 5354if (options.EndpointBuilder.FilterFactories.Count > 0) 5473if (options.EndpointBuilder.FilterFactories.Count > 0) 5592if (options.EndpointBuilder.FilterFactories.Count > 0) 5711if (options.EndpointBuilder.FilterFactories.Count > 0) 5810for (var i = routeHandlerFilters.Count - 1; i >= 0; i--)
Shared (4)
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)
Throw\Throw.cs (1)
268if (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)
24T[] 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)
46ValidateCopyToArguments(collection.Count, array, index);
System\Collections\Generic\OrderedDictionary.cs (2)
161this(dictionary?.Count ?? 0, comparer) 195this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
System\Collections\Generic\PriorityQueue.cs (2)
403if (collection is not null && (count = collection.Count) > _nodes.Length - _size) 466(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)
1323if (other is ICollection<T> c && c.Count == 0)
System.Collections.Concurrent (4)
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)); 158if (_metadataConstraints.Count == 1) 180if (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)
249object[] values = new object[keys.Count];
System.Diagnostics.DiagnosticSource (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;
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)
1058PackUriHelper.ValidatedPartUri[] partKeys = new PackUriHelper.ValidatedPartUri[_partList.Keys.Count];
System.Linq (50)
System\Linq\AnyAll.cs (1)
20return gc.Count != 0;
System\Linq\AppendPrepend.SpeedOpt.cs (2)
23result = new TSource[c.Count + 1]; 193var 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; 178int sourceCount = collection?.Count ?? source.Count(); 247int sourceCount = source.Count; 261int 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)
280private int CountForDebugger => _source.Count;
System\Linq\Select.SizeOpt.cs (2)
89TResult[] array = new TResult[_source.Count]; 99List<TResult> list = new List<TResult>(_source.Count);
System\Linq\Select.SpeedOpt.cs (12)
515int count = _source.Count; 530int count = _source.Count; 551int count = _source.Count; 578if ((uint)index < (uint)_source.Count) 590if (_source.Count != 0) 602int len = _source.Count; 615int count = _source.Count; 874if ((uint)index <= (uint)(_maxIndexInclusive - _minIndexInclusive) && index < _source.Count - _minIndexInclusive) 904if ((uint)index <= (uint)(_maxIndexInclusive - _minIndexInclusive) && index < _source.Count - _minIndexInclusive) 916if (_source.Count > _minIndexInclusive) 928int lastIndex = _source.Count - 1; 943int count = _source.Count;
System\Linq\SequenceEqual.cs (3)
32if (firstCol.Count != secondCol.Count) 41int count = firstCol.Count;
System\Linq\Shuffle.SpeedOpt.cs (5)
52int listCount = list.Count; 177int count = list.Count; 208int listCount = list.Count; 294if (list.Count <= _takeCount) 299totalCount = list.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; 104public int Count => GetAdjustedCount(_minIndexInclusive, _maxIndexInclusive, _source.Count);
System\Linq\ToCollection.cs (1)
47int count = collection.Count;
System.Linq.AsyncEnumerable (1)
System\Linq\ToAsyncEnumerable.cs (1)
56int 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)
287if (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 (2)
115if (values is IList<string?> { Count: 1 } valuesList) 204int count = valuesList.Count;
System\Net\Http\HttpRequestOptions.cs (1)
97var items = new KeyValuePair<string, object?>[dictionary.Count];
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)
1144if (buffers.Count == 0) 1638if (buffers.Count == 0)
System\Net\Sockets\Socket.Tasks.cs (1)
817if (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 (58)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
37int count = ic.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (2)
288ICollection<KeyValuePair<TKey, TValue>> c => Math.Max(DefaultCapacity, c.Count), 2713var keyValuePairs = new KeyValuePair<TKey, TValue>[_dictionary.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; 842if (otherAsCollection.Count == 0) 947if (Count > otherAsCollection.Count) 983if (otherAsCollection.Count <= Count) 1028if (otherAsCollection.Count == 0) 1072if (otherAsCollection.Count == 0) 1149return otherAsCollection.Count == 0; 1168if (Count > otherAsCollection.Count)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ICollectionDebugView.cs (1)
24T[] 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)
46ValidateCopyToArguments(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>)[]).GetEnumerator() :
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (5)
3060Debug.Assert(data.ConstructorArguments.Count <= 1); 3062if (data.ConstructorArguments.Count == 1) 3066else if (data.ConstructorArguments.Count == 0) 3452if ((flags & EventManifestOptions.Strict) != 0 && (manifest?.Errors.Count > 0 || exception != null)) 3456if (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) 309attribute.ConstructorArguments.Count == 1) 401attribute.ConstructorArguments.Count == 1)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (3)
6015count = taskCollection.Count; 6329int count = taskCollection.Count; 6815int 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)
1615for (int i = 0; i < attrs.Count; i++)
System.Private.DataContractSerialization (21)
System\Runtime\Serialization\DataContract.cs (1)
1923if (nestedParameterCounts.Count > 1 || !genericNameProvider.ParametersFromBuiltInNamespaces)
System\Runtime\Serialization\DataContractSet.cs (3)
486genericParameters = new object[genInfo.Parameters.Count]; 487DataContract[] structureCheckContracts = new DataContract[genInfo.Parameters.Count]; 488for (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)
842else if (dataNode.Size != dataNode.Items.Count) 843throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ArraySizeAttributeIncorrect, arraySize, dataNode.Items.Count)); 849dataNode.Size = dataNode.Items.Count; 1054for (int i = 0; i < xmlAttributes.Count; i++) 1061for (int i = 0; i < xmlChildNodes.Count; i++)
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (5)
427IncrementCollectionCount(xmlWriter, collection.Count); 665for (int i = 0; i < members.Count; i++) 763for (int i = 0; i < members.Count; i++) 784for (int i = 0; i < items.Count; i++) 808for (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)
1022for (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)
516for (int i = 0; i < tmpl.Content.Count; i++) 705for (int i = from; i < instructions.Count; i++) 771i = instructions.Count; 1178for (int i = 0; i < content.Count; i++) 1264if (content.Count > 0) 1418for (int i = cases.Count - 1; 0 <= i; i--) 1489else if (content.Count != 0) 1529while (i < content.Count) 2534if (args.Count <= pos || args[pos].Name != name) 2572if (actualArgs.Count != formalArgs.Count) 2583for (int actArg = 0; actArg < actualArgs.Count; actArg++) 2664for (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++) 219XmlExtensionFunction? scrFunc = _compiler.Scripts.ResolveFunction(name, ns, args.Count, (IErrorHelper)this); 243for (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) 1140XmlExtensionFunction? scrFunc = _compiler.Scripts.ResolveFunction(name, ns, args.Count, default(NullErrorHelper)); 1354int last = content.Count - 1; 1480Debug.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)
135if (ctas.Count != 1)
System\Reflection\TypeLoading\Types\RoType.cs (1)
302if (fixedArguments.Count == 1 && fixedArguments[0].Value is string memberName)
System.Runtime.Caching (2)
System\Runtime\Caching\HostFileChangeMonitor.cs (2)
164if (filePaths.Count == 0) 177List<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.Primitives (43)
System\IdentityModel\Claims\DefaultClaimSet.cs (3)
47get { return _claims.Count; } 62for (int i = 0; i < _claims.Count; ++i) 77for (int i = 0; i < _claims.Count; ++i)
System\IdentityModel\Claims\X509CertificateClaimSet.cs (2)
69return _claims.Count; 306for (int i = 0; i < _claims.Count; ++i)
System\IdentityModel\SecurityUtils.cs (4)
138if (authorizationPolicies != null && authorizationPolicies.Count == 1 && authorizationPolicies[0] is UnconditionalPolicy) 143else if (authorizationPolicies == null || authorizationPolicies.Count <= 0) 151object[] policyState = new object[authorizationPolicies.Count]; 159for (int i = 0; i < authorizationPolicies.Count; i++)
System\IdentityModel\Tokens\WSSecurityJan2004.cs (3)
199for (int i = 0; i < StrEntries.Count; ++i) 224for (int i = 0; i < StrEntries.Count; ++i) 236for (int i = 0; i < StrEntries.Count; ++i)
System\IdentityModel\Tokens\WSSecurityXXX2005.cs (1)
54for (int i = 0; i < StrEntries.Count; ++i)
System\ServiceModel\Channels\AddressHeaderCollection.cs (1)
27for (int i = 0; i < collection.Count; i++)
System\ServiceModel\Channels\BinaryMessageEncoder.cs (2)
379for (int i = 0; i < newStrings.Count; i++) 409for (int i = 0; i < newStrings.Count; i++)
System\ServiceModel\Channels\CloseCollectionAsyncResult.cs (2)
25_count = collection.Count; 32for (int index = 0; index < collection.Count; index++)
System\ServiceModel\Channels\OpenCollectionAsyncResult.cs (2)
26_count = collection.Count; 33for (int index = 0; index < collection.Count; index++)
System\ServiceModel\Dispatcher\FaultFormatter.cs (1)
125for (int i = 0; i < faultInfos.Count; i++)
System\ServiceModel\Dispatcher\XmlSerializerFaultFormatter.cs (1)
87for (int i = 0; i < faultInfos.Count; i++)
System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs (1)
598object[] messageHeaderOfTArray = (object[])Array.CreateInstance(TypedHeaderManager.GetMessageHeaderType(headerDescription.Type), messageHeaderOfTAttributes.Count);
System\ServiceModel\EmptyArray.cs (2)
26if (collection.Count == 0) 32T[] array = new T[collection.Count];
System\ServiceModel\Security\ReceiveSecurityHeader.cs (7)
368for (int i = 0; i < _outOfBandPrimaryTokenCollection.Count; ++i) 404if (_supportingTokenAuthenticators != null && _supportingTokenAuthenticators.Count > 0) 406_supportingTokenTrackers = new List<TokenTracker>(_supportingTokenAuthenticators.Count); 407for (int i = 0; i < _supportingTokenAuthenticators.Count; ++i) 584for (int i = 0; i < _supportingTokenAuthenticators.Count; ++i) 615for (int i = 0; i < _outOfBandPrimaryTokenCollection.Count; ++i) 775for (int i = 0; i < allowedTokenAuthenticators.Count; ++i)
System\ServiceModel\Security\SecurityProtocol.cs (9)
264if (scopedProviders == null || scopedProviders.Count == 0) 331if (ChannelSupportingTokenProviderSpecification.Count == 0) 422if (tokens == null || tokens.Count == 0) 427for (int i = 0; i < tokens.Count; ++i) 507if (supportingTokenProviders != null && supportingTokenProviders.Count > 0) 510for (int i = 0; i < supportingTokenProviders.Count; ++i) 528if (supportingAuthenticators != null && supportingAuthenticators.Count > 0) 530for (int i = 0; i < supportingAuthenticators.Count; ++i) 561for (int i = 0; i < supportingTokens.Count; ++i)
System\ServiceModel\ServiceSecurityContext.cs (1)
82if (identities != null && identities.Count == 1)
System\ServiceModel\SynchronizedReadOnlyCollection.cs (1)
75get { lock (_sync) { return Items.Count; } }
System.ServiceModel.Syndication (3)
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (2)
35for (int i = 0; i < source.Items.Count; ++i) 135for (int i = 0; i < Items.Count; ++i)
System\ServiceModel\Syndication\SyndicationFeed.cs (1)
91for (int i = 0; i < srcList.Count; ++i)
System.Text.Json (6)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
122int 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)
87if (parentPolymorphicTypeInfo is null && typeInfo.PolymorphismOptions is { DerivedTypes.Count: > 0 } polyOptions)
System\Text\Json\Serialization\Converters\FSharp\FSharpMapConverter.cs (1)
48int mapCount = ((ICollection<KeyValuePair<TKey, TValue>>)map).Count;
System\Text\Json\Serialization\JsonSerializerContext.cs (1)
61options.Converters.Count == 0 &&
System\Text\Json\Serialization\ReadStackFrame.cs (1)
155AssignedProperties = new BitArray(typeInfo.Properties.Count);
System.Text.Json.SourceGeneration (1)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
122int 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)
176if (exceptions != null && exceptions.Count > 0)
System.Threading.Tasks.Parallel (5)
System\Threading\Tasks\Parallel.cs (5)
17630, list.Count, parallelOptions, (i) => body(list[i]), null, null, null, null); 17680, list.Count, parallelOptions, null, (i, state) => bodyWithState(list[i], state), null, null, null); 17730, list.Count, parallelOptions, null, (i, state) => bodyWithStateAndIndex(list[i], state, i), null, null, null); 17780, list.Count, parallelOptions, null, null, (i, state, local) => bodyWithStateAndLocal(list[i], state, local), localInit, localFinally); 17830, 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)
75for (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)
197Assert.Equal(28, values.Count);
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (21)
249Assert.Equal(2, neighboringToolsRectangles.Count); 267Assert.Equal(3, neighboringToolsRectangles.Count); 286Assert.Equal(2, neighboringToolsRectangles.Count); 304Assert.Equal(3, neighboringToolsRectangles.Count); 323Assert.Equal(4, neighboringToolsRectangles.Count); 343Assert.Equal(3, neighboringToolsRectangles.Count); 362Assert.Equal(2, neighboringToolsRectangles.Count); 380Assert.Equal(3, neighboringToolsRectangles.Count); 399Assert.Equal(2, neighboringToolsRectangles.Count); 418Assert.Equal(2, neighboringToolsRectangles.Count); 438Assert.Equal(3, neighboringToolsRectangles.Count); 459Assert.Equal(2, neighboringToolsRectangles.Count); 479Assert.Equal(3, neighboringToolsRectangles.Count); 500Assert.Equal(4, neighboringToolsRectangles.Count); 522Assert.Equal(3, neighboringToolsRectangles.Count); 543Assert.Equal(2, neighboringToolsRectangles.Count); 562Assert.Equal(3, neighboringToolsRectangles.Count); 582Assert.Equal(2, neighboringToolsRectangles.Count); 599Assert.Equal(2, neighboringToolsRectangles.Count); 616Assert.Equal(3, neighboringToolsRectangles.Count); 634Assert.Equal(2, neighboringToolsRectangles.Count);
System\Windows\Forms\ScrollBarTests.cs (1)
2495Assert.Equal(expected.Count, callCount);
System\Windows\Forms\TreeNode.IKeyboardToolTipTests.cs (8)
144Assert.Equal(2, neighboringRectangles.Count); 179Assert.Equal(2, neighboringRectangles.Count); 198Assert.Equal(2, neighboringRectangles.Count); 217Assert.Equal(2, neighboringRectangles.Count); 238Assert.Equal(2, neighboringRectangles.Count); 257Assert.Equal(2, neighboringRectangles.Count); 278Assert.Equal(2, neighboringRectangles.Count); 298Assert.Equal(2, neighboringRectangles.Count);
System.Xaml (43)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (2)
1304_count = collection.Count; 1990int count = collection.Count;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (4)
254for (int j = 0; j < list.Count; j++) 287for (int j = 0; j < list.Count && !attributeDataFound; j++) 331if (constructorArguments.Count == 1 && !noArgs) 350else if (constructorArguments.Count == 0)
System\Xaml\Context\XamlContext.cs (1)
385XamlType[] typeArgArray = new XamlType[typeArguments.Count];
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1249int paramTypesCount = paramTypes.Count;
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
440string[] keys = new string[dict.Count];
System\Xaml\Schema\Reflector.cs (6)
444if (cad.ConstructorArguments.Count == 1) 459if (cad.ConstructorArguments.Count != count) 494if (cad.ConstructorArguments.Count == 0) 499if (cad.ConstructorArguments.Count > 1 || 519for (int i = 0; i < _attributeData.Count; i++) 533for (int i = 0; i < _attributeData.Count; i++)
System\Xaml\Schema\XamlTypeInvoker.cs (1)
150(_xamlType.AllowedContentTypes.Count == 1 && contentType.CanAssignTo(_xamlType.ItemType)))
System\Xaml\Schema\XamlTypeTypeConverter.cs (2)
104typeArgs = new XamlType[typeName.TypeArguments.Count]; 105for (int i = 0; i < typeName.TypeArguments.Count; i++)
System\Xaml\XamlMember.cs (1)
213if (namespaces.Count > 0)
System\Xaml\XamlObjectReader.cs (5)
727for (int i = 0; i < itemsList.Count; i++) 765bool isLastElementOfCollection = (i == (itemsList.Count - 1)); 1095if (property.XamlNode.Member.DependsOn.Count > 0) 1180if (types is null || types.Count == 0) 1685if (constructorArguments.Count == properties.Count)
System\Xaml\XamlSchemaContext.cs (7)
290typeArgs = new XamlType[xamlTypeName.TypeArguments.Count]; 291for (int i = 0; i < xamlTypeName.TypeArguments.Count; i++) 785if (friends.Count == 0) 834for (int i = _unexaminedAssemblies.Count - 1; i >= 0; i--) 1124for (int i = 0; i < unexaminedAssembliesCopy.Count; i++) 1152for (int j = i; j < unexaminedAssembliesCopy.Count; j++) 1189for (int i = 0; i < xmlnsDefs.Count; i++)
System\Xaml\XamlType.cs (12)
135if (namespaces.Count > 0) 728List<XamlType> result = new List<XamlType>(contentWrappers.Count + 1); 1472for (int i = 0; i < TypeArguments.Count; i++) 1475if (i < TypeArguments.Count - 1) 1568if (list.Count > 0) 1578if (typeArguments is null || typeArguments.Count == 0) 1663List<XamlMember> result = new List<XamlMember>(excludedMembers.Count); 1664for (int i = 0; i < excludedMembers.Count; i++) 1850if (_typeArguments is not null && _typeArguments.Count > 0) 1941if (xamlType1._typeArguments.Count != xamlType2._typeArguments.Count) 1946for (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);
Test.Utilities (47)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
Text.Analyzers (52)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (5)
44for (int i = 0, count = list.Count; i < count; i++) 87if (items is ICollection<T> collection && collection.Count == 0) 203return genericCollection.Count == 0; 231return source.Count == 0; 790return (list.Count == 1) ? list[0] : default;
src\Dependencies\Collections\Internal\ICollectionDebugView`1.cs (1)
33var items = new T[_collection.Count];
src\Dependencies\Collections\Internal\IDictionaryDebugView`2.cs (3)
34var items = new KeyValuePair<K, V>[_dict.Count]; 55var items = new TKey[_collection.Count]; 76var items = new TValue[_collection.Count];
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
165if (items is ICollection<T> { Count: 0 })
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
124: this(dictionary?.Count ?? 0, comparer) 140: this((collection as ICollection<KeyValuePair<TKey, TValue>>)?.Count ?? 0, comparer)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (7)
122var count = coll.Count; 448if (otherAsCollection.Count == 0) 588if (otherAsCollection.Count == 0) 596return otherAsCollection.Count > 0; 637if (otherAsCollection.Count == 0) 681if (otherAsCollection.Count == 0) 772otherAsCollection.Count > 0)
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (3)
89var count = c.Count; 306var count = c.Count; 906var count = c.Count;
src\Dependencies\Collections\Specialized\SpecializedCollections.cs (3)
97return collection == null || collection.Count == 0 104return set == null || set.Count == 0 111return set == null || set.Count == 0
src\Dependencies\Collections\Specialized\SpecializedCollections.ReadOnly.Collection.cs (1)
48return this.Underlying.Count;
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
52return collectionoft.Count == count; 89return collectionoft.Count > count; 126return collectionoft.Count < count;
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
299if (set1.Length > set2.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (3)
90for (var i = 0; i < list.Count; i++) 107for (var i = 0; i < list.Count; i++) 118for (var i = 0; i < list.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
51for (var i = range.Count - 1; i >= 0; i--)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (3)
56return this.GetTextChanges(CancellationToken.None).Count > 0; 82if (_formattingResults.Count == 1) 88var 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)
45for (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\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
16if (index < sequence.Count && predicate(sequence[index]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
468if (t1.Count != t2.Count) 477for (var i = 0; i < t1.Count; ++i)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (3)
64CodeGenerationNamespaceInfo.GetImports(innermostNamespace).Count == 0) 93for (var i = index; i < availableIndices.Count; i++) 200Contract.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)
vbc (2)
src\Compilers\Shared\BuildProtocol.cs (2)
87var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 103for (int i = 0; i < args.Count; ++i)
VBCSCompiler (2)
src\Compilers\Shared\BuildProtocol.cs (2)
87var requestLength = args.Count + 1 + (libDirectory == null ? 0 : 1); 103for (int i = 0; i < args.Count; ++i)
Wasm.Performance.TestApp (1)
PersonJsonContext.g.cs (1)
56for (int i = 0; i < options.Converters.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)