6 writes to Parent
Microsoft.Build (6)
Construction\ProjectElement.cs (1)
442Parent = null;
Construction\ProjectElementContainer.cs (3)
162child.Parent = this; 218child.Parent = this; 654child.Parent = this;
Evaluation\ProjectParser.cs (2)
329metadatum.Parent = item; 746metadatum.Parent = itemDefinition;
174 references to Parent
Microsoft.Build (69)
Construction\ProjectChooseElement.cs (1)
114parent = parent.Parent;
Construction\ProjectElement.cs (6)
89Parent?.RemoveFromXml(this); 91Parent?.AddToXml(this); 194ProjectElementContainer currentParent = Parent; 198currentParent = currentParent.Parent; 258return Parent.ContainingProject; 488Parent?.MarkDirty(reason, param);
Construction\ProjectElementContainer.cs (6)
297ErrorUtilities.VerifyThrowArgument(child.Parent == this, "OM_NodeNotAlreadyParentedByThis"); 389ErrorUtilities.VerifyThrow(child.Parent == this, "Expected parent already set"); 675ErrorUtilities.VerifyThrowInvalidOperation(Parent != null || ContainingProject == this, "OM_ParentNotParented"); 676ErrorUtilities.VerifyThrowInvalidOperation(reference == null || reference.Parent == this, "OM_ReferenceDoesNotHaveThisParent"); 677ErrorUtilities.VerifyThrowInvalidOperation(child.Parent == null, "OM_NodeAlreadyParented"); 699ancestor = ancestor.Parent;
Construction\ProjectItemElement.cs (19)
189ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is ProjectTargetElement || Parent.Parent is ProjectRootElement, "OM_NoMatchOnMetadataOutsideTargets"); 231ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is ProjectTargetElement, "OM_NoKeepMetadataOutsideTargets"); 252ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is ProjectTargetElement, "OM_NoRemoveMetadataOutsideTargets"); 273ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is ProjectTargetElement, "OM_NoKeepDuplicatesOutsideTargets"); 475ErrorUtilities.VerifyThrowInvalidOperation(parent.Parent is ProjectTargetElement || (Include.Length > 0 || Update.Length > 0 || Remove.Length > 0), "OM_ItemsOutsideTargetMustHaveIncludeOrUpdateOrRemove"); 476ErrorUtilities.VerifyThrowInvalidOperation(parent.Parent is ProjectRootElement || parent.Parent is ProjectTargetElement || parent.Parent is ProjectWhenElement || parent.Parent is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectMetadataElement.cs (6)
70ValidateValidMetadataAsAttributeName(Name, Parent?.ElementName ?? "null", Parent?.Location); 94Parent?.UpdateElementValue(this); 134ValidateValidMetadataAsAttributeName(newName, Parent.ElementName, Parent.Location); 144Parent.UpdateElementName(this, oldName);
Construction\ProjectTargetElement.cs (1)
283((ProjectRootElement)Parent).ContainsTargetsWithReturnsAttribute = true;
Definition\Project.cs (13)
1700itemElement.Parent.RemoveChild(itemElement); 2943property.Xml.Parent?.Parent != null && 3027itemElementToAddBefore.Parent.InsertBeforeChild(itemElement, itemElementToAddBefore); 3164ErrorUtilities.VerifyThrowArgument(property.Xml.Parent != null, "OM_IncorrectObjectAssociation", "ProjectProperty", "Project"); 3167ProjectElementContainer parent = property.Xml.Parent; 3169property.Xml.Parent.RemoveChild(property.Xml); 3173parent.Parent.RemoveChild(parent); 3421itemElement.Parent.RemoveChild(itemElement); 3644if (item.Project == null || item.Xml.Parent == null) 3657ProjectElementContainer parent = item.Xml.Parent; 3659item.Xml.Parent.RemoveChild(item.Xml); 3663parent.Parent.RemoveChild(parent);
Definition\ProjectItem.cs (9)
588ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive"); 646ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive"); 696ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive"); 792ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive"); 827oldXml.Parent.InsertBeforeChild(_xml, oldXml);
Definition\ProjectMetadata.cs (3)
136ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent?.Parent != null, "OM_ObjectIsNoLongerActive");
Definition\ProjectProperty.cs (2)
405ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive");
Evaluation\Evaluator.cs (1)
1041ProjectTargetInstance targetInstance = targetElement.TargetInstance ?? ReadNewTargetElement(targetElement, _projectSupportsReturnsAttribute[(ProjectRootElement)targetElement.Parent], _evaluationProfiler);
Evaluation\ProjectParser.cs (1)
261bool belowTarget = parent.Parent is ProjectTargetElement;
ObjectModelRemoting\ConstructionObjectLinks\ProjectElementLink.cs (1)
49/// Access to remote <see cref="ProjectElement.Parent"/>.
Microsoft.Build.Engine.OM.UnitTests (105)
Construction\ConstructionEditing_Tests.cs (80)
44Assert.Null(project.Parent); 45Assert.Equal(project, target.Parent); 1120updateElement.Parent.RemoveChild(updateElement); 1387Assert.Null(target1.Parent); 1388Assert.Null(target2.Parent); 2233property1.Parent.Condition = "c"; 2515import.Parent.RemoveAllChildren(); 2527import.Parent.RemoveAllChildren(); 2547element.Parent.RemoveAllChildren(); 2558element.Parent.RemoveAllChildren(); 2569element.Parent.RemoveAllChildren(); 2580element.Parent.RemoveAllChildren(); 2591element.Parent.RemoveAllChildren(); 2602element.Parent.RemoveAllChildren(); 2613element.Parent.RemoveAllChildren(); 2624element.Parent.RemoveAllChildren(); 2635element.Parent.RemoveAllChildren(); 2646element.Parent.RemoveAllChildren(); 2659element.Parent.RemoveAllChildren(); 2672element.Parent.RemoveAllChildren(); 2685element.Parent.RemoveAllChildren(); 2698element.Parent.RemoveAllChildren(); 2709element.Parent.RemoveAllChildren(); 2720element.Parent.RemoveAllChildren(); 2731element.Parent.RemoveAllChildren(); 2742element.Parent.RemoveAllChildren(); 2753element.Parent.RemoveAllChildren(); 2764element.Parent.RemoveAllChildren(); 2775element.Parent.RemoveAllChildren(); 2786element.Parent.RemoveAllChildren(); 2797element.Parent.RemoveAllChildren(); 2808element.Parent.RemoveAllChildren(); 2819element.Parent.RemoveAllChildren(); 2830element.Parent.RemoveAllChildren(); 2841element.Parent.RemoveAllChildren(); 2852element.Parent.RemoveAllChildren(); 2863element.Parent.Parent.RemoveAllChildren(); 2874element.Parent.Parent.RemoveAllChildren(); 2894element.Parent.Parent.RemoveAllChildren(); 2905element.Parent.Parent.RemoveAllChildren(); 2916element.Parent.Parent.RemoveAllChildren(); 2927element.Parent.Parent.RemoveAllChildren(); 2938element.Parent.Parent.RemoveAllChildren(); 2949element.Parent.Parent.RemoveAllChildren(); 2962element.Parent.Parent.RemoveAllChildren(); 2975element.Parent.Parent.RemoveAllChildren(); 2988element.Parent.Parent.RemoveAllChildren(); 3001element.Parent.Parent.RemoveAllChildren(); 3012element.Parent.Parent.RemoveAllChildren(); 3023element.Parent.Parent.RemoveAllChildren(); 3034element.Parent.Parent.RemoveAllChildren(); 3045element.Parent.Parent.RemoveAllChildren(); 3056element.Parent.Parent.RemoveAllChildren(); 3067element.Parent.Parent.RemoveAllChildren(); 3078element.Parent.Parent.RemoveAllChildren(); 3089element.Parent.Parent.RemoveAllChildren(); 3100element.Parent.Parent.RemoveAllChildren(); 3184element.Parent.Parent.RemoveAllChildren();
Definition\DefinitionEditing_Tests.cs (19)
1188Assert.True(object.ReferenceEquals(itemGroupElement, item.Xml.Parent)); 1235Assert.True(object.ReferenceEquals(itemElement, metadatumElement1.Parent)); 1282Assert.True(object.ReferenceEquals(itemGroupElement, item.Xml.Parent)); 1283Assert.True(object.ReferenceEquals(itemGroupElement, Helpers.GetFirst(project.GetItems("i")).Xml.Parent)); 1591property.Xml.Parent.RemoveAllChildren(); 1606property.Xml.Parent.Parent.RemoveAllChildren(); 1621metadatum.Xml.Parent.RemoveAllChildren(); 1636item.Xml.Parent.RemoveAllChildren(); 1651item.Xml.Parent.RemoveAllChildren(); 1725metadatum.Xml.Parent.Parent.RemoveAllChildren(); 1740metadatum.Xml.Parent.Parent.Parent.RemoveAllChildren(); 1762project.Xml.ItemGroups.First().Parent.RemoveAllChildren(); 1781property.Xml.Parent.RemoveAllChildren(); 1800property.Xml.Parent.Parent.RemoveAllChildren();
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (5)
409VerifyNotLinked(realXml.Parent); 410VerifyLinked(viewXml.Parent); 437Assert.Same(realChild.Parent, realXml); 439if (!object.ReferenceEquals(viewChild.Parent, viewXml)) 445Assert.Same(viewChild.Parent, viewXml);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectElementLink.cs (1)
23public MockProjectElementContainerLinkRemoter Parent => (MockProjectElementContainerLinkRemoter)this.Export(Source.Parent);