6 writes to Parent
Microsoft.Build (6)
Construction\ProjectElement.cs (1)
442Parent = null;
Construction\ProjectElementContainer.cs (3)
162child.Parent = this; 218child.Parent = this; 663child.Parent = this;
Evaluation\ProjectParser.cs (2)
329metadatum.Parent = item; 746metadatum.Parent = itemDefinition;
72 references to Parent
dotnet (2)
MsbuildProject.cs (2)
224ProjectElementContainer itemGroup = existingItem.Parent; 228itemGroup.Parent.RemoveChild(itemGroup);
Microsoft.Build (69)
Construction\ProjectChooseElement.cs (1)
109parent = 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"); 389Assumed.Equal(child.Parent, this, "Expected parent already set"); 684ErrorUtilities.VerifyThrowInvalidOperation(Parent != null || ContainingProject == this, "OM_ParentNotParented"); 685ErrorUtilities.VerifyThrowInvalidOperation(reference == null || reference.Parent == this, "OM_ReferenceDoesNotHaveThisParent"); 686ErrorUtilities.VerifyThrowInvalidOperation(child.Parent == null, "OM_NodeAlreadyParented"); 708ancestor = 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"); 480ErrorUtilities.VerifyThrowInvalidOperation(parent.Parent is ProjectTargetElement || (Include.Length > 0 || Update.Length > 0 || Remove.Length > 0), "OM_ItemsOutsideTargetMustHaveIncludeOrUpdateOrRemove"); 481ErrorUtilities.VerifyThrowInvalidOperation(parent.Parent is ProjectRootElement || parent.Parent is ProjectTargetElement || parent.Parent is ProjectWhenElement || parent.Parent is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectMetadataElement.cs (6)
72ValidateValidMetadataAsAttributeName(Name, Parent?.ElementName ?? "null", Parent?.Location); 96Parent?.UpdateElementValue(this); 136ValidateValidMetadataAsAttributeName(newName, Parent.ElementName, Parent.Location); 146Parent.UpdateElementName(this, oldName);
Construction\ProjectTargetElement.cs (1)
283((ProjectRootElement)Parent).ContainsTargetsWithReturnsAttribute = true;
Definition\Project.cs (13)
1700itemElement.Parent.RemoveChild(itemElement); 2946property.Xml.Parent?.Parent != null && 3030itemElementToAddBefore.Parent.InsertBeforeChild(itemElement, itemElementToAddBefore); 3167ErrorUtilities.VerifyThrowArgument(property.Xml.Parent != null, "OM_IncorrectObjectAssociation", "ProjectProperty", "Project"); 3170ProjectElementContainer parent = property.Xml.Parent; 3172property.Xml.Parent.RemoveChild(property.Xml); 3176parent.Parent.RemoveChild(parent); 3424itemElement.Parent.RemoveChild(itemElement); 3647if (item.Project == null || item.Xml.Parent == null) 3660ProjectElementContainer parent = item.Xml.Parent; 3662item.Xml.Parent.RemoveChild(item.Xml); 3666parent.Parent.RemoveChild(parent);
Definition\ProjectItem.cs (9)
583ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive"); 641ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive"); 691ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive"); 787ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive"); 822oldXml.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)
1046ProjectTargetInstance 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"/>.
NuGet.CommandLine.XPlat (1)
Utility\MSBuildAPIUtility.cs (1)
514.Select(item => item.Xml.Parent as ProjectItemGroupElement)