6 writes to Parent
Microsoft.Build (6)
Construction\ProjectElement.cs (1)
442
Parent
= null;
Construction\ProjectElementContainer.cs (3)
162
child.
Parent
= this;
218
child.
Parent
= this;
654
child.
Parent
= this;
Evaluation\ProjectParser.cs (2)
329
metadatum.
Parent
= item;
746
metadatum.
Parent
= itemDefinition;
174 references to Parent
Microsoft.Build (69)
Construction\ProjectChooseElement.cs (1)
114
parent = parent.
Parent
;
Construction\ProjectElement.cs (6)
89
Parent
?.RemoveFromXml(this);
91
Parent
?.AddToXml(this);
194
ProjectElementContainer currentParent =
Parent
;
198
currentParent = currentParent.
Parent
;
258
return
Parent
.ContainingProject;
488
Parent
?.MarkDirty(reason, param);
Construction\ProjectElementContainer.cs (6)
297
ErrorUtilities.VerifyThrowArgument(child.
Parent
== this, "OM_NodeNotAlreadyParentedByThis");
389
ErrorUtilities.VerifyThrow(child.
Parent
== this, "Expected parent already set");
675
ErrorUtilities.VerifyThrowInvalidOperation(
Parent
!= null || ContainingProject == this, "OM_ParentNotParented");
676
ErrorUtilities.VerifyThrowInvalidOperation(reference == null || reference.
Parent
== this, "OM_ReferenceDoesNotHaveThisParent");
677
ErrorUtilities.VerifyThrowInvalidOperation(child.
Parent
== null, "OM_NodeAlreadyParented");
699
ancestor = ancestor.
Parent
;
Construction\ProjectItemElement.cs (19)
189
ErrorUtilities.VerifyThrowInvalidOperation(
Parent
== null ||
Parent
.
Parent
is ProjectTargetElement ||
Parent
.
Parent
is ProjectRootElement, "OM_NoMatchOnMetadataOutsideTargets");
231
ErrorUtilities.VerifyThrowInvalidOperation(
Parent
== null ||
Parent
.
Parent
is ProjectTargetElement, "OM_NoKeepMetadataOutsideTargets");
252
ErrorUtilities.VerifyThrowInvalidOperation(
Parent
== null ||
Parent
.
Parent
is ProjectTargetElement, "OM_NoRemoveMetadataOutsideTargets");
273
ErrorUtilities.VerifyThrowInvalidOperation(
Parent
== null ||
Parent
.
Parent
is ProjectTargetElement, "OM_NoKeepDuplicatesOutsideTargets");
475
ErrorUtilities.VerifyThrowInvalidOperation(parent.
Parent
is ProjectTargetElement || (Include.Length > 0 || Update.Length > 0 || Remove.Length > 0), "OM_ItemsOutsideTargetMustHaveIncludeOrUpdateOrRemove");
476
ErrorUtilities.VerifyThrowInvalidOperation(parent.
Parent
is ProjectRootElement || parent.
Parent
is ProjectTargetElement || parent.
Parent
is ProjectWhenElement || parent.
Parent
is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectMetadataElement.cs (6)
70
ValidateValidMetadataAsAttributeName(Name,
Parent
?.ElementName ?? "null",
Parent
?.Location);
94
Parent
?.UpdateElementValue(this);
134
ValidateValidMetadataAsAttributeName(newName,
Parent
.ElementName,
Parent
.Location);
144
Parent
.UpdateElementName(this, oldName);
Construction\ProjectTargetElement.cs (1)
283
((ProjectRootElement)
Parent
).ContainsTargetsWithReturnsAttribute = true;
Definition\Project.cs (13)
1694
itemElement.
Parent
.RemoveChild(itemElement);
2937
property.Xml.
Parent
?.
Parent
!= null &&
3021
itemElementToAddBefore.
Parent
.InsertBeforeChild(itemElement, itemElementToAddBefore);
3158
ErrorUtilities.VerifyThrowArgument(property.Xml.
Parent
!= null, "OM_IncorrectObjectAssociation", "ProjectProperty", "Project");
3161
ProjectElementContainer parent = property.Xml.
Parent
;
3163
property.Xml.
Parent
.RemoveChild(property.Xml);
3167
parent.
Parent
.RemoveChild(parent);
3415
itemElement.
Parent
.RemoveChild(itemElement);
3638
if (item.Project == null || item.Xml.
Parent
== null)
3651
ProjectElementContainer parent = item.Xml.
Parent
;
3653
item.Xml.
Parent
.RemoveChild(item.Xml);
3657
parent.
Parent
.RemoveChild(parent);
Definition\ProjectItem.cs (9)
588
ErrorUtilities.VerifyThrowInvalidOperation(_xml.
Parent
?.
Parent
!= null, "OM_ObjectIsNoLongerActive");
646
ErrorUtilities.VerifyThrowInvalidOperation(_xml.
Parent
?.
Parent
!= null, "OM_ObjectIsNoLongerActive");
696
ErrorUtilities.VerifyThrowInvalidOperation(_xml.
Parent
?.
Parent
!= null, "OM_ObjectIsNoLongerActive");
792
ErrorUtilities.VerifyThrowInvalidOperation(_xml.
Parent
?.
Parent
!= null, "OM_ObjectIsNoLongerActive");
827
oldXml.
Parent
.InsertBeforeChild(_xml, oldXml);
Definition\ProjectMetadata.cs (3)
136
ErrorUtilities.VerifyThrowInvalidOperation(_xml.
Parent
?.
Parent
?.
Parent
!= null, "OM_ObjectIsNoLongerActive");
Definition\ProjectProperty.cs (2)
405
ErrorUtilities.VerifyThrowInvalidOperation(_xml.
Parent
?.
Parent
!= null, "OM_ObjectIsNoLongerActive");
Evaluation\Evaluator.cs (1)
1033
ProjectTargetInstance targetInstance = targetElement.TargetInstance ?? ReadNewTargetElement(targetElement, _projectSupportsReturnsAttribute[(ProjectRootElement)targetElement.
Parent
], _evaluationProfiler);
Evaluation\ProjectParser.cs (1)
261
bool 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)
45
Assert.Null(project.
Parent
);
46
Assert.Equal(project, target.
Parent
);
1121
updateElement.
Parent
.RemoveChild(updateElement);
1388
Assert.Null(target1.
Parent
);
1389
Assert.Null(target2.
Parent
);
2234
property1.
Parent
.Condition = "c";
2516
import.
Parent
.RemoveAllChildren();
2528
import.
Parent
.RemoveAllChildren();
2548
element.
Parent
.RemoveAllChildren();
2559
element.
Parent
.RemoveAllChildren();
2570
element.
Parent
.RemoveAllChildren();
2581
element.
Parent
.RemoveAllChildren();
2592
element.
Parent
.RemoveAllChildren();
2603
element.
Parent
.RemoveAllChildren();
2614
element.
Parent
.RemoveAllChildren();
2625
element.
Parent
.RemoveAllChildren();
2636
element.
Parent
.RemoveAllChildren();
2647
element.
Parent
.RemoveAllChildren();
2660
element.
Parent
.RemoveAllChildren();
2673
element.
Parent
.RemoveAllChildren();
2686
element.
Parent
.RemoveAllChildren();
2699
element.
Parent
.RemoveAllChildren();
2710
element.
Parent
.RemoveAllChildren();
2721
element.
Parent
.RemoveAllChildren();
2732
element.
Parent
.RemoveAllChildren();
2743
element.
Parent
.RemoveAllChildren();
2754
element.
Parent
.RemoveAllChildren();
2765
element.
Parent
.RemoveAllChildren();
2776
element.
Parent
.RemoveAllChildren();
2787
element.
Parent
.RemoveAllChildren();
2798
element.
Parent
.RemoveAllChildren();
2809
element.
Parent
.RemoveAllChildren();
2820
element.
Parent
.RemoveAllChildren();
2831
element.
Parent
.RemoveAllChildren();
2842
element.
Parent
.RemoveAllChildren();
2853
element.
Parent
.RemoveAllChildren();
2864
element.
Parent
.
Parent
.RemoveAllChildren();
2875
element.
Parent
.
Parent
.RemoveAllChildren();
2895
element.
Parent
.
Parent
.RemoveAllChildren();
2906
element.
Parent
.
Parent
.RemoveAllChildren();
2917
element.
Parent
.
Parent
.RemoveAllChildren();
2928
element.
Parent
.
Parent
.RemoveAllChildren();
2939
element.
Parent
.
Parent
.RemoveAllChildren();
2950
element.
Parent
.
Parent
.RemoveAllChildren();
2963
element.
Parent
.
Parent
.RemoveAllChildren();
2976
element.
Parent
.
Parent
.RemoveAllChildren();
2989
element.
Parent
.
Parent
.RemoveAllChildren();
3002
element.
Parent
.
Parent
.RemoveAllChildren();
3013
element.
Parent
.
Parent
.RemoveAllChildren();
3024
element.
Parent
.
Parent
.RemoveAllChildren();
3035
element.
Parent
.
Parent
.RemoveAllChildren();
3046
element.
Parent
.
Parent
.RemoveAllChildren();
3057
element.
Parent
.
Parent
.RemoveAllChildren();
3068
element.
Parent
.
Parent
.RemoveAllChildren();
3079
element.
Parent
.
Parent
.RemoveAllChildren();
3090
element.
Parent
.
Parent
.RemoveAllChildren();
3101
element.
Parent
.
Parent
.RemoveAllChildren();
3185
element.
Parent
.
Parent
.RemoveAllChildren();
Definition\DefinitionEditing_Tests.cs (19)
1190
Assert.True(object.ReferenceEquals(itemGroupElement, item.Xml.
Parent
));
1237
Assert.True(object.ReferenceEquals(itemElement, metadatumElement1.
Parent
));
1284
Assert.True(object.ReferenceEquals(itemGroupElement, item.Xml.
Parent
));
1285
Assert.True(object.ReferenceEquals(itemGroupElement, Helpers.GetFirst(project.GetItems("i")).Xml.
Parent
));
1593
property.Xml.
Parent
.RemoveAllChildren();
1608
property.Xml.
Parent
.
Parent
.RemoveAllChildren();
1623
metadatum.Xml.
Parent
.RemoveAllChildren();
1638
item.Xml.
Parent
.RemoveAllChildren();
1653
item.Xml.
Parent
.RemoveAllChildren();
1727
metadatum.Xml.
Parent
.
Parent
.RemoveAllChildren();
1742
metadatum.Xml.
Parent
.
Parent
.
Parent
.RemoveAllChildren();
1764
project.Xml.ItemGroups.First().
Parent
.RemoveAllChildren();
1783
property.Xml.
Parent
.RemoveAllChildren();
1802
property.Xml.
Parent
.
Parent
.RemoveAllChildren();
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (5)
409
VerifyNotLinked(realXml.
Parent
);
410
VerifyLinked(viewXml.
Parent
);
437
Assert.Same(realChild.
Parent
, realXml);
439
if (!object.ReferenceEquals(viewChild.
Parent
, viewXml))
445
Assert.Same(viewChild.
Parent
, viewXml);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectElementLink.cs (1)
23
public MockProjectElementContainerLinkRemoter Parent => (MockProjectElementContainerLinkRemoter)this.Export(Source.
Parent
);