672 implementations of Count
Aspire.RabbitMQ.Client (1)
src\Components\Aspire.RabbitMQ.Client\RabbitMQEventSourceLogForwarder.cs (1)
76public int Count { get; }
ConfigurationSchemaGenerator (1)
RuntimeSource\SourceGenerators\ImmutableEquatableArray.cs (1)
22public int Count => _values.Length;
GenerateDocumentationAndConfigFiles (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Metrics (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Metrics.Legacy (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.AspNetCore.Components (3)
ResourceAssetCollection.cs (1)
68int IReadOnlyCollection<ResourceAsset>.Count => _resources.Count;
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
312public int Count => _count;
src\Http\Routing\src\PathTokenizer.cs (1)
28public int Count
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.cs (1)
282public int Count => _form.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 (4)
Internal\HostingApplicationDiagnostics.cs (1)
497public int Count => 2;
Internal\HostingRequestFinishedLog.cs (1)
22public int Count => 12;
Internal\HostingRequestStartingLog.cs (1)
21public int Count => 10;
Internal\HostingRequestUnhandledLog.cs (1)
19public int Count => 7;
Microsoft.AspNetCore.Http (1)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
144public int Count => _dictionaryStorage != null ? _dictionaryStorage.Count : _count;
Microsoft.AspNetCore.Http.Abstractions (2)
Routing\EndpointMetadataCollection.cs (1)
63public int Count => _items.Length;
Routing\RouteValueDictionary.cs (1)
312public int Count => _count;
Microsoft.AspNetCore.Http.Connections (1)
Internal\ConnectionLogScope.cs (1)
33public int Count => string.IsNullOrEmpty(ConnectionId) ? 0 : 1;
Microsoft.AspNetCore.Http.Connections.Client (1)
Internal\ConnectionLogScope.cs (1)
41public int Count => string.IsNullOrEmpty(ConnectionId) ? 0 : 1;
Microsoft.AspNetCore.HttpLogging (1)
HttpLog.cs (1)
25public int Count => _keyValues.Count;
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelStateDictionary.cs (1)
137public int Count { get; private set; }
ModelBinding\Validation\ValidationStateDictionary.cs (1)
55public int Count => _inner.Count;
Microsoft.AspNetCore.Mvc.Core (2)
Diagnostics\EventData.cs (1)
26int IReadOnlyCollection<KeyValuePair<string, object>>.Count => Count;
MvcCoreLoggerExtensions.cs (1)
307public int Count => 2;
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
AttributeDictionary.cs (1)
57public int Count => _items == null ? 0 : _items.Count;
ViewComponents\DefaultViewComponentInvoker.cs (1)
309public int Count => 2;
Microsoft.AspNetCore.Routing (1)
PathTokenizer.cs (1)
28public int Count
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\ConnectionLogScope.cs (1)
33public int Count => 1;
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
144public int Count => _dictionaryStorage != null ? _dictionaryStorage.Count : _count;
Microsoft.AspNetCore.SignalR.Client.Core (1)
Internal\ConnectionLogScope.cs (1)
42public int Count => string.IsNullOrEmpty(ConnectionId) ? 0 : 1;
Microsoft.AspNetCore.SignalR.Core (1)
Internal\HubGroupList.cs (1)
45public int Count => _groups.Count;
Microsoft.Build.Framework (14)
ImmutableSegmentedDictionary`2.cs (1)
84public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+Builder.cs (1)
54public int Count => ReadOnlyDictionary.Count;
ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
26public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
26public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
22public int Count => _dictionary.Count;
ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
22public int Count => _dictionary.Count;
ImmutableSegmentedList`1.cs (1)
81public int Count => _list.Count;
ImmutableSegmentedList`1+Builder.cs (1)
24public int Count => _builder.Count;
ImmutableSegmentedList`1+ValueBuilder.cs (1)
33public int Count => ReadOnlyList.Count;
SegmentedArray`1.cs (1)
129int IReadOnlyCollection<T>.Count => Length;
SegmentedDictionary`2.cs (3)
165public int Count => _count - _freeCount; 1301public int Count => _dictionary.Count; 1501public int Count => _dictionary.Count;
SegmentedList`1.cs (1)
152public int Count => _size;
Microsoft.CodeAnalysis (32)
Collections\OrderedSet.cs (1)
47public int Count
InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
Operations\IOperation.OperationList.cs (1)
33public int Count => _operation.ChildOperationsCount;
Operations\IOperation.OperationList.Reversed.cs (1)
35public int Count => _operation.ChildOperationsCount;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Syntax\ChildSyntaxList.cs (1)
29public int Count
Syntax\SeparatedSyntaxList.cs (1)
96public int Count
Syntax\SyntaxList`1.cs (1)
109public int Count
Syntax\SyntaxNodeOrTokenList.cs (1)
124public int Count
Syntax\SyntaxTokenList.cs (1)
117public int Count => Node == null ? 0 : (Node.IsList ? Node.SlotCount : 1);
Syntax\SyntaxTriviaList.cs (1)
107public int Count
Text\TextLineCollection.cs (1)
21public abstract int Count { get; }
Microsoft.CodeAnalysis.Analyzers (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.AnalyzerUtilities (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.BannedApiAnalyzers (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.CodeStyle (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
src\Workspaces\CoreTestUtilities\OptionsCollection.cs (1)
35public int Count => _options.Count;
Microsoft.CodeAnalysis.Collections.Package (21)
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)
128int IReadOnlyCollection<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.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 (21)
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.InteractiveHost (21)
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.PooledObjects.Package (1)
ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.PublicApiAnalyzers (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.ResxSourceGenerator (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.Threading.Package (21)
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.UnitTests (1)
Collections\Extensions\EnumerableExtensionsTests.cs (1)
64public int Count => _items.Length;
Microsoft.CodeAnalysis.Workspaces (24)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Workspace\Solution\ChecksumCollection.cs (1)
27public int Count => children.Length;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (22)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
OptionsCollection.cs (1)
35public int Count => _options.Count;
Microsoft.DotNet.XUnitAssert.Tests (1)
Utility\ReadOnlySet.cs (1)
15 public int Count => hashSet.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)
77public int Count => _dictionary.Count;
Embeddings\GeneratedEmbeddings.cs (1)
56public int Count => _embeddings.Count;
Functions\AIFunctionArguments.cs (1)
117public 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.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
1116public int Count => 1; 1164public int Count => _dictionary.Count;
Microsoft.Extensions.AI.AzureAIInference (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.AI.Ollama (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.AI.OpenAI (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.Diagnostics.HealthChecks (2)
DefaultHealthCheckService.cs (1)
301public int Count => _values.Count;
HealthCheckLogScope.cs (1)
14int IReadOnlyCollection<KeyValuePair<string, object>>.Count { get; } = 1;
Microsoft.Extensions.Http (1)
Logging\HttpHeadersLogValue.cs (1)
74public int Count => Values.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.Logging (1)
LoggerFactoryScopeProvider.cs (1)
171public int Count { get; }
Microsoft.Extensions.Logging.Abstractions (8)
FormattedLogValues.cs (1)
81public int Count
LoggerMessage.cs (7)
489public int Count => 1; 533public int Count => 2; 585public int Count => 3; 612public int Count => 4; 668public int Count => 5; 730public int Count => 6; 796public int Count => 7;
Microsoft.Extensions.Primitives (1)
StringValues.cs (1)
91public int Count
Microsoft.Extensions.Telemetry (3)
Logging\ExtendedLogger.LegacyTagJoiner.cs (1)
80public int Count => _incomingTagCount + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLogger.ModernTagJoiner.cs (1)
84public int Count => _incomingTagsCount + _redactedTagsCount + _extraTags.Count + StaticTags!.Length;
Logging\Import\LoggerFactoryScopeProvider.cs (1)
187public int Count { get; }
Microsoft.Extensions.Telemetry.Abstractions (1)
Logging\LoggerMessageState.ReadOnlyList.cs (1)
16int IReadOnlyCollection<KeyValuePair<string, object?>>.Count => TagsCount;
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.Maui (2)
Primitives\ItemDelegateList.cs (1)
15 public int Count => ItemDelegate.GetCount();
Primitives\LockableObservableListWrapper.cs (1)
46 public int Count
Microsoft.Maui.Controls (7)
DragAndDrop\DataPackagePropertySetView.cs (1)
29 public int Count => _dataPackagePropertySet.Count;
ListProxy.cs (1)
112 public int Count
ReadOnlyCastingList.cs (2)
28 public int Count 58 public int Count
SynchronizedList.cs (1)
44 public int Count
TemplatedItemsList.cs (2)
338 public int Count 1271 public int Count
Microsoft.ML.Core (1)
Data\IEstimator.cs (1)
24public int Count => _columns.Count();
Microsoft.ML.Data (1)
Transforms\Normalizer.cs (1)
496public int Count => _infos.Length;
Microsoft.ML.DataView (1)
DataViewSchema.cs (1)
27public int Count => _columns.Length;
Microsoft.ML.StandardTrainers (1)
Standard\LinearModelParameters.cs (1)
67public int Count => _pred.Weight.Length;
PresentationFramework (2)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (2)
67public int Count 428public int Count => _FromVectorView.Count;
Roslyn.Diagnostics.Analyzers (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Shared (2)
EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
1116public int Count => 1; 1164public int Count => _dictionary.Count;
SignalRSamples (1)
ConnectionList.cs (1)
26public int Count => _connections.Count;
SocialWeather (1)
ConnectionList.cs (1)
27public int Count => _connections.Count;
System.Collections (11)
System\Collections\Generic\LinkedList.cs (1)
49public int Count
System\Collections\Generic\OrderedDictionary.cs (3)
242public int Count => _count; 1481public int Count => _dictionary.Count; 1676public int Count => _dictionary.Count;
System\Collections\Generic\PriorityQueue.cs (1)
950public int Count => _queue._size;
System\Collections\Generic\SortedDictionary.cs (3)
137public int Count 587public int Count 748public int Count
System\Collections\Generic\SortedList.cs (1)
282public int Count
System\Collections\Generic\SortedSet.cs (1)
266public int Count
System\Collections\Generic\Stack.cs (1)
57public int Count => _size;
System.Collections.Concurrent (4)
System\Collections\Concurrent\BlockingCollection.cs (1)
103public int Count
System\Collections\Concurrent\ConcurrentBag.cs (1)
486public int Count
System\Collections\Concurrent\ConcurrentDictionary.cs (1)
1136public int Count
System\Collections\Concurrent\ConcurrentStack.cs (1)
134public int Count
System.Collections.Immutable (16)
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)
67int IReadOnlyCollection<T>.Count
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (1)
140public int Count
System\Collections\Immutable\ImmutableDictionary_2.cs (1)
133public int Count
System\Collections\Immutable\ImmutableExtensions.cs (2)
128public int Count 195public int Count
System\Collections\Immutable\ImmutableHashSet_1.Builder.cs (1)
83public int Count
System\Collections\Immutable\ImmutableHashSet_1.cs (1)
92public int Count
System\Collections\Immutable\ImmutableList_1.Builder.cs (1)
70public int Count
System\Collections\Immutable\ImmutableList_1.cs (1)
142public int Count => _root.Count;
System\Collections\Immutable\ImmutableSortedDictionary_2.Builder.cs (1)
118public int Count
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
108public int Count
System\Collections\Immutable\ImmutableSortedSet_1.Builder.cs (1)
76public int Count
System\Collections\Immutable\ImmutableSortedSet_1.cs (1)
115public int Count
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\TagList.netcore.cs (1)
52public readonly int Count => _tagsCount;
System.Formats.Nrbf (1)
System\Formats\Nrbf\RecordMap.cs (1)
20public int Count => _map.Count;
System.Linq (4)
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 (1)
System\Linq\ToLookupAsync.cs (1)
226public int Count => 0;
System.Linq.Expressions (1)
System\Linq\Expressions\Compiler\CompilerScope.cs (1)
551public int Count => _provider.ParameterCount;
System.Net.Http (3)
artifacts\obj\System.Net.Http\Debug\net10.0\System.Net.Http.notsupported.cs (3)
312int System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<string, object?>>.Count { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetHttp); } } 587public int Count { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetHttp); } } 639public int Count { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetHttp); } }
System.Net.Primitives (1)
artifacts\obj\System.Net.Primitives\Debug\net10.0\System.Net.Primitives.notsupported.cs (1)
52public int Count { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } }
System.Net.WebSockets.Client (1)
System\Net\WebSockets\HttpResponseHeadersReadOnlyCollection.cs (1)
41public int Count => _headers.Count;
System.Private.CoreLib (15)
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (1)
71public int Count => _count;
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (1)
256public int Count
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (3)
209public int Count => _count - _freeCount; 1926public int Count => _dictionary.Count; 2121public int Count => _dictionary.Count;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (1)
357public int Count => _count - _freeCount;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (1)
127public int Count => _size;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (1)
55public 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\Runtime\InteropServices\TypeMapLazyDictionary.cs (1)
258public int Count => throw new NotSupportedException();
System.Private.Windows.Core (2)
System\Collections\Generic\ListConverter.cs (1)
28public int Count => _values.Count;
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.StringListAdapter.cs (1)
30int IReadOnlyCollection<string?>.Count => _recordList.Count;
System.Private.Windows.Core.TestUtilities (2)
XUnit\EnumerableTupleTheoryData.cs (2)
17public int Count => _data.Count(); 35public int Count => _data.Count();
System.Reflection.Metadata (25)
System\Reflection\Metadata\PortablePdb\HandleCollections.Debug.cs (7)
27public int Count 126public int Count 232public int Count 440public int Count 546public int Count 645public int Count 752public int Count
System\Reflection\Metadata\TypeSystem\HandleCollections.TypeSystem.cs (18)
26public int Count 134public int Count 251public int Count 372public int Count 479public int Count 599public int Count 719public int Count 839public int Count 955public int Count 1054public int Count 1166public int Count 1261public int Count 1351public int Count 1441public int Count 1531public int Count 1664public int Count 1775public int Count 1865public int Count
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (1)
55public int Count => _headerParameters.Count;
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (1)
22public int Count => _values.Length;
System.Text.RegularExpressions (4)
System\Text\RegularExpressions\CaptureCollection.cs (1)
31public int Count => _capcount;
System\Text\RegularExpressions\GroupCollection.cs (2)
36public int CountCount => _match._matchcount.Length;
System\Text\RegularExpressions\MatchCollection.cs (1)
45public int Count
System.Windows.Forms.Primitives (1)
System\Windows\Forms\NonNullCollection.cs (1)
32public int Count => _list.Count;
Test.Utilities (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Text.Analyzers (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
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)
128int IReadOnlyCollection<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.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
106public int Count
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
2451 references to Count
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (1)
154Console.WriteLine($"{project.Name} ({project.DocumentIds.Count} documents): {averageEditsInProject:0.00} edits per second");
Program.cs (1)
179Console.WriteLine("Number of documents:\t\t" + projects.Sum(x => x.DocumentIds.Count));
aspire (9)
Commands\PublishCommandBase.cs (9)
419if (activity.Data.Inputs is not { Count: > 0 } inputs) 425var hasValidationErrors = inputs.Any(input => input.ValidationErrors is { Count: > 0 }); 429if (!hasValidationErrors && inputs.Count > 1) 435var results = new string?[inputs.Count]; 436for (var i = 0; i < inputs.Count; i++) 444if (!hasValidationErrors || input.ValidationErrors is { Count: > 0 }) 448var promptText = inputs.Count > 1 475if (input.ValidationErrors is { Count: > 0 } errors) 510if (input.Options is null || input.Options.Count == 0)
Aspire.Cli.Tests (4)
Commands\PublishCommandPromptingIntegrationTests.cs (4)
158Assert.Equal(3, receivedPrompt.Inputs[0].Options?.Count); 387Assert.Equal(4, receivedPrompt.Inputs.Count); 401Assert.Equal(3, receivedPrompt.Inputs[2].Options?.Count); 597StatusText = prompt.Inputs.Count > 1
Aspire.Dashboard (15)
Authentication\AspirePolicyEvaluator.cs (1)
40if (policy.AuthenticationSchemes != null && policy.AuthenticationSchemes.Count > 0)
Components\Pages\ConsoleLogs.razor.cs (1)
542if (batch.Count is 0)
Components\Pages\StructuredLogs.razor.cs (2)
419var filters = (serializable.Filters.Count > 0) ? TelemetryFilterFormatter.SerializeFiltersToString(serializable.Filters) : null; 498new ComponentTelemetryProperty(TelemetryPropertyKeys.StructuredLogsFilterCount, new AspireTelemetryProperty(ViewModel.Filters.Count.ToString(CultureInfo.InvariantCulture), AspireTelemetryPropertyType.Metric))
Components\Pages\Traces.razor.cs (1)
287var filters = (serializable.Filters.Count > 0) ? TelemetryFilterFormatter.SerializeFiltersToString(serializable.Filters) : null;
DashboardWebApplication.cs (8)
457logger.LogError("Failed to start the dashboard due to {Count} configuration error(s).", validationFailures.Count); 504var hasSingleEndpoint = frontendAddresses.Count == 1 && IsSameOrNull(frontendAddresses[0], otlpGrpcAddress) && IsSameOrNull(frontendAddresses[0], otlpHttpAddress); 507var browserEndpointNames = new List<string>(capacity: frontendAddresses.Count); 522if (frontendAddresses.Count == 1) 529for (var i = 0; i < frontendAddresses.Count; i++) 845if (_validationFailures.Count > 0) 856Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures)); 862Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures));
ServiceClient\DashboardClient.cs (2)
583if (batch.Count == 1) 677if (batch.Count == 1)
Aspire.Dashboard.Components.Tests (4)
Pages\ResourcesTests.cs (1)
295return filterComponents.Count == 3;
Pages\TraceDetailsTests.cs (3)
143return rows.Count == 3; 157return rows.Count == 2; 276cut.WaitForAssertion(() => Assert.Equal(2, cut.FindAll(".main-grid-expand-button").Count));
Aspire.Hosting (10)
ApplicationModel\ExpressionResolver.cs (2)
85var args = new object?[expr.ValueProviders.Count]; 88for (var i = 0; i < expr.ValueProviders.Count; i++)
ApplicationModel\ReferenceExpression.cs (2)
64var args = new object?[ValueProviders.Count]; 65for (var i = 0; i < ValueProviders.Count; i++)
ApplicationModel\ResourceLoggerService.cs (2)
595var logs = new LogLine[entries.Count]; 596for (var i = 0; i < entries.Count; i++)
Dashboard\DashboardService.cs (1)
284while (sentLines < group.Count)
Dashboard\DashboardServiceData.cs (1)
169for (var i = 0; i < inputsInfo.Inputs.Count; i++)
Publishing\PublishingActivityReporter.cs (2)
266if (interaction.InteractionInfo is not Interaction.InputsInteractionInfo inputsInfo || inputsInfo.Inputs.Count == 0) 326for (var i = 0; i < Math.Min(inputsInfo.Inputs.Count, responses.Length); i++)
Aspire.Hosting.Azure (2)
AzurePublishingContext.cs (2)
182var args = new object[expr.ValueProviders.Count]; 184for (var i = 0; i < expr.ValueProviders.Count; i++)
Aspire.Hosting.Azure.AppContainers (2)
ContainerAppContext.cs (2)
597if (expr.Format == "{0}" && expr.ValueProviders.Count == 1) 602var args = new object[expr.ValueProviders.Count];
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceWebsiteContext.cs (2)
162if (expr.Format == "{0}" && expr.ValueProviders.Count == 1) 167var args = new object[expr.ValueProviders.Count];
Aspire.Hosting.Azure.CosmosDB (2)
AzureCosmosDBContainerResource.cs (1)
91if (value.Count == 0)
AzureCosmosDBExtensions.cs (1)
494Kind = container.PartitionKeyPaths.Count > 1 ? CosmosDBPartitionKind.MultiHash : CosmosDBPartitionKind.Hash,
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubExtensions.cs (1)
106if (urlExpression.ManifestExpressions.Count == 0)
Aspire.Hosting.Docker (2)
DockerComposeServiceResourceExtensions.cs (2)
61if (expr is { Format: "{0}", ValueProviders.Count: 1 }) 66var args = new object[expr.ValueProviders.Count];
Aspire.Hosting.Kubernetes (2)
KubernetesServiceResourceExtensions.cs (2)
67if (expr is { Format: "{0}", ValueProviders.Count: 1 }) 72var args = new object[expr.ValueProviders.Count];
Aspire.Hosting.Tests (5)
Dcp\DcpExecutorTests.cs (1)
704Assert.Equal(7, watchLogsResults1.Count);
ResourceLoggerServiceTests.cs (4)
50Assert.Equal(2, allLogs.Count); 131Assert.Equal(2, allLogs.Count); 189Assert.Equal(2, allLogs.Count); 208Assert.Equal(4, allLogs.Count);
Aspire.Hosting.Yarp (1)
ConfigurationBuilder\YarpRoute.cs (1)
159transforms = new List<IReadOnlyDictionary<string, string>>(r.Transforms.Count + 1);
Aspire.RabbitMQ.Client.Tests (2)
AspireRabbitMQLoggingTests.cs (2)
139Assert.Equal(3, errorEvent.Count); 185Assert.Equal(4, errorEvent.Count);
Aspire.RabbitMQ.Client.v7.Tests (2)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (2)
139Assert.Equal(3, errorEvent.Count); 185Assert.Equal(4, errorEvent.Count);
Aspire.Templates.Tests (1)
TemplateTestsBase.cs (1)
209if (allRows.Count == 0)
Diagnostics.EFCore.FunctionalTests (1)
MigrationsEndPointMiddlewareTest.cs (1)
134Assert.Equal(2, appliedMigrations.Count);
dotnet-dev-certs (2)
Program.cs (2)
355reporter.Output(certificates.Count switch 358_ => $"{certificates.Count} {certificateState} certificates were found: {CertificateManager.ToCertificateDescription(certificates)}"
dotnet-svcutil-lib (1)
Shared\MSBuildProj.cs (1)
901foreach (var rtLib in depContext.RuntimeLibraries.Where(l => l.NativeLibraryGroups.Count == 0))
GenerateDocumentationAndConfigFiles (33)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
HttpStress (1)
Program.cs (1)
47if (cmdline.Errors.Count > 0)
illink (3)
ILLink.CodeFixProvider (1)
DynamicallyAccessedMembersCodeFixProvider.cs (1)
101if (diagnostic.AdditionalLocations.Count == 0)
ILLink.RoslynAnalyzer (2)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (2)
101Debug.Assert(argumentValues.Count == 1); 1405if (argumentValues.Count > argsParam)
KeyManagementSample (2)
Program.cs (2)
38Console.WriteLine($"The key ring contains {allKeys.Count} key(s)."); 56Console.WriteLine($"The key ring contains {allKeys.Count} key(s).");
Metrics (25)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Metrics.Legacy (25)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
407if (index < details.MessageArgs.Count)
Microsoft.Analyzers.Extra.Tests (24)
AsyncCallInsideUsingBlockAnalyzerTests.cs (2)
405for (int i = 0; i < d.Count; i++) 410d.Count.Should().Be(expected);
AsyncMethodWithoutCancellationTests.cs (2)
166for (int i = 0; i < d.Count; i++) 171d.Count.Should().Be(expected);
CallAnalysis\ArraysTests.cs (2)
127Assert.Equal(54, d.Count); 128for (int i = 0; i < d.Count; i++)
CallAnalysis\LegacyCollectionTests.cs (2)
49Assert.Equal(8, d.Count); 50for (int i = 0; i < d.Count; i++)
CallAnalysis\SplitTests.cs (1)
35for (int i = 0; i < d.Count; i++)
CallAnalysis\StartsEndsWithTests.cs (4)
61Assert.Equal(8, d.Count); 63for (int i = 0; i < d.Count; i++) 119Assert.Equal(8, d.Count); 121for (int i = 0; i < d.Count; i++)
CallAnalysis\StaticTimeTests.cs (2)
82Assert.Equal(17, d.Count); 83for (int i = 0; i < d.Count; i++)
CallAnalysis\ValueTupleTests.cs (2)
51Assert.Equal(16, d.Count); 52for (int i = 0; i < d.Count; i++)
CoalesceAnalyzerTests.cs (4)
97Assert.Equal(4, d.Count); 98for (int i = 0; i < d.Count; i++) 165Assert.Equal(5, d.Count); 166for (int i = 0; i < d.Count; i++)
ConditionalAccessAnalyzerTests.cs (2)
110Assert.Equal(8, d.Count); 111for (int i = 0; i < d.Count; i++)
MakeExeTypesInternalTests.cs (1)
162for (int i = 0; i < d.Count; i++)
Microsoft.Analyzers.Local.Tests (11)
ApiLifecycle\ApiLifecycleAnalyzerTest.cs (4)
44Assert.Equal(expectedDiagnostics, diagnostics.Count); 46for (int i = 0; i < diagnostics.Count; i++) 70Assert.Equal(expectedDiagnostics, diagnostics.Count); 72for (int i = 0; i < diagnostics.Count; i++)
CallAnalysis\ToInvariantStringTests.cs (2)
42Assert.Equal(4, d.Count); 43for (int i = 0; i < d.Count; i++)
InternalReferencedInPublicDocAnalyzerTests.cs (4)
43var casesCnt = Math.Max(firstList.Count, secondList.Count); 46var first = $"{firstPrefix} {firstList[i % firstList.Count]}"; 47var second = $"{secondPrefix} {secondList[i % secondList.Count]}";
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.AspNetCore.App.Analyzers.Test (3)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (3)
213Assert.True(routeParameter.Policies.Length == parsedRoutePattern.ParameterPolicies.Count, "ParameterPolicies"); 214for (var i = 0; i < parsedRoutePattern.ParameterPolicies.Count; i++) 234parsedRoutePatterns.Count == tree.RouteParameters.Length,
Microsoft.AspNetCore.AsyncState (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerHandler.cs (1)
381var messages = new List<string>(exceptions.Count);
Microsoft.AspNetCore.Authorization.Policy (4)
AuthorizationMiddleware.cs (1)
123if (requirementData.Count > 0)
AuthorizationMiddlewareResultHandler.cs (2)
28if (policy.AuthenticationSchemes.Count > 0) 42if (policy.AuthenticationSchemes.Count > 0)
PolicyEvaluator.cs (1)
36if (policy.AuthenticationSchemes != null && policy.AuthenticationSchemes.Count > 0)
Microsoft.AspNetCore.Components (46)
ParameterView.cs (1)
435if (nextIndex < _cascadingParameters.Count)
Rendering\ComponentState.cs (4)
50if (_cascadingParameters.Count != 0) 206remainingCascadingParameters ??= new(_cascadingParameters.Count /* upper bound on capacity needed */); 270var numCascadingParameters = _cascadingParameters!.Count; 287var numCascadingParameters = _cascadingParameters!.Count;
ResourceAssetCollection.cs (1)
68int IReadOnlyCollection<ResourceAsset>.Count => _resources.Count;
Routing\RouteTable.cs (2)
101else if (parameter.ParameterPolicies.Count > 0 && !parameter.IsCatchAll) 105for (var i = 0; i < parameter.ParameterPolicies.Count; i++)
Routing\RouteTableFactory.cs (6)
319for (var k = 0; k < x.RoutePattern.PathSegments.Count; k++) 323if (leftSegment.Parts.Count != rightSegment.Parts.Count) 328for (var l = 0; l < leftSegment.Parts.Count; l++) 349for (var i = 0; i < obj.RoutePattern.PathSegments.Count; i++) 352for (var j = 0; j < segment.Parts.Count; j++)
src\Http\Routing\src\Patterns\RoutePattern.cs (1)
144var parametersCount = parameters.Count;
src\Http\Routing\src\Patterns\RoutePatternFactory.cs (6)
476for (var j = 0; j < segment.Parts.Count; j++) 546for (var i = 0; i < segment.Parts.Count; i++) 610parameter.ParameterPolicies.Count > 0) 617parameterConstraints = new List<RoutePatternParameterPolicyReference>(parameter.ParameterPolicies.Count); 621if (parameter.ParameterPolicies.Count > 0) 627&& parameter.ParameterPolicies.Count == 0
src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (9)
33_hasDefaultValue = new bool[RoutePattern.PathSegments.Count]; 34_defaultValues = new object[RoutePattern.PathSegments.Count]; 36for (var i = 0; i < RoutePattern.PathSegments.Count; i++) 86var pathSegment = i >= RoutePattern.PathSegments.Count ? null : RoutePattern.PathSegments[i]; 106for (; i < RoutePattern.PathSegments.Count; i++) 163for (; i < RoutePattern.PathSegments.Count; i++) 291var indexOfLastSegment = routeSegment.Parts.Count - 1; 339Debug.Assert(routeSegment.Parts.Count > 1); 402if (indexOfLastSegmentUsed == (routeSegment.Parts.Count - 1))
src\Http\Routing\src\Patterns\RoutePatternParser.cs (2)
322for (var j = 0; j < segment.Parts.Count; j++) 327(i != segments.Count - 1 || j != segment.Parts.Count - 1))
src\Http\Routing\src\Patterns\RoutePatternPathSegment.cs (1)
35public bool IsSimple => Parts.Count == 1;
src\Http\Routing\src\Template\RoutePrecedence.cs (8)
60ValidateSegementLength(routePattern.PathSegments.Count); 64for (var i = 0; i < routePattern.PathSegments.Count; i++) 114ValidateSegementLength(routePattern.PathSegments.Count); 120for (var i = 0; i < routePattern.PathSegments.Count; i++) 179if (pathSegment.Parts.Count > 1) 194if (parameterPart.ParameterPolicies.Count > 0) 251if (pathSegment.Parts.Count > 1) 276if (parameterPart.ParameterPolicies.Count > 0)
src\Http\Routing\src\Tree\UrlMatchingTree.cs (5)
82for (var i = 0; i < entry.RoutePattern.PathSegments.Count; i++) 98Debug.Assert(segment.Parts.Count == 1); 185if (parameterPart.ParameterPolicies.Count > 0 && !parameterPart.IsCatchAll) 207if (parameterPart.ParameterPolicies.Count > 0 && parameterPart.IsCatchAll) 252for (var i = currentParameterIndex; i < segments.Count; i++)
Microsoft.AspNetCore.Components.Endpoints (21)
Assets\ImportMapDefinition.cs (1)
89for (var i = 0; i < asset.Properties!.Count; i++)
Discovery\AssemblyComponentLibraryDescriptor.cs (2)
50return $"Assembly = {AssemblyName}, Pages = {Pages.Count}, Components = {Components.Count}";
Discovery\ComponentCollectionBuilder.cs (2)
51totalCount += value.Count; 63for (var i = 0; i < components.Count; i++, current++)
Discovery\PageCollectionBuilder.cs (2)
50totalCount += value.Count; 63for (var i = 0; i < pages.Count; i++)
Discovery\PageComponentBuilder.cs (2)
32ArgumentOutOfRangeException.ThrowIfZero(value.Count, nameof(value)); 75for (var i = 0; i < RouteTemplates.Count; i++)
Discovery\RazorComponentApplication.cs (3)
40for (var i = 0; i < Components.Count; i++) 65return $"Pages = {Pages.Count}, Components = {Components.Count}";
FormMapping\Converters\FileConverter.cs (2)
42for (var i = 0; i < targetFiles.Count; i++) 67if (formFileCollection.Count == 0)
FormMapping\FormDataReader.cs (3)
178return _readOnlyMemoryKeys.Count > 0; 183_prefixResolver = new PrefixResolver(_readOnlyMemoryKeys.Keys, _readOnlyMemoryKeys.Count); 324$"Key count = {_readOnlyMemoryKeys.Count}, Prefix = {_currentPrefixBuffer}, Error count = {_errorCount}, Current depth = {_currentDepth}";
FormMapping\HttpContextFormValueMapper.cs (1)
117if (form.Count == 0)
src\Shared\Components\PrerenderComponentApplicationStore.cs (1)
64if (state is not null && state.Count > 0)
src\Shared\Components\ResourceCollectionResolver.cs (2)
63if (descriptor.Selectors.Count == 0) 66for (var i = 0; i < descriptor.Properties.Count; i++)
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
RazorComponentEndpointDataSourceTest.cs (1)
30Assert.Equal(3, endpoints.Count);
RazorComponentResultTest.cs (1)
46Assert.Equal(2, result.Parameters.Count);
src\Components\Shared\src\WebRootComponentParameters.cs (2)
28var count = _parameterDefinitions.Count; 29if (count != other._parameterDefinitions.Count)
Microsoft.AspNetCore.Components.QuickGrid.Tests (1)
GridSortTest.cs (1)
136Assert.Equal(2, propertyList.Count);
Microsoft.AspNetCore.Components.Server (15)
Circuits\CircuitFactory.cs (2)
72if (components.Count > 0) 101var circuitHandlers = components.Count == 0 ? [] : scope.ServiceProvider.GetServices<CircuitHandler>()
Circuits\CircuitHost.cs (7)
138if (Descriptors.Count > 0) 146var count = Descriptors.Count; 163if (Descriptors.Count > 0) 173_isFirstUpdate = Descriptors.Count == 0; 657if (circuitHandlers.Count == 0) 665for (var i = circuitHandlers.Count - 1; i >= 0; i--) 768if (Descriptors.Count > 0)
Circuits\PersistedCircuitState.cs (1)
17return $"ApplicationStateCount={ApplicationState?.Count ?? 0}, RootComponentsLength={RootComponents?.Length ?? 0} bytes";
src\Components\Shared\src\WebRootComponentParameters.cs (2)
28var count = _parameterDefinitions.Count; 29if (count != other._parameterDefinitions.Count)
src\Shared\Components\PrerenderComponentApplicationStore.cs (1)
64if (state is not null && state.Count > 0)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (2)
300if (parameterTypes.Count != argumentCount) 303$"Invocation provides {argumentCount} argument(s) but target expects {parameterTypes.Count}.");
Microsoft.AspNetCore.Components.Server.Tests (5)
Circuits\CircuitMetricsTest.cs (2)
176Assert.Equal(2, activeMeasurements.Count); 181Assert.Equal(4, connectedMeasurements.Count);
Circuits\CircuitPersistenceManagerTest.cs (3)
66Assert.Equal(2, state.ApplicationState.Count); 120Assert.Equal(3, state.ApplicationState.Count); 387Assert.Equal(parameters.Count, actualParameters.Count);
Microsoft.AspNetCore.Components.Tests (6)
CascadingParameterTest.cs (2)
747Assert.Equal(3, nestedComponent.LatestParameterView.Count); 772Assert.Equal(2, nestedComponent.LatestParameterView.Count);
PersistentState\PersistentServicesRegistryTest.cs (1)
275Assert.Equal(2, registrations.Count);
Routing\TemplateParserTests.cs (3)
289if (x.PathSegments.Count != y.PathSegments.Count) 294for (var i = 0; i < x.PathSegments.Count; i++)
Microsoft.AspNetCore.Components.Web (5)
Forms\InputBase.cs (1)
319if (AdditionalAttributes!.Count == 1)
Forms\InputFile\InputFileChangeEventArgs.cs (4)
25public int FileCount => _files.Count; 31public IBrowserFile File => _files.Count switch 46if (_files.Count > maximumFileCount) 48throw new InvalidOperationException($"The maximum number of files accepted is {maximumFileCount}, but {_files.Count} were supplied.");
Microsoft.AspNetCore.Components.WebAssembly (3)
src\Components\Shared\src\WebRootComponentParameters.cs (2)
28var count = _parameterDefinitions.Count; 29if (count != other._parameterDefinitions.Count)
src\Shared\Components\PrerenderComponentApplicationStore.cs (1)
64if (state is not null && state.Count > 0)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Builder\WebAssemblyRazorComponentsEndpointConventionBuilderExtensions.cs (1)
60if (descriptors != null && descriptors.Count > 0)
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\XmlKeyManager.cs (1)
180var elementCount = allElements.Count;
Microsoft.AspNetCore.DataProtection.Tests (6)
KeyManagement\XmlKeyManagerTests.cs (2)
959Assert.Equal(9, repository.GetAllElements().Count); // 4 keys, 2 time-revocations, 3 guid-revocations 972Assert.Equal(4, repository.GetAllElements().Count); // 2 keys, 1 time-revocation, 1 guid-revocations
Repositories\EphemeralXmlRepositoryTests.cs (1)
58Assert.Equal(2, deletableElements.Count);
Repositories\FileSystemXmlRepositoryTests.cs (2)
163Assert.Equal(2, deletableElements.Count); 224Assert.Equal(3, deletableElements.Count);
Repositories\RegistryXmlRepositoryTests.cs (1)
151Assert.Equal(2, deletableElements.Count);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (40)
Logging\AcceptanceTests.cs (26)
244Assert.Equal(8, state!.Count); 249Assert.Equal(7, state!.Count); 304Assert.Equal(9, state!.Count); 309Assert.Equal(7, state!.Count); 390Assert.Equal(5, logRecords.Count); 402Assert.Equal(6, requestState!.Count); 412Assert.Equal(3, requestBodyState!.Count); 415Assert.Equal(2, responseState!.Count); 419Assert.Equal(2, responseBodyState!.Count); 422Assert.Equal(2, durationState!.Count); 460Assert.Equal(9, state!.Count); 506Assert.Equal(9, state!.Count); 548Assert.Equal(7, state!.Count); 571Assert.Equal(3, logRecords.Count); 580Assert.Equal(5, firstState!.Count); 584Assert.Equal(3, secondState!.Count); 609Assert.Equal(6, logRecords.Count); 622Assert.Equal(5, firstRecord!.Count); 624Assert.Equal(5, fourthRecord!.Count); 638Assert.Equal(2, thirdRecord!.Count); 639Assert.Equal(2, sixthRecord!.Count); 665Assert.Equal(7, state!.Count); 706Assert.Equal(10, state!.Count); 740Assert.Equal(7, state!.Count); 798Assert.Equal(7, logCollector.GetSnapshot()[0].StructuredState!.Count); 991Assert.Equal(7, logCollector.GetSnapshot()[1].StructuredState!.Count);
Logging\IncomingHttpDimensionsTests.cs (2)
17Assert.Equal(9, dimensions.Count); 20Assert.Equal(names.Count, dimensions.Count);
Logging\IncomingHttpRouteUtilityTests.cs (6)
96Assert.Equal(2, sensitiveParameters.Count); 136Assert.Equal(2, sensitiveParameters.Count); 314Assert.Equal(3, sensitiveParameters.Count); 361Assert.Equal(2, sensitiveParameters.Count); 403Assert.Equal(2, sensitiveParameters.Count); 412Assert.Equal(2, sensitiveParameters.Count);
Logging\RequestHeadersEnricherTests.cs (2)
104Assert.True(enrichedState.Count == 2); 286Assert.True(enrichedState.Count == 0);
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\Server\InterceptorPipelineBuilder.cs (1)
145for (var i = _interceptors.Count - 1; i >= 0; i--)
Microsoft.AspNetCore.HeaderParsing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.AspNetCore.Http (1)
Features\FormFeature.cs (1)
396var metadataCount = formOptionsMetadatas.Count;
Microsoft.AspNetCore.Http.Connections.Tests (8)
MapConnectionHandlerTests.cs (8)
53Assert.Equal(2, policies.Count); 63Assert.Equal(2, policies.Count); 143Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count); 148Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count); 174Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count); 179Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count); 233Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count); 238Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count);
Microsoft.AspNetCore.Http.Extensions (4)
src\Components\Endpoints\src\FormMapping\Converters\FileConverter.cs (1)
67if (formFileCollection.Count == 0)
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (3)
178return _readOnlyMemoryKeys.Count > 0; 183_prefixResolver = new PrefixResolver(_readOnlyMemoryKeys.Keys, _readOnlyMemoryKeys.Count); 324$"Key count = {_readOnlyMemoryKeys.Count}, Prefix = {_currentPrefixBuffer}, Error count = {_errorCount}, Current depth = {_currentDepth}";
Microsoft.AspNetCore.Http.Extensions.Tests (1)
ValidationEndpointConventionBuilderExtensionsTests.cs (1)
38Assert.Equal(2, endpoints.Count);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
RequestDelegateGeneratorSuppressor.cs (1)
45var location = diagnostic.AdditionalLocations.Count > 0
Microsoft.AspNetCore.Http.Results (5)
ChallengeHttpResult.cs (1)
80if (AuthenticationSchemes != null && AuthenticationSchemes.Count > 0)
ForbidHttpResult.cs (2)
91if (AuthenticationSchemes != null && AuthenticationSchemes.Count > 0) 93for (var i = 0; i < AuthenticationSchemes.Count; i++)
SignOutHttpResult.cs (2)
80if (AuthenticationSchemes.Count == 0) 86for (var i = 0; i < AuthenticationSchemes.Count; i++)
Microsoft.AspNetCore.Identity (1)
DefaultPasskeyHandler.cs (1)
320if (originalOptions.AllowCredentials is { Count: > 0 } allowCredentials &&
Microsoft.AspNetCore.JsonPatch (1)
Internal\ObjectVisitor.cs (1)
55for (var i = 0; i < _path.Segments.Count - 1; i++)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (1)
Internal\ObjectVisitor.cs (1)
51for (var i = 0; i < _path.Segments.Count - 1; i++)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
402for (var i = 0; i < providers.Count; i++)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
181Assert.Equal(3, descriptions.Count);
Microsoft.AspNetCore.Mvc.Core (60)
ActionConstraints\HttpMethodActionConstraint.cs (2)
63if (_httpMethods.Count == 0) 71for (var i = 0; i < _httpMethods.Count; i++)
ConsumesAttribute.cs (1)
210if (candidate.Constraints == null || candidate.Constraints.Count == 0 ||
Infrastructure\ActionSelector.cs (10)
70if (matches.Count > 0) 86if (finalMatches == null || finalMatches.Count == 0) 90else if (finalMatches.Count == 1) 115var actionsCount = actions.Count; 131var matchesCount = matches.Count; 154for (var i = 0; i < candidates.Count; i++) 159for (var j = 0; j < candidate.Constraints.Count; j++) 189for (var i = 0; i < candidates.Count; i++) 198for (var j = 0; j < candidate.Constraints.Count; j++) 233if (matches?.Count > 0)
Infrastructure\CopyOnWriteList.cs (1)
43public int Count => Readable.Count;
ModelBinding\Binders\ComplexObjectModelBinder.cs (9)
83var values = new object[boundConstructor.BoundConstructorParameters!.Count]; 231if (parameters.Count == 0) 237for (var i = 0; i < parameters.Count; i++) 292for (var i = 0; i < parameters.Count; i++) 327if (boundProperties.Count == 0) 333for (var i = 0; i < boundProperties.Count; i++) 384for (var i = 0; i < boundProperties.Count; i++) 548(!performsConstructorBinding || modelMetadata.BoundConstructor!.BoundConstructorParameters!.Count == 0)) 614for (var i = 0; i < parameters.Count; i++)
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (2)
49var parameterBinders = boundConstructor.BoundConstructorParameters!.Count == 0 ? 51new IModelBinder[boundConstructor.BoundConstructorParameters.Count];
ModelBinding\FormFileValueProvider.cs (1)
44var count = formFiles.Count;
ModelBinding\FormFileValueProviderFactory.cs (1)
52if (form.Files.Count > 0)
ModelBinding\Validation\ClientValidatorCache.cs (2)
41var items = new List<ClientValidatorItem>(metadata.ValidatorMetadata.Count); 42for (var i = 0; i < metadata.ValidatorMetadata.Count; i++)
ModelBinding\Validation\CompositeClientModelValidatorProvider.cs (1)
37for (var i = 0; i < ValidatorProviders.Count; i++)
ModelBinding\Validation\DefaultComplexObjectValidationStrategy.cs (4)
66_count = _properties.Count + _parameters.Count; 84if (_index < _parameters.Count) 107var property = _properties[_index - _parameters.Count];
ModelBinding\Validation\ValidationVisitor.cs (1)
213var count = validators.Count;
ModelBinding\Validation\ValidatorCache.cs (2)
31var items = new List<ValidatorItem>(metadata.ValidatorMetadata.Count); 32for (var i = 0; i < metadata.ValidatorMetadata.Count; i++)
Routing\ActionConstraintMatcherPolicy.cs (8)
38for (var i = 0; i < endpoints.Count; i++) 90for (var i = 0; i < finalMatches.Count; i++) 121if (matches?.Count > 0) 165for (var i = 0; i < items.Count; i++) 171for (var j = 0; j < constraints.Count; j++) 200for (var i = 0; i < items.Count; i++) 210for (var j = 0; j < constraints.Count; j++) 258if (matches?.Count > 0)
Routing\ActionEndpointFactory.cs (6)
243for (var i = 0; i < groupConventions.Count; i++) 248for (var i = 0; i < conventions.Count; i++) 253for (var i = 0; i < route.Conventions.Count; i++) 347for (var i = 0; i < groupConventions.Count; i++) 446for (var i = 0; i < conventions.Count; i++) 451for (var i = 0; i < perRouteConventions.Count; i++)
Routing\ControllerActionEndpointDataSource.cs (1)
87for (var i = 0; i < actions.Count; i++)
Routing\DynamicControllerEndpointMatcherPolicy.cs (4)
40for (var i = 0; i < endpoints.Count; i++) 117if (endpoints.Count == 0 && dynamicControllerMetadata != null) 125else if (endpoints.Count == 0) 147if (endpoints.Count == 0)
Routing\EndpointRoutingUrlHelper.cs (1)
89private string DebuggerToString() => $"Endpoints = {_endpointDataSource.Endpoints.Count}";
Routing\KnownRouteValueConstraint.cs (1)
99for (var i = 0; i < actionDescriptors.Items.Count; i++)
Routing\MvcRouteHandler.cs (1)
44if (candidates == null || candidates.Count == 0)
Routing\RoutePatternWriter.cs (1)
26for (var i = 0; i < segment.Parts.Count; i++)
Microsoft.AspNetCore.Mvc.Core.Test (11)
ApplicationModels\DefaultApplicationModelProviderTest.cs (7)
444Assert.Equal(2, model.Attributes.Count); 466Assert.Equal(2, model.Attributes.Count); 955Assert.Equal(2, action.Attributes.Count); 1034Assert.Equal(2, action.Attributes.Count); 1182Assert.Equal(3, actionModel.Attributes.Count); 1214Assert.Equal(2, actions.Attributes.Count); 1236Assert.Equal(4, action.Attributes.Count);
Formatters\OutputFormatterTests.cs (1)
122Assert.Equal(2, contentTypes.Count);
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (1)
405Assert.Equal(2, context.ParameterAttributes.Count);
ModelBinding\Metadata\ModelAttributesTest.cs (2)
165Assert.Equal(3, attributes.Attributes.Count); 170Assert.Equal(2, attributes.PropertyAttributes.Count);
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
DataAnnotationsMetadataProvider.cs (1)
304var contextAttributesCount = contextAttributes.Count;
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
DataAnnotationsModelValidatorProviderTest.cs (2)
162var items = new List<ValidatorItem>(metadata.ValidatorMetadata.Count); 163for (var i = 0; i < metadata.ValidatorMetadata.Count; i++)
Microsoft.AspNetCore.Mvc.Razor (4)
RazorView.cs (1)
163for (var i = 0; i < ViewStartPages.Count; i++)
RazorViewEngine.cs (1)
464var viewStarts = new IRazorPage[result.ViewStartEntries!.Count];
ViewLocationCacheKey.cs (2)
103(ViewLocationExpanderValues.Count != y.ViewLocationExpanderValues.Count))
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
ChecksumValidator.cs (1)
66for (var i = 0; i < checksums.Count; i++)
PageLoaderMatcherPolicy.cs (1)
42for (var i = 0; i < endpoints.Count; i++)
RuntimeViewCompiler.cs (3)
283var expirationTokens = new List<IChangeToken>(checksums.Count); 285for (var i = 0; i < checksums.Count; i++) 318if (cSharpDocument.Diagnostics.Count > 0)
Microsoft.AspNetCore.Mvc.RazorPages (7)
ApplicationModels\DefaultPageApplicationModelProvider.cs (1)
156for (var i = 0; i < pageModel.HandlerTypeAttributes.Count; i++)
Filters\PageViewDataAttributeFilter.cs (1)
36for (var i = 0; i < Properties.Count; i++)
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (4)
43for (var i = 0; i < endpoints.Count; i++) 116if (endpoints.Count == 0 && dynamicPageMetadata != null) 124else if (endpoints.Count == 0) 146if (endpoints.Count == 0)
Infrastructure\PageActionEndpointDataSource.cs (1)
54for (var i = 0; i < actions.Count; i++)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
ApplicationModels\AuthorizationPageApplicationModelProviderTest.cs (1)
131Assert.Equal(3, authorizeFilter.Policy.Requirements.Count);
Microsoft.AspNetCore.Mvc.TagHelpers (6)
GlobbingUrlBuilder.cs (2)
83var urls = new List<string>(1 + globbedUrls.Count) 88for (var i = 0; i < globbedUrls.Count; i++)
LinkTagHelper.cs (3)
320for (var i = 0; i < urls.Count; i++) 345if (fallbackHrefs.Count == 0) 437var fallbackHrefsCount = fallbackHrefs.Count;
ScriptTagHelper.cs (1)
355if (fallbackSrcs.Count > 0)
Microsoft.AspNetCore.Mvc.Testing (1)
WebApplicationFactory.cs (1)
466if (context == null || context.CompileLibraries.Count == 0)
Microsoft.AspNetCore.Mvc.ViewFeatures (13)
DefaultValidationHtmlAttributeProvider.cs (2)
62if (validators.Count > 0) 70for (var i = 0; i < validators.Count; i++)
Filters\ControllerViewDataAttributeFilter.cs (1)
31for (var i = 0; i < Properties.Count; i++)
Filters\SaveTempDataPropertyFilterBase.cs (2)
46for (var i = 0; i < Properties.Count; i++) 72for (var i = 0; i < Properties.Count; i++)
src\Shared\Components\ResourceCollectionResolver.cs (2)
63if (descriptor.Selectors.Count == 0) 66for (var i = 0; i < descriptor.Properties.Count; i++)
ViewComponents\DefaultViewComponentHelper.cs (2)
96for (var i = 0; i < descriptors.Items.Count; i++) 117if (descriptor.Parameters.Count == 1 && descriptor.Parameters[0].ParameterType.IsAssignableFrom(arguments.GetType()))
ViewEngines\CompositeViewEngine.cs (4)
33if (ViewEngines.Count == 0) 44for (var i = 0; i < ViewEngines.Count; i++) 82if (ViewEngines.Count == 0) 93for (var i = 0; i < ViewEngines.Count; i++)
Microsoft.AspNetCore.OpenApi (2)
Extensions\ApiDescriptionExtensions.cs (1)
52for (var i = 0; i < routePattern.PathSegments.Count; i++)
Services\OpenApiGenerator.cs (1)
329if (metadataList.Count > 0)
Microsoft.AspNetCore.Owin (1)
OwinEnvironment.cs (1)
503return _entries.Count + _contextDependentEntries.Count - (_deletedKeys?.Count ?? 0);
Microsoft.AspNetCore.Routing (124)
DecisionTree\DecisionTreeBuilder.cs (1)
75var itemCount = items.Count;
DefaultLinkGenerator.cs (1)
442if (values == null || values.Count == 0)
DefaultLinkParser.cs (1)
96for (var i = 0; i < kvp.Value.Count; i++)
EndpointDataSource.cs (4)
39var wrappedEndpoints = new RouteEndpoint[endpoints.Count]; 41for (int i = 0; i < endpoints.Count; i++) 91if (endpoints is null || endpoints.Count == 0) 113if (routeValues.Count > 0)
EndpointNameAddressScheme.cs (1)
39for (var i = 0; i < endpoints.Count; i++)
HostAttribute.cs (1)
54var hostsDisplay = (Hosts.Count == 0)
Internal\DfaGraphWriter.cs (1)
45for (var i = 0; i < endpoints.Count; i++)
Matching\AcceptsMatcherPolicy.cs (14)
44return endpoints.Any(e => e.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes.Count > 0); 62if (metadata == null || metadata.ContentTypes?.Count == 0) 79for (var j = 0; j < metadata.ContentTypes?.Count; j++) 96for (var j = 0; j < metadata.ContentTypes?.Count; j++) 151for (var i = 0; i < endpoints.Count; i++) 155if (contentTypes == null || contentTypes.Count == 0) 160for (var j = 0; j < contentTypes.Count; j++) 173for (var i = 0; i < endpoints.Count; i++) 177if (contentTypes.Count == 0) 197for (var j = 0; j < contentTypes.Count; j++) 266var ordered = new (ReadOnlyMediaTypeHeaderValue mediaType, int destination)[edges.Count]; 267for (var i = 0; i < edges.Count; i++) 338x?.ContentTypes.Count > 0 ? x : null, 339y?.ContentTypes.Count > 0 ? y : null);
Matching\CandidateSet.cs (3)
229switch (endpoints.Count) 246var candidates = new CandidateState[original.Length - 1 + endpoints.Count]; 305Candidates[i + endpoints.Count - 1] = new CandidateState(original[i].Endpoint, original[i].Values, original[i].Score + scoreOffset);
Matching\DataSourceDependentMatcher.cs (1)
42for (var i = 0; i < endpoints.Count; i++)
Matching\DfaMatcherBuilder.cs (18)
84maxDepth = Math.Max(maxDepth, endpoint.RoutePattern.PathSegments.Count); 383for (var i = 0; i < segment.Parts.Count; i++) 396Debug.Assert(i == segment.Parts.Count - 1 && partParameter.IsOptional); 402for (var j = 0; j < parameterPolicyReferences.Count; j++) 433for (var i = 0; i < parameterPolicyReferences.Count; i++) 477for (var k = 0; k < parameterPolicyReferences.Count; k++) 513if (depth < endpoint.RoutePattern.PathSegments.Count) 518if (endpoint.RoutePattern.PathSegments.Count == 0) 523var lastSegment = endpoint.RoutePattern.PathSegments[endpoint.RoutePattern.PathSegments.Count - 1]; 707if (endpoints == null || endpoints.Count == 0) 712var candiates = new Candidate[endpoints.Count]; 718for (var i = 1; i < endpoints.Count; i++) 753for (var i = 0; i < routeEndpoint.RoutePattern.PathSegments.Count; i++) 800for (var i = 0; i < routeEndpoint.RoutePattern.PathSegments.Count; i++) 815for (var i = 0; i < parameterPolicyReferences.Count; i++) 850for (var i = depth; i < endpoint.RoutePattern.PathSegments.Count; i++) 922for (var k = 0; k < edges.Count; k++) 932if (edge.Endpoints.Count > 0)
Matching\HostMatcherPolicy.cs (9)
51if (hosts == null || hosts.Count == 0) 84if (hosts == null || hosts.Count == 0) 92for (var j = 0; j < hosts.Count; j++) 199for (var i = 0; i < endpoints.Count; i++) 220for (var i = 0; i < endpoints.Count; i++) 293var ordered = new (EdgeKey host, int destination)[edges.Count]; 294for (var i = 0; i < edges.Count; i++) 360x?.Hosts.Count > 0 ? x : null, 361y?.Hosts.Count > 0 ? y : null);
Matching\HttpMethodMatcherPolicy.cs (13)
61for (var i = 0; i < endpoints.Count; i++) 63if (endpoints[i].Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Count > 0) 100if (metadata == null || metadata.HttpMethods.Count == 0) 128for (var j = 0; j < metadata.HttpMethods.Count; j++) 176for (var i = 0; i < endpoints.Count; i++) 184if (httpMethods.Count == 0) 189for (var j = 0; j < httpMethods.Count; j++) 226for (var i = 0; i < endpoints.Count; i++) 231if (httpMethods.Count == 0) 246for (var j = 0; j < httpMethods.Count; j++) 317for (var i = 0; i < edges.Count; i++) 436x?.HttpMethods.Count > 0 ? x : null, 437y?.HttpMethods.Count > 0 ? y : null);
Matching\MatcherPolicy.cs (1)
51for (var i = 0; i < endpoints.Count; i++)
Matching\NegotiationMatcherPolicy.cs (5)
31for (var i = 0; i < endpoints.Count; i++) 234for (var i = 0; i < endpoints.Count; i++) 246for (var i = 0; i < endpoints.Count; i++) 333var destinations = new (string negotiationValue, double quality, int destination)[edges.Count]; 334for (var i = 0; i < edges.Count; i++)
Patterns\DefaultRoutePatternTransformer.cs (2)
201for (var i = 0; i < policies.Count; i++) 223for (var j = 0; j < segment.Parts.Count; j++)
Patterns\RoutePattern.cs (1)
144var parametersCount = parameters.Count;
Patterns\RoutePatternFactory.cs (12)
476for (var j = 0; j < segment.Parts.Count; j++) 546for (var i = 0; i < segment.Parts.Count; i++) 610parameter.ParameterPolicies.Count > 0) 617parameterConstraints = new List<RoutePatternParameterPolicyReference>(parameter.ParameterPolicies.Count); 621if (parameter.ParameterPolicies.Count > 0) 627&& parameter.ParameterPolicies.Count == 0 1041if (leftDictionary.Count is 0) 1045if (rightDictionary.Count is 0) 1050var combinedDictionary = new Dictionary<string, TValue>(leftDictionary.Count + rightDictionary.Count, StringComparer.OrdinalIgnoreCase); 1107var leftCount = leftList.Count; 1113var rightCount = rightList.Count;
Patterns\RoutePatternMatcher.cs (9)
33_hasDefaultValue = new bool[RoutePattern.PathSegments.Count]; 34_defaultValues = new object[RoutePattern.PathSegments.Count]; 36for (var i = 0; i < RoutePattern.PathSegments.Count; i++) 86var pathSegment = i >= RoutePattern.PathSegments.Count ? null : RoutePattern.PathSegments[i]; 106for (; i < RoutePattern.PathSegments.Count; i++) 163for (; i < RoutePattern.PathSegments.Count; i++) 291var indexOfLastSegment = routeSegment.Parts.Count - 1; 339Debug.Assert(routeSegment.Parts.Count > 1); 402if (indexOfLastSegmentUsed == (routeSegment.Parts.Count - 1))
Patterns\RoutePatternParser.cs (2)
322for (var j = 0; j < segment.Parts.Count; j++) 327(i != segments.Count - 1 || j != segment.Parts.Count - 1))
Patterns\RoutePatternPathSegment.cs (1)
35public bool IsSimple => Parts.Count == 1;
RouteValuesAddressScheme.cs (3)
92for (var i = 0; i < endpoints.Count; i++) 101if (metadata == null && routeEndpoint.RoutePattern.RequiredValues.Count == 0) 118if (routeEndpoint.RoutePattern.RequiredValues.Count > 0)
Template\DefaultTemplateBinderFactory.cs (1)
49for (var i = 0; i < kvp.Value.Count; i++)
Template\RoutePrecedence.cs (8)
60ValidateSegementLength(routePattern.PathSegments.Count); 64for (var i = 0; i < routePattern.PathSegments.Count; i++) 114ValidateSegementLength(routePattern.PathSegments.Count); 120for (var i = 0; i < routePattern.PathSegments.Count; i++) 179if (pathSegment.Parts.Count > 1) 194if (parameterPart.ParameterPolicies.Count > 0) 251if (pathSegment.Parts.Count > 1) 276if (parameterPart.ParameterPolicies.Count > 0)
Template\RouteTemplate.cs (1)
32Segments = new List<TemplateSegment>(other.PathSegments.Count);
Template\TemplateBinder.cs (8)
84for (var i = 0; i < pattern.Parameters.Count; i++) 116for (var i = 0; i < pattern.Parameters.Count; i++) 254var parameterCount = _pattern.Parameters.Count; 515var segmentsCount = segments.Count; 523var partsCount = parts.Count; 722var slots = new KeyValuePair<string, object?>[pattern.Parameters.Count + filters.Length]; 724for (var i = 0; i < pattern.Parameters.Count; i++) 731slots[i + pattern.Parameters.Count] = new KeyValuePair<string, object?>(filters[i].Key, null);
Template\TemplateSegment.cs (1)
32var partCount = other.Parts.Count;
Tree\LinkGenerationDecisionTree.cs (1)
39for (var i = 0; i < entries.Count; i++)
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (1)
53for (var i = 0; i < withoutDefaults.Parameters.Count; i++)
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (1)
57for (var i = 0; i < endpoint.RoutePattern.Parameters.Count; i++)
Microsoft.AspNetCore.Routing.Tests (22)
DefaultEndpointDataSourceTests.cs (2)
39Assert.Equal(2, dataSource.Endpoints.Count); 83Assert.Equal(2, dataSource.Endpoints.Count);
Matching\RouteMatcherBuilder.cs (1)
53for (var i = 0; i < withoutDefaults.Parameters.Count; i++)
Matching\TreeRouterMatcherBuilder.cs (1)
57for (var i = 0; i < endpoint.RoutePattern.Parameters.Count; i++)
Patterns\RoutePatternFactoryTest.cs (8)
424Assert.Equal(3, actual.Parameters.Count); 453Assert.Equal(3, actual.Parameters.Count); 483Assert.Equal(3, actual.Parameters.Count); 523Assert.Equal(3, actual.Parameters.Count); 642Assert.Equal(3, parameterPart.ParameterPolicies.Count); 669Assert.Equal(3, parameterPart.ParameterPolicies.Count); 690Assert.Equal(3, actual.Parts.Count); 711Assert.Equal(3, actual.Parts.Count);
Patterns\RoutePatternParserTest.cs (9)
659if (x.PathSegments.Count != y.PathSegments.Count) 664for (var i = 0; i < x.PathSegments.Count; i++) 666if (x.PathSegments[i].Parts.Count != y.PathSegments[i].Parts.Count) 671for (int j = 0; j < x.PathSegments[i].Parts.Count; j++) 680if (x.Parameters.Count != y.Parameters.Count) 685for (var i = 0; i < x.Parameters.Count; i++)
Template\TemplateSegmentTest.cs (1)
36Assert.Equal(4, routePatternPathSegment.Parts.Count);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
HttpsTests.cs (1)
212Assert.True(requestInfoFeature.RequestInfo.Count > 0);
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (2)
RequestHeaderBenchmarks.cs (2)
92requestStructure.Headers.UnknownHeaderCount += (ushort)headerNames.Count; 95var dataDestination = unknownHeaderStructureDestination[(unknownHeadersSize * headerNames.Count)..];
Microsoft.AspNetCore.Server.HttpSys.Tests (4)
RequestHeaderTests.cs (4)
407requestStructure.Headers.UnknownHeaderCount += (ushort)headerNames.Count; 410var dataDestination = unknownHeaderStructureDestination.Slice(unknownHeadersSize * headerNames.Count); 447requestStructure.Headers.UnknownHeaderCount += (ushort)headerNames.Count; 450var dataDestination = unknownHeaderStructureDestination.Slice(unknownHeadersSize * headerNames.Count);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
InMemoryTransportBenchmark.cs (1)
148if (_acceptedConnections < _connections.Count)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Internal\SerializedHubMessage.cs (1)
35for (var i = 0; i < messages.Count; i++)
Microsoft.AspNetCore.SignalR.Client.Tests (3)
HttpConnectionTests.Negotiate.cs (3)
304Assert.Equal(5, testHttpHandler.ReceivedRequests.Count); 411Assert.Equal(5, testHttpHandler.ReceivedRequests.Count); 475Assert.Equal(5, testHttpHandler.ReceivedRequests.Count);
Microsoft.AspNetCore.SignalR.Core (2)
Internal\DefaultHubDispatcher.cs (1)
723arguments = new object?[descriptor.OriginalParameterTypes!.Count];
SerializedHubMessage.cs (1)
31for (var i = 0; i < messages.Count; i++)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
836var paramCount = paramTypes.Count;
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (2)
Protocol\MessagePackHubProtocolWorker.cs (2)
300if (parameterTypes.Count != argumentCount) 303$"Invocation provides {argumentCount} argument(s) but target expects {parameterTypes.Count}.");
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (3)
Protocol\NewtonsoftJsonHubProtocol.cs (3)
807if (paramIndex < paramTypes.Count) 822var paramCount = paramTypes.Count; 897var paramCount = paramTypes.Count;
Microsoft.AspNetCore.SignalR.StackExchangeRedis (7)
Internal\RedisProtocol.cs (3)
59if (excludedConnectionIds != null && excludedConnectionIds.Count > 0) 61writer.WriteArrayHeader(excludedConnectionIds.Count); 237writer.WriteMapHeader(serializedHubMessages.Count);
RedisHubLifetimeManager.cs (4)
245var publishTasks = new List<Task>(connectionIds.Count); 260var publishTasks = new List<Task>(groupNames.Count); 277if (userIds.Count > 0) 280var publishTasks = new List<Task>(userIds.Count);
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
DefaultHubMessageSerializerTests.cs (1)
30Assert.Equal(testData.SerializedCount, serializedHubMessage.Count);
Microsoft.AspNetCore.SignalR.Tests (7)
HubConnectionHandlerTests.cs (1)
2311Assert.Equal(2, resource.HubMethodArguments?.Count);
MapSignalRTests.cs (6)
125Assert.Equal(2, policies.Count); 135Assert.Equal(2, policies.Count); 191Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count); 196Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count); 252Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count); 257Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count);
Microsoft.AspNetCore.StaticAssets (5)
Development\StaticAssetDevelopmentRuntimeHandler.cs (5)
251if (descriptor.ResponseHeaders.Count == 0) 258for (var i = 0; i < descriptor.ResponseHeaders.Count; i++) 280if (descriptor.Properties.Count == 0) 285for (var i = 0; i < descriptor.Properties.Count; i++) 294if (propertiesList.Count < descriptor.Properties.Count)
Microsoft.AspNetCore.Testing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
1875Assert.Equal(3, ds.Endpoints.Count);
Microsoft.Build.Framework (4)
BuildSubmissionStartedEventArgs.cs (1)
56writer.Write(GlobalProperties.Count);
FileClassifier.cs (1)
406for (int i = 0; i < locations.Count; i++)
Profiler\ProfilerResult.cs (2)
37(ProfiledLocations.Count == result.ProfiledLocations.Count &&
Microsoft.CodeAnalysis (75)
Collections\CollectionsExtensions.cs (1)
20return collection == null || collection.Count == 0;
CommandLine\AnalyzerConfigSet.cs (1)
128var sortedAnalyzerConfigs = ArrayBuilder<AnalyzerConfig>.GetInstance(analyzerConfigs.Count);
CommandLine\SarifV1ErrorLogger.cs (1)
109additionalLocations.Count > 0 &&
CommandLine\SarifV2ErrorLogger.cs (1)
148additionalLocations.Count > 0 &&
Diagnostic\Diagnostic.cs (1)
501if (AdditionalLocations is null || AdditionalLocations.Count == 0)
Emit\EditAndContinue\DeltaMetadataWriter.cs (20)
159sizes[(int)TableIndex.TypeRef] = _typeRefIndex.Rows.Count; 160sizes[(int)TableIndex.TypeDef] = _typeDefs.GetAdded().Count; 161sizes[(int)TableIndex.Field] = _fieldDefs.GetAdded().Count; 162sizes[(int)TableIndex.MethodDef] = _methodDefs.GetAdded().Count; 163sizes[(int)TableIndex.Param] = _parameterDefs.GetAdded().Count; 164sizes[(int)TableIndex.MemberRef] = _memberRefIndex.Rows.Count; 165sizes[(int)TableIndex.StandAloneSig] = _standAloneSignatureIndex.Rows.Count; 166sizes[(int)TableIndex.EventMap] = _eventMap.GetAdded().Count; 167sizes[(int)TableIndex.Event] = _eventDefs.GetAdded().Count; 168sizes[(int)TableIndex.PropertyMap] = _propertyMap.GetAdded().Count; 169sizes[(int)TableIndex.Property] = _propertyDefs.GetAdded().Count; 170sizes[(int)TableIndex.MethodImpl] = _methodImpls.GetAdded().Count; 171sizes[(int)TableIndex.ModuleRef] = _moduleRefIndex.Rows.Count; 172sizes[(int)TableIndex.TypeSpec] = _typeSpecIndex.Rows.Count; 173sizes[(int)TableIndex.AssemblyRef] = _assemblyRefIndex.Rows.Count; 174sizes[(int)TableIndex.GenericParam] = _genericParameters.GetAdded().Count; 175sizes[(int)TableIndex.MethodSpec] = _methodSpecIndex.Rows.Count; 264if (previous.Count == 0) 269if (current.Count == 0) 956int lastCustomAttributeRowId = _previousGeneration.CustomAttributesAdded.Count > 0
Emit\EditAndContinue\EmitBaseline.cs (7)
343Debug.Assert(tableEntriesAdded[(int)TableIndex.TypeDef] >= typesAdded.Count); 344Debug.Assert(tableEntriesAdded[(int)TableIndex.Event] >= eventsAdded.Count); 345Debug.Assert(tableEntriesAdded[(int)TableIndex.Field] >= fieldsAdded.Count); 346Debug.Assert(tableEntriesAdded[(int)TableIndex.MethodDef] >= methodsAdded.Count); 347Debug.Assert(tableEntriesAdded[(int)TableIndex.Property] >= propertiesAdded.Count); 348Debug.Assert(tableEntriesAdded[(int)TableIndex.EventMap] >= eventMapAdded.Count); 349Debug.Assert(tableEntriesAdded[(int)TableIndex.PropertyMap] >= propertyMapAdded.Count);
Emit\EditAndContinue\SymbolMatcher.cs (1)
171if (previousMembers.Count == 0)
InternalUtilities\IReadOnlyListExtensions.cs (1)
14for (int i = 0; i < list.Count; i++)
PEWriter\MetadataWriter.cs (16)
1961metadata.SetCapacity(TableIndex.AssemblyRef, assemblyRefs.Count); 2212metadata.SetCapacity(TableIndex.Event, eventDefs.Count); 2380metadata.SetCapacity(TableIndex.Field, fieldDefs.Count); 2588metadata.SetCapacity(TableIndex.MemberRef, memberRefs.Count); 2615metadata.SetCapacity(TableIndex.MethodSpec, methodSpecs.Count); 2628metadata.SetCapacity(TableIndex.MethodDef, methodDefs.Count); 2651metadata.SetCapacity(TableIndex.MethodSemantics, propertyDefs.Count * 2 + eventDefs.Count * 2); 2713metadata.SetCapacity(TableIndex.ModuleRef, moduleRefs.Count); 2753metadata.SetCapacity(TableIndex.Param, parameterDefs.Count); 2767metadata.SetCapacity(TableIndex.Property, propertyDefs.Count); 2781metadata.SetCapacity(TableIndex.TypeDef, typeDefs.Count); 2838metadata.SetCapacity(TableIndex.TypeRef, typeRefs.Count); 2898metadata.SetCapacity(TableIndex.TypeSpec, typeSpecs.Count); 2920int[] bodyOffsets = new int[methods.Count]; 2952int[] bodyOffsets = new int[methods.Count];
ReferenceManager\CommonReferenceManager.Binding.cs (1)
971for (int i = 1; i < referenceBindings.Count; i++)
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (6)
85Debug.Assert(groupSizes.Count <= ushort.MaxValue); 89if (groupSizes.Count == 0) 99builder.WriteUInt16((ushort)uc.Count); 148builder.WriteInt32(infos.Count); 172Debug.Assert(infos.Count > 0); 174builder.WriteInt32(infos.Count);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
Syntax\GreenNode.cs (2)
936switch (list.Count) 948var array = new ArrayElement<GreenNode>[list.Count];
Text\ChangedText.cs (4)
193if (changes.Count > 1) 200if (actualOldText != null && actualOldText.GetChangeRanges(oldText).Count == 0) 254Debug.Assert(changeSets.Count > 1); 257for (int i = 1; i < changeSets.Count; i++)
Text\CompositeText.cs (1)
374for (int i = 0; i < segments.Count; i++)
Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
Microsoft.CodeAnalysis.Analyzers (34)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
119if (diagnostic.AdditionalLocations.Count == 1)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.CodeAnalysis.AnalyzerUtilities (29)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAbstractValue.cs (4)
70if (values.Count == 0) 75else if (values.Count == 1) 80else if (values.Count == 2) 87for (int i = 2; i < values.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.BannedApiAnalyzers (33)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.CodeAnalysis.CodeStyle (24)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
138for (var index = 0; index < triviaList.Count; index++)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
120var insertionIndex = newParameterIndex ?? existingParameters.Count; 141if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
169if (statements.Count > 0) 171return semanticModel.AnalyzeControlFlow(statements[0], statements[statements.Count - 1]);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
169var nullAssignmentOpt = diagnostic.AdditionalLocations.Count == 4
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.CodeAnalysis.Collections.Package (9)
Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
Microsoft.CodeAnalysis.CSharp (13)
Binder\Binder_Expressions.cs (1)
7255if (suppressUnsupportedRequiredMembersError && useSiteInfo.AccumulatesDiagnostics && useSiteInfo.Diagnostics is { Count: not 0 })
BoundTree\UnboundLambda.cs (2)
1420var nx = x.Arguments?.Count ?? 0; 1421var ny = y.Arguments?.Count ?? 0;
Compiler\MethodCompiler.cs (2)
1260if (capturedParameters.Count != 0) 1264var initializers = ArrayBuilder<BoundStatement>.GetInstance(capturedParameters.Count);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
145var builder = ArrayBuilder<BoundExpression>.GetInstance(bytes.Count + 1);
Symbols\ConstraintsHelper.cs (1)
1308useSiteInfo.Dependencies.Count == 1 ?
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4778var members = ArrayBuilder<Symbol>.GetInstance(membersSoFar.Count + 1);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (3)
116if (capturedParameters.Count == 0) 215int count = oldSet.Count; 216Debug.Assert(count == value.Count);
Syntax\CSharpSyntaxTree.cs (2)
542if (changes.Count == 0 && newText == oldText) 565if (workingChanges.Count == 1 && workingChanges[0].Span == new TextSpan(0, this.Length) && workingChanges[0].NewLength == newText.Length)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
240while (index + 1 < statements.Count && statements[index + 1] is LocalFunctionStatementSyntax) 244if (index == statements.Count - 1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
159for (var i = declarationIndex + 1; i < statements.Count; i++)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
70var references = new List<ExpressionSyntax>(diagnostic.AdditionalLocations.Count - 2); 72for (var i = 2; i < diagnostic.AdditionalLocations.Count; i++)
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (3)
71if (originalBlockStatements.Count == currentBlockStatements.Count) 90for (var i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2633Assert.Equal(3, diagnostic.AdditionalLocations.Count);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (8)
CommandLineTests.cs (8)
833Assert.Equal(1, parsedArgs.Errors.First().Arguments.Count); 838Assert.Equal(1, parsedArgs.Errors.First().Arguments.Count); 843Assert.Equal(1, parsedArgs.Errors.First().Arguments.Count); 2889Assert.Equal(2, err.Arguments.Count); 9856Assert.Equal(2, args.ParseOptions.Features.Count); 12328Assert.Equal(1, options.Features.Count); 12348Assert.Equal(1, options.Features.Count); 12370Assert.Equal(1, options.Features.Count);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
CodeActions\PreviewTests.cs (1)
76var removedReference = _oldDocument.Project.MetadataReferences[_oldDocument.Project.MetadataReferences.Count - 1];
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
1070Assert.Equal(1, project.AdditionalDocumentIds.Count);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
Emit\CompilationEmitTests.cs (2)
5218Assert.Equal(1, err.Arguments.Count); 5229Assert.Equal(1, err.Arguments.Count);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
Attributes\InternalsVisibleToAndStrongNameTests.cs (2)
402Assert.Equal(2, err.Arguments.Count); 1614Assert.Equal(2, err.Arguments.Count);
Semantics\PrimaryConstructorTests.cs (8)
9946Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10000Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10001Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10002Assert.Equal(2, comp.GetTypeByMetadataName("C4").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10021Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10048Assert.Equal(2, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10150Assert.Equal(1, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 12043Assert.Equal(2, comp1.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count);
Microsoft.CodeAnalysis.CSharp.Features (12)
AddImport\CSharpAddImportFeatureService.cs (1)
396CreateNameSyntax(namespaceParts, namespaceParts.Count - 1));
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (2)
46var completionCount = context.Items.Count; 49if (completionCount < context.Items.Count)
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
240while (index + 1 < statements.Count && statements[index + 1] is LocalFunctionStatementSyntax) 244if (index == statements.Count - 1)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
159for (var i = declarationIndex + 1; i < statements.Count; i++)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
70var references = new List<ExpressionSyntax>(diagnostic.AdditionalLocations.Count - 2); 72for (var i = 2; i < diagnostic.AdditionalLocations.Count; i++)
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (3)
71if (originalBlockStatements.Count == currentBlockStatements.Count) 90for (var i = 0; i < list.Count; i++)
Wrapping\SeparatedSyntaxList\CSharpParameterWrapper.cs (1)
62var firstToken = attributes?.Count > 0
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2633Assert.Equal(3, diagnostic.AdditionalLocations.Count);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.cs (1)
4265Assert.Equal(4, diagnostic.Arguments.Count);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Parsing\LocalFunctionParsingTests.cs (2)
1293Assert.Equal(0, file.SyntaxTree.Options.Features.Count); 1345Assert.Equal(0, file.SyntaxTree.Options.Features.Count);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
DiagnosticTestUtilities.cs (1)
122Parameters = (e.Arguments != null && e.Arguments.Count > 0 && e.Arguments[0] != null) ?
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
CodeGeneration\CSharpSyntaxGenerator.cs (10)
1044if (index >= 0 && index < existingAttributes.Count) 1048else if (existingAttributes.Count > 0) 1050return this.InsertNodesAfter(declaration, existingAttributes[existingAttributes.Count - 1], WithRequiredTargetSpecifier(newAttributes, declaration)); 1079if (index >= 0 && index < existingAttributes.Count) 1083else if (existingAttributes.Count > 0) 1085return this.InsertNodesAfter(d, existingAttributes[existingAttributes.Count - 1], newAttributes); 1361if (index >= 0 && index < existingMembers.Count) 1365else if (existingMembers.Count > 0) 1367return this.InsertNodesAfter(declaration, existingMembers[existingMembers.Count - 1], newMembers); 3082var count = subDecls.Count;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (78)
CodeGeneration\SyntaxGeneratorTests.cs (78)
2078Assert.Equal(1, attrsAdded.Count); 2758=> Assert.Equal(0, Generator.GetNamespaceImports(Generator.RemoveNodes(declaration, Generator.GetNamespaceImports(declaration))).Count); 2974=> Assert.Equal(0, Generator.GetMembers(Generator.RemoveNodes(declaration, Generator.GetMembers(declaration))).Count); 3375Assert.Equal(0, Generator.GetParameters(Generator.MethodDeclaration("m")).Count); 3376Assert.Equal(1, Generator.GetParameters(Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3377Assert.Equal(2, Generator.GetParameters(Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))])).Count); 3379Assert.Equal(0, Generator.GetParameters(Generator.ConstructorDeclaration()).Count); 3380Assert.Equal(1, Generator.GetParameters(Generator.ConstructorDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3381Assert.Equal(2, Generator.GetParameters(Generator.ConstructorDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))])).Count); 3383Assert.Equal(1, Generator.GetParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("t"))).Count); 3384Assert.Equal(2, Generator.GetParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))], Generator.IdentifierName("t"))).Count); 3386Assert.Equal(0, Generator.GetParameters(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("expr"))).Count); 3387Assert.Equal(1, Generator.GetParameters(Generator.ValueReturningLambdaExpression("p1", Generator.IdentifierName("expr"))).Count); 3389Assert.Equal(0, Generator.GetParameters(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("expr"))).Count); 3390Assert.Equal(1, Generator.GetParameters(Generator.VoidReturningLambdaExpression("p1", Generator.IdentifierName("expr"))).Count); 3392Assert.Equal(0, Generator.GetParameters(Generator.DelegateDeclaration("d")).Count); 3393Assert.Equal(1, Generator.GetParameters(Generator.DelegateDeclaration("d", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3395Assert.Equal(0, Generator.GetParameters(Generator.ClassDeclaration("c")).Count); 3396Assert.Equal(0, Generator.GetParameters(Generator.IdentifierName("x")).Count); 3402Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.MethodDeclaration("m"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3403Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ConstructorDeclaration(), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3404Assert.Equal(3, Generator.GetParameters(Generator.AddParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("t")), [Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2")), Generator.ParameterDeclaration("p3", Generator.IdentifierName("t3"))])).Count); 3406Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("expr")), [Generator.LambdaParameter("p")])).Count); 3407Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("expr")), [Generator.LambdaParameter("p")])).Count); 3409Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.DelegateDeclaration("d"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3411Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ClassDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3412Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.StructDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3413Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.InterfaceDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3414Assert.Equal(0, Generator.GetParameters(Generator.AddParameters(Generator.IdentifierName("x"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3427Assert.Equal(1, Generator.GetStatements(Generator.ValueReturningLambdaExpression("p", [Generator.IdentifierName("x")])).Count); 3492Assert.Equal(2, Generator.GetAccessors(prop).Count); 3517Assert.Equal(0, Generator.GetStatements(getAccessor).Count); 3518Assert.Equal(0, Generator.GetStatements(setAccessor).Count); 3595Assert.Equal(2, Generator.GetAccessors(x).Count); 3596Assert.Equal(0, Generator.GetAccessors(y).Count); 3601Assert.Equal(0, Generator.GetAccessors(y2).Count); 3618Assert.Equal(2, Generator.GetAccessors(x).Count); 3619Assert.Equal(0, Generator.GetAccessors(y).Count); 3624Assert.Equal(0, Generator.GetAccessors(y2).Count); 3690Assert.Equal(0, Generator.GetStatements(Generator.MethodDeclaration("m")).Count); 3691Assert.Equal(2, Generator.GetStatements(Generator.MethodDeclaration("m", statements: stmts)).Count); 3693Assert.Equal(0, Generator.GetStatements(Generator.ConstructorDeclaration()).Count); 3694Assert.Equal(2, Generator.GetStatements(Generator.ConstructorDeclaration(statements: stmts)).Count); 3696Assert.Equal(0, Generator.GetStatements(Generator.VoidReturningLambdaExpression([])).Count); 3697Assert.Equal(2, Generator.GetStatements(Generator.VoidReturningLambdaExpression(stmts)).Count); 3699Assert.Equal(0, Generator.GetStatements(Generator.ValueReturningLambdaExpression([])).Count); 3700Assert.Equal(2, Generator.GetStatements(Generator.ValueReturningLambdaExpression(stmts)).Count); 3702Assert.Equal(0, Generator.GetStatements(Generator.IdentifierName("x")).Count); 3717Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.MethodDeclaration("m"), stmts)).Count); 3718Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ConstructorDeclaration(), stmts)).Count); 3719Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.VoidReturningLambdaExpression([]), stmts)).Count); 3720Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ValueReturningLambdaExpression([]), stmts)).Count); 3722Assert.Equal(0, Generator.GetStatements(Generator.WithStatements(Generator.IdentifierName("x"), stmts)).Count); 3740Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count); 3741Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), getAccessorStatements: stmts)).Count); 3743Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"))).Count); 3744Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"), getAccessorStatements: stmts)).Count); 3746Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.IdentifierName("x")).Count); 3749Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count); 3750Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), setAccessorStatements: stmts)).Count); 3752Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"))).Count); 3753Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"), setAccessorStatements: stmts)).Count); 3755Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.IdentifierName("x")).Count); 3773Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), stmts)).Count); 3774Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t")), stmts)).Count); 3775Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.IdentifierName("x"), stmts)).Count); 3778Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), stmts)).Count); 3779Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t")), stmts)).Count); 3780Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.IdentifierName("x"), stmts)).Count); 3795Assert.Equal(2, baseListBI.Count); 3808Assert.Equal(1, baseListB.Count); 4031Assert.Equal(1, Generator.GetAttributes(xAttributed).Count); 4035Assert.Equal(3, membersC.Count); 4381Assert.Equal(3, attrs.Count); 4588Assert.Equal(0, Generator.GetAttributes(declM).Count); 4591Assert.Equal(3, attrs.Count); 4695Assert.Equal(4, attrs.Count); 4714Assert.Equal(4, rattrs.Count);
Microsoft.CodeAnalysis.Debugging.Package (6)
CustomDebugInfoEncoder.cs (6)
85Debug.Assert(groupSizes.Count <= ushort.MaxValue); 89if (groupSizes.Count == 0) 99builder.WriteUInt16((ushort)uc.Count); 148builder.WriteInt32(infos.Count); 172Debug.Assert(infos.Count > 0); 174builder.WriteInt32(infos.Count);
Microsoft.CodeAnalysis.EditorFeatures (15)
Copilot\CopilotWpfTextCreationListener.cs (1)
84if (proposal is not { Edits.Count: > 0 })
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (9)
344Debug.Assert(matchResults.Count > 0); 371for (var i = 1; i < matchResults.Count; ++i) 396for (selectedItemIndex = 0; selectedItemIndex < matchResults.Count; ++selectedItemIndex) 402Debug.Assert(selectedItemIndex < matchResults.Count); 491for (var i = 0; i < items.Count; ++i) 683Debug.Assert(filteredMatchResults.Count > 0); 688for (int i = 1, n = filteredMatchResults.Count; i < n; i++) 866inferiorItemIndex = matches.Count; 882while (++inferiorItemIndex < matches.Count)
NavigateTo\NavigateToItemProvider.cs (1)
102if (kinds == null || kinds.Count == 0)
Structure\StructureTag.cs (4)
81Hash.Combine(this.SubHeadings?.Count ?? 0, this.GuideLineSpan.GetHashCode())))))))); 103if (this.SubHeadings.Count != other.SubHeadings.Count) 106for (int i = 0, n = this.SubHeadings.Count; i < n; i++)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Completion\AbstractCompletionProviderTests.cs (1)
203Assert.Equal(items.Count, 0);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
Preview\PreviewWorkspaceTests.cs (5)
61Assert.Equal(0, previewWorkspace.CurrentSolution.ProjectIds.Count); 76Assert.Equal(1, previewWorkspace.CurrentSolution.Projects.First().MetadataReferences.Count); 77Assert.Equal(1, previewWorkspace.CurrentSolution.Projects.First().DocumentIds.Count); 89Assert.Equal(0, previewWorkspace.CurrentSolution.Projects.First().MetadataReferences.Count); 90Assert.Equal(0, previewWorkspace.CurrentSolution.Projects.First().DocumentIds.Count);
Tagging\TagSpanIntervalTreeTests.cs (7)
87Assert.Equal(50, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 150, 50)).Count); 90Assert.Equal(26, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 175, 25)).Count); 101Assert.Equal(1, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 0, 1)).Count); 102Assert.Equal(1, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 50, 1)).Count); 105Assert.Equal(2, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 100, 1)).Count); 119Assert.Equal(51, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 0, 1)).Count); 133Assert.Equal(51, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 99, 1)).Count);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
IntelliSense\CompletionServiceTests.vb (1)
44Assert.True(list.ItemsList.Count = 1, "Completion list contained more than one item")
IntelliSense\CompletionServiceTests_Exclusivitiy.vb (1)
46Assert.True(list.ItemsList.Count = 2, "Completion List does not contain exactly two items.")
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
ResultProviderTestBase.cs (1)
352int n = actual.Count;
Microsoft.CodeAnalysis.Extensions.Package (13)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.Features (60)
AddImport\AbstractAddImportFeatureService.cs (2)
145var projectToAssembly = new ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>>(concurrencyLevel: 2, capacity: project.Solution.ProjectIds.Count); 146var referenceToCompilation = new ConcurrentDictionary<PortableExecutableReference, Compilation>(concurrencyLevel: 2, capacity: project.Solution.Projects.Sum(p => p.MetadataReferences.Count));
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
585if (refLocations.Count > 0)
Completion\CompletionList.cs (1)
188internal bool IsEmpty => ItemsList.Count == 0 && SuggestionModeItem is null;
Completion\CompletionService_GetCompletions.cs (2)
101if (!triggeredContexts.Any(static cc => cc.Items.Count > 0)) 229=> cc.Items.Count > 0 || cc.SuggestionModeItem != null;
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (2)
95var count = context.Items.Count; 98if (context.Items.Count > count)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
164if (context.Items.Count > 0)
Copilot\ICopilotChangeAnalysisService.cs (2)
130var projectDocumentCount = newDocument.Project.DocumentIds.Count; 134.GetProjectsThatThisProjectTransitivelyDependsOn(document.Project.Id).Count;
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (1)
62if (project.AnalyzerReferences.Count == 0)
Diagnostics\Service\EngineV2\InProcOrRemoteHostAnalyzerRunner.cs (1)
138var count = documentAnalysisScope != null ? 1 : project.DocumentIds.Count + 1;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
2574if (editScript.Edits.Length == 0 && triviaEdits.Count == 0)
EditAndContinue\DeclarationBodyMap.cs (2)
29Contract.ThrowIfFalse(forwardMatch.Count == reverseMatch.Count);
EditAndContinue\EditSession.cs (5)
715using var _0 = ArrayBuilder<SemanticEdit>.GetInstance(edits.Count, out var mergedEditsBuilder); 717using var _2 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol)>.GetInstance(edits.Count, out var resolvedSymbols); 752for (var i = 0; i < edits.Count; i++) 776if (edits.Count == mergedEditsBuilder.Count) 817for (var i = 0; i < edits.Count; i++)
EditAndContinue\Utilities\BidirectionalMap.cs (7)
21Contract.ThrowIfFalse(forward.Count == reverse.Count); 28var forward = new Dictionary<T, T>(Forward.Count + 1); 29var reverse = new Dictionary<T, T>(Reverse.Count + 1); 44if (map.Forward.Count == 0) 49var count = Forward.Count + map.Forward.Count;
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (1)
120var sortText = context.Items.Count.ToString("0000");
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (1)
112var sortText = context.Items.Count.ToString("0000");
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
619count += project.DocumentIds.Count;
NavigateTo\RoslynNavigateToItem.cs (4)
251var activeDiff = activeFolders.Count - commonCount; 252var itemDiff = itemFolders.Count - commonCount; 263var maxCommon = Math.Min(activeFolders.Count, itemFolders.Count);
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (3)
94while (statements.Count == 1 && blockFacts.IsScopeBlock(statements[0])) 116blockFacts.GetExecutableBlockStatements(parent).Count == statements.Count)
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
206if (insideStatements.Count == 0) 220var controlFlow = semanticModel.AnalyzeControlFlow(insideStatements[0], insideStatements[insideStatements.Count - 1]);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
136if (insideStatements.Count == 0) 151var controlFlow = semanticModel.AnalyzeControlFlow(insideStatements[0], insideStatements[insideStatements.Count - 1]);
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (6)
102if (statements.Count > 0 && statements[0] == statement) 105if (rootStatements.Count > 0 && ifGenerator.IsIfOrElseIf(rootStatements[0].Parent)) 133if (statements.Count > 0 && ifGenerator.IsIfOrElseIf(statements[0])) 176if (statements.Count == 1) 216if (!remainingStatements.SequenceEqual(remainingOuterStatements.Take(statements.Count - 1), syntaxFacts.AreEquivalent)) 222var controlFlow = semanticModel.AnalyzeControlFlow(statements[0], statements[statements.Count - 1]);
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
138for (var index = 0; index < triviaList.Count; index++)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
120var insertionIndex = newParameterIndex ?? existingParameters.Count; 141if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
169if (statements.Count > 0) 171return semanticModel.AnalyzeControlFlow(statements[0], statements[statements.Count - 1]);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
169var nullAssignmentOpt = diagnostic.AdditionalLocations.Count == 4
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (6)
85Debug.Assert(groupSizes.Count <= ushort.MaxValue); 89if (groupSizes.Count == 0) 99builder.WriteUInt16((ushort)uc.Count); 148builder.WriteInt32(infos.Count); 172Debug.Assert(infos.Count > 0); 174builder.WriteInt32(infos.Count);
Microsoft.CodeAnalysis.Features.UnitTests (8)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (5)
4106Assert.Equal(2, documentMap.Count); 4119Assert.Equal(3, baseActiveStatementsMap.InstructionMap.Count); 4218Assert.Equal(1, baseActiveStatementMap.InstructionMap.Count); 4823Assert.Equal(1, oldProject.DocumentIds.Count); 4824Assert.Equal(2, newProject.DocumentIds.Count);
EditAndContinue\EditSessionActiveStatementsTests.cs (3)
207Assert.Equal(4, baseActiveStatementsMap.DocumentPathMap.Count); 678Assert.Equal(1, baseActiveStatementMap.DocumentPathMap.Count); 686Assert.Equal(2, baseActiveStatementMap.InstructionMap.Count);
Microsoft.CodeAnalysis.InteractiveHost (9)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Handler\Completion\CompletionHandler.cs (3)
209if (completionListMaxSize < 0 || completionListMaxSize >= completionList.ItemsList.Count) 256? completionList.ItemsList.Count > newCompletionList.ItemsList.Count
Handler\Completion\CompletionResultFactory.cs (1)
47if (list.ItemsList.Count == 0)
Protocol\Converters\SumConverter.cs (3)
201if (applicableUnionTypeInfos.Count > 0) 211for (var i = 0; i < applicableUnionTypeInfos.Count; i++) 228for (var i = 0; i < applicableUnionTypeInfos.Count; i++)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (33)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.CodeAnalysis.PublicApiAnalyzers (25)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Host\RemoteWorkspace.cs (1)
274using var _ = ArrayBuilder<ProjectInfo>.GetInstance(solutionInfo.Projects.Count, out var projectInfos);
Host\RemoteWorkspace.SolutionCreator.cs (1)
127Debug.Assert(solution.ProjectIds.Count == newVersions.Map.Count);
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (1)
199unitCount += _project.DocumentIds.Count;
Microsoft.CodeAnalysis.ResxSourceGenerator (26)
AbstractResxGenerator.cs (1)
884public bool HasArguments => _arguments.Count > 0;
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Verifiers\CSharpSourceGeneratorVerifier`1+Test.cs (1)
88foreach (var tree in compilation.SyntaxTrees.Skip(project.DocumentIds.Count))
Verifiers\VisualBasicSourceGeneratorVerifier`1+Test.cs (1)
73foreach (var tree in compilation.SyntaxTrees.Skip(project.DocumentIds.Count))
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\DiagnosticDescription.cs (1)
171if (args == null || args.Count == 0)
Microsoft.CodeAnalysis.Threading.Package (9)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
Microsoft.CodeAnalysis.UnitTests (42)
Collections\ImmutableDictionaryTestBase.cs (7)
46Assert.Equal(2, map.Count); 49Assert.Equal(2, map.Count); 66Assert.Equal(2, map.Count); 74Assert.Equal(3, map.Count); 84Assert.Equal(3, map.Count); 93Assert.Equal(2, map.Count); 241Assert.Equal(0, empty.Count);
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (6)
93Assert.Equal(100, map.Count); 149Assert.Equal(10, map.Count); 163Assert.Equal(10, map.Count); 180Assert.Equal(inputs.Length, map.Count); 191Assert.Equal(0, map.Count); 203Assert.Equal(1, halfRemoved.Count);
Collections\ImmutableSegmentedListTest.cs (4)
376Assert.Equal(9, list2.Count); 380Assert.Equal(8, list2.Count); 384Assert.Equal(7, list2.Count); 388Assert.Equal(5, list2.Count);
Collections\ImmutableSetTest.cs (12)
226Assert.Equal(1, set.Count); 269Assert.Equal(expectedValues.Length, set.Count); 289Assert.Equal(0, emptySet.Count); //, "Empty set should have a Count of 0"); 394int initialCount = set.Count; 400Assert.Equal(initialCount - removedCount, set.Count); 401Assert.Equal(initialCount - removedCount - 1, nextSet.Count); 408Assert.Equal(initialCount - removedCount, set.Count); 490int initialCount = set.Count; 494Assert.Equal(initialCount + uniqueValues.Count, enumerateAddSet.Count); 505Assert.True(nextSet.Count > 0); 506Assert.Equal(initialCount + addedCount, set.Count); 512Assert.Equal(expectedCount, nextSet.Count);
Collections\ImmutableSetTest.nonnetstandard.cs (1)
139Assert.True(set.Intersect(Enumerable.Empty<T>()).Count == 0);
Collections\SegmentedArrayTests.cs (2)
61Assert.Equal(0, ((IReadOnlyCollection<IntPtr>)data).Count); 133Assert.Equal(length, ((IReadOnlyCollection<IntPtr>)data).Count);
Text\TextChangeTests.cs (10)
100Assert.Equal(1, changes.Count); 685Assert.Equal(1, changes.Count); 741Assert.Equal(1, changes.Count); 755Assert.Equal(1, changes.Count); 769Assert.Equal(1, changes.Count); 875Assert.Equal(1, changes.Count); 889Assert.Equal(2, changes.Count); 905Assert.Equal(2, changes.Count); 922Assert.Equal(1, changes.Count); 940Assert.Equal(1, changes.Count);
Microsoft.CodeAnalysis.VisualBasic (1)
Binding\Binder_XmlLiterals.vb (1)
1431Debug.Assert(namespaces.Count > 0)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (3)
CommandLineArgumentsTests.vb (2)
231Assert.Equal(1, dict.Count) 265Assert.Equal(1, dict.Count)
CommandLineTests.vb (1)
7744Assert.Equal(2, args.ParseOptions.Features.Count)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Wrapping\SeparatedSyntaxList\VisualBasicParameterWrapper.vb (1)
54Dim firstToken = If(attributes?.Count > 0,
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.vb (1)
816Assert.Equal(4, diagnostic.Arguments.Count)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (73)
CodeGeneration\SyntaxGeneratorTests.vb (73)
2292Assert.Equal(1, attrsAdded.Count) 2836Assert.Equal(0, Generator.GetParameters(Generator.MethodDeclaration("m")).Count) 2837Assert.Equal(1, Generator.GetParameters(Generator.MethodDeclaration("m", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2838Assert.Equal(2, Generator.GetParameters(Generator.MethodDeclaration("m", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))})).Count) 2840Assert.Equal(0, Generator.GetParameters(Generator.ConstructorDeclaration()).Count) 2841Assert.Equal(1, Generator.GetParameters(Generator.ConstructorDeclaration(parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2842Assert.Equal(2, Generator.GetParameters(Generator.ConstructorDeclaration(parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))})).Count) 2844Assert.Equal(0, Generator.GetParameters(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count) 2846Assert.Equal(1, Generator.GetParameters(Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))}, Generator.IdentifierName("t"))).Count) 2847Assert.Equal(2, Generator.GetParameters(Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))}, Generator.IdentifierName("t"))).Count) 2849Assert.Equal(0, Generator.GetParameters(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("expr"))).Count) 2850Assert.Equal(1, Generator.GetParameters(Generator.ValueReturningLambdaExpression("p1", Generator.IdentifierName("expr"))).Count) 2852Assert.Equal(0, Generator.GetParameters(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("expr"))).Count) 2853Assert.Equal(1, Generator.GetParameters(Generator.VoidReturningLambdaExpression("p1", Generator.IdentifierName("expr"))).Count) 2855Assert.Equal(0, Generator.GetParameters(Generator.DelegateDeclaration("d")).Count) 2856Assert.Equal(1, Generator.GetParameters(Generator.DelegateDeclaration("d", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2858Assert.Equal(0, Generator.GetParameters(Generator.ClassDeclaration("c")).Count) 2859Assert.Equal(0, Generator.GetParameters(Generator.IdentifierName("x")).Count) 2864Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.MethodDeclaration("m"), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2865Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ConstructorDeclaration(), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2866Assert.Equal(3, Generator.GetParameters(Generator.AddParameters(Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))}, Generator.IdentifierName("t")), {Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2")), Generator.ParameterDeclaration("p3", Generator.IdentifierName("t3"))})).Count) 2868Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("expr")), {Generator.LambdaParameter("p")})).Count) 2869Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("expr")), {Generator.LambdaParameter("p")})).Count) 2871Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.DelegateDeclaration("d"), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2873Assert.Equal(0, Generator.GetParameters(Generator.AddParameters(Generator.ClassDeclaration("c"), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2874Assert.Equal(0, Generator.GetParameters(Generator.AddParameters(Generator.IdentifierName("x"), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2875Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2887Assert.Equal(1, Generator.GetStatements(Generator.ValueReturningLambdaExpression("p", {Generator.IdentifierName("x")})).Count) 2965Assert.Equal(0, Generator.GetStatements(Generator.MethodDeclaration("m")).Count) 2966Assert.Equal(2, Generator.GetStatements(Generator.MethodDeclaration("m", statements:=stmts)).Count) 2968Assert.Equal(0, Generator.GetStatements(Generator.ConstructorDeclaration()).Count) 2969Assert.Equal(2, Generator.GetStatements(Generator.ConstructorDeclaration(statements:=stmts)).Count) 2971Assert.Equal(0, Generator.GetStatements(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("e"))).Count) 2972Assert.Equal(0, Generator.GetStatements(Generator.VoidReturningLambdaExpression({})).Count) 2973Assert.Equal(2, Generator.GetStatements(Generator.VoidReturningLambdaExpression(stmts)).Count) 2975Assert.Equal(0, Generator.GetStatements(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("e"))).Count) 2976Assert.Equal(0, Generator.GetStatements(Generator.ValueReturningLambdaExpression({})).Count) 2977Assert.Equal(2, Generator.GetStatements(Generator.ValueReturningLambdaExpression(stmts)).Count) 2979Assert.Equal(0, Generator.GetStatements(Generator.IdentifierName("x")).Count) 2986Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.MethodDeclaration("m"), stmts)).Count) 2987Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ConstructorDeclaration(), stmts)).Count) 2989Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.VoidReturningLambdaExpression({}), stmts)).Count) 2990Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ValueReturningLambdaExpression({}), stmts)).Count) 2992Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("e")), stmts)).Count) 2993Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("e")), stmts)).Count) 2995Assert.Equal(0, Generator.GetStatements(Generator.WithStatements(Generator.IdentifierName("x"), stmts)).Count) 3056Assert.Equal(2, _g.GetAccessors(prop).Count) 3082Assert.Equal(0, _g.GetStatements(getAccessor).Count) 3083Assert.Equal(0, _g.GetStatements(setAccessor).Count) 3105Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count) 3106Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), getAccessorStatements:=stmts)).Count) 3108Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.IndexerDeclaration({p}, Generator.IdentifierName("t"))).Count) 3109Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.IndexerDeclaration({p}, Generator.IdentifierName("t"), getAccessorStatements:=stmts)).Count) 3111Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.IdentifierName("x")).Count) 3114Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count) 3115Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), setAccessorStatements:=stmts)).Count) 3117Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.IndexerDeclaration({p}, Generator.IdentifierName("t"))).Count) 3118Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.IndexerDeclaration({p}, Generator.IdentifierName("t"), setAccessorStatements:=stmts)).Count) 3120Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.IdentifierName("x")).Count) 3130Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), stmts)).Count) 3131Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.IndexerDeclaration({p}, Generator.IdentifierName("t")), stmts)).Count) 3132Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.IdentifierName("x"), stmts)).Count) 3135Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), stmts)).Count) 3136Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.IndexerDeclaration({p}, Generator.IdentifierName("t")), stmts)).Count) 3137Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.IdentifierName("x"), stmts)).Count) 3194Assert.Equal(0, Generator.GetMembers(Generator.RemoveNodes(declaration, Generator.GetMembers(declaration))).Count) 3207Assert.Equal(2, baseListBI.Count) 3219Assert.Equal(2, baseListXY.Count) 3242Assert.Equal(3, baseList.Count) 3533Assert.Equal(1, Generator.GetAttributes(xAttributed).Count) 3537Assert.Equal(3, membersC.Count) 3731Assert.Equal(3, attrs.Count) 3863Assert.Equal(3, imps.Count)
Microsoft.CodeAnalysis.Workspaces (76)
CodeFixesAndRefactorings\FixAllLogger.cs (2)
82m[DocumentCount] = fixAllState.Project.DocumentIds.Count; 86m[DocumentCount] = fixAllState.Solution.Projects.Sum(p => p.DocumentIds.Count);
Diagnostics\DiagnosticData.cs (2)
267if (diagnostic.AdditionalLocations.Count == 0) 272using var _ = ArrayBuilder<DiagnosticDataLocation>.GetInstance(diagnostic.AdditionalLocations.Count, out var builder);
Differencing\MapBasedLongestCommonSubsequence.cs (2)
17foreach (var edit in GetEdits(oldNodes, oldNodes.Count, newNodes, newNodes.Count))
Differencing\Match.LongestCommonSubsequence.cs (4)
31foreach (var pair in GetMatchingPairs(oldNodes, oldNodes.Count, newNodes, newNodes.Count)) 41foreach (var edit in GetEdits(oldNodes, oldNodes.Count, newNodes, newNodes.Count))
Editing\SyntaxGenerator.cs (10)
1030attributeArguments: args.Count > 0 ? args : null); 1105=> this.InsertAttributes(declaration, this.GetAttributes(declaration).Count, attributes); 1133=> this.InsertReturnAttributes(declaration, this.GetReturnAttributes(declaration).Count, attributes); 1155=> this.InsertAttributeArguments(attributeDeclaration, this.GetAttributeArguments(attributeDeclaration).Count, attributeArguments); 1177=> this.InsertNamespaceImports(declaration, this.GetNamespaceImports(declaration).Count, imports); 1205=> this.InsertMembers(declaration, this.GetMembers(declaration).Count, members); 1278=> this.InsertParameters(declaration, this.GetParameters(declaration).Count, parameters); 1294=> this.InsertSwitchSections(switchStatement, this.GetSwitchSections(switchStatement).Count, switchSections); 1336=> this.InsertAccessors(declaration, this.GetAccessors(declaration).Count, accessors); 1521for (int i = 0, count = list.Count; i < count; i++)
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
465var order = new Dictionary<ProjectId, int>(capacity: solution.ProjectIds.Count);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
94if (scope != null && scope.Count == 1)
Serialization\AbstractOptionsSerializationService.cs (1)
198writer.WriteInt32(options.Features.Count);
Serialization\SerializerService_Reference.cs (3)
101if (portable is ISupportTemporaryStorage { StorageHandles: { Count: > 0 } handles } && 363Contract.ThrowIfTrue(handles.Count == 0); 368writer.WriteInt32(handles.Count);
Shared\Extensions\SourceTextExtensions.cs (2)
65if (ranges.Count == 0) 71if (ranges.Count == 1)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
1403if (w.CurrentSolution.ProjectIds.Count == 1)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (3)
148if (oldSolution.ProjectIds.Count == 0) 171return oldSolution.ProjectIds.Count == 0 562if (projectToRetarget.MetadataReferences.Count > 0 &&
Workspace\Solution\ChecksumCollection.cs (1)
97Contract.ThrowIfFalse(values.Count == checksums.Children.Length);
Workspace\Solution\ProjectDependencyGraph.cs (1)
144else if (projectReferences.Count == 0)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
19if (projectReferences.Count == 0)
Workspace\Solution\Solution.cs (1)
843var builder = new FixedSizeArrayBuilder<AnalyzerReference>(oldProject.AnalyzerReferences.Count - 1);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
490(this.ProjectState.MetadataReferences.Count > 0 ||
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (1)
108if (projectState.AnalyzerReferences.Count == 0)
Workspace\Solution\SolutionState.cs (5)
162Contract.ThrowIfFalse(SortedProjectStates.Length == ProjectIds.Count); 409using var _1 = ArrayBuilder<ProjectId>.GetInstance(ProjectIds.Count + projectStates.Count, out var newProjectIdsBuilder); 757if (projectReferences.Count == 0) 866if (metadataReferences.Count == 0) 1230if (analyzerReferences.Count == 0)
Workspace\Solution\StateChecksums.cs (1)
566var checksums = new FixedSizeArrayBuilder<Checksum>(references.Count);
Workspace\Workspace.cs (1)
774using var _ = ArrayBuilder<ProjectInfo>.GetInstance(projects.Count, out var builder);
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
431var results = new FixedSizeArrayBuilder<DocumentInfo>(documentFileInfos.Count);
MSBuild\MSBuildWorkspace.cs (1)
466var relativePath = (info.Folders != null && info.Folders.Count > 0)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (10)
src\Compilers\Core\Portable\InternalUtilities\IReadOnlyListExtensions.cs (1)
14for (int i = 0; i < list.Count; i++)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (15)
NetCoreTests.cs (8)
146Assert.Equal(2, workspace.CurrentSolution.ProjectIds.Count); 175Assert.Equal(2, workspace.CurrentSolution.ProjectIds.Count); 186Assert.Equal(3, workspace.CurrentSolution.ProjectIds.Count); 218Assert.Equal(3, workspace.CurrentSolution.ProjectIds.Count); 260Assert.Equal(3, workspace.CurrentSolution.ProjectIds.Count); 308Assert.Equal(4, workspace.CurrentSolution.ProjectIds.Count); 465Assert.Equal(2, workspace.CurrentSolution.ProjectIds.Count); 519Assert.Equal(2, workspace.CurrentSolution.ProjectIds.Count);
VisualStudioMSBuildWorkspaceTests.cs (7)
2312Assert.Equal(1, proj.AnalyzerReferences.Count); 2712Assert.Equal(2, solution.ProjectIds.Count); 2738Assert.Equal(3, solution.ProjectIds.Count); 3015Assert.Equal(2, proj.DocumentIds.Count); 3033Assert.Equal(2, project.DocumentIds.Count); 3279Assert.Equal(0, workspace.CurrentSolution.ProjectIds.Count); 3307Assert.Equal(0, workspace.CurrentSolution.ProjectIds.Count);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
MEF\ExportProviderCache.cs (1)
156if (exportBindings.Count <= 1)
Workspaces\TestWorkspace_XmlCreation.cs (1)
121if (parseOptions.Features == null || parseOptions.Features.Count == 0)
Microsoft.CodeAnalysis.Workspaces.UnitTests (35)
CommandLineProject\CommandLineProjectTests.cs (7)
28Assert.Equal(0, docInfo.Folders.Count); 58Assert.Equal(0, docInfo.Folders.Count); 69Assert.Equal(1, docInfo.Folders.Count); 81Assert.Equal(0, docInfo.Folders.Count); 92Assert.Equal(1, docInfo.Folders.Count); 104Assert.Equal(0, docInfo.Folders.Count); 115Assert.Equal(0, docInfo.Folders.Count);
CommandLineProject\CommandLineProjectWorkspaceTests.cs (3)
39Assert.Equal(0, gooDoc.Folders.Count); 67Assert.Equal(0, gooDoc.Folders.Count); 71Assert.Equal(1, barDoc.Folders.Count);
SolutionTests\SolutionTests.cs (14)
3021Assert.Equal(1, actualAnalyzerReferences.Count); 3047Assert.Equal(2, actualAnalyzerReferences.Count); 3053Assert.Equal(1, actualAnalyzerReferences.Count); 3059Assert.Equal(2, actualAnalyzerReferences.Count); 4998Assert.Equal(2, solution.ProjectIds.Count); 5022Assert.Equal(2, solution.ProjectIds.Count); 5050Assert.Equal(2, solution.ProjectIds.Count); 5081Assert.Equal(3, solution.ProjectIds.Count); 5112Assert.Equal(3, solution.ProjectIds.Count); 5144Assert.Equal(3, solution.ProjectIds.Count); 5196Assert.Equal(3, solution.ProjectIds.Count); 5212Assert.Equal(1, solution.ProjectIds.Count); 5241Assert.Equal(3, solution.ProjectIds.Count); 5256Assert.Equal(1, solution.ProjectIds.Count);
WorkspaceTests\AdhocWorkspaceTests.cs (9)
97Assert.Equal(sinfo.Projects.Count, solution.ProjectIds.Count); 129Assert.Equal(2, solution.ProjectIds.Count); 448Assert.Equal(0, originalDoc.Folders.Count); 451Assert.Equal(2, changedDoc.Folders.Count); 468Assert.Equal(2, appliedDoc.Folders.Count); 547Assert.Equal(0, originalDoc.Folders.Count); 555Assert.Equal(2, changedDoc.Folders.Count); 564Assert.Equal(2, appliedDoc.Folders.Count);
WorkspaceTests\WorkspaceTests.cs (2)
56Assert.Equal(0, originalDoc.Folders.Count); 59Assert.Equal(2, changedDoc.Folders.Count);
Microsoft.Data.Analysis (17)
DataFrame.BinaryOperations.cs (14)
18if (values.Count != Columns.Count) 57if (values.Count != Columns.Count) 96if (values.Count != Columns.Count) 135if (values.Count != Columns.Count) 174if (values.Count != Columns.Count) 212if (values.Count != Columns.Count) 249if (values.Count != Columns.Count) 286if (values.Count != Columns.Count) 360if (values.Count != Columns.Count) 393if (values.Count != Columns.Count) 426if (values.Count != Columns.Count) 459if (values.Count != Columns.Count) 492if (values.Count != Columns.Count) 525if (values.Count != Columns.Count)
DataFrame.Join.Extrensions.cs (3)
19while (i < sortedList1.Count && j < sortedList2.Count) 23while (j < sortedList2.Count)
Microsoft.Data.Analysis.Tests (6)
ArrayComparer.cs (5)
67Assert.Equal(expectedArray.Fields.Count, array.Fields.Count); 69for (int i = 0; i < array.Fields.Count; i++) 161if (s2 == null || s1 == null || s1.HasMetadata != s2.HasMetadata || s1.FieldsList.Count != s2.FieldsList.Count)
DataFrameTests.cs (1)
952Assert.Equal(columns.Count, df.Columns.Count);
Microsoft.DotNet.Arcade.Sdk (1)
src\GenerateResxSource.cs (1)
523public bool HasArguments => _arguments.Count > 0;
Microsoft.DotNet.NuGetRepack.Tasks (2)
src\NuGetVersionUpdater.cs (2)
387if (exceptions.Count == 1) 392if (exceptions.Count > 1)
Microsoft.Extensions.AI (5)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Abstractions (5)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Functions\AIFunctionArgumentsTests.cs (1)
77Assert.Equal(2, args.Count);
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
1164public int Count => _dictionary.Count;
Microsoft.Extensions.AI.AzureAIInference (6)
AzureAIInferenceChatClient.cs (1)
102if (response.ToolCalls is { Count: > 0 } toolCalls)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation (3)
CompositeEvaluator.cs (2)
51if (evaluator.EvaluationMetricNames.Count == 0) 150if (e.EvaluationMetricNames.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Console (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.NLP (3)
BLEUEvaluator.cs (1)
72if (context.References.Count is 0)
GLEUEvaluator.cs (1)
72if (context.References.Count is 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Quality (6)
IntentResolutionEvaluator.cs (1)
109if (context is not null && context.ToolDefinitions.Count is 0)
RetrievalEvaluator.cs (2)
102if (context.RetrievedContextChunks.Count is 0) 151if (++count < context.RetrievedContextChunks.Count)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
TaskAdherenceEvaluator.cs (1)
108if (context is not null && context.ToolDefinitions.Count is 0)
ToolCallAccuracyEvaluator.cs (1)
119if (context.ToolDefinitions.Count is 0)
Microsoft.Extensions.AI.Evaluation.Reporting (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Safety (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Integration.Tests (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Ollama (5)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.OpenAI (9)
OpenAIChatClient.cs (1)
353if (update.ToolCallUpdates is { Count: > 0 } toolCallUpdates)
OpenAISpeechToTextClient.cs (3)
88int segmentCount = translation.Segments.Count; 102int segmentCount = transcription.Segments.Count; 110int wordCount = transcription.Words.Count;
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AmbientMetadata.Application (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AsyncState (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Caching.Hybrid (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Compliance.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Compliance.Redaction (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Compliance.Testing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Compliance.Testing.Tests (2)
FakeRedactorTests.cs (1)
90Assert.Equal(fakeRedactorProvider.Collector.AllRedactorRequests.Count, iterations.Length);
RedactionFakesAcceptanceTests.cs (1)
212Assert.Equal(2, collector.AllRedactedData.Count);
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.DependencyModel (4)
DependencyContextWriter.cs (4)
135int count = libraries.Count; 198if (dependencies.Count == 0) 213int count = resourceAssemblies.Count; 322if (group.RuntimeFiles.Count != 0)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (2)
ExceptionSummarizer.cs (1)
90if (descriptionIndex >= exceptionSummaryProvider.Descriptions.Count || descriptionIndex < 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
259if (entry.Data.Count > 0 && logger.IsEnabled(LogLevel.Debug))
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.Probes (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (4)
Windows\Disk\WindowsDiskMetricsTests.cs (2)
86Assert.Equal(4, measurements.Count); 160Assert.Equal(4, measurements.Count);
Windows\WindowsContainerSnapshotProviderTests.cs (1)
232Assert.Equal(2, snapshot.Count);
Windows\WindowsSnapshotProviderTests.cs (1)
68Assert.Equal(2, logRecords.Count);
Microsoft.Extensions.Diagnostics.Testing (3)
Metrics\CollectedMeasurement.cs (2)
100public bool MatchesTags(params KeyValuePair<string, object?>[] tags) => ContainsTags(tags) && (Tags.Count == tags.Length); 107public bool MatchesTags(params string[] tags) => ContainsTags(Throw.IfNull(tags)) && (Tags.Count == tags.Length);
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.Testing.Tests (14)
Logging\FakeLoggerProviderTests.cs (1)
48Assert.Equal(2, records.Count);
Logging\FakeLoggerTests.cs (2)
33Assert.Equal(2, records.Count); 282Assert.Equal(2, logger.LatestRecord.Scopes.Count);
Metrics\MeasurementExtensionsTests.cs (4)
31Assert.Equal(2, filtered[1].Tags.Count); 56Assert.Equal(2, filtered[1].Tags.Count); 81Assert.Equal(2, filtered[1].Tags.Count); 109Assert.Equal(2, filtered[1].Tags.Count);
Metrics\MetricCollectorTests.cs (7)
73Assert.Equal(2, collector.GetMeasurementSnapshot().Count); 118Assert.Equal(2, collector.GetMeasurementSnapshot().Count); 165Assert.Equal(2, collector.GetMeasurementSnapshot().Count); 226Assert.Equal(2, collector.GetMeasurementSnapshot().Count); 399Assert.Equal(3, snap.Count); 400Assert.Equal(3, collector.GetMeasurementSnapshot().Count); 415Assert.Equal(3, snap.Count);
Microsoft.Extensions.FileProviders.Embedded (2)
Manifest\ManifestDirectory.cs (2)
89var list = new List<ManifestEntry>(Children.Count); 90for (var i = 0; i < Children.Count; i++)
Microsoft.Extensions.Hosting.Testing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Http (1)
HttpMessageHandlerBuilder.cs (1)
92for (int i = additionalHandlersList.Count - 1; i >= 0; i--)
Microsoft.Extensions.Http.Diagnostics (9)
Logging\Internal\HttpHeadersRedactor.cs (5)
99if (input.Count == 0) 106if (input.Count == 1) 118for (int i = 1; i < input.Count; i++) 134for (int i = 0; i < input.Count; i++) 142if (i < input.Count - 1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Extensions.Http.Diagnostics.Tests (4)
Logging\HttpClientLoggerTest.cs (4)
337Assert.Equal(2, logRecords.Count); 740Assert.Equal(2, logRecords.Count); 778Assert.Equal(2, logRecords.Count); 823Assert.Equal(2, logRecords.Count);
Microsoft.Extensions.Http.Resilience (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Logging.Console (1)
JsonConsoleFormatter.cs (1)
35bufferedRecord.Attributes.Count > 0, null, bufferedRecord.Attributes, bufferedRecord.Timestamp);
Microsoft.Extensions.Logging.EventSource (2)
EventSourceLogger.cs (2)
244var arguments = new KeyValuePair<string, string?>[keyValuePairs.Count]; 245for (int i = 0; i < keyValuePairs.Count; i++)
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Roslyn3.11.cs (1)
34if (logClasses.Count > 0)
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Options.Contextual (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Options.SourceGeneration (1)
Generator.cs (1)
51if (validatorTypes.Count > 0)
Microsoft.Extensions.Primitives (3)
CompositeChangeToken.cs (3)
39for (int i = 0; i < ChangeTokens.Count; i++) 71for (int i = 0; i < ChangeTokens.Count; i++) 105for (int i = 0; i < ChangeTokens.Count; i++)
Microsoft.Extensions.Resilience (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.ServiceDiscovery (5)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
43_includeAllSchemes = serviceDiscoveryOptions.Value.AllowAllSchemes && query.IncludedSchemes.Count == 0;
LoadBalancing\RoundRobinServiceEndpointSelector.cs (2)
23if (_endpoints is not { Count: > 0 } collection) 28return collection[(int)(Interlocked.Increment(ref _next) % collection.Count)];
ServiceDiscoveryOptions.cs (1)
35if (schemes.Count > 0)
ServiceEndpointWatcher.Log.cs (1)
25ResolutionSucceededCore(logger, endpointSource.Endpoints.Count, serviceName, string.Join(", ", endpointSource.Endpoints.Select(GetEndpointString)));
Microsoft.Extensions.ServiceDiscovery.Dns (6)
Resolver\DnsResolver.cs (2)
40Debug.Assert(_options.Servers.Count > 0); 364for (int index = 0; index < _options.Servers.Count; index++)
Resolver\EncodedDomainName.cs (3)
37if (Labels.Count != other.Labels.Count) 42for (int i = 0; i < Labels.Count; i++)
Resolver\ResolverOptions.cs (1)
19if (servers.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (6)
DnsServiceEndpointResolverTests.cs (3)
27Assert.True(initialResult.Endpoints.Count > 0); 31Assert.True(initialResult.Endpoints.Count > 0); 35Assert.True(initialResult.Endpoints.Count > 0);
DnsSrvServiceEndpointResolverTests.cs (3)
68Assert.Equal(3, initialResult.EndpointSource.Endpoints.Count); 149Assert.Equal(3, initialResult.EndpointSource.Endpoints.Count); 165Assert.Equal(2, initialResult.EndpointSource.Endpoints.Count);
Microsoft.Extensions.ServiceDiscovery.Tests (5)
ConfigurationServiceEndpointResolverTests.cs (4)
302Assert.Equal(2, initialResult.EndpointSource.Endpoints.Count); 324Assert.Equal(2, initialResult.EndpointSource.Endpoints.Count); 369Assert.Equal(3, initialResult.EndpointSource.Endpoints.Count); 414Assert.Equal(3, initialResult.EndpointSource.Endpoints.Count);
ServiceEndpointResolverTests.cs (1)
127Assert.Equal(2, resolverResult.EndpointSource.Endpoints.Count);
Microsoft.Extensions.ServiceDiscovery.Yarp (2)
ServiceDiscoveryDestinationResolver.cs (2)
27var tasks = new List<Task<(List<(string Name, DestinationConfig Config)>, IChangeToken ChangeToken)>>(destinations.Count); 61var results = new List<(string Name, DestinationConfig Config)>(result.Endpoints.Count);
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (2)
YarpServiceDiscoveryTests.cs (2)
145Assert.Equal(4, result.Destinations.Count); 303Assert.Equal(3, result.Destinations.Count);
Microsoft.Extensions.Telemetry (3)
Logging\ExtendedLogger.LegacyTagJoiner.cs (1)
46_incomingTagCount = _incomingTags.Count;
src\Shared\LogBuffering\SerializedLogRecordFactory.cs (1)
30for (int i = 0; i < attributes.Count; i++)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Telemetry.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Telemetry.Abstractions.Tests (6)
Latency\LatencyRegistryExtensionsTests.cs (3)
80Assert.True(lcro.CheckpointNames.Count == 1); 81Assert.True(lcro.MeasureNames.Count == 2); 82Assert.True(lcro.TagNames.Count == 3);
Logging\LoggerMessageStateTests.cs (3)
141Assert.Equal(1, list.Count); 151Assert.Equal(1, list.Count); 157Assert.Equal(1, list.Count);
Microsoft.Extensions.Telemetry.PerformanceTests (1)
BenchLogger.cs (1)
41int count = l.Count;
Microsoft.Extensions.TimeProvider.Testing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Validation (1)
ValidatableTypeInfo.cs (1)
30_membersCount = members.Count;
Microsoft.Gen.ComplianceReports (1)
ComplianceReportsGenerator.cs (1)
73if (classifiedTypes.Count == 0)
Microsoft.Gen.ComplianceReports.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.Logging (1)
LoggingGenerator.cs (1)
44if (logTypes.Count > 0)
Microsoft.Gen.Logging.Generated.Tests (10)
LoggerMessageAttributeTests.cs (1)
160Assert.Equal(expectedState.Length, collector.LatestRecord.StructuredState!.Count);
LogMethodTests.cs (4)
92Assert.Equal(3, collector.LatestRecord.StructuredState!.Count); 100Assert.Equal(3, collector.LatestRecord.StructuredState!.Count); 982Assert.Equal(3, collector.LatestRecord.StructuredState!.Count); 1002Assert.Equal(expected, rol.Count);
LogPropertiesTests.cs (3)
63Assert.Equal(2, state.Count); 80Assert.Equal(2, state.Count); 120Assert.Equal(21, state.Count);
TagProviderTests.cs (2)
167Assert.Equal(2, state.Count); 193Assert.Equal(2, state.Count);
Microsoft.Gen.Logging.Unit.Tests (6)
ParserTests.cs (2)
747else if (d.Count > 0) 749Assert.Fail($"Expected no diagnostics, got {d.Count} diagnostics");
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.MetadataExtractor (7)
MetadataReportsGenerator.cs (2)
126if (meteringClasses.Count == 0) 153if (classifiedTypes.Count == 0)
src\Generators\Microsoft.Gen.ComplianceReports\ComplianceReportsGenerator.cs (1)
73if (classifiedTypes.Count == 0)
src\Generators\Microsoft.Gen.MetricsReports\MetricDefinitionEmitter.cs (3)
23if (metricClasses == null || metricClasses.Count == 0) 30for (int i = 0; i < metricClasses.Count; i++) 36if (i < metricClasses.Count - 1)
src\Generators\Microsoft.Gen.MetricsReports\MetricsReportsGenerator.cs (1)
70if (meteringClasses.Count == 0)
Microsoft.Gen.MetadataExtractor.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.Metrics (1)
MetricsGenerator.cs (1)
36if (metricClasses.Count > 0)
Microsoft.Gen.Metrics.Generated.Tests (2)
MetricTests.cs (2)
171Assert.Equal(2, measurements.Count); 195Assert.Equal(2, measurements.Count);
Microsoft.Gen.Metrics.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.MetricsReports (4)
MetricDefinitionEmitter.cs (3)
23if (metricClasses == null || metricClasses.Count == 0) 30for (int i = 0; i < metricClasses.Count; i++) 36if (i < metricClasses.Count - 1)
MetricsReportsGenerator.cs (1)
70if (meteringClasses.Count == 0)
Microsoft.Gen.MetricsReports.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
75&& document.Folders.Count == 1
Microsoft.Maui (3)
Layouts\GridLayoutManager.cs (2)
157 int count = rowDefinitions.Count; 178 int count = columnDefinitions.Count;
VisualDiagnostics\VisualDiagnosticsOverlay.cs (1)
109 if (WindowElements.Count == 0)
Microsoft.Maui.Controls (98)
Application\Application.cs (4)
95 if (Windows.Count == 0) 121 if (Windows.Count == 1) 538 if (Windows.Count > 1) 543 if (Windows.Count > 0)
ContentPresenter.cs (1)
43 for (var i = 0; i < LogicalChildrenInternal.Count; i++)
Element\Element.cs (3)
706 for (var i = 0; i < children.Count; i++) 812 for (var i = 0; i < children.Count; i++) 1086 int ICollection<Element>.Count => _inner.Count;
LegacyLayouts\Layout.cs (3)
436 var oldBounds = new Rect[LogicalChildrenInternal.Count]; 465 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 548 int count = children.Count;
LegacyLayouts\StackLayout.cs (5)
70 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 157 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 193 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 424 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 452 for (var i = 0; i < LogicalChildrenInternal.Count; i++)
NavigationPage\NavigationPage.cs (9)
464 CurrentPage = (Page)newStack[newStack.Count - 1]; 477 for (int i = 0; i < newStack.Count; i++) 497 while (InternalChildren.Count > newStack.Count) 691 var visiblePage = Navigation.NavigationStack[NavigationStack.Count - 1]; 780 var currentPage = NavigationStack[NavigationStack.Count - 1]; 781 var newCurrentPage = NavigationStack[NavigationStack.Count - 2]; 810 if (NavigationStack.Count == 1) 820 var lastIndex = NavigationStack.Count - 1; 825 lastIndex = NavigationStack.Count - 1;
NavigationPage\NavigationPageToolbar.cs (5)
159 if (navPage.Navigation.NavigationStack.Count == 0) 162 if (navPage.Navigation.NavigationStack.Count > 1) 224 if (stack.Count == 0) 230 if (stack.Count > 1) 231 previousPage = stack[stack.Count - 1];
Platform\ModalNavigationManager\ModalNavigationManager.cs (1)
290 if (ModalStack.Count == 0)
ReadOnlyCastingList.cs (1)
60 get { return _readonlyList.Count; }
ReadOnlyListAdapter.cs (1)
33 get { return _collection.Count; }
Region.cs (3)
75 for (int i = 0; i < Regions.Count; i++) 103 Rect[] rectangles = new Rect[Regions.Count]; 104 for (int i = 0; i < Regions.Count; i++)
Routing.cs (2)
46 var navigationStackCount = section.Navigation.NavigationStack.Count; 51 var navigationModalStackCount = section.Navigation.ModalStack.Count;
Shell\BaseShellItem.cs (4)
175 if (Navigation.ModalStack.Count > 0) 177 Navigation.ModalStack[Navigation.ModalStack.Count - 1] 182 else if (Navigation.NavigationStack.Count > 1) 184 Navigation.NavigationStack[Navigation.NavigationStack.Count - 1]
Shell\RouteRequestBuilder.cs (1)
204 var nextMatch = matchedSegments.Count;
Shell\Shell.cs (6)
958 if (Application.Current is null || Application.Current.Windows.Count == 0) 961 if (Application.Current.Windows.Count == 1) 1538 if (currentContent != null && currentContent.Stack.Count > 1) 1944 currentPage = navStack[navStack.Count - 1] ?? 2109 if (ModalStack.Count == 0 && !_shell.CurrentItem.CurrentItem.IsPoppingModalStack) 2131 if (ModalStack.Count == 0)
Shell\ShellElementCollection.cs (1)
215 return (sgi.ShellElementCollection.VisibleItemsReadOnly.Count > 0) ||
Shell\ShellNavigationManager.cs (14)
157 if (!modalStackPreBuilt && currentShellSection?.Navigation.ModalStack.Count > 0) 167 for (int i = currentShellSection.Stack.Count - 1; i >= 1; i--) 185 nextActiveSection?.Navigation?.NavigationStack?.Count > 1) 491 (modalStack?.Count > 0 ? modalStack[modalStack.Count - 1] : null) ?? 492 (navStack?.Count > 0 ? navStack[navStack.Count - 1] : null); 521 bool stackAtRoot = sectionStack == null || sectionStack.Count <= 1; 545 for (int i = 1; i < sectionStack.Count; i++) 552 if (modalStack != null && modalStack.Count > 0) 554 for (int i = 0; i < modalStack.Count; i++) 560 for (int j = 1; j < topPage.Navigation.NavigationStack.Count; j++) 587 for (int i = 0; i < modalStack.Count; i++) 590 for (int j = 1; j < modalStack[i].Navigation.NavigationStack.Count; j++)
Shell\ShellSection.cs (18)
58 if (Navigation.ModalStack.Count > 0) 60 if (Navigation.ModalStack[Navigation.ModalStack.Count - 1] is NavigationPage np) 61 return np.Navigation.NavigationStack[np.Navigation.NavigationStack.Count - 1]; 63 return Navigation.ModalStack[Navigation.ModalStack.Count - 1]; 330 if (Navigation.ModalStack.Count > 0) 351 if (Navigation.ModalStack.Count == 0) 419 while (navStack.Count > popCount && Navigation.ModalStack.Count > 0) 440 else if (Navigation.ModalStack.Count > 0) 442 await Navigation.ModalStack[Navigation.ModalStack.Count - 1].Navigation.PopAsync(isAnimated); 561 for (int i = Navigation.ModalStack.Count - 1; i >= 0; i--) 653 if (stack.Count > 1) 655 DisplayedPage = stack[stack.Count - 1]; 891 int modalStackCount = Navigation.ModalStack.Count; 894 var pageToPop = Navigation.ModalStack[Navigation.ModalStack.Count - 1]; 900 if (page == null && Navigation.ModalStack.Count == 1) 904 else if (Navigation.ModalStack.Count > 1 && Navigation.ModalStack[Navigation.ModalStack.Count - 2] == page) 1167 var page = ModalStack[ModalStack.Count - 1];
Shell\ShellUriHandler.cs (1)
451 if (routeRequestBuilder.FullSegments.Count <= i || currentSeg != routeRequestBuilder.FullSegments[i])
ShellToolbar.cs (6)
73 if (stack.Count == 0) 82 if (stack.Count > 1) 83 previousPage = stack[stack.Count - 1]; 94 _drawerToggleVisible = stack.Count <= 1 && flyoutBehavior is FlyoutBehavior.Flyout; 95 BackButtonVisible = backButtonVisible && stack.Count > 1; 181 else if (_shell.Navigation?.NavigationStack?.Count <= 1)
TemplatedView\TemplatedView.cs (1)
33 for (var i = 0; i < LogicalChildrenInternal.Count; i++)
TemplateUtilities.cs (1)
93 for (var i = 0; i < children.Count; i++)
ViewExtensions.cs (2)
511 if (modalStack.Count > 0) 513 var currentPage = modalStack[modalStack.Count - 1];
VisualElement\VisualElement.cs (1)
1380 for (var i = 0; i < LogicalChildrenInternal.Count; i++)
Window\Window.cs (4)
427 if (Navigation.ModalStack.Count == 0) 433 if (Navigation.ModalStack.Count == 0) 678 if (Navigation.ModalStack.Count > 0) 680 return Navigation.ModalStack[Navigation.ModalStack.Count - 1].SendBackButtonPressed();
Microsoft.Maui.Controls.Build.Tasks (1)
CompiledMarkupExtensions\ArrayExtension.cs (1)
22 var n = items.Count;
Microsoft.Maui.Graphics (5)
Text\AttributedTextExtensions.cs (4)
91 if (text.Runs == null || text.Runs.Count == 0) 95 if (!(startIndexForSearch < text.Runs.Count)) 149 } while (index < text.Runs.Count); 164 if (text.Runs?.Count > 0)
Text\XmlAttributedTextWriter.cs (1)
43 if (attributedText.Runs != null && attributedText.Runs.Count > 0)
Microsoft.ML.AutoML (8)
ColumnInference\PurposeInference.cs (4)
146if (imagePathCount < data.Count - 1) 148Double avgLength = 1.0 * sumLength / data.Count; 149Double cardinalityRatio = 1.0 * seen.Count / data.Count; 150Double avgSpaces = 1.0 * sumSpaces / data.Count;
Experiment\MetricsAgents\RankingMetricsAgent.cs (2)
42return metrics.NormalizedDiscountedCumulativeGains[Math.Min(metrics.NormalizedDiscountedCumulativeGains.Count, (int)_dcgTruncationLevel) - 1]; 44return metrics.DiscountedCumulativeGains[Math.Min(metrics.DiscountedCumulativeGains.Count, (int)_dcgTruncationLevel) - 1];
Sweepers\SmacSweeper.cs (1)
331for (var treeId = 0; treeId < forest.TrainedTreeEnsemble.Trees.Count; treeId++)
Tuner\SmacTuner.cs (1)
323for (var treeId = 0; treeId < forest.TrainedTreeEnsemble.Trees.Count; treeId++)
Microsoft.ML.AutoML.Tests (2)
AutoFitTests.cs (2)
455Assert.Equal(10, bestRun.ValidationMetrics.DiscountedCumulativeGains.Count); 456Assert.Equal(10, bestRun.ValidationMetrics.NormalizedDiscountedCumulativeGains.Count);
Microsoft.ML.Core (14)
Data\AnnotationUtils.cs (1)
304if (list?.Count != 1 || !schema.Schema[list[0].Index].HasSlotNames(vectorSize))
Data\ProgressReporter.cs (7)
133Contracts.Assert(entry.Header.MetricNames.Count == 0 && entry.Header.UnitNames.Count == 0); 233Contracts.Assert(entry.Header.MetricNames.Count == 0 && entry.Header.UnitNames.Count == 0); 559Progress = new Double?[header.UnitNames.Count]; 560ProgressLim = new Double?[header.UnitNames.Count]; 561Metrics = new Double?[header.MetricNames.Count];
Data\RoleMappedSchema.cs (3)
172if (cols.Count == 1) 244=> _map.TryGetValue(role.Value, out var cols) && cols.Count == 1; 250=> _map.TryGetValue(role.Value, out var cols) && cols.Count > 1;
Environment\ConsoleEnvironment.cs (2)
273for (int i = 0; i < ev.ProgressEntry.Header.UnitNames.Count; i++) 286for (int i = 0; i < ev.ProgressEntry.Header.MetricNames.Count; i++)
Utilities\Utils.cs (1)
87return x == null ? 0 : x.Count;
Microsoft.ML.Data (13)
DataView\RowToRowMapperTransform.cs (2)
176Contracts.Assert(0 <= col && col < _bindings.AddedColumnIndices.Count); 177return 0 <= col && col < _bindings.AddedColumnIndices.Count && active[_bindings.AddedColumnIndices[col]];
Evaluators\BinaryClassifierEvaluator.cs (3)
145host.CheckParam(prob.Count == 1, nameof(schema), "Cannot have multiple probability columns"); 162Host.Assert(prob == null || prob.Count == 1); 633Host.Assert(prob == null || prob.Count == 1);
Evaluators\EvaluatorUtils.cs (2)
1594int numLabels = confusionMatrix?.Counts == null ? 0 : confusionMatrix.Counts.Count; 1610rowDigitLen = Math.Max(confusionMatrix.PredictedClassesIndicators.Count - 1, 0).ToString().Length;
Evaluators\Metrics\ConfusionMatrix.cs (2)
116_host.CheckParam(predictedClassIndicatorIndex > -1 && predictedClassIndicatorIndex < Counts.Count, 118_host.CheckParam(actualClassIndicatorIndex > -1 && actualClassIndicatorIndex < Counts.Count,
Transforms\ColumnBindingsBase.cs (2)
754Contracts.Assert(index < AddedColumnIndices.Count); 778Contracts.Assert(-AddedColumnIndices.Count <= src && src < InputSchema.Count);
Transforms\ColumnConcatenatingTransformer.cs (2)
446int[] sources = new int[_parent._columns[iinfo].Sources.Count]; 463for (int i = 0; i < _parent._columns[iinfo].Sources.Count; i++)
Microsoft.ML.FastTree (2)
Utils\RegressionTreeBaseUtils.cs (2)
41for (int i = 0; i < trees.Count; i++) 122for (int i = 0; i < quantileTrees.Count; i++)
Microsoft.ML.GenAI.Core (1)
Trainer\CausalLMDataset.cs (1)
86var enumerable = Enumerable.Range(0, labelIds.Count)
Microsoft.ML.IntegrationTests (16)
Explainability.cs (1)
105Assert.Equal(HousingRegression.Features.Length, weights.Count);
IntrospectiveTraining.cs (14)
52Assert.Equal(3, treeCollection.Trees.Count); 53Assert.Equal(3, treeCollection.TreeWeights.Count); 59Assert.Equal(tree.SplitGains.Count, tree.NumberOfNodes); 60Assert.Equal(tree.NumericalSplitThresholds.Count, tree.NumberOfNodes); 96Assert.Equal(3, treeCollection.Trees.Count); 97Assert.Equal(3, treeCollection.TreeWeights.Count); 103Assert.Equal(tree.SplitGains.Count, tree.NumberOfNodes); 104Assert.Equal(tree.NumericalSplitThresholds.Count, tree.NumberOfNodes); 160Assert.Equal(shapeFunctionBins.Count, shapeFunctionValues.Count); 161Common.AssertFiniteNumbers(shapeFunctionBins as IList<double>, shapeFunctionBins.Count - 1); 198Assert.Equal(numTopics, ldaDetails.ItemScoresPerTopic.Count); 200Assert.Equal(numTopics, ldaDetails.WordScoresPerTopic.Count); 245Assert.Equal(numFeatures, weights.Count);
Validation.cs (1)
51Assert.Equal(5, cvResult.Count);
Microsoft.ML.Maml (2)
HelpCommand.cs (2)
314if (names.Count <= 1) 318for (int i = 1; i < names.Count; i++)
Microsoft.ML.OnnxTransformer (1)
OnnxTransform.cs (1)
698Contracts.Assert(outputCache.OutputOnnxValues.Count > 0);
Microsoft.ML.PerformanceTests (1)
Harness\Metrics.cs (1)
55if (results.Count != 1)
Microsoft.ML.Samples (4)
Dynamic\Trainers\BinaryClassification\Gam.cs (1)
77for (int j = 0; j < binUpperBounds.Count; j++)
Dynamic\Trainers\BinaryClassification\GamWithOptions.cs (1)
85for (int j = 0; j < binUpperBounds.Count; j++)
Dynamic\Trainers\Regression\GamAdvanced.cs (1)
77for (int j = 0; j < binUpperBounds.Count; j++)
Dynamic\Trainers\Regression\GamWithOptionsAdvanced.cs (1)
85for (int j = 0; j < binUpperBounds.Count; j++)
Microsoft.ML.StandardTrainers (2)
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (1)
374for (int i = 0; i < FeatureColumns.Count; i++)
Optimizer\LearningRateScheduler.cs (1)
112for (int i = 0; i < _lrSchedule.Count; i++)
Microsoft.ML.Tests (14)
PermutationFeatureImportanceTests.cs (6)
579for (int i = 0; i < pfi[0].PerClassLogLoss.Count; i++) 656for (int i = 0; i < pfi[0].PerClassLogLoss.Count; i++) 721for (int i = 0; i < pfi[0].DiscountedCumulativeGains.Count; i++) 726for (int i = 0; i < pfi[0].NormalizedDiscountedCumulativeGains.Count; i++) 792for (int i = 0; i < pfi[0].DiscountedCumulativeGains.Count; i++) 797for (int i = 0; i < pfi[0].NormalizedDiscountedCumulativeGains.Count; i++)
Scenarios\IrisPlantClassificationTests.cs (1)
95Assert.Equal(3, metrics.PerClassLogLoss.Count);
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (1)
98Assert.Equal(3, metrics.PerClassLogLoss.Count);
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (1)
100Assert.Equal(3, metrics.PerClassLogLoss.Count);
TrainerEstimators\MatrixFactorizationTests.cs (5)
93Assert.Equal(leftMatrix.Count, model.Model.NumberOfRows * model.Model.ApproximationRank); 94Assert.Equal(rightMatrix.Count, model.Model.NumberOfColumns * model.Model.ApproximationRank); 102Assert.Equal(0.468956589698792, leftMatrix[leftMatrix.Count - 1], 0.0001); 104Assert.Equal(0.503888845443726, rightMatrix[rightMatrix.Count - 1], 0.0001); 828for (int i = 0; i < leftFactorMatrix.Count; ++i)
Microsoft.ML.TimeSeries (30)
Deseasonality.cs (1)
120for (int i = 0; i < _stl.Residual.Count; ++i)
STL\FastLoess.cs (2)
46if (yValues.Count < MinTimeSeriesLength) 51_length = _y.Count;
STL\InnerStl.cs (6)
122if (yValues.Count < MinTimeSeriesLength) 125int length = yValues.Count; 181for (int i = 0; i < y.Count; i++) 258for (int i = 0; i < y.Count; i++) 313List<double> results = new List<double>(s.Count); 320for (int i = length; i < s.Count; ++i)
STL\LeastSquares.cs (7)
31if (x.Count == 0 || y.Count == 0) 33if (x.Count != y.Count) 37_length = _x.Count; 48Contracts.CheckParam(weights.Count == _length, nameof(weights)); 49if (weights.Count != _length)
STL\LocalRegression.cs (4)
41if (x.Count <= 1 || x.Count != y.Count) 48_length = _x.Count;
STL\Loess.cs (5)
52if (xValues.Count < MinTimeSeriesLength || yValues.Count < MinTimeSeriesLength) 55if (xValues.Count != yValues.Count) 60_length = xValues.Count;
STL\MathsTools.cs (3)
35double[] left = new double[values.Count]; 36double[] right = new double[values.Count]; 37int numsCount = nums.Count;
STL\PolynomialModel.cs (2)
41for (int i = 1; i < Coeffs.Count; i++) 64Contracts.CheckParam(coeffs.Count == 2, nameof(coeffs), "must contain exact 2 elements.");
Microsoft.ML.Tokenizers (24)
Model\CodeGenTokenizer.cs (2)
1575if (tokensToAdd.Count > 0) 1580for (int i = 1; i < tokensToAdd.Count; i++)
Model\EnglishRobertaTokenizer.cs (7)
836List<int> list = new List<int>(ids.Count); 858List<int> list = new List<int>(ids.Count); 880List<int> list = new List<int>(ranks.Count); 915for (int i = 0; i < tokens.Count; i++) 921List<EncodedToken> list = new List<EncodedToken>(tokens.Count); 927for (int j = i; j < tokens.Count; j++) 1065if (word.Count <= 1)
Model\SentencePieceBaseModel.cs (1)
39if (specialTokens is not null && specialTokens.Count > 0)
PreTokenizer\CompositePreTokenizer.cs (9)
39if (preTokenizers.Count > MaxPreTokenizersCount) 52if (specialTokens is { Count: > 0 }) 54var list = new List<PreTokenizer>(specialTokens.Count + 1); 92Debug.Assert(preTokenizerIndex < preTokenizers.Count, "Index out of range for pre-tokenizers."); 101if (preTokenizerIndex + 1 < preTokenizers.Count) 122if (preTokenizerIndex + 1 < preTokenizers.Count) 170Debug.Assert(preTokenizerIndex < preTokenizers.Count, "Index out of range for pre-tokenizers."); 179if (preTokenizerIndex + 1 < preTokenizers.Count) 200if (preTokenizerIndex + 1 < preTokenizers.Count)
PreTokenizer\RegexPreTokenizer.cs (1)
36if (specialTokens is { Count: > 0 })
Tokenizer.cs (4)
46var ids = new int[results.Tokens.Count]; 184=> EncodeToTokens(text, textSpan, settings).Tokens.Count; 237tokenCount = Math.Min(maxTokenCount, tokens.Tokens.Count); 253var token = tokens.Tokens[tokens.Tokens.Count - tokenCount];
Microsoft.ML.Tokenizers.Tests (113)
BertTokenizerTests.cs (23)
383ids1Span = stackalloc int[ids1.Count + 2]; 386Assert.Equal(ids1.Count + 2, written); 398ids1Span = stackalloc int[ids1.Count + ids2.Count + 3]; 421ids1Span = stackalloc int[ids1.Count + 2]; 438ids1Span = stackalloc int[ids1.Count + ids2.Count + 3]; 483ids1Span = stackalloc int[ids1.Count]; 486Assert.Equal(ids1.Count, written); 498ids1Span = stackalloc int[ids1.Count + ids2.Count]; 501Assert.Equal(ids1.Count + ids2.Count, written); 518ids1Span = stackalloc int[ids1.Count + 2]; 521Assert.Equal(ids1.Count + 2, written); 533ids1Span = stackalloc int[ids1.Count + ids2.Count + 3]; 536Assert.Equal(ids1.Count + ids2.Count + 3, written); 576ids1Span = stackalloc int[ids1.Count + 2]; 579Assert.Equal(ids1.Count + 2, written); 591ids1Span = stackalloc int[ids1.Count + ids2.Count + 3];
BpeTests.cs (9)
292Assert.Equal(expectedTokens.Length, encoding.Count); 293Assert.Equal(offsets.Length, encoding.Count); 294Assert.Equal(ids.Length, encoding.Count); 295Assert.Equal(ids.Length, idsList.Count); 305for (int i = 0; i < encoding.Count; i++) 412Assert.Equal(12, encoding.Count); 816for (int i = 1; i < encoding.Count; i++) 819Assert.Equal(i, subIds.Count); 826Assert.Equal(encoding[encoding.Count - i].Offset.Start.Value, index);
CodeGenTests.cs (38)
691Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 696Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 701Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 706Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 715Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 720Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 725Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 730Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 735Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 740Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 743Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 745Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 747Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 749Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 751Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 753Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 755Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 757Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 827Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 833Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 839Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 845Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 857Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 863Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 869Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 875Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 881Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 887Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 891Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 894Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 897Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 900Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 903Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 906Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 909Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 912Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 998Assert.Equal(expectedTokenCount, ids.Count); 1003Assert.Equal(expectedTokenCount, ids.Count);
LlamaTests.cs (12)
360Assert.True(bpe.Vocabulary.Count > 0); 673Assert.Equal(tokenCount, encodedTokens.Count); 689for (int i = 1; i <= encodedTokens.Count; i++) 697accumulatedStringFromEnd = (encodedTokens.Count == i ? DummyPrefix : (i % 2 == 0 ? $"{DummyPrefix}Hello" : specialTokens[specialTokens.Length - 1 - (i / 2)])) + accumulatedStringFromEnd; 849Assert.True(idsConsumed < ids.Count); 854Assert.Equal(ids.Count, idsConsumed); 863Assert.True(idsConsumed < ids.Count); 868Assert.Equal(ids.Count, idsConsumed); 888Assert.True(idsConsumed < ids.Count); 893Assert.Equal(ids.Count, idsConsumed); 902Assert.True(idsConsumed < ids.Count); 912Assert.Equal(ids.Count, idsConsumed);
PreTokenizerTests.cs (2)
67Assert.True(encoding.Count >= splitParts.Length, $"Expected to have {encoding.Count} >= {splitParts.Length}");
TiktokenTests.cs (20)
125Assert.Equal(externalEncoder.Count, encoder.Count); 155Assert.Equal(encoded.Count, idsCount); 209Assert.Equal(encoded.Count, idsCount); 217Assert.Equal(5584, encoded.Count); 219Assert.Equal(encoded.Count, idsCount); 249Assert.Equal(encoded.Count, idsCount); 279Assert.Equal(encoded.Count, idsCount); 291Assert.Equal(5609, encoded.Count); 292Assert.Equal(encoded.Count, idsCount); 314Assert.Equal(encoded.Count, idsCount); 327Assert.Equal(11378, encoded.Count); 328Assert.Equal(encoded.Count, idsCount); 346Assert.Equal(7230, encoded.Count); 347Assert.Equal(encoded.Count, idsCount); 365Assert.Equal(7230, encoded.Count); 366Assert.Equal(encoded.Count, idsCount); 384Assert.Equal(11378, encoded.Count); 385Assert.Equal(encoded.Count, idsCount); 531int entriesCount = GetEncoder((tokenizer as TiktokenTokenizer)!)!.Count;
TokenizerTests.cs (9)
135for (int i = 1; i <= fullIdsList.Count; i++) 144Assert.Equal(fullIdsList.Take(partialIdsList.Count), partialIdsList); 165Assert.Equal(tokenCount1, prefixIds.Count); 166Assert.Equal(prefixIds, fullIdsList.Take(prefixIds.Count)); 178if (i < fullIdsList.Count) 188Assert.Equal(tokenCount2, suffixIds.Count); 189Assert.Equal(suffixIds, fullIdsList.Skip(fullIdsList.Count - suffixIds.Count)); 192if (i == fullIdsList.Count)
Microsoft.ML.TorchSharp (10)
NasBert\NerTrainer.cs (5)
172if (target.Length != encoding.Count) 175var targetEditor = VBufferEditor.Create(ref target, encoding.Count); 177for (var i = 0; i < encoding.Count; i++) 387for (var i = 0; i < encoding.Count; i++) 401for (var i = 1; i < encoding.Count; i++)
Roberta\QATrainer.cs (5)
420var targetList = new List<int> { mapping[answerIndex] + 2 + questionTokenId.Count, mapping[answerEnd] + 2 + questionTokenId.Count }; 445for (var (i, j, tid) = (0, 0, 0); i < text.Length && tid < tokens.Count;) 866contextLength = contextTokenId.Count; 867questionLength = questionTokenId.Count;
Microsoft.ML.Transforms (17)
ExpressionTransformer.cs (2)
117for (int isrc = 0; isrc < inputColumnNames.Count; isrc++) 137for (int isrc = 0; isrc < inputColumnNames.Count; isrc++)
MetricStatistics.cs (6)
58Contracts.Assert(src.Count == dest.Count); 60for (int i = 0; i < dest.Count; i++) 271PerClassLogLoss = MetricsStatisticsUtils.InitializeArray(metrics.PerClassLogLoss.Count); 303DiscountedCumulativeGains = MetricsStatisticsUtils.InitializeArray(metrics.DiscountedCumulativeGains.Count); 306NormalizedDiscountedCumulativeGains = MetricsStatisticsUtils.InitializeArray(metrics.NormalizedDiscountedCumulativeGains.Count);
PermutationFeatureImportanceExtensions.cs (4)
643Contracts.Assert(a.Count == b.Count); 645var delta = new double[a.Count]; 646for (int i = 0; i < a.Count; i++)
Text\NgramTransform.cs (5)
327for (int i = 0; i < lims.Count; i++) 341env.Assert(lims.Count > 0); 342env.Assert(lims.Count == Utils.Size(counts)); 345int ngramLength = lims.Count; 351env.Assert(lim <= lims.Count);
Microsoft.VisualStudio.LanguageServices (10)
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
201progressTracker.AddItems(projects.Sum(static p => p.DocumentIds.Count));
EditorConfigSettings\SettingsEditorPane.SearchFilter.cs (2)
50var cachedColumnValues = new string[_visibleColumns.Count + 1]; 90for (var i = 0; i < _visibleColumns.Count; i++)
EditorConfigSettings\SettingsEditorPane.SearchTask.cs (1)
48resultCount += (uint)results.FilteredAndSortedEntries.Count;
FindReferences\Contexts\AbstractTableDataSourceFindUsagesContext.cs (2)
144Debug.Assert(_findReferencesWindow.Manager.Sources.Count == 0); 654Debug.Assert(_findReferencesWindow.Manager.Sources.Count == 1);
GenerateType\GenerateTypeDialogViewModel.cs (2)
359this.SelectedProject.Documents.Where(n => n.Name != null && n.Folders.Count > 0 && n.Name == this.FileName && this.Folders.SequenceEqual(n.Folders)).Any()) || 774if (document.Folders.Count == 0)
PreviewPane\PreviewPane.xaml.cs (2)
158if (previewItems == null || previewItems.Count == 0) 164if (previewItems.Count > MaxItems)
MinimalSample (1)
Program.cs (1)
37return $"{result} | /inner filter! Tags: {(tags.Count == 0 ? "(null)" : string.Join(", ", tags))}";
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Parser\SpecialBracketCharacters.cs (1)
36if (attributeList is not null && attributeList.Count > 0)
PresentationCore (1)
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
360ArgumentOutOfRangeException.ThrowIfLessThan(readOnlyList.Count, count, nameof(count));
PresentationFramework (25)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (6)
131EnsureIndexInt32(index, _list.Count); 144public uint Size => (uint)_list.Count; 149int max = _list.Count; 174if (startIndex == _list.Count) 177EnsureIndexInt32(startIndex, _list.Count); 184uint itemCount = Math.Min((uint)items.Length, (uint)_list.Count - startIndex);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Parser\SpecialBracketCharacters.cs (1)
36if (attributeList is not null && attributeList.Count > 0)
System\Windows\Documents\NLGSpellerInterop.cs (6)
229segmentCount += sentence.Segments.Count; 234for (int i = 0; continueIteration && (i < sentence.Segments.Count); i++ ) 722for (int i = 0; result && (i < SubSegments.Count); i++) 844Invariant.Assert(_segments.Count == sentenceSegmentCount); 874if (Segments.Count > 0) 876ITextRange textRange = Segments[Segments.Count - 1].TextRange;
System\Windows\Documents\Speller.cs (3)
896if (textSegment.SubSegments.Count == 0) 899if(textSegment.Suggestions.Count > 0) 950if (textSegment.SubSegments.Count == 0)
System\Windows\Documents\WinRTSpellerInterop.cs (5)
382segmentCount += sentence.Segments.Count; 386for (int i = 0; continueIteration && (i < sentence.Segments.Count); i++) 1013for (int i = 0; result && (i < SubSegments.Count); i++) 1070if (Segments.Count > 0) 1072ITextRange textRange = Segments[Segments.Count - 1].TextRange;
System\Windows\Documents\WinRTSpellerInteropExtensions.cs (4)
60if (tokens.Count == 0) 68for (int i = 0; i < tokens.Count; i++) 110if (tokens.Count > 0 && 112spellChecker.HasErrors(tokens[tokens.Count - 1].Text) &&
Roslyn.Diagnostics.Analyzers (34)
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (1)
122while (index < existingMembers.Count)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTest.cs (1)
152for (int generation = 0; generation < exceptions.Count; generation++)
Roslyn.VisualStudio.Next.UnitTests (7)
Services\ServiceHubServicesTests.cs (5)
1479for (var i = 0; i < projectIds.Count; i++) 1486for (var j = 0; j < documentIds.Count; j++) 1676for (var i = 0; i < projectIds.Count; i++) 1688for (var j = 0; j < documentIdsInProject.Count; j++) 1823var projectName = $"Project{solution.ProjectIds.Count}";
Services\SolutionServiceTests.cs (2)
838Assert.True(csharpProject.DocumentIds.Count == 2); 895Assert.True(project1Synced.DocumentIds.Count == 2);
Sample (2)
Endpoints\MapFormEndpoints.cs (2)
19forms.MapPost("/form-files", (IFormFileCollection files) => Results.Ok(files.Count)); 20forms.MapPost("/form-file-multiple", (IFormFile resume, IFormFileCollection files) => Results.Ok(files.Count + resume.FileName));
SemanticSearch.BuildTask (1)
GenerateFilteredReferenceAssembliesTask.cs (1)
202for (var i = 0; i < lines.Count; i++)
Shared (6)
EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
LogBuffering\SerializedLogRecordFactory.cs (1)
30for (int i = 0; i < attributes.Count; i++)
Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Shared.Tests (1)
JsonSchemaExporter\TestTypes.cs (1)
1164public int Count => _dictionary.Count;
Swaggatherer (4)
Template.cs (4)
19for (var i = 0; i < entries.Count; i++) 45for (var i = 0; i < entries.Count; i++) 60for (var i = 0; i < entries.Count; i++) 135entries.Count);
System.Collections.Concurrent (1)
System\Collections\Concurrent\ConcurrentDictionary.cs (1)
289IReadOnlyCollection<KeyValuePair<TKey, TValue>> rc => Math.Max(DefaultCapacity, rc.Count),
System.Collections.Immutable (20)
System\Collections\Frozen\EmptyFrozenSet.cs (1)
45other is IReadOnlyCollection<T> s ? s.Count == 0 : // TODO https://github.com/dotnet/runtime/issues/42254: Remove if/when Any includes this check
System\Collections\Frozen\FrozenSetInternalBase.cs (2)
92return _thisSet.Count <= otherAsSet.Count && IsSubsetOfSetWithCompatibleComparer(otherAsSet); 152return _thisSet.Count == otherAsSet.Count && ContainsAllElements(otherAsSet);
System\Collections\Immutable\ImmutableEnumerableDebuggerProxy.cs (1)
50??= _dictionary.Select(kv => new DebugViewDictionaryItem<TKey, TValue>(kv)).ToArray(_dictionary.Count);
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (1)
49count = readOnlyCollection.Count;
System\Collections\Immutable\ImmutableList.cs (10)
149return list.IndexOf(item, 0, list.Count, EqualityComparer<T>.Default); 170return list.IndexOf(item, 0, list.Count, equalityComparer); 195return list.IndexOf(item, startIndex, list.Count - startIndex, EqualityComparer<T>.Default); 243if (list.Count == 0) 249return list.LastIndexOf(item, list.Count - 1, list.Count, EqualityComparer<T>.Default); 270if (list.Count == 0) 276return list.LastIndexOf(item, list.Count - 1, list.Count, equalityComparer); 301if (list.Count == 0 && startIndex == 0)
System\Collections\Immutable\ImmutableList_1.cs (2)
1183if (list.Count == 0) 1188Node root = Node.NodeTreeFromList(list, 0, list.Count);
System\Collections\Immutable\ImmutableList_1.Node.cs (1)
1562return NodeTreeFromList(list, 0, list.Count);
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (1)
236return NodeTreeFromList(list, 0, list.Count);
System\Collections\Immutable\KeysOrValuesCollectionAccessor.cs (1)
55get { return _dictionary.Count; }
System.Formats.Nrbf (3)
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (2)
54for (int i = 0; i < _values.Count; i++) 77Debug.Assert(numElementsWritten == (uint)_values.Count, "We should have traversed the entirety of the source values collection.");
System\Formats\Nrbf\ClassRecord.cs (1)
38internal int ExpectedValuesCount => MemberTypeInfo.Infos.Count;
System.Linq.Expressions (41)
System\Dynamic\Utils\ExpressionUtils.cs (3)
256return current.Count == 0; 272return current.Count == 0; 289int count = current.Count;
System\Linq\Expressions\BlockExpression.cs (5)
471Debug.Assert(expressions.Count != 0); 481Debug.Assert(index >= 0 && index < _expressions.Count); 486internal override int ExpressionCount => _expressions.Count; 618internal override int ExpressionCount => _body.Count; 1090return expressions.Count switch
System\Linq\Expressions\Compiler\CompilerScope.cs (1)
102Definitions = new Dictionary<ParameterExpression, VariableStorageKind>(variables.Count);
System\Linq\Expressions\DebugViewWriter.cs (1)
262if (open == '{' || expressions.Count > 1)
System\Linq\Expressions\DynamicExpression.cs (2)
507int IArgumentProvider.ArgumentCount => _arguments.Count; 854switch (argumentList.Count)
System\Linq\Expressions\Expression.cs (1)
242for (int i = 0, n = items.Count; i < n; i++)
System\Linq\Expressions\IndexExpression.cs (3)
31Debug.Assert(instance.Type.GetArrayRank() == arguments.Count); 110public int ArgumentCount => _arguments.Count; 123Debug.Assert(arguments == null || arguments.Length == _arguments.Count);
System\Linq\Expressions\Interpreter\InstructionList.cs (1)
122for (int i = 0, n = instructions.Count; i < n; i++)
System\Linq\Expressions\InvocationExpression.cs (3)
142public override int ArgumentCount => _arguments.Count; 147Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 715switch (argumentList.Count)
System\Linq\Expressions\LambdaExpression.cs (3)
311return parameters.Count switch 573internal override int ParameterCount => _parameters.Count; 585Debug.Assert(parameters == null || parameters.Length == _parameters.Count);
System\Linq\Expressions\MethodCallExpression.cs (17)
179public override int ArgumentCount => _arguments.Count; 192Debug.Assert(args == null || args.Count == _arguments.Count); 210public override int ArgumentCount => _arguments.Count; 223Debug.Assert(args == null || args.Count == _arguments.Count); 254Debug.Assert(args == null || args.Count == 0); 301Debug.Assert(args == null || args.Count == 1); 367Debug.Assert(args == null || args.Count == 2); 438Debug.Assert(args == null || args.Count == 3); 515Debug.Assert(args == null || args.Count == 4); 598Debug.Assert(args == null || args.Count == 5); 634Debug.Assert(args == null || args.Count == 0); 683Debug.Assert(args == null || args.Count == 1); 748Debug.Assert(args == null || args.Count == 2); 819Debug.Assert(args == null || args.Count == 3); 1193int argCount = argumentList.Count;
System\Linq\Expressions\NewExpression.cs (1)
61public int ArgumentCount => _arguments.Count;
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (6)
63MemoryHandle[] handles = new MemoryHandle[buffers.Count]; 64Span<Interop.Sys.IOVector> vectors = buffers.Count <= IovStackThreshold ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffers.Count]; 69int buffersCount = buffers.Count; 80result = Interop.Sys.PReadV(handle, pinnedVectors, buffers.Count, fileOffset); 163int buffersCount = buffers.Count;
System.Private.Windows.Core (17)
System\Collections\Generic\CollectionExtensions.cs (1)
18ArgumentOutOfRangeException.ThrowIfLessThan(readOnlyList.Count, count, nameof(count));
System\IO\BinaryReaderExtensions.cs (2)
202if (values.Count == 0) 271for (int i = 0; i < values.Count; i++)
System\IO\BinaryWriterExtensions.cs (2)
33for (int i = 0; i < memberTypeInfo.Count; i++) 38for (int i = 0; i < memberTypeInfo.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\ArrayRecord.cs (1)
64if (arrayInfo.Length != arrayObjects.Count)
System\Private\Windows\BinaryFormat\Serializer\ArraySingleObject.cs (1)
23: base(new ArrayInfo(objectId, arrayObjects.Count), arrayObjects)
System\Private\Windows\BinaryFormat\Serializer\ArraySinglePrimitive.cs (1)
29: base(new ArrayInfo(objectId, arrayObjects.Count), arrayObjects)
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.cs (1)
23: base(new ArrayInfo(objectId, arrayObjects.Count), new StringListAdapter(arrayObjects, recordMap))
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.StringListAdapter.cs (2)
30int IReadOnlyCollection<string?>.Count => _recordList.Count; 38for (int i = 0; i < _recordList.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\ClassInfo.cs (1)
33writer.Write(MemberNames.Count);
System\Private\Windows\BinaryFormat\Serializer\ClassRecord.cs (2)
33for (int i = 0; i < ClassInfo.MemberNames.Count; i++) 64for (int i = 0; i < memberTypeInfo.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\Record.cs (1)
91for (int i = 0; i < objects.Count; i++)
System\Private\Windows\Ole\DataFormatsCore.cs (2)
57for (int i = 0; i < formats.Count; i++) 120for (int i = 0; i < formats.Count; i++)
System.Reflection.Metadata (8)
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (8)
71if (baseTableRowCounts.Count != MetadataTokens.TableCount) 81if (baseHeapSizes.Count != MetadataTokens.HeapCount) 87if (deltaReaders == null || deltaReaders.Count == 0) 92for (int i = 0; i < deltaReaders.Count; i++) 139int generationCount = 1 + deltaReaders.Count; 151for (int r = 0; r < deltaReaders.Count; r++) 171var rowCounts = GetBaseRowCounts(baseRowCounts, generations: 1 + deltaReaders.Count); 173for (int generation = 1; generation <= deltaReaders.Count; generation++)
System.Windows.Forms (17)
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (1)
149if (index >= entries.Count)
System\Windows\Forms\Controls\ListView\ListView.ListViewAccessibleObject.cs (7)
100return index < visibleGroups.Count ? visibleGroups[index].AccessibilityObject : null; 113int count = owningListView.GroupsDisplayed ? GetVisibleGroups().Count : owningListView.Items.Count; 142for (int i = 0; i < visibleGroups.Count; i++) 216return visibleGroups.Count == 0 ? null : visibleGroups[visibleGroups.Count - 1].AccessibilityObject; 275&& listViewGroupAccessibleObject.GetVisibleItems().Count > 0) 297for (int i = 0; i < visibleGroups.Count; i++)
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (6)
139private bool IsEmpty => GetVisibleItems().Count == 0; 242return visibleItems.Count > 0 ? visibleItems[visibleItems.Count - 1].AccessibilityObject : null; 257if (index >= visibleItems.Count) 273for (int i = 0; i < visibleItems.Count; i++) 291return GetVisibleItems().Count;
System\Windows\Forms\Controls\PropertyGrid\GridItemCollection.cs (3)
25public int Count => _entries.Count; 54if (_entries.Count > 0) 56for (int i = 0; i < _entries.Count; i++)
System.Windows.Forms.Design (3)
System\Windows\Forms\Design\DesignerUtils.cs (2)
765List<IComponent> newObjects = new(objects.Count); 778Debug.Assert(newObjects.Count == objects.Count, "Why is the count of the copied objects not the same?");
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
1936for (int i = 0; i < components.Count; i++)
System.Xaml (2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Parser\SpecialBracketCharacters.cs (1)
36if (attributeList is not null && attributeList.Count > 0)
System\Xaml\XamlSchemaContext.cs (1)
596SpecialBracketCharacters splBracketCharacters = markupExtensionBracketCharactersList is not null && markupExtensionBracketCharactersList.Count > 0
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\E2ETesting\BrowserAssertFailedException.cs (1)
32if (logs.Count > 0)
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\E2ETesting\BrowserAssertFailedException.cs (1)
32if (logs.Count > 0)
Templates.Mvc.Tests (1)
src\Shared\E2ETesting\BrowserAssertFailedException.cs (1)
32if (logs.Count > 0)
Templates.Tests (1)
src\Shared\E2ETesting\BrowserAssertFailedException.cs (1)
32if (logs.Count > 0)
Test.Utilities (25)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Text.Analyzers (33)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (7)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 385var builder = new TResult[source.Count]; 401var builder = new TResult[source.Count]; 442var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 576for (int i = 0, length = list.Count; i < length; i++)
src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
34switch (list.Count) 48for (int i = 0, n = list.Count; i < n; i++)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
xunit.assert (1)
Sdk\Exceptions\AllException.cs (1)
55 errors.Count,
xunit.console (1)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (1)
67.Where(lib => lib.RuntimeAssemblyGroups?.Count > 0)