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)
1694itemElement.Parent.RemoveChild(itemElement); 2937property.Xml.Parent?.Parent != null && 3021itemElementToAddBefore.Parent.InsertBeforeChild(itemElement, itemElementToAddBefore); 3158ErrorUtilities.VerifyThrowArgument(property.Xml.Parent != null, "OM_IncorrectObjectAssociation", "ProjectProperty", "Project"); 3161ProjectElementContainer parent = property.Xml.Parent; 3163property.Xml.Parent.RemoveChild(property.Xml); 3167parent.Parent.RemoveChild(parent); 3415itemElement.Parent.RemoveChild(itemElement); 3638if (item.Project == null || item.Xml.Parent == null) 3651ProjectElementContainer parent = item.Xml.Parent; 3653item.Xml.Parent.RemoveChild(item.Xml); 3657parent.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)
1033ProjectTargetInstance 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)
45Assert.Null(project.Parent); 46Assert.Equal(project, target.Parent); 1121updateElement.Parent.RemoveChild(updateElement); 1388Assert.Null(target1.Parent); 1389Assert.Null(target2.Parent); 2234property1.Parent.Condition = "c"; 2516import.Parent.RemoveAllChildren(); 2528import.Parent.RemoveAllChildren(); 2548element.Parent.RemoveAllChildren(); 2559element.Parent.RemoveAllChildren(); 2570element.Parent.RemoveAllChildren(); 2581element.Parent.RemoveAllChildren(); 2592element.Parent.RemoveAllChildren(); 2603element.Parent.RemoveAllChildren(); 2614element.Parent.RemoveAllChildren(); 2625element.Parent.RemoveAllChildren(); 2636element.Parent.RemoveAllChildren(); 2647element.Parent.RemoveAllChildren(); 2660element.Parent.RemoveAllChildren(); 2673element.Parent.RemoveAllChildren(); 2686element.Parent.RemoveAllChildren(); 2699element.Parent.RemoveAllChildren(); 2710element.Parent.RemoveAllChildren(); 2721element.Parent.RemoveAllChildren(); 2732element.Parent.RemoveAllChildren(); 2743element.Parent.RemoveAllChildren(); 2754element.Parent.RemoveAllChildren(); 2765element.Parent.RemoveAllChildren(); 2776element.Parent.RemoveAllChildren(); 2787element.Parent.RemoveAllChildren(); 2798element.Parent.RemoveAllChildren(); 2809element.Parent.RemoveAllChildren(); 2820element.Parent.RemoveAllChildren(); 2831element.Parent.RemoveAllChildren(); 2842element.Parent.RemoveAllChildren(); 2853element.Parent.RemoveAllChildren(); 2864element.Parent.Parent.RemoveAllChildren(); 2875element.Parent.Parent.RemoveAllChildren(); 2895element.Parent.Parent.RemoveAllChildren(); 2906element.Parent.Parent.RemoveAllChildren(); 2917element.Parent.Parent.RemoveAllChildren(); 2928element.Parent.Parent.RemoveAllChildren(); 2939element.Parent.Parent.RemoveAllChildren(); 2950element.Parent.Parent.RemoveAllChildren(); 2963element.Parent.Parent.RemoveAllChildren(); 2976element.Parent.Parent.RemoveAllChildren(); 2989element.Parent.Parent.RemoveAllChildren(); 3002element.Parent.Parent.RemoveAllChildren(); 3013element.Parent.Parent.RemoveAllChildren(); 3024element.Parent.Parent.RemoveAllChildren(); 3035element.Parent.Parent.RemoveAllChildren(); 3046element.Parent.Parent.RemoveAllChildren(); 3057element.Parent.Parent.RemoveAllChildren(); 3068element.Parent.Parent.RemoveAllChildren(); 3079element.Parent.Parent.RemoveAllChildren(); 3090element.Parent.Parent.RemoveAllChildren(); 3101element.Parent.Parent.RemoveAllChildren(); 3185element.Parent.Parent.RemoveAllChildren();
Definition\DefinitionEditing_Tests.cs (19)
1190Assert.True(object.ReferenceEquals(itemGroupElement, item.Xml.Parent)); 1237Assert.True(object.ReferenceEquals(itemElement, metadatumElement1.Parent)); 1284Assert.True(object.ReferenceEquals(itemGroupElement, item.Xml.Parent)); 1285Assert.True(object.ReferenceEquals(itemGroupElement, Helpers.GetFirst(project.GetItems("i")).Xml.Parent)); 1593property.Xml.Parent.RemoveAllChildren(); 1608property.Xml.Parent.Parent.RemoveAllChildren(); 1623metadatum.Xml.Parent.RemoveAllChildren(); 1638item.Xml.Parent.RemoveAllChildren(); 1653item.Xml.Parent.RemoveAllChildren(); 1727metadatum.Xml.Parent.Parent.RemoveAllChildren(); 1742metadatum.Xml.Parent.Parent.Parent.RemoveAllChildren(); 1764project.Xml.ItemGroups.First().Parent.RemoveAllChildren(); 1783property.Xml.Parent.RemoveAllChildren(); 1802property.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);