5 writes to Count
Microsoft.Build (5)
Construction\ProjectElementContainer.cs (5)
182Count++; 238Count++; 329Count--; 405Count++; 664Count++;
53 references to Count
Microsoft.Build (21)
Construction\ProjectItemGroupElement.cs (2)
72return Count == 0; 75if (Count == 0)
Construction\ProjectRootElement.cs (2)
999if (itemGroupToAddTo == null && itemGroup.Count == 0) 1009if (itemGroupToAddTo?.Count > 0)
Definition\Project.cs (8)
2060if (Xml.Count > 0) // don't log empty projects, evaluation is not interesting 3067if (group.Count == 0 || MSBuildNameIgnoreCaseComparer.Default.Equals(itemType, group.Items.First().ItemType)) 3082if (groupToAppendTo.Count == 0 || 3165if (parent.Count == 0) 3443if ((metadata?.Any() == true) || candidateExistingItemXml.Count > 0) 3655if (parent.Count == 0) 3872if (itemGroupToAddTo == null && itemGroupXml.Count == 0) 3884if (itemGroupToAddTo == null || itemGroupToAddTo.Count == 0)
Definition\ProjectItem.cs (1)
705if (_xml.Count == 0 /* no metadata */ && _project.IsSuitableExistingItemXml(_xml, name, null /* no metadata */) && !FileMatcher.HasWildcardsSemicolonItemOrPropertyReferences(name))
Evaluation\Evaluator.cs (6)
426List<ProjectTaskInstanceChild> taskOutputs = new List<ProjectTaskInstanceChild>(taskElement.Count); 468List<ProjectPropertyGroupTaskPropertyInstance> properties = new List<ProjectPropertyGroupTaskPropertyInstance>(propertyGroupElement.Count); 498List<ProjectItemGroupTaskItemInstance> items = new List<ProjectItemGroupTaskItemInstance>(itemGroupElement.Count); 549List<ProjectTargetInstanceChild> targetChildren = new List<ProjectTargetInstanceChild>(targetElement.Count); 794if (_projectRootElement.Count > 0) // VB/C# will new up empty projects; they aren't worth recording 810string output = String.Format(CultureInfo.CurrentUICulture, "###: MSBUILD: Evaluating or reevaluating project {0} with {1} global properties and {2} tools version, child count {3}, CurrentSolutionConfigurationContents hash {4} other properties:\n{5}", _projectRootElement.FullPath, globalPropertiesCount, _data.Toolset.ToolsVersion, _projectRootElement.Count, hash, propertyDump);
Instance\TaskRegistry.cs (1)
425if (projectUsingTaskXml.Count > 0)
ObjectModelRemoting\ConstructionObjectLinks\ProjectElementContainerLink.cs (1)
17/// Access to remote <see cref="ProjectElementContainer.Count"/>.
Microsoft.Build.Engine.OM.UnitTests (32)
Construction\ConstructionEditing_Tests.cs (22)
41Assert.Equal(1, project.Count); 42Assert.Equal(0, target.Count); 68Assert.Equal(1, project.Count); 92Assert.Equal(2, project.Count); 425Assert.Equal(1, project.Count); 452Assert.Equal(2, project.Count); 529Assert.Equal(3, project.Count); 553Assert.Equal(1, project.Count); 574Assert.Equal(1, project.Count); 1344Assert.Equal(1, project.Count); 1368Assert.Equal(1, project.Count); 1387Assert.Equal(0, project.Count); 1403Assert.Equal(0, target1.Count); 1425Assert.Equal(2, project.Count); 1451Assert.Equal(2, project.Count); 1473Assert.Equal(1, project.Count); 2386Assert.Equal(0, group1.Count); 2409Assert.Equal(0, group1.Count); 2432Assert.Equal(0, group1.Count); 2455Assert.Equal(0, group1.Count); 2478Assert.Equal(0, group1.Count); 2502Assert.Equal(1, group1.Count);
Construction\ProjectImportGroupElement_Tests.cs (3)
271Assert.Equal(2, importGroups[0].Count); 303Assert.Equal(2, importGroups[0].Count); 304Assert.Equal(1, importGroups[1].Count);
Construction\ProjectUsingTaskElement_Tests.cs (1)
424Assert.Equal(2, usingTask.Count);
Construction\UsingTaskParameterGroup_Tests.cs (2)
67Assert.Equal(0, parameterGroup.Count); 79Assert.Equal(2, parameterGroup.Count);
Definition\ProjectItem_Tests.cs (1)
1903Assert.Equal(0, item.Xml.Count);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (2)
423Assert.Equal(realXml.Count, viewXml.Count);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectElementContainerLink.cs (1)
17public int Count => ContainerXml.Count;