3 instantiations of ProjectTargetElement
Microsoft.Build (3)
Construction\ProjectTargetElement.cs (1)
408return new ProjectTargetElement(element, containingProject) { Name = name };
Evaluation\ProjectParser.cs (1)
586ProjectTargetElement target = new ProjectTargetElement(element, _project, _project);
ObjectModelRemoting\LinkedObjectFactory.cs (1)
208return new ProjectTargetElement(link);
174 references to ProjectTargetElement
Microsoft.Build (48)
Construction\ProjectItemElement.cs (6)
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\ProjectItemGroupElement.cs (1)
177ErrorUtilities.VerifyThrowInvalidOperation(parent is ProjectRootElement || parent is ProjectTargetElement || parent is ProjectWhenElement || parent is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectOnErrorElement.cs (2)
29internal ProjectOnErrorElement(XmlElementWithLocation xmlElement, ProjectTargetElement parent, ProjectRootElement project) 89ErrorUtilities.VerifyThrowInvalidOperation(parent is ProjectTargetElement, "OM_CannotAcceptParent");
Construction\ProjectPropertyGroupElement.cs (1)
110ErrorUtilities.VerifyThrowInvalidOperation(parent is ProjectRootElement || parent is ProjectTargetElement || parent is ProjectWhenElement || parent is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectRootElement.cs (6)
339public ICollection<ProjectTargetElement> Targets => GetChildrenOfType<ProjectTargetElement>(); 1214public ProjectTargetElement AddTarget(string name) 1216ProjectTargetElement target = CreateTargetElement(name); 1411public ProjectTargetElement CreateTargetElement(string name) 1413return Link != null ? RootLink.CreateTargetElement(name) : ProjectTargetElement.CreateDisconnected(name, this);
Construction\ProjectTargetElement.cs (1)
404internal static ProjectTargetElement CreateDisconnected(string name, ProjectRootElement containingProject)
Construction\ProjectTaskElement.cs (2)
46internal ProjectTaskElement(XmlElementWithLocation xmlElement, ProjectTargetElement parent, ProjectRootElement containingProject) 427ErrorUtilities.VerifyThrowInvalidOperation(parent is ProjectTargetElement, "OM_CannotAcceptParent");
Construction\Solution\SolutionProjectGenerator.cs (2)
320ProjectTargetElement target, 985ProjectTargetElement target = traversalProject.CreateTargetElement(targetName);
Evaluation\Evaluator.cs (16)
102private readonly List<ProjectTargetElement> _targetElements; 248_targetElements = new List<ProjectTargetElement>(); 547private static ProjectTargetInstance ReadNewTargetElement(ProjectTargetElement targetElement, bool parentProjectSupportsReturnsAttribute, EvaluationProfiler evaluationProfiler) 756LinkedList<ProjectTargetElement> activeTargetsByEvaluationOrder = new LinkedList<ProjectTargetElement>(); 757Dictionary<string, LinkedListNode<ProjectTargetElement>> activeTargets = new Dictionary<string, LinkedListNode<ProjectTargetElement>>(StringComparer.OrdinalIgnoreCase); 766var element = _targetElements[i]; 773foreach (ProjectTargetElement target in activeTargetsByEvaluationOrder) 904case ProjectTargetElement target: 1030private void ReadTargetElement(ProjectTargetElement targetElement, LinkedList<ProjectTargetElement> activeTargetsByEvaluationOrder, Dictionary<string, LinkedListNode<ProjectTargetElement>> activeTargets) 1042if (activeTargets.TryGetValue(targetName, out LinkedListNode<ProjectTargetElement> node)) 1054private void AddBeforeAndAfterTargetMappings(ProjectTargetElement targetElement, Dictionary<string, LinkedListNode<ProjectTargetElement>> activeTargets, Dictionary<string, List<TargetSpecification>> targetsWhichRunBeforeByTarget, Dictionary<string, List<TargetSpecification>> targetsWhichRunAfterByTarget)
Evaluation\ProjectParser.cs (4)
261bool belowTarget = parent.Parent is ProjectTargetElement; 572private ProjectTargetElement ParseProjectTargetElement(XmlElementWithLocation element) 586ProjectTargetElement target = new ProjectTargetElement(element, _project, _project); 651private ProjectTaskElement ParseProjectTaskElement(XmlElementWithLocation element, ProjectTargetElement parent)
Instance\ProjectTargetInstance.cs (2)
468internal ProjectTargetElement ToProjectTargetElement(ProjectRootElement rootElement) 470ProjectTargetElement target = rootElement.CreateTargetElement(Name);
ObjectModelRemoting\ConstructionObjectLinks\ProjectRootElementLink.cs (1)
153public abstract ProjectTargetElement CreateTargetElement(string name);
ObjectModelRemoting\ConstructionObjectLinks\ProjectTargetElementLink.cs (3)
12/// Allow for creating a local representation to external object of type <see cref="ProjectTargetElement"/> 17/// Access to remote <see cref="ProjectTargetElement.Name"/>. 22/// Access to remote <see cref="ProjectTargetElement.Returns"/>.
ObjectModelRemoting\LinkedObjectFactory.cs (1)
206public ProjectTargetElement Create(ProjectTargetElementLink link)
Microsoft.Build.Engine.OM.UnitTests (117)
Construction\ConstructionEditing_Tests.cs (57)
32ProjectTargetElement target = project.AddTarget("t"); 57ProjectTargetElement target = project.CreateTargetElement("t"); 78ProjectTargetElement target1 = project.CreateTargetElement("t"); 79ProjectTargetElement target2 = project.CreateTargetElement("t2"); 109ProjectTargetElement target = project1.CreateTargetElement("t"); 123ProjectTargetElement target = project1.CreateTargetElement("t"); 137ProjectTargetElement target1 = project1.CreateTargetElement("t"); 138ProjectTargetElement target2 = project2.AddTarget("t2"); 152ProjectTargetElement target1 = project1.CreateTargetElement("t"); 153ProjectTargetElement target2 = project2.AddTarget("t2"); 249ProjectTargetElement target = project.AddTarget("t"); 263ProjectTargetElement target = project.AddTarget("t"); 277ProjectTargetElement target1 = project.AddTarget("t"); 278ProjectTargetElement target2 = project.AddTarget("t2"); 292ProjectTargetElement target1 = project.AddTarget("t"); 293ProjectTargetElement target2 = project.AddTarget("t2"); 307ProjectTargetElement target = project.CreateTargetElement("t"); 322ProjectTargetElement target = project.CreateTargetElement("t"); 337ProjectTargetElement target = project.CreateTargetElement("t"); 353ProjectTargetElement target = project.CreateTargetElement("t"); 367ProjectTargetElement target = project.CreateTargetElement("t"); 391ProjectTargetElement target = project.CreateTargetElement("t"); 439ProjectTargetElement target = project.CreateTargetElement("t"); 468ProjectTargetElement target = project.CreateTargetElement("t"); 491ProjectTargetElement target = project.CreateTargetElement("t"); 513ProjectTargetElement target1 = project.CreateTargetElement("t"); 514ProjectTargetElement target2 = project.CreateTargetElement("t2"); 544ProjectTargetElement target1 = project.CreateTargetElement("t"); 565ProjectTargetElement target = project.CreateTargetElement("t"); 586ProjectTargetElement target = project.CreateTargetElement("t"); 610ProjectTargetElement target = project.AddTarget("t"); 633ProjectTargetElement target = project.CreateTargetElement("t"); 647ProjectTargetElement target = project.CreateTargetElement("t"); 677ProjectTargetElement target = project.CreateTargetElement("t"); 704ProjectTargetElement target = project.CreateTargetElement("t"); 1174ProjectTargetElement target = project.AddTarget("t"); 1195ProjectTargetElement target = project.CreateTargetElement("t"); 1208ProjectTargetElement target = project1.CreateTargetElement("t"); 1334ProjectTargetElement target1 = project.AddTarget("t1"); 1335ProjectTargetElement target2 = project.AddTarget("t2"); 1358ProjectTargetElement target1 = project.AddTarget("t1"); 1359ProjectTargetElement target2 = project.AddTarget("t2"); 1382ProjectTargetElement target1 = project.AddTarget("t1"); 1383ProjectTargetElement target2 = project.AddTarget("t2"); 1399ProjectTargetElement target1 = project.AddTarget("t1"); 1413ProjectTargetElement target1 = project.AddTarget("t1"); 1414ProjectTargetElement target2 = project.AddTarget("t2"); 1439ProjectTargetElement target1 = project.AddTarget("t1"); 1462ProjectTargetElement target1 = project.AddTarget("t1"); 1484ProjectTargetElement target1 = project.AddTarget("t1"); 1504ProjectTargetElement target1 = project.AddTarget("t1"); 1552ProjectTargetElement target1 = project.AddTarget("t1"); 1553ProjectTargetElement target2 = project.AddTarget("t2"); 2709var element = ProjectRootElement.Create().AddTarget("t"); 2720var element = ProjectRootElement.Create().AddTarget("t"); 2731var element = ProjectRootElement.Create().AddTarget("t"); 2742var element = ProjectRootElement.Create().AddTarget("t");
Construction\ElementLocationPublic_Tests.cs (3)
31ProjectTargetElement target = project.CreateTargetElement("t"); 48ProjectTargetElement target = project.CreateTargetElement("t"); 69ProjectTargetElement target = project.CreateTargetElement("t");
Construction\ProjectOnErrorElement_Tests.cs (10)
51ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 81ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 107ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 259ProjectTargetElement target = project.AddTarget("t"); 277ProjectTargetElement target = project.AddTarget("t"); 303ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children);
Construction\ProjectOutputElement_Tests.cs (4)
292ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 315ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children);
Construction\ProjectRootElement_Tests.cs (1)
1171var target = pre.AddTarget("SomeTarget");
Construction\ProjectTargetElement_Tests.cs (20)
61ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 73ProjectTargetElement target = GetTargetXml(); 87ProjectTargetElement target = GetTargetXml(); 108ProjectTargetElement target = GetTargetXml(); 120ProjectTargetElement target = GetTargetXml(); 132ProjectTargetElement target = GetTargetXml(); 144ProjectTargetElement target = GetTargetXml(); 154ProjectTargetElement target = GetTargetXml(); 200ProjectTargetElement target = GetTargetXml(); 220ProjectTargetElement target = project.AddTarget("t"); 236ProjectTargetElement target = project.AddTarget("t"); 252ProjectTargetElement target = project.AddTarget("t"); 268ProjectTargetElement target = project.AddTarget("t"); 284ProjectTargetElement target = project.AddTarget("t"); 300ProjectTargetElement target = project.AddTarget("t"); 317ProjectTargetElement target = project.AddTarget("t"); 372private static ProjectTargetElement GetTargetXml() 385ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children);
Construction\ProjectTaskElement_Tests.cs (2)
304ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (2)
791public static void Verify(ProjectTargetElement viewXml, ProjectTargetElement realXml, ValidationContext context = null)
ObjectModelRemoting\Helpers\ViewValidation.cs (1)
184if (VerifyCheckType<ProjectTargetElement>(view, real, context, Verify))
ObjectModelRemoting\LinkedConstructionModify_Tests.cs (12)
97xmlPair.Add2NewChildrenWithVerify<ProjectTargetElement>("NewTarget", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n), out var newTarget1, out var newTarget2); 121xmlPair.CreateWithVerify<ProjectTargetElement>((p) => p.CreateTargetElement("target")); 148var newTarget1 = xmlPair.AddNewChaildWithVerify<ProjectTargetElement>(ObjectType.View, NewTargetName, (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n)); 182Assert.Empty(xmlPair.QueryChildrenWithValidation<ProjectTargetElement>((t) => string.Equals(t.Name, NewTargetName))); 183newTarget1.VerifySame(xmlPair.QuerySingleChildrenWithValidation<ProjectTargetElement>((t) => string.Equals(t.Name, NewTargetRenamed))); 186Assert.Empty(xmlPair.QueryChildrenWithValidation<ProjectTargetElement>((t) => string.Equals(t.Name, NewTargetRenamed))); 187Assert.Empty(xmlPair.QueryChildrenWithValidation<ProjectTargetElement>((t) => string.Equals(t.Name, NewTargetName))); 189newTarget1.VerifySame(xmlPair.QuerySingleChildrenWithValidation<ProjectTargetElement>((t) => string.Equals(t.Name, NewTargetRenamed.Ver(2)))); 223var newTarget = xmlPair.AddNewChaildWithVerify<ProjectTargetElement>(ObjectType.View, "TargetToTestTask", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n)); 319var newTarget = xmlPair.AddNewChaildWithVerify<ProjectTargetElement>(ObjectType.View, "TargetToTestTask", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n)); 642var target = xmlPair.AddNewChaildWithVerify<ProjectTargetElement>(ObjectType.View, "NewTarget", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n)); 777var newTarget = xmlPair.AddNewChaildWithVerify<ProjectTargetElement>(ObjectType.View, "TargetToTestTask", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n));
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectRootElementLink.cs (2)
286public override ProjectTargetElement CreateTargetElement(string name) 288return (ProjectTargetElement)this.Proxy.CreateTargetElement(name).Import(this.Linker);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectTargetElementLink.cs (2)
14public ProjectTargetElement TargetXml => (ProjectTargetElement)Source;
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\ProjectElemetExportHelper.cs (1)
66ElementInfo.New<ProjectTargetElement , MockProjectTargetElementLinkRemoter>(),
Microsoft.Build.Engine.UnitTests (9)
BackEnd\BuildManager_Tests.cs (1)
3643ProjectTargetElement buildTarget = rootProject.AddTarget("Build");
ConsoleLogger_Tests.cs (1)
148ProjectTargetElement target = project.Xml.AddTarget("T");
Construction\SolutionProjectGenerator_Tests.cs (1)
303ProjectTargetElement target = projectXml.AddTarget("Build");
Evaluation\Evaluator_Tests.cs (6)
1339ProjectTargetElement target0 = main.AddTarget("t0"); 1344ProjectTargetElement target1 = import1.AddTarget("t1"); 1349ProjectTargetElement target2 = import2.AddTarget("t2"); 1354ProjectTargetElement target3 = import3.AddTarget("t3"); 5159private void AddPropertyDumpTasks(string prefix, ProjectTargetElement target) 5175ProjectTargetElement target = import.AddTarget(targetName);