Implemented interface members:
property
Count
System.Collections.Generic.ICollection<T>.Count
property
Count
System.Collections.Generic.IReadOnlyCollection<T>.Count
property
Count
System.Collections.ICollection.Count
829 references to Count
Aspire.RabbitMQ.Client (4)
RabbitMQEventSourceLogForwarder.cs (4)
39eventData.PayloadNames?.Count == 2 && 40eventData.Payload?.Count == 2 && 103Debug.Assert(EventData.PayloadNames?.Count == 2 && EventData.Payload?.Count == 2);
Crossgen2Tasks (1)
CommonFilePulledFromSdkRepo\TaskBase.cs (1)
64for (int i = 0; i < aggregate.InnerExceptions.Count; i++)
csc (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
165writer.Write(Arguments.Count); 462writer.Write(ErrorMessages.Count);
dotnet-svcutil-lib (29)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\ExceptionTrace.cs (2)
137if (innerExceptions.Count == 0) 164Fx.Assert(innerExceptions.Count > 0, "InnerException.Count is known to be > 0 here.");
FrameworkFork\System.ServiceModel\System\IdentityModel\Policy\UnconditionalPolicy.cs (3)
97for (int i = 0; i < issuances.Count; ++i) 140for (int i = 0; i < _issuances.Count; ++i) 219for (int i = 0; i < _issuances.Count; ++i)
FrameworkFork\System.ServiceModel\System\IdentityModel\SecurityUtils.cs (6)
320if (authorizationPolicies != null && authorizationPolicies.Count > 0) 323for (int i = 0; i < authorizationPolicies.Count; ++i) 334List<IAuthorizationPolicy> ret = new List<IAuthorizationPolicy>(authorizationPolicies.Count); 335for (int i = 0; i < authorizationPolicies.Count; ++i) 355if (authorizationPolicies != null && authorizationPolicies.Count > 0) 357for (int i = 0; i < authorizationPolicies.Count; ++i)
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\SecurityTokenResolver.cs (2)
122for (int i = 0; i < _tokens.Count; ++i) 197for (int i = 0; i < _tokens.Count; ++i)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SecurityToken.cs (1)
42if (this.SecurityKeys.Count != 0 && MatchesKeyIdentifierClause(keyIdentifierClause))
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeaderCollection.cs (3)
55return Count; 78for (int i = 0; i < Count; i++) 99for (int i = 0; i < Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportOutputChannel.cs (1)
51_anyHeadersToAdd = to.Headers.Count > 0;
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (2)
1131if (_headers != null && _headers.Count > 0) 1288for (int i = 0; i < address.Headers.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\IdentityVerifier.cs (2)
98for (int i = 0; i < authorizationContext.ClaimSets.Count; ++i) 222for (int i = 0; i < authContext.ClaimSets.Count; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityAlgorithmSuite.cs (2)
294if (keys == null || keys.Count == 0) 299for (int i = 0; i < keys.Count; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityMessageProperty.cs (2)
223if (spec != null && spec.SecurityTokenPolicies != null && spec.SecurityTokenPolicies.Count > 0) 225for (int i = 0; i < spec.SecurityTokenPolicies.Count; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (3)
467for (int i = 0; i < token.SecurityKeys.Count; ++i) 486for (int i = 0; i < authContext.ClaimSets.Count; ++i) 540for (int i = 0; i < authContext.ClaimSets.Count; ++i)
HttpStress (2)
Program.cs (2)
751for (int i = 0; i < eventData.Payload.Count; i++) 766for (int i = 0; i < eventData.Payload.Count; i++)
Infrastructure.Common (1)
xunit\WcfTestCase.cs (1)
86e.Message, DisplayName, item.Message, item.Payload.Count));
InMemory.FunctionalTests (2)
EventSourceTests.cs (2)
492Payload = new Dictionary<string, string>(eventWrittenEventArgs.PayloadNames.Count); 494for (int i = 0; i < eventWrittenEventArgs.PayloadNames.Count; i++)
Microsoft.AspNetCore.Components.Forms (1)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (1)
145if (expression is not MethodCallExpression methodExpression || methodExpression.Arguments.Count != 1)
Microsoft.AspNetCore.Components.Web (1)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (1)
145if (expression is not MethodCallExpression methodExpression || methodExpression.Arguments.Count != 1)
Microsoft.AspNetCore.HostFiltering (1)
MiddlewareConfigurationManager.cs (1)
30if (!config.AllowAnyNonEmptyHost && (config.AllowedHosts is null || config.AllowedHosts.Count == 0))
Microsoft.AspNetCore.Hosting.Tests (1)
Internal\HostingEventSourceTests.cs (1)
127Assert.Equal(expected.Length, payloadList.Count);
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DefaultApiDescriptionProvider.cs (2)
606modelMetadata.Properties.Count == 0) 640var metadataPropertiesCount = metadataProperties.Count;
Microsoft.AspNetCore.Mvc.Core (9)
ModelBinding\Binders\ComplexObjectModelBinder.cs (2)
547if (modelMetadata.Properties.Count == 0 && 578for (var i = 0; i < bindingContext.ModelMetadata.Properties.Count; i++)
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (1)
29for (var i = 0; i < context.Metadata.Properties.Count; i++)
ModelBinding\Binders\ComplexTypeModelBinder.cs (4)
109for (var i = 0; i < modelMetadata.Properties.Count; i++) 159for (var i = 0; i < modelMetadata.Properties.Count; i++) 349if (bindingContext.ModelMetadata.Properties.Count == 0) 379for (var i = 0; i < bindingContext.ModelMetadata.Properties.Count; i++)
ModelBinding\Binders\ComplexTypeModelBinderProvider.cs (1)
25for (var i = 0; i < context.Metadata.Properties.Count; i++)
ModelBinding\ModelBindingHelper.cs (1)
415for (var i = 0; i < modelMetadata.Properties.Count; i++)
Microsoft.AspNetCore.Mvc.Core.Test (3)
ModelBinding\Metadata\DefaultModelMetadataTest.cs (3)
495Assert.Equal(expectedProperties.Length, properties.Count); 567Assert.Equal(expectedNames.Count(), properties.Count); 679Assert.Equal(expectedNames.Count(), properties.Count);
Microsoft.AspNetCore.Mvc.Cors (2)
CorsHttpMethodActionConstraint.cs (2)
25if (methods.Count == 0) 38var methodsCount = methods.Count;
Microsoft.AspNetCore.Mvc.Razor (1)
TagHelpers\UrlResolutionTagHelper.cs (1)
153var attributesCount = attributes.Count;
Microsoft.AspNetCore.Mvc.TagHelpers (8)
AttributeMatcher.cs (1)
39var allAttributesCount = allAttributes.Count;
LinkTagHelper.cs (2)
376var attributesCount = attributes.Count; 496var attributesCount = attributes.Count;
ScriptTagHelper.cs (2)
373var attributesCount = attributes.Count; 487var attributesCount = attributes.Count;
TagHelperOutputExtensions.cs (3)
54for (var i = context.AllAttributes.Count - 1; i >= 0; i--) 307var allAttributesCount = allAttributes.Count; 328var attributesCount = attributes.Count;
Microsoft.AspNetCore.Mvc.TagHelpers.Test (18)
AnchorTagHelperTest.cs (1)
78Assert.Equal(2, output.Attributes.Count);
FormTagHelperTest.cs (3)
114Assert.Equal(2, output.Attributes.Count); 168Assert.Equal(2, output.Attributes.Count); 356Assert.Equal(3, output.Attributes.Count);
ImageTagHelperTest.cs (6)
120Assert.Equal(4, output.Attributes.Count); 122for (var i = 0; i < expectedOutput.Attributes.Count; i++) 159Assert.Equal(2, output.Attributes.Count); 211Assert.Equal(2, output.Attributes.Count); 254Assert.Equal(2, output.Attributes.Count); 286Assert.Equal(2, output.Attributes.Count);
OptionTagHelperTest.cs (2)
438Assert.Equal(expectedTagHelperOutput.Attributes.Count, output.Attributes.Count);
TagHelperOutputExtensionsTest.cs (2)
913Assert.Equal(2, tagHelperOutput.Attributes.Count); 962Assert.Equal(2, tagHelperOutput.Attributes.Count);
ValidationMessageTagHelperTest.cs (3)
73Assert.Equal(4, output.Attributes.Count); 346Assert.Equal(2, output.Attributes.Count); 408Assert.Equal(2, output.Attributes.Count);
ValidationSummaryTagHelperTest.cs (1)
254Assert.InRange(output.Attributes.Count, low: 1, high: 2);
Microsoft.AspNetCore.Mvc.ViewFeatures (7)
DefaultDisplayTemplates.cs (1)
212var content = new HtmlContentBuilder(modelExplorer.Metadata.Properties.Count);
DefaultEditorTemplates.cs (1)
254var content = new HtmlContentBuilder(modelExplorer.Metadata.Properties.Count);
ExpressionHelper.cs (1)
237if (!(expression is MethodCallExpression methodExpression) || methodExpression.Arguments.Count != 1)
ModelExplorer.cs (2)
185_properties = new ModelExplorer[properties.Count]; 186for (var i = 0; i < properties.Count; i++)
ModelStateDictionaryExtensions.cs (1)
125for (var i = 0; i < modelMetadata.Properties.Count; i++)
ValidationHelpers.cs (1)
96for (var i = 0; i < metadata.Properties.Count; i++)
Microsoft.AspNetCore.Razor (3)
TagHelpers\TagHelperOutput.cs (3)
293var count = Attributes.Count; 342var count = Attributes.Count; 397var count = Attributes.Count;
Microsoft.AspNetCore.Razor.Test (3)
TagHelpers\ReadOnlyTagHelperAttributeListTest.cs (1)
199var count = attributes.Count;
TagHelpers\TagHelperOutputTest.cs (2)
1047var attributeCount = output.Attributes.Count; 1060Assert.Equal(attributeCount, output.Attributes.Count);
Microsoft.AspNetCore.SignalR.Client.Tests (1)
HttpConnectionTests.ConnectionLifecycle.cs (1)
448Assert.Equal(3, ex.InnerExceptions.Count);
Microsoft.Build (3)
BackEnd\BuildManager\BuildManager.cs (3)
1061if (e is AggregateException ae && ae.InnerExceptions.Count == 1) 1736if (ae.InnerExceptions.Count == 1) 2856if (e is AggregateException ae && ae.InnerExceptions.Count == 1)
Microsoft.Build.Engine.UnitTests (1)
BackEnd\BuildManager_Tests.cs (1)
4256aggException.InnerExceptions.Count.ShouldBe(2);
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
165writer.Write(Arguments.Count); 462writer.Write(ErrorMessages.Count);
Microsoft.Build.Tasks.Core (5)
RedistList.cs (5)
142internal int Count => _assemblyList.Count; 393for (int i = index; i < _assemblyList.Count; ++i) 440for (int i = index; i < _assemblyList.Count; ++i) 490for (int i = index; i < _assemblyList.Count; ++i) 526if (_assemblyList.Count == 0)
Microsoft.Cci.Extensions (1)
HostEnvironment.cs (1)
513if (coreAssemblyFile != null && assemblies.Count > 0)
Microsoft.CodeAnalysis (2)
InternalUtilities\FailFast.cs (1)
35if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1)
InternalUtilities\FatalError.cs (1)
268if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1 && aggregate.InnerExceptions[0].Data[s_reportedMarker] != null)
Microsoft.CodeAnalysis.CodeStyle (31)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
35if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
268if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1 && aggregate.InnerExceptions[0].Data[s_reportedMarker] != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (28)
74if (left.Count == 0) 79if (right.Count == 0) 91while (index1 < left.Count && index2 < right.Count) 108while (index1 < left.Count) 114while (index2 < right.Count) 148if (left.Count == 0) 153if (right.Count == 0) 159for (int index1 = 0, index2 = 0; index1 < left.Count && index2 < right.Count;) 208if (left.Count == 0) 213if (right.Count == 0) 219for (int index1 = 0, index2 = 0; (index1 < left.Count) && (index2 < right.Count);) 266if (left.Count == 0) 271if (right.Count == 0) 329while ((index1 < left.Count) && (index2 < right.Count)); 331while (index1 < left.Count) 358if (left.Count != right.Count) 363for (var i = 0; i < left.Count; ++i) 396for (int index1 = 0, index2 = 0; (index1 < this.Count) && (index2 < set.Count);) 432for (var index = 0; index < this.Count; ++index) 456for (int index1 = 0, index2 = 0; (index1 < this.Count) && (index2 < set.Count);) 486for (var index = 0; index < this.Count; ++index)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
582if (task.Exception.InnerExceptions.Count > 0)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpFormatter.Values.cs (1)
67var numSizes = sizes.Count;
Microsoft.CodeAnalysis.EditorFeatures (2)
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
234if (intersectionSpans.Count == 0)
Shared\Utilities\LinkedEditsTracker.cs (1)
69if (trackingSpansAfterEdit.Count != normalizedTrackingSpansAfterEdit.Count)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
IntelliSense\VisualBasicCompletionCommandHandlerTests.vb (2)
1235projection.ReplaceSpans(0, sourceSpans.Count, {subjectBuffer.CurrentSnapshot.CreateTrackingSpan(0, subjectBuffer.CurrentSnapshot.Length, SpanTrackingMode.EdgeInclusive)}, EditOptions.DefaultMinimalChange, editTag:=Nothing) 1265projection.ReplaceSpans(0, projection.CurrentSnapshot.GetSourceSpans.Count, {projection.CurrentSnapshot.GetText()}, EditOptions.DefaultMinimalChange, editTag:=Nothing)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (8)
CustomTypeInfo.cs (5)
38if (length == payload.Count) 74return tupleElementNames != null && index < tupleElementNames.Count 98int length = dynamicFlags.Count; 139if (start < payload.Count) 155int length = bytes.Count - start;
DynamicFlagsCustomTypeInfo.cs (1)
60return b < bytes.Count &&
ExpressionCompiler.cs (2)
72Debug.Assert((builder.Count == 0) == (assembly.Count == 0)); 100var builder = ArrayBuilder<Alias>.GetInstance(dkmAliases.Count);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (21)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
35if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
268if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1 && aggregate.InnerExceptions[0].Data[s_reportedMarker] != null)
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\CustomTypeInfo.cs (5)
38if (length == payload.Count) 74return tupleElementNames != null && index < tupleElementNames.Count 98int length = dynamicFlags.Count; 139if (start < payload.Count) 155int length = bytes.Count - start;
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\DynamicFlagsCustomTypeInfo.cs (1)
60return b < bytes.Count &&
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\ArrayExpansion.cs (7)
29Debug.Assert(sizes.Count > 0); 30Debug.Assert(sizes.Count == lowerBounds.Count); 110Debug.Assert(_lowerBounds == null || _lowerBounds.Count == 1); 111int lowerBound = _lowerBounds != null && _lowerBounds.Count == 1 ? _lowerBounds[0] : 0; 115var n = _divisors.Count; 139var n = sizes.Count;
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TupleExpansion.cs (2)
65GetIntersection(startIndex, count, index, defaultView.Count, out startIndex2, out count2); 74index += defaultView.Count;
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (1)
345Debug.Assert((formatSpecifiers.Count == 0) == (newLength == oldLength));
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\AttributeHelpers.cs (2)
58var numFlags = collection.Count; 82var numFlags = collection.Count;
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (1)
79favoritesMemberNames = new Dictionary<string, object>(favoritesInfo.Favorites.Count);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (25)
Debugger\Engine\DkmClrModuleInstance.cs (2)
55Debug.Assert(typeArguments.Count == type.GetGenericArguments().Length); 56if (typeArguments.Count > 0)
Debugger\Engine\DkmClrValue.cs (2)
685Debug.Assert(typeArgs.Count <= 1); 686var proxyTypeName = (typeArgs.Count == 0)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
35if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
268if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1 && aggregate.InnerExceptions[0].Data[s_reportedMarker] != null)
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\CustomTypeInfo.cs (5)
38if (length == payload.Count) 74return tupleElementNames != null && index < tupleElementNames.Count 98int length = dynamicFlags.Count; 139if (start < payload.Count) 155int length = bytes.Count - start;
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\DynamicFlagsCustomTypeInfo.cs (1)
60return b < bytes.Count &&
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\ArrayExpansion.cs (7)
29Debug.Assert(sizes.Count > 0); 30Debug.Assert(sizes.Count == lowerBounds.Count); 110Debug.Assert(_lowerBounds == null || _lowerBounds.Count == 1); 111int lowerBound = _lowerBounds != null && _lowerBounds.Count == 1 ? _lowerBounds[0] : 0; 115var n = _divisors.Count; 139var n = sizes.Count;
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TupleExpansion.cs (2)
65GetIntersection(startIndex, count, index, defaultView.Count, out startIndex2, out count2); 74index += defaultView.Count;
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (1)
345Debug.Assert((formatSpecifiers.Count == 0) == (newLength == oldLength));
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\AttributeHelpers.cs (2)
58var numFlags = collection.Count; 82var numFlags = collection.Count;
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (1)
79favoritesMemberNames = new Dictionary<string, object>(favoritesInfo.Favorites.Count);
Microsoft.CodeAnalysis.Features (1)
Copilot\ICopilotChangeAnalysisService.cs (1)
59Contract.ThrowIfTrue(new NormalizedTextSpanCollection(changes.Select(c => c.Span)).Count != changes.Length, "'changes' was not normalized.");
Microsoft.CodeAnalysis.InteractiveHost (3)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
35if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
268if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1 && aggregate.InnerExceptions[0].Data[s_reportedMarker] != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
582if (task.Exception.InnerExceptions.Count > 0)
Microsoft.CodeAnalysis.Threading.Package (1)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
268if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1 && aggregate.InnerExceptions[0].Data[s_reportedMarker] != null)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (9)
ExpressionTrees\Sources\ExprLambdaUtils.vb (9)
216Dim n As Integer = node.Arguments.Count 235Dim n As Integer = node.Arguments.Count 247Dim n As Integer = node.Parameters.Count 287Dim n As Integer = node.Initializers.Count 306Dim n As Integer = node.Arguments.Count 347Dim n As Integer = node.Arguments.Count 361Dim n As Integer = node.Arguments.Count 369n = node.Members.Count 386Dim n As Integer = node.Expressions.Count
Microsoft.CodeAnalysis.VisualBasic.ResultProvider (2)
src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\VisualBasicFormatter.Values.vb (2)
56Debug.Assert(sizes.Count > 0) 59For i = 1 To sizes.Count - 1
Microsoft.CodeAnalysis.Workspaces (31)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
35if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
268if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1 && aggregate.InnerExceptions[0].Data[s_reportedMarker] != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (28)
74if (left.Count == 0) 79if (right.Count == 0) 91while (index1 < left.Count && index2 < right.Count) 108while (index1 < left.Count) 114while (index2 < right.Count) 148if (left.Count == 0) 153if (right.Count == 0) 159for (int index1 = 0, index2 = 0; index1 < left.Count && index2 < right.Count;) 208if (left.Count == 0) 213if (right.Count == 0) 219for (int index1 = 0, index2 = 0; (index1 < left.Count) && (index2 < right.Count);) 266if (left.Count == 0) 271if (right.Count == 0) 329while ((index1 < left.Count) && (index2 < right.Count)); 331while (index1 < left.Count) 358if (left.Count != right.Count) 363for (var i = 0; i < left.Count; ++i) 396for (int index1 = 0, index2 = 0; (index1 < this.Count) && (index2 < set.Count);) 432for (var index = 0; index < this.Count; ++index) 456for (int index1 = 0, index2 = 0; (index1 < this.Count) && (index2 < set.Count);) 486for (var index = 0; index < this.Count; ++index)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
582if (task.Exception.InnerExceptions.Count > 0)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
35if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
268if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count == 1 && aggregate.InnerExceptions[0].Data[s_reportedMarker] != null)
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
309Assert.Equal(2, ex.InnerExceptions.Count); 315Assert.Equal(2, ex.InnerExceptions.Count);
Microsoft.Extensions.Caching.Hybrid.Tests (1)
TestEventListener.cs (1)
67&& eventData.Payload is { Count: > 0 })
Microsoft.Extensions.Logging.AzureAppServices (1)
BatchingLoggerProvider.cs (1)
177catch (AggregateException ex) when (ex.InnerExceptions.Count == 1 && ex.InnerExceptions[0] is TaskCanceledException)
Microsoft.Maui.Controls (9)
Shell\Shell.cs (3)
1697 var count = items.Count; 1708 var count = items.Count; 1719 var count = items.Count;
Shell\ShellExtensions.cs (1)
27 for (var i = 0; i < items.Count; i++)
Shell\ShellFlyoutItemsManager.cs (2)
142 if (Routing.IsImplicit(shellSection) && shellContents.Count == 1) 154 if (shellContents.Count == 1 && shellSection == shellItem.CurrentItem && shellSection.CurrentItem.MenuItems.Count > 0)
Shell\ShellItem.cs (2)
125 if (ShellItemController.GetItems().Count <= 1) 275 if (ShellItemController.GetItems().Count == 0)
Shell\ShellSection.cs (1)
721 if (contentItems.Count == 0)
Microsoft.ML.Core (6)
Utilities\FuncInstanceMethodInfo1`2.cs (1)
71Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo1`3.cs (1)
72Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo1`4.cs (1)
73Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo2`4.cs (1)
73Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`3.cs (1)
72Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`4.cs (1)
73Contracts.CheckParam(methodCallExpression.Arguments.Count == 2, nameof(expression), "Unexpected expression form");
Microsoft.VisualBasic.Core (2)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (2)
1219Dim positionalArgCount As Integer = argCount - callInfo.ArgumentNames.Count 1286Dim namedArgCount As Integer = callInfo.ArgumentNames.Count
Microsoft.VisualBasic.Forms.Tests (4)
System\Windows\Forms\FileSystemProxyTests.vb (4)
164_fileSystem.Drives.Count.Should.Be(FileIO.FileSystem.Drives.Count) 198filenames.Count.Should.Be(1) 207filenames.Count.Should.Be(0)
Microsoft.VisualBasic.Tests (13)
Microsoft\VisualBasic\MyServices\FileSystemProxyTests.cs (13)
276Assert.Equal(6, DirectoryList.Count); 284Assert.Equal(6, DirectoryList.Count); 298Assert.Equal(6, DirectoryList.Count); 306Assert.Equal(6, DirectoryList.Count); 308Assert.Equal(7, DirectoryList.Count); 323Assert.Equal(2, DirectoryList.Count); 334Assert.Equal(2, DirectoryList.Count); 400Assert.Equal(6, FileList.Count); 409Assert.Equal(6, FileList.Count); 427Assert.Equal(6, FileList.Count); 434Assert.Equal(8, FileList.Count); 453Assert.Equal(3, FileList.Count); 464Assert.Equal(4, FileList.Count);
Microsoft.VisualStudio.LanguageServices (1)
ErrorReporting\VisualStudioErrorReportingService.ExceptionFormatting.cs (1)
38for (var i = 0; i < aggregate.InnerExceptions.Count; i++)
MSBuild (1)
PerformanceLogEventListener.cs (1)
146for (int i = 0; i < eventData.PayloadNames.Count; i++)
PresentationCore (16)
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (2)
706for (i = 2/*past x,y*/; i < propertyInfos.Count; i++) 818for (; i < propertyInfos.Count; i++)
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (1)
481for (int j=0; j<tabletDevice.StylusDevices.Count; j++)
System\Windows\Input\Stylus\Common\StylusButtonCollection.cs (1)
34for (int x = 0; x < this.Count; x++)
System\Windows\Input\Stylus\Common\StylusPoint.cs (2)
116int expectedAdditionalValues = properties.Count - StylusPointDescription.RequiredCountOfProperties; //for x, y, pressure 130for (int i = StylusPointDescription.RequiredCountOfProperties, j = 0; i < properties.Count; i++, j++)
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (1)
499for (int x = StylusPointDescription.RequiredCountOfProperties/*3*/; x < properties.Count; x++)
System\Windows\Input\Stylus\Pointer\PointerTabletDeviceCollection.cs (1)
127tablet.StylusDevices.Count));
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (2)
62StylusDevices.Count)); 96if (cCursors > StylusDevices.Count)
System\Windows\Media\Imaging\BitmapDecoder.cs (1)
1441if ((frames != null) && (frames.Count == (i + 1)))
System\Windows\Media\Imaging\BitmapFrame.cs (2)
61if (decoder.Frames.Count == 0) 78if (decoder.Frames.Count == 0)
System\Windows\Media\Imaging\BitmapImage.cs (1)
366if (decoder.Frames.Count == 0)
System\Windows\Media\Imaging\BitmapMetadata.cs (2)
1228strAuthors = new String[value.Count]; 1414strKeywords = new String[value.Count];
PresentationFramework (299)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (4)
294if (ts == null || ts.Count <= 0) 352if (resolvedAnchor.TextSegments.Count > 0) 598if ((textView.TextSegments == null) || (textView.TextSegments.Count == 0)) 602end = textView.TextSegments[textView.TextSegments.Count - 1].End.CreatePointer(LogicalDirection.Backward);
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (1)
342Debug.Assert((rangeSegments != null) && (rangeSegments.Count > 0), "invalid rangeSegments");
MS\Internal\AppModel\IconHelper.cs (1)
444for (int i = 0; i < frames.Count && bestScore != 0; ++i)
MS\Internal\Data\CollectionViewGroupInternal.cs (6)
133for (int k = 0, n = Items.Count; k < n; ++k) 251for (int k = 0, n = Items.Count; k < n; ++k) 298for (int k = 0, n = group.Items.Count; k < n; ++k) 321for (int k = 0, n = Items.Count; k < n; ++k) 783if (_index >= _group.Items.Count) 811if (_index < 0 || _index >= _group.Items.Count)
MS\Internal\Data\CollectionViewGroupRoot.cs (4)
532for (int n = group.Items.Count; index < n; ++index) 614for (int index = 0, n = group.Items.Count; index < n; ++index) 727for (int index = 0, n = group.Items.Count; index < n; ++index) 773for (int k = group.Items.Count - 1; k >= 0; --k)
MS\Internal\Data\XmlDataCollection.cs (3)
72int count = this.Count; 93while (i < this.Count && i < nodes.Count) 132while (i < this.Count)
MS\Internal\Documents\ColumnResult.cs (1)
172Debug.Assert(_paragraphs != null && _paragraphs.Count > 0);
MS\Internal\Documents\FlowDocumentPaginator.cs (1)
386if (textView.TextSegments.Count == 0)
MS\Internal\Documents\HostedElements.cs (4)
62if (_textSegments.Count == 0) 82else if (_currentTextSegment < _textSegments.Count) 95while (_currentTextSegment < _textSegments.Count) 113if (_currentTextSegment < _textSegments.Count)
MS\Internal\Documents\MultiPageTextView.cs (2)
156for (int segmentIndex = 0; segmentIndex < textSegments.Count; segmentIndex++) 727for (index = 0; index < pageViews.Count; index++)
MS\Internal\Documents\ParagraphResult.cs (3)
499return (Lines.Count > 0 && !ContainsOnlyFloatingElements); 528if (Lines.Count == 0) 533else if (Lines.Count == 1)
MS\Internal\Documents\TextDocumentView.cs (159)
127if (FloatingElements.Count > 0) 147for (int segmentIndex = 0; segmentIndex < textSegments.Count; segmentIndex++) 163for (int columnIndex = 0; columnIndex < columns.Count; columnIndex++) 518if (!contains && segments.Count > 0) 526contains = (position.TextContainer.End.CompareTo(segments[segments.Count - 1].End) == 0); 691Invariant.Assert(!snapToTextInFloatingElements || floatingElements.Count == 0, "When snap to text is enabled a valid text position is required if paragraphs exist."); 704Invariant.Assert(!snapToText || paragraphs.Count == 0, "When snap to text is enabled a valid text position is required if paragraphs exist."); 709Invariant.Assert(paragraphIndex < paragraphs.Count); 716Invariant.Assert(paragraphIndex < floatingElements.Count); 754if (nestedParagraphs.Count > 0) 846if (columns.Count > 0 || nestedFloatingElements.Count > 0) 901if (columnIndex < 0 && floatingElements.Count == 0) 910if (columnIndex < columns.Count && columnIndex >= 0) 968Invariant.Assert(paragraphIndex < floatingElements.Count); 976Invariant.Assert(paragraphIndex < paragraphs.Count); 1010if (nestedParagraphs.Count > 0) 1019if (nestedParagraphs.Count > 0) 1068if (columnIndex < 0 && floatingElements.Count == 0) 1075ReadOnlyCollection<ParagraphResult> paragraphs = (columnIndex < columns.Count && columnIndex >= 0) ? columns[columnIndex].Paragraphs : _emptyParagraphCollection; 1102Invariant.Assert(paragraphIndex < floatingElements.Count); 1107if (paragraphIndex < paragraphs.Count) 1144if (nestedParagraphs.Count > 0) 1164if (nestedParagraphs.Count > 0) 1189if (nestedFloatingElements.Count > 0 || columns.Count > 0) 1202if (nestedFloatingElements.Count > 0 || columns.Count > 0) 1232if (columnIndex < columns.Count || floatingElements.Count > 0) 1235ReadOnlyCollection<ParagraphResult> paragraphs = (columnIndex < columns.Count && columnIndex >= 0) ? columns[columnIndex].Paragraphs : _emptyParagraphCollection; 1255int paragraphCount = paragraphs.Count; 1323if (floatingElements != null && floatingElements.Count > 0) 1350int paragraphCount = floatingElements.Count; 1434Invariant.Assert(paragraphIndex < floatingElements.Count); 1439if (paragraphIndex < paragraphs.Count) 1467if (nestedParagraphs.Count > 0) 1481if (nestedParagraphs.Count > 0) 1492if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1503if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1514if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1528if (columnIndex < columns.Count || floatingElements.Count > 0) 1530ReadOnlyCollection<ParagraphResult> paragraphs = (columnIndex < columns.Count && columnIndex >= 0) ? columns[columnIndex].Paragraphs : _emptyParagraphCollection; 1556Invariant.Assert(paragraphIndex < floatingElements.Count); 1561if (paragraphIndex < paragraphs.Count) 1590if (nestedParagraphs.Count > 0) 1605if (nestedParagraphs.Count > 0) 1616if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1627if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1638if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1653if (columnIndex < columns.Count || floatingElements.Count > 0) 1655ReadOnlyCollection<ParagraphResult> paragraphs = (columnIndex < columns.Count && columnIndex >= 0) ? columns[columnIndex].Paragraphs : _emptyParagraphCollection; 1679Invariant.Assert(paragraphIndex < floatingElements.Count); 1684if (paragraphIndex < paragraphs.Count) 1711if (nestedParagraphs.Count > 0) 1725if (nestedParagraphs.Count > 0) 1736if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1747if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1758if (columns.Count > 0 || nestedFloatingElements.Count > 0) 1772if (columnIndex < columns.Count || floatingElements.Count > 0) 1774ReadOnlyCollection<ParagraphResult> paragraphs = (columnIndex < columns.Count && columnIndex >= 0) ? columns[columnIndex].Paragraphs : _emptyParagraphCollection; 1807for (columnIndex = 0; columnIndex < columns.Count; columnIndex++) 1812if (columnIndex == columns.Count - 1) 1854if (columnIndex < columns.Count - 1) 1884if (columnIndex < columns.Count - 1) 1911Invariant.Assert(!foundHit || lastColumnWithContent < columns.Count, "Column not found."); 1939for (paragraphIndex = 0; paragraphIndex < paragraphs.Count; paragraphIndex++) 1944if (paragraphIndex == paragraphs.Count - 1) 1985if (paragraphIndex < paragraphs.Count - 1) 2015if (paragraphIndex < paragraphs.Count - 1) 2042Invariant.Assert(!foundHit || lastParagraphWithContent < paragraphs.Count, "Paragraph not found."); 2059for (int paragraphIndex = 0; paragraphIndex < floatingElements.Count; paragraphIndex++) 2095if (columns.Count > 0) 2097if (columns.Count == 1) 2103for (columnIndex = 0; columnIndex < columns.Count; columnIndex++) 2113if (columnIndex >= columns.Count) 2119else if (position.CompareTo(columns[columns.Count - 1].EndPosition) == 0) 2121columnIndex = columns.Count - 1; 2145if (paragraphIndex < floatingElements.Count) 2170int paragraphSearchIndexUpper = paragraphs.Count - 1; 2173if (paragraphs.Count > 0) 2215else if (position.CompareTo(paragraphs[paragraphs.Count - 1].EndPosition) == 0) 2217paragraphIndex = paragraphs.Count - 1; 2221paragraphIndex = paragraphs.Count; 2246Invariant.Assert(paragraphIndex < floatingElements.Count); 2251if (paragraphIndex < paragraphs.Count) 2284if (nestedParagraphs.Count > 0) 2307Invariant.Assert(lineIndex >= 0 && lineIndex < lines.Count, "Line not found."); 2317if (nestedParagraphs.Count > 0) 2328if (columns.Count > 0 || nestedFloatingElements.Count > 0) 2339if (columns.Count > 0 || nestedFloatingElements.Count > 0) 2350if (columns.Count > 0 || nestedFloatingElements.Count > 0) 2374if (columnIndex < columns.Count || floatingElements.Count > 0) 2376ReadOnlyCollection<ParagraphResult> paragraphs = (columnIndex < columns.Count && columnIndex >= 0) ? columns[columnIndex].Paragraphs : _emptyParagraphCollection; 2412if (paragraphIndex < paragraphs.Count) 2429if (nestedParagraphs.Count > 0) 2454Invariant.Assert(lineIndex >= 0 && lineIndex < lines.Count, "Line not found."); 2467else if (lineIndex + count > lines.Count - 1) 2469lineIndex = lines.Count - 1; 2470count -= (lines.Count - 1 - oldLineIndex); 2517positionOut = lines[lines.Count - 1].GetTextPositionFromDistance(suggestedX); 2521positionOut = lines[lines.Count - 1].StartPosition.CreatePointer(LogicalDirection.Forward); 2540if (nestedParagraphs.Count > 0) 2544int nesteParagraphIndex = (count > 0) ? 0 : nestedParagraphs.Count - 1; 2586if (paragraphIndex >= 0 && paragraphIndex < paragraphs.Count) 2632Invariant.Assert(paragraphIndex < floatingElements.Count); 2643if (columns.Count > 0 || nestedFloatingElements.Count > 0) 2656if (columns.Count > 0 || nestedFloatingElements.Count > 0) 2677if (floatingElements.Count > 0) 2687if (columnIndex < columns.Count) 2707if (columnIndex >= 0 && columnIndex < columns.Count) 2745Invariant.Assert(paragraphIndex >= 0 && paragraphIndex < paragraphs.Count, "Paragraph collection is empty."); 2750while (paragraphIndex >= 0 && paragraphIndex < paragraphs.Count) 2771if (nestedParagraphs.Count > 0) 2773int nesteParagraphIndex = (count > 0) ? 0 : nestedParagraphs.Count - 1; 2810if (nestedParagraphs.Count > 0) 2812int nesteParagraphIndex = (count > 0) ? 0 : nestedParagraphs.Count - 1; 2835if (nestedParagraphs.Count > 0) 2837int nesteParagraphIndex = (count > 0) ? 0 : nestedParagraphs.Count - 1; 2928int lineIndex = (count > 0) ? 0 : lines.Count - 1; 2947else if (lineIndex + count > lines.Count - 1) 2949count -= (lines.Count - 1 - lineIndex); 2991positionOut = lines[lines.Count - 1].GetTextPositionFromDistance(suggestedX); 2995positionOut = lines[lines.Count - 1].StartPosition.CreatePointer(LogicalDirection.Forward); 3027while (columnIndex >= 0 && columnIndex < columns.Count) 3033if (paragraphs.Count > 0) 3037int paragraphIndex = (count > 0) ? 0 : paragraphs.Count - 1; 3091for (int index = 0; index < paragraphs.Count; index++) 3113if (nestedParagraphs.Count > 0) 3142for (int index = 0; index < floatingElements.Count; index++) 3156if (columns.Count > 0 || nestedFloatingElements.Count > 0) 3167if (columns.Count > 0 || nestedFloatingElements.Count > 0) 3187if (floatingElements.Count > 0) 3195for (columnIndexStart = 0; columnIndexStart < columns.Count; columnIndexStart++) 3201for (columnIndexEnd = columnIndexStart; columnIndexEnd < columns.Count; columnIndexEnd++) 3207Invariant.Assert(columnIndexStart < columns.Count && columnIndexEnd < columns.Count, "Start or End position does not belong to TextView's content range"); 3213if (paragraphs != null && paragraphs.Count > 0) 3256for (int index = 0; index < columns.Count; index++)
MS\Internal\Documents\TextParagraphView.cs (19)
148Debug.Assert(lines != null && lines.Count > 0); 152if (!(lineIndex >= 0 && lineIndex < lines.Count)) 161lineIndex = Math.Min(lines.Count - 1, lineIndex); 266Debug.Assert(lines != null && lines.Count > 0); 270Debug.Assert(lineIndex >= 0 && lineIndex < lines.Count); 322Debug.Assert(lines != null && lines.Count > 0, "Line array is empty."); 326Debug.Assert(lineIndex < lines.Count); 356int indexEnd = lines.Count - 1; 364dcp > lines[lines.Count - 1].EndPositionCP) 366return dcp < lines[0].StartPositionCP ? 0 : lines.Count - 1; 396if (position.LogicalDirection == LogicalDirection.Forward && (lineIndex != lines.Count - 1)) 416(position.LogicalDirection == LogicalDirection.Forward && (lineIndex == lines.Count - 1))))); 525Debug.Assert(lines != null && lines.Count > 0); 562Debug.Assert(lines != null && lines.Count > 0); 571lineIndex = Math.Max(Math.Min((int)(point.Y / approximatedLineHeight), lines.Count - 1), 0); 595if (lineIndex < lines.Count - 1) 648if (lineIndex < lines.Count - 1) 689Debug.Assert(lines != null && lines.Count > 0); 734else if ((point.X > lineBox.X + lineBox.Width) && (lineIndex < lines.Count - 1))
MS\Internal\Ink\InkCanvasSelection.cs (10)
96return SelectedStrokes.Count != 0 || SelectedElements.Count != 0; 512&& SelectedElements.Count == 1 556if ( SelectedElements.Count == 0 ) 590if ( SelectedElements.Count == 1 ) 723int count = SelectedElements.Count; 740if ( SelectedElements.Count == 0 ) 761Debug.Assert( SelectedElements.Count != 0, 831if ( SelectedElements.Count != 0 ) 849if ( SelectedElements.Count == 0 ) 953if ( SelectedElements.Count != 0 )
MS\Internal\LayoutDump.cs (6)
650writer.WriteAttributeString("Count", lines.Count.ToString(CultureInfo.InvariantCulture)); 652for (int index = 0; index < lines.Count; index++) 691writer.WriteAttributeString("Count", paragraphs.Count.ToString(CultureInfo.InvariantCulture)); 693for (int index = 0; index < paragraphs.Count; index++) 878writer.WriteAttributeString("Count", columns.Count.ToString(CultureInfo.InvariantCulture)); 880for (int index = 0; index < columns.Count; index++)
MS\Internal\PtsHost\ContainerParaClient.cs (1)
401if (paragraphs.Count > 0)
MS\Internal\PtsHost\FigureParaClient.cs (4)
736Invariant.Assert(columns != null && columns.Count <= 1, "Columns collection is null."); 738ReadOnlyCollection<ParagraphResult> paragraphs = (columns.Count > 0) ? columns[0].Paragraphs : ReadOnlyCollection<ParagraphResult>.Empty; 740if (paragraphs.Count > 0 || floatingElements.Count > 0)
MS\Internal\PtsHost\FloaterParaClient.cs (4)
745Invariant.Assert(columns != null && columns.Count <= 1, "Columns collection is null."); 747ReadOnlyCollection<ParagraphResult> paragraphs = (columns.Count > 0) ? columns[0].Paragraphs : ReadOnlyCollection<ParagraphResult>.Empty; 749if (paragraphs.Count > 0 || floatingElements.Count > 0)
MS\Internal\PtsHost\FlowDocumentPage.cs (2)
363Invariant.Assert(_textView != null && ((ITextView)_textView).TextSegments.Count > 0); 978for (int segmentIndex = 0; segmentIndex < ((ITextView)_textView).TextSegments.Count; segmentIndex++)
System\Windows\Annotations\AnnotationHelper.cs (1)
541if (viewer.PageViews.Count <= endPage - startPage)
System\Windows\Automation\Peers\GroupItemAutomationPeer.cs (1)
76sizeOfSet = parent.Items.Count;
System\Windows\Controls\DataGrid.cs (3)
5584if (cvg != null && cvg.Items.Count > 0) 5588(e.Key == Key.Down && ItemsControl.EqualsEx(cvg.Items[cvg.Items.Count - 1], currentInfo.Item))) 7831itemProperties.Count > 0)
System\Windows\Controls\FlowDocumentScrollViewer.cs (1)
1141if (rects.Count > 0)
System\Windows\Controls\GridViewHeaderRowPresenter.cs (1)
726int count = e.ClearedColumns.Count;
System\Windows\Controls\InkCanvas.cs (1)
1069if (results.Count > 0)
System\Windows\Controls\Primitives\BulletDecorator.cs (3)
344if (cr != null && cr.Count > 0) 348if (pr != null && pr.Count > 0) 365if (lr != null && lr.Count > 0)
System\Windows\Controls\Primitives\DocumentViewerBase.cs (8)
398for (index = 0; index < _pageViews.Count; index++) 410masterPageView = _pageViews.Count > 0 ? _pageViews[0] : null; 436for (int index = 0; index < _pageViews.Count; index++) 615for (index = 0; index < _pageViews.Count; index++) 834for (index = 0; index < _pageViews.Count; index++) 868for (index = 0; index < pageViews.Count; index++) 1212if (_document != null && _pageViews.Count > 0) 1253for (index = 0; index < _pageViews.Count; index++)
System\Windows\Controls\ScrollViewer.cs (1)
2476if (rects.Count > 0)
System\Windows\Controls\SinglePageViewer.cs (7)
687for (int index = 0; index < pageViews.Count; index++) 831if (pageViews.Count > 0) 834pageRects = new Rect[pageViews.Count]; 835for (index = 0; index < pageViews.Count; index++) 1010for (int index = 0; index < pageViews.Count; index++) 1092for (int index = 0; index < pageViews.Count; index++) 1131for (index = 0; index < pageViews.Count; index++)
System\Windows\Controls\TextAdaptor.cs (3)
98if (textSegments.Count > 0) 104if (!textView.Contains(end) && end.CompareTo(textSegments[textSegments.Count-1].End) > 0) 106end = textSegments[textSegments.Count - 1].End.CreatePointer();
System\Windows\Controls\TextBlock.cs (1)
3470if (rects.Count > 0)
System\Windows\Controls\TextRangeAdaptor.cs (9)
676if (textSegments != null && textSegments.Count > 0) 693if (textSegments != null && textSegments.Count > 0) 695if (_end.CompareTo(textSegments[textSegments.Count - 1].End) != 0) 697_end = textSegments[textSegments.Count - 1].End.CreatePointer(); 915if (textSegments != null && textSegments.Count > 0) 922while (position.CompareTo(textSegments[textSegments.Count - 1].End) != 0) 926position.MoveToPosition(textSegments[textSegments.Count - 1].End); 1137if (textSegments == null || textSegments.Count == 0) 1149position.MoveToPosition(textSegments[textSegments.Count - 1].End);
System\Windows\Data\BindingGroup.cs (1)
958for (int i=0, n=errors.Count; i<n; ++i)
System\Windows\Data\BindingListCollectionView.cs (8)
528int index = (oldIndex == 0) ? 0 : _group.Items.Count - 1; 533int index = (newIndex == 0) ? 0 : _group.Items.Count; 802index = _group.Items.Count - 1; 808index = _group.Items.Count - 2; 2283_group.InsertSpecialItem(_group.Items.Count, _newItem, true /*loading*/); 2287_group.InsertSpecialItem(_group.Items.Count, NewItemPlaceholder, true /*loading*/); 2335index = _group.Items.Count; 2341index = _group.Items.Count - 1;
System\Windows\Data\ListCollectionView.cs (8)
641int index = (oldIndex == 0) ? 0 : _group.Items.Count - 1; 646int index = (newIndex == 0) ? 0 : _group.Items.Count; 908index = _group.Items.Count - 1; 914index = _group.Items.Count - 2; 2975_group.InsertSpecialItem(_group.Items.Count, _newItem, true /*loading*/); 2979_group.InsertSpecialItem(_group.Items.Count, NewItemPlaceholder, true /*loading*/); 3028index = _group.Items.Count; 3034index = _group.Items.Count - 1;
System\Windows\Documents\DocumentSequenceTextView.cs (1)
548List<TextSegment> parentSegments = new List<TextSegment>(childSegments.Count);
System\Windows\Documents\WpfPayload.cs (2)
629imageBitmap1.Decoder.Frames.Count == 1 && imageBitmap2.Decoder.Frames.Count == 1 &&
System\Windows\Input\KeyboardNavigation.cs (4)
583if (_canvasChildren.Count == _contentRects.Count) 725if (_contentRects != null && oldRects != null && _contentRects.Count == oldRects.Count) 727for (int i=0; i<oldRects.Count; i++)
PresentationFramework-SystemXml (1)
SystemXmlExtension.cs (1)
67return (xdc != null) ? xdc.Count > 0 : false;
PresentationUI (5)
MS\Internal\Documents\DigitalSignatureProvider.cs (1)
64return XpsDocument.Signatures.Count > 0;
MS\Internal\Documents\RightsManagementProvider.cs (3)
369new List<RightsManagementUser>(users.Count); 416if ((users.Count > 0) && (defaultUserName != null)) 431if ((defaultUser == null) && (users.Count > 0))
MS\Internal\Documents\RMPublishingDialog.cs (1)
212if (radioButtonTemplate.Checked && (comboBoxTemplates.SelectedIndex < _templates.Count))
Replay (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
165writer.Write(Arguments.Count); 462writer.Write(ErrorMessages.Count);
System.ComponentModel.Composition (7)
System\ComponentModel\Composition\CompositionException.cs (3)
122if (Errors.Count == 0) 147if (ce.RootCauses.Count > 0) 166WriteHeader(writer, Errors.Count, paths.Count);
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (4)
240if ((batch.PartsToAdd.Count == 0) && (batch.PartsToRemove.Count == 0)) 365IEnumerable<ExportDefinition> addedExports = batch.PartsToAdd.Count != 0 ? 369IEnumerable<ExportDefinition> removedExports = batch.PartsToRemove.Count != 0 ?
System.ComponentModel.Composition.Registration (1)
System\ComponentModel\Composition\Registration\PartBuilderOfT.cs (1)
115if (methodCallExpression.Arguments.Count == 1)
System.Composition.Convention (1)
System\Composition\Convention\PartConventionBuilderOfT.cs (1)
174if (methodCallExpression.Arguments.Count == 1)
System.Data.Odbc (1)
src\libraries\Common\src\System\Data\Common\BasicFieldNameLookup.cs (1)
33int length = columnNames.Count;
System.Linq.Expressions (141)
System\Dynamic\CallInfo.cs (1)
55if (argCount < argNameCol.Count) throw System.Linq.Expressions.Error.ArgCntMustBeGreaterThanNameCnt();
System\Dynamic\DynamicMetaObjectBinder.cs (2)
56ArgumentOutOfRangeException.ThrowIfZero(parameters.Count); 57ArgumentOutOfRangeException.ThrowIfNotEqual(args.Length, parameters.Count);
System\Dynamic\Utils\CollectionExtensions.cs (3)
15T[] res = new T[list.Count + 1]; 104int count = first.Count; 106if (count != second.Count)
System\Dynamic\Utils\ExpressionUtils.cs (2)
106ValidateArgumentCount(method, nodeKind, arguments.Count, pis); 117newArgs = new Expression[arguments.Count];
System\Linq\Expressions\BlockExpression.cs (24)
243Debug.Assert(variables == null || variables.Count == 0); 309Debug.Assert(variables == null || variables.Count == 0); 381Debug.Assert(variables == null || variables.Count == 0); 459Debug.Assert(variables == null || variables.Count == 0); 495Debug.Assert(variables == null || variables.Count == 0); 590Debug.Assert(variables!.Count == Variables.Count); 595Debug.Assert(variables == null || variables.Count == Variables.Count); 629Debug.Assert(variables!.Count == Variables.Count); 634Debug.Assert(variables == null || variables.Count == Variables.Count); 654Debug.Assert(variables!.Count == Variables.Count); 659Debug.Assert(variables == null || variables.Count == Variables.Count); 976if (variableList.Count == 0) 1009if (variableList.Count == 0 && expressionList.Count != 0) 1011int expressionCount = expressionList.Count; 1033if (expressions.Count == 0) 1057return expressions.Count switch 1068int count = varList.Count;
System\Linq\Expressions\Compiler\CompilerScope.cs (4)
173if (NearestHoistedLocals != null && vars.Count > 0) 176var indexes = new ArrayBuilder<long>(vars.Count); 298if (hoistedVars.Count > 0) 314lc.IL.EmitPrimitive(_hoistedLocals.Variables.Count);
System\Linq\Expressions\Compiler\DelegateHelpers.cs (1)
33for (int i = 0; i < types.Count; i++)
System\Linq\Expressions\Compiler\HoistedLocals.cs (3)
67if (vars.Count != 0) 69Dictionary<Expression, int> indexes = new Dictionary<Expression, int>(vars.Count); 70for (int i = 0; i < vars.Count; i++)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (4)
901int n = expressions.Count; 1011if (init.NewExpression.Type.IsValueType && init.Bindings.Count > 0) 1029int n = bindings.Count; 1073int n = initializers.Count;
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (11)
116return block.Variables.Count > 0; 164if (node.Cases.Count == 0) 211var labels = new Label[node.Cases.Count]; 212var isGoto = new bool[node.Cases.Count]; 213for (int i = 0, n = node.Cases.Count; i < n; i++) 392var labels = new Label[node.Cases.Count]; 393var isGoto = new bool[node.Cases.Count]; 397for (int i = 0; i < node.Cases.Count; i++) 491for (int i = 0, n = node.Cases.Count; i < n; i++) 667var cases = new ArrayBuilder<SwitchCase>(node.Cases.Count); 671for (int i = 0, n = node.Cases.Count; i < n; i++)
System\Linq\Expressions\Compiler\StackSpiller.Bindings.cs (7)
66int count = _bindings.Count; 84int count = _bindings.Count; 102int count = _bindings.Count; 139int count = _inits.Count; 146ChildRewriter cr = new ChildRewriter(spiller, stack, init.Arguments.Count); 161int count = _inits.Count; 187int count = _inits.Count;
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (1)
151for (int i = 0, count = expressions.Count; i < count; i++)
System\Linq\Expressions\Compiler\StackSpiller.cs (9)
484var cr = new ChildRewriter(this, stack, node.Expressions.Count); 634int count = inits.Count; 643var cr = new ChildRewriter(this, Stack.NonEmpty, init.Arguments.Count); 712int count = bindings.Count; 887for (int i = 0; i < cases.Count; i++) 893for (int j = 0; j < testValues.Count; j++) 964for (int i = 0; i < handlers.Count; i++) 1044Debug.Assert(max < original.Count); 1046T[] clone = new T[original.Count];
System\Linq\Expressions\Compiler\VariableBinder.cs (3)
119if (node.Variables.Count == 0) 165while (body.Count == 1 && body[0].NodeType == ExpressionType.Block) 169if (block.Variables.Count > 0)
System\Linq\Expressions\DebugViewWriter.cs (1)
812if (node.Arguments.Count == 1)
System\Linq\Expressions\DynamicExpression.cs (1)
1244int n = arguments.Count;
System\Linq\Expressions\ElementInit.cs (1)
42public int ArgumentCount => Arguments.Count;
System\Linq\Expressions\ExpressionStringBuilder.cs (4)
326for (int i = 0, n = node.Initializers.Count; i < n; i++) 427for (int i = 0, n = node.Bindings.Count; i < n; i++) 452for (int i = 0, n = binding.Initializers.Count; i < n; i++) 468for (int i = 0, n = binding.Bindings.Count; i < n; i++)
System\Linq\Expressions\ExpressionVisitor.cs (3)
47for (int i = 0, n = nodes.Count; i < n; i++) 96for (int i = 0, n = nodes.Count; i < n; i++) 157for (int i = 0, n = nodes.Count; i < n; i++)
System\Linq\Expressions\IndexExpression.cs (4)
184if (arrayType.GetArrayRank() != indexList.Count) 493if (indexes.Length != arguments.Count) 517newArgs = new Expression[arguments.Count]; 533else if (arguments.Count > 0)
System\Linq\Expressions\Interpreter\LightCompiler.cs (15)
523Expression lastExpression = node.Expressions[node.Expressions.Count - 1]; 535if (variables.Count != 0) 539locals = new LocalDefinition[variables.Count]; 555for (int i = 0; i < node.Expressions.Count - 1; i++) 1533if (node.Cases.Count == 0) 1648for (int i = 0; i < node.Cases.Count; i++) 1661if (i < node.Cases.Count - 1) 1692for (int i = 0; i < node.Cases.Count; i++) 1715if (i < node.Cases.Count - 1) 1902for (int i = 0, n = block.Expressions.Count; i < n; i++) 2004if (node.Handlers.Count > 0) 2101Debug.Assert(expr.Handlers.Count == 0); 2526int rank = node.Expressions.Count; 2571_instructions.EmitNewRuntimeVariables(node.Variables.Count); 2698for (int i = 0; i < initializers.Count; i++)
System\Linq\Expressions\Interpreter\TypeOperations.cs (3)
540if (node.Variables.Count > 0) 545if (node.Variables.Count > 0) 577int count = node.Variables.Count;
System\Linq\Expressions\LambdaExpression.cs (4)
342switch (parameters.Count) 858int paramCount = parameterList.Count; 940if (pis.Length != parameters.Count) 970else if (parameters.Count > 0)
System\Linq\Expressions\ListInitExpression.cs (3)
128if (initializerlist.Count == 0) 170ElementInit[] initList = new ElementInit[initializerlist.Count]; 171for (int i = 0; i < initializerlist.Count; i++)
System\Linq\Expressions\MemberInitExpression.cs (2)
73int count = bindings.Count; 89int count = initializers.Count;
System\Linq\Expressions\MemberListBinding.cs (1)
127for (int i = 0, n = initializers.Count; i < n; i++)
System\Linq\Expressions\MemberMemberBinding.cs (1)
155for (int i = 0, n = bindings.Count; i < n; i++)
System\Linq\Expressions\MethodCallExpression.cs (2)
1421if (arrayType.GetArrayRank() != indexList.Count) 1426for (int i = 0, n = indexList.Count; i < n; i++)
System\Linq\Expressions\NewArrayExpression.cs (3)
148for (int i = 0, n = initializerList.Count; i < n; i++) 161newList = new Expression[initializerList.Count]; 225int dimensions = boundsList.Count;
System\Linq\Expressions\NewExpression.cs (8)
225if (arguments.Count != pis.Length) 229if (arguments.Count != members.Count) 235for (int i = 0, n = arguments.Count; i < n; i++) 269newArguments = new Expression[arguments.Count]; 282newMembers = new MemberInfo[members.Count]; 302else if (arguments != null && arguments.Count > 0) 306else if (members != null && members.Count > 0)
System\Linq\Expressions\RuntimeVariablesExpression.cs (1)
94for (int i = 0; i < vars.Count; i++)
System\Linq\Expressions\SwitchExpression.cs (4)
189else if (caseList.Count != 0) 223for (int i = 0, n = c.TestValues.Count; i < n; i++) 249else if (caseList.Count != 0) 259for (int i = 0, n = c.TestValues.Count; i < n; i++)
System\Linq\Expressions\TryExpression.cs (2)
163if (@finally != null || @catch.Count > 0) 173else if (@catch.Count == 0)
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (3)
95if (node.Variables.Count > 0) 100if (node.Variables.Count > 0) 132int count = node.Variables.Count;
System.Linq.Parallel (2)
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
112for (int i = 0; i < flattenedAE.InnerExceptions.Count; i++) 130if (!allOCEsOnTrackedExternalCancellationToken || flattenedAE.InnerExceptions.Count == 0)
System.Linq.Queryable (5)
System\Linq\EnumerableRewriter.cs (5)
76newArgs = new List<Expression>(argList.Count); 109List<Expression> exprs = new List<Expression>(na.Expressions.Count); 110for (int i = 0, n = na.Expressions.Count; i < n; i++) 316if (mParams.Length != args.Count) 338for (int i = 0, n = args.Count; i < n; i++)
System.Net.Quic (2)
System\Net\Quic\Internal\MsQuicConfiguration.Cache.cs (1)
42certCount += intermediates?.Count ?? 0;
System\Net\Quic\Internal\MsQuicConfiguration.cs (1)
256if (intermediates != null && intermediates.Count > 0)
System.Net.Security (8)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (3)
53int certCount = 1 + certContext.IntermediateCertificates.Count; 283if (sslAuthenticationOptions.CertificateContext.IntermediateCertificates.Count > 0) 335if (sslAuthenticationOptions.CertificateContext.IntermediateCertificates.Count > 0)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
291for (int i = 0; i < chain.Count; i++)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (1)
50for (int i = 0; i < chain.Count; i++)
System\Net\Security\SslStreamCertificateContext.Linux.cs (3)
47if (intermediates.Count > 0) 49_privateIntermediateCertificates = new X509Certificate2[intermediates.Count]; 51for (int i = 0; i < intermediates.Count; i++)
System.Private.CoreLib (11)
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (2)
228while (backAsAggregate != null && backAsAggregate.InnerExceptions.Count == 1) 313for (int i = 0; i < currentInnerExceptions.Count; i++)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (1)
123if (array.Length - index < Count)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (7)
83if (payloadName.Count == 0 || payload.Count == 0) 86int eventDataCount = payloadName.Count; 88if (payloadName.Count != payload.Count) 90eventDataCount = Math.Min(payloadName.Count, payload.Count);
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (1)
657when index < args.Count && args[index].Value is byte elementB:
System.Runtime.Caching (6)
System\Runtime\Caching\HostFileChangeMonitor.cs (3)
35if (_filePaths.Count == 1) 51Hashtable fcnState = new Hashtable(_filePaths.Count); 125if (_filePaths.Count > 1)
System\Runtime\Caching\MemoryCacheEntryChangeMonitor.cs (3)
35_dependencies = new List<MemoryCacheEntry>(_keys.Count); 36if (_keys.Count == 1) 136Debug.Assert(keys != null && keys.Count > 0, "keys != null && keys.Count > 0");
System.Runtime.Serialization.Schema (3)
System\Runtime\Serialization\Schema\CodeExporter.cs (3)
662Debug.Assert(itemContract.DataMembers.Count >= 2); 842for (int i = 0; i < classDataContract.DataMembers.Count; i++) 1087for (int i = 0; i < enumDataContract.DataMembers.Count; i++)
System.Security.Cryptography.Cose (3)
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (3)
536encodedLength += CoseHelpers.GetIntegerEncodedSize(Signatures.Count); 573if (Signatures.Count < 1) 599writer.WriteStartArray(Signatures.Count);
System.ServiceModel.NetFramingBase (2)
System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (1)
457for (int i = 0; i < authorizationContext.ClaimSets.Count; ++i)
System\ServiceModel\Security\SecurityUtilsEx.cs (1)
119for (int i = 0; i < authContext.ClaimSets.Count; ++i)
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\ChainedRateLimiter.cs (1)
163Exception[] exceptions = new Exception[innerEx.InnerExceptions.Count + 1];
System.Threading.Tasks.Dataflow (1)
Internal\SourceCore.cs (1)
483Debug.Assert(aggregateException != null && aggregateException.InnerExceptions.Count > 0, "Aggregate must be valid and contain inner exceptions to unwrap.");
System.Windows.Controls.Ribbon (2)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonWindowSmallIconConverter.cs (2)
60if (bf != null && bf.Decoder != null && bf.Decoder.Frames != null && bf.Decoder.Frames.Count > 0) 97for (int i = 0; i < frames.Count && bestScore != 0; ++i)
System.Xaml (9)
System\Xaml\Schema\XamlDirective.cs (5)
68for (int i = 0; i < ns.Count; i++) 78if (_xamlNamespaces.Count > 0) 102if (ns1.Count != ns2.Count) 107for (int i = 0; i < ns1.Count; i++)
System\Xaml\XamlSchemaContext.cs (2)
1268AssemblyName[] asmNames = new AssemblyName[_referenceAssemblies.Count]; 1272for (int i = 0; i < _referenceAssemblies.Count; i++)
System\Xaml\XamlType.cs (2)
1451else if (_namespaces is not null && _namespaces.Count > 0) 1845if (_namespaces is not null && _namespaces.Count > 0)
vbc (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
165writer.Write(Arguments.Count); 462writer.Write(ErrorMessages.Count);
VBCSCompiler (3)
src\Compilers\Core\CommandLine\BuildProtocol.cs (2)
165writer.Write(Arguments.Count); 462writer.Write(ErrorMessages.Count);
src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
65if (request.Arguments.Count == 1 && request.Arguments[0].ArgumentId == BuildProtocolConstants.ArgumentId.Shutdown)