2 writes to ContainingProject
Microsoft.Build (2)
Construction\ProjectElement.cs (2)
68ContainingProject = containingProject; 433ContainingProject = projectRootElement;
171 references to ContainingProject
Microsoft.Build (77)
Construction\ProjectElement.cs (3)
171_parent = new WrapperForProjectRootElement(ContainingProject); 258return Parent.ContainingProject; 344return Clone(ContainingProject);
Construction\ProjectElementContainer.cs (7)
369childContainer.DeepClone(ContainingProject, this); 373AppendChild(child.Clone(ContainingProject)); 423childContainer.DeepClone(clone.ContainingProject, clone); 427clone.AppendChild(child.Clone(clone.ContainingProject)); 675ErrorUtilities.VerifyThrowInvalidOperation(Parent != null || ContainingProject == this, "OM_ParentNotParented"); 678ErrorUtilities.VerifyThrowInvalidOperation(child.ContainingProject == ContainingProject, "OM_MustBeSameProject");
Construction\ProjectImportGroupElement.cs (1)
66ProjectImportElement newImport = ContainingProject.CreateImportElement(project);
Construction\ProjectItemDefinitionElement.cs (1)
83ProjectMetadataElement metadata = ContainingProject.CreateMetadataElement(name);
Construction\ProjectItemDefinitionGroupElement.cs (1)
56ProjectItemDefinitionElement itemDefinition = ContainingProject.CreateItemDefinitionElement(itemType);
Construction\ProjectItemElement.cs (1)
400ProjectMetadataElement metadata = ContainingProject.CreateMetadataElement(name);
Construction\ProjectItemGroupElement.cs (1)
135ProjectItemElement newItem = ContainingProject.CreateItemElement(itemType, include);
Construction\ProjectPropertyGroupElement.cs (1)
64ProjectPropertyElement newProperty = ContainingProject.CreatePropertyElement(name);
Construction\ProjectTargetElement.cs (3)
355ProjectItemGroupElement itemGroup = ContainingProject.CreateItemGroupElement(); 368ProjectPropertyGroupElement propertyGroup = ContainingProject.CreatePropertyGroupElement(); 383ProjectTaskElement task = ContainingProject.CreateTaskElement(taskName);
Construction\ProjectTaskElement.cs (2)
244ProjectOutputElement outputItem = ContainingProject.CreateOutputElement(taskParameter, itemType, null); 274ProjectOutputElement outputProperty = ContainingProject.CreateOutputElement(taskParameter, null, propertyName);
Construction\ProjectUsingTaskElement.cs (2)
210UsingTaskParameterGroupElement newParameterGroup = ContainingProject.CreateUsingTaskParameterGroupElement(); 221ProjectUsingTaskBodyElement newTaskBody = ContainingProject.CreateUsingTaskBodyElement(evaluate, taskBody);
Construction\UsingTaskParameterGroupElement.cs (1)
82ProjectUsingTaskParameterElement newParameter = ContainingProject.CreateUsingTaskParameterElement(name, output, required, parameterType);
Definition\Project.cs (7)
2619var includeItemspec = new EvaluationItemSpec(itemElement.Include, _data.Expander, itemElement.IncludeLocation, itemElement.ContainingProject.DirectoryPath); 2635var excludeItemspec = new EvaluationItemSpec(itemElement.Exclude, _data.Expander, itemElement.ExcludeLocation, itemElement.ContainingProject.DirectoryPath); 2675var removeSpec = new EvaluationItemSpec(itemElement.Remove, _data.Expander, itemElement.RemoveLocation, itemElement.ContainingProject.DirectoryPath); 2798EvaluationItemSpec expandedItemSpec = new EvaluationItemSpec(itemSpec, _data.Expander, elementLocation, itemElement.ContainingProject.DirectoryPath, expandProperties: true); 2938ReferenceEquals(property.Xml.ContainingProject, Xml)) 3159VerifyThrowInvalidOperationNotImported(property.Xml.ContainingProject); 3647VerifyThrowInvalidOperationNotImported(item.Xml.ContainingProject);
Definition\ProjectItem.cs (7)
251bool isImported = !Object.ReferenceEquals(_xml.ContainingProject, _project.Xml); 583Project.VerifyThrowInvalidOperationNotImported(_xml.ContainingProject); 645Project.VerifyThrowInvalidOperationNotImported(_xml.ContainingProject); 695Project.VerifyThrowInvalidOperationNotImported(_xml.ContainingProject); 791Project.VerifyThrowInvalidOperationNotImported(_xml.ContainingProject); 825_xml = _xml.ContainingProject.CreateItemElement(ItemType, ((IItem)this).EvaluatedIncludeEscaped); 862value = BuiltInMetadata.GetMetadataValueEscaped(_project.DirectoryPath, _evaluatedIncludeBeforeWildcardExpansionEscaped, _evaluatedIncludeEscaped, this.Xml.ContainingProject.FullPath, name, ref _fullPath);
Definition\ProjectItemDefinition.cs (1)
165Project.VerifyThrowInvalidOperationNotImported(metadatum.Xml.ContainingProject);
Definition\ProjectMetadata.cs (2)
135Project.VerifyThrowInvalidOperationNotImported(_xml.ContainingProject); 214bool isImported = !Object.ReferenceEquals(_xml.ContainingProject, _parent.Project.Xml);
Definition\ProjectProperty.cs (2)
404Project.VerifyThrowInvalidOperationNotImported(_xml.ContainingProject); 477bool isImported = !Object.ReferenceEquals(_xml.ContainingProject, _project.Xml);
Definition\ResolvedImport.cs (1)
46IsImported = importingElement != null && !ReferenceEquals(project.Xml, importingElement.ContainingProject);
Evaluation\Evaluator.cs (20)
410items.Add(itemFactory.CreateItem(includeSplitFileEscaped, includeSplitEscaped, itemElement.ContainingProject.FullPath)); 1698importElement.ContainingProject.FullPath, 1706ProjectFile = importElement.ContainingProject.FullPath 1813ProjectFile = importElement.ContainingProject.FullPath, 1986importElement.ContainingProject.FullPath, 1992ProjectFile = importElement.ContainingProject.FullPath, 2047importElement.ContainingProject.FullPath, 2053ProjectFile = importElement.ContainingProject.FullPath, 2099string importedBy = importElement.ContainingProject.FullPath ?? String.Empty; 2123if (previouslyImportedAt.ContainingProject != _projectRootElement && importElement.ContainingProject != _projectRootElement) 2142bool explicitlyLoaded = importElement.ContainingProject.IsExplicitlyLoaded; 2188importElement.ContainingProject.FullPath, 2195ProjectFile = importElement.ContainingProject.FullPath 2219importElement.ContainingProject.FullPath, 2225ProjectFile = importElement.ContainingProject.FullPath, 2274importElement.ContainingProject.FullPath, 2280ProjectFile = importElement.ContainingProject.FullPath, 2350string importedBy = importElement.ContainingProject.FullPath; 2452return element.ContainingProject.DirectoryPath;
Evaluation\LazyItemEvaluator.cs (2)
111return element.ContainingProject.DirectoryPath; 135var clonedItem = itemFactory.CreateItem(Item, OriginatingItemElement.ContainingProject.FullPath);
Evaluation\LazyItemEvaluator.IncludeOperation.cs (2)
89itemsToAdd.Add(_itemFactory.CreateItem(value, value, _itemElement.ContainingProject.FullPath)); 132itemsToAdd.Add(_itemFactory.CreateItem(includeSplitFileEscaped, glob, _itemElement.ContainingProject.FullPath));
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (2)
215itemContext.OperationItem.SetMetadata(metadataElement, FileUtilities.MaybeAdjustFilePath(evaluatedValue, metadataElement.ContainingProject.DirectoryPath)); 252evaluatedValue = FileUtilities.MaybeAdjustFilePath(evaluatedValue, metadataElement.ContainingProject.DirectoryPath);
Instance\ProjectInstance.cs (2)
3360item.Xml.ContainingProject.EscapedFullPath, 3419item.Xml.ContainingProject.EscapedFullPath,
Instance\ProjectItemDefinitionInstance.cs (1)
212ProjectItemDefinitionElement element = parent.ContainingProject.CreateItemDefinitionElement(ItemType);
Instance\ProjectItemInstance.cs (1)
679ProjectItemElement item = parent.ContainingProject.CreateItemElement(ItemType);
Instance\ProjectPropertyInstance.cs (1)
308ProjectPropertyElement property = parent.ContainingProject.CreatePropertyElement(Name);
Instance\TaskRegistry.cs (1)
306projectUsingTaskXml.ContainingProject.DirectoryPath,
ObjectModelRemoting\ConstructionObjectLinks\ProjectElementLink.cs (1)
54/// Access to remote <see cref="ProjectElement.ContainingProject"/>.
Microsoft.Build.Engine.OM.UnitTests (87)
Construction\ProjectExtensionsElement_Tests.cs (2)
84Helpers.ClearDirtyFlag(extensions.ContainingProject); 89Assert.True(extensions.ContainingProject.HasUnsavedChanges);
Construction\ProjectMetadataElement_Tests.cs (3)
224Assert.True(metadatum.ContainingProject.HasUnsavedChanges); 234Helpers.ClearDirtyFlag(metadatum.ContainingProject); 238Assert.False(metadatum.ContainingProject.HasUnsavedChanges);
Construction\ProjectOutputElement_Tests.cs (6)
213Helpers.ClearDirtyFlag(output.ContainingProject); 217Assert.True(output.ContainingProject.HasUnsavedChanges); 227Helpers.ClearDirtyFlag(output.ContainingProject); 231Assert.True(output.ContainingProject.HasUnsavedChanges); 254Helpers.ClearDirtyFlag(output.ContainingProject); 258Assert.True(output.ContainingProject.HasUnsavedChanges);
Construction\ProjectPropertyElement_Tests.cs (11)
160Helpers.ClearDirtyFlag(property.ContainingProject); 164Assert.True(property.ContainingProject.HasUnsavedChanges); 176Helpers.ClearDirtyFlag(property.ContainingProject); 180Assert.False(property.ContainingProject.HasUnsavedChanges); 193Assert.True(property.ContainingProject.HasUnsavedChanges); 203Helpers.ClearDirtyFlag(property.ContainingProject); 207Assert.False(property.ContainingProject.HasUnsavedChanges); 230Helpers.ClearDirtyFlag(property.ContainingProject); 234Assert.True(property.ContainingProject.HasUnsavedChanges); 258Helpers.ClearDirtyFlag(property.ContainingProject); 262Assert.True(property.ContainingProject.HasUnsavedChanges);
Construction\ProjectTaskElement_Tests.cs (8)
157Helpers.ClearDirtyFlag(task.ContainingProject); 163Assert.True(task.ContainingProject.HasUnsavedChanges); 225Helpers.ClearDirtyFlag(task.ContainingProject); 231Assert.True(task.ContainingProject.HasUnsavedChanges); 241Helpers.ClearDirtyFlag(task.ContainingProject); 247Assert.True(task.ContainingProject.HasUnsavedChanges); 275Helpers.ClearDirtyFlag(task.ContainingProject); 290Helpers.ClearDirtyFlag(task.ContainingProject);
Construction\ProjectUsingTaskElement_Tests.cs (12)
250Helpers.ClearDirtyFlag(usingTask.ContainingProject); 254Assert.True(usingTask.ContainingProject.HasUnsavedChanges); 264Helpers.ClearDirtyFlag(usingTask.ContainingProject); 268Assert.True(usingTask.ContainingProject.HasUnsavedChanges); 305Helpers.ClearDirtyFlag(usingTask.ContainingProject); 309Assert.True(usingTask.ContainingProject.HasUnsavedChanges); 320Helpers.ClearDirtyFlag(usingTask.ContainingProject); 324Assert.True(usingTask.ContainingProject.HasUnsavedChanges); 335Helpers.ClearDirtyFlag(usingTask.ContainingProject); 339Assert.True(usingTask.ContainingProject.HasUnsavedChanges); 528Assert.Contains("TaskFactory", usingTask.ContainingProject.RawXml); 530Assert.DoesNotContain("TaskFactory", usingTask.ContainingProject.RawXml);
Construction\UsingTaskBodyElement_Tests.cs (6)
78Helpers.ClearDirtyFlag(body.ContainingProject); 82Assert.True(body.ContainingProject.HasUnsavedChanges); 92Helpers.ClearDirtyFlag(body.ContainingProject); 96Assert.True(body.ContainingProject.HasUnsavedChanges); 119Assert.Contains("Evaluate", body.ContainingProject.RawXml); 121Assert.DoesNotContain("Evaluate", body.ContainingProject.RawXml);
Construction\UsingTaskParameterElement_Tests.cs (18)
103Helpers.ClearDirtyFlag(parameter.ContainingProject); 107Assert.True(parameter.ContainingProject.HasUnsavedChanges); 117Helpers.ClearDirtyFlag(parameter.ContainingProject); 121Assert.True(parameter.ContainingProject.HasUnsavedChanges); 131Helpers.ClearDirtyFlag(parameter.ContainingProject); 135Assert.True(parameter.ContainingProject.HasUnsavedChanges); 145Helpers.ClearDirtyFlag(parameter.ContainingProject); 149Assert.True(parameter.ContainingProject.HasUnsavedChanges); 159Helpers.ClearDirtyFlag(parameter.ContainingProject); 163Assert.True(parameter.ContainingProject.HasUnsavedChanges); 173Helpers.ClearDirtyFlag(parameter.ContainingProject); 177Assert.True(parameter.ContainingProject.HasUnsavedChanges); 187Helpers.ClearDirtyFlag(parameter.ContainingProject); 191Assert.True(parameter.ContainingProject.HasUnsavedChanges); 201Helpers.ClearDirtyFlag(parameter.ContainingProject); 205Assert.True(parameter.ContainingProject.HasUnsavedChanges); 215Helpers.ClearDirtyFlag(parameter.ContainingProject); 219Assert.True(parameter.ContainingProject.HasUnsavedChanges);
Construction\WhiteSpacePreservation_Tests.cs (1)
406var newItemElement = itemGroup.ContainingProject.CreateItemElement("i2", "b");
Definition\Project_Tests.cs (14)
2576object.ReferenceEquals(zero, logicalProject[0].ContainingProject).ShouldBeTrue(); 2577object.ReferenceEquals(zero, logicalProject[1].ContainingProject).ShouldBeTrue(); 2578object.ReferenceEquals(one, logicalProject[2].ContainingProject).ShouldBeTrue(); 2579object.ReferenceEquals(one, logicalProject[3].ContainingProject).ShouldBeTrue(); 2580object.ReferenceEquals(three, logicalProject[4].ContainingProject).ShouldBeTrue(); 2581object.ReferenceEquals(three, logicalProject[5].ContainingProject).ShouldBeTrue(); 2582object.ReferenceEquals(two, logicalProject[6].ContainingProject).ShouldBeTrue(); 2583object.ReferenceEquals(two, logicalProject[7].ContainingProject).ShouldBeTrue(); 2622object.ReferenceEquals(zero, logicalProject[0].ContainingProject).ShouldBeTrue(); // PropertyGroup 2623object.ReferenceEquals(zero, logicalProject[1].ContainingProject).ShouldBeTrue(); // p = 0 2624object.ReferenceEquals(one, logicalProject[2].ContainingProject).ShouldBeTrue(); // PropertyGroup 2625object.ReferenceEquals(one, logicalProject[3].ContainingProject).ShouldBeTrue(); // p = 1 2626object.ReferenceEquals(two, logicalProject[4].ContainingProject).ShouldBeTrue(); // PropertyGroup 2627object.ReferenceEquals(two, logicalProject[5].ContainingProject).ShouldBeTrue(); // p = 2
Definition\ProtectImports_Tests.cs (3)
529Assert.Equal(_importFilename, item.Xml.ContainingProject.FullPath); // "Item was not found in the imported project." 620Assert.Equal(_importFilename, property.Xml.ContainingProject.FullPath); // "Property was not found in the imported project." 636Assert.Null(item.Xml.ContainingProject.FullPath); // "Item was not found in the project." // null because XML is in-memory
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (2)
392VerifyNotLinked(realXml.ContainingProject); 393VerifyLinked(viewXml.ContainingProject);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectElementLink.cs (1)
25public MockProjectRootElementLinkRemoter ContainingProject => (MockProjectRootElementLinkRemoter)this.Export(Source.ContainingProject);
Microsoft.Build.Engine.UnitTests (7)
Evaluation\Evaluator_Tests.cs (5)
1011bool circularImportsAreRecorded = project.ImportsIncludingDuplicates.Any(resolvedImport => string.Equals(resolvedImport.ImportingElement.ContainingProject.FullPath, importPath2, StringComparison.OrdinalIgnoreCase)); 1479ProjectRootElement importXml = ProjectRootElement.Open(project.Items.ElementAt(0).Xml.ContainingProject.FullPath); 1480ProjectRootElement predecessorXmlRoot = project.GetProperty("outdir").Predecessor.Xml.ContainingProject; 1850Assert.True(Object.ReferenceEquals(import, predecessor.Xml.ContainingProject)); 1851Assert.True(Object.ReferenceEquals(project.Xml, predecessor.Predecessor.Xml.ContainingProject));
Evaluation\ProjectSdkImplicitImport_Tests.cs (2)
825Assert.NotNull(property?.Xml?.ContainingProject?.FullPath); 827Assert.Equal(expectedContainingProjectPath, property.Xml.ContainingProject.FullPath);