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)
357public ICollection<ProjectTargetElement> Targets => GetChildrenOfType<ProjectTargetElement>(); 1244public ProjectTargetElement AddTarget(string name) 1246ProjectTargetElement target = CreateTargetElement(name); 1441public ProjectTargetElement CreateTargetElement(string name) 1443return 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, 977ProjectTargetElement target = traversalProject.CreateTargetElement(targetName);
Evaluation\Evaluator.cs (16)
101private readonly List<ProjectTargetElement> _targetElements; 253_targetElements = new List<ProjectTargetElement>(); 555private static ProjectTargetInstance ReadNewTargetElement(ProjectTargetElement targetElement, bool parentProjectSupportsReturnsAttribute, EvaluationProfiler evaluationProfiler) 764LinkedList<ProjectTargetElement> activeTargetsByEvaluationOrder = new LinkedList<ProjectTargetElement>(); 765Dictionary<string, LinkedListNode<ProjectTargetElement>> activeTargets = new Dictionary<string, LinkedListNode<ProjectTargetElement>>(StringComparer.OrdinalIgnoreCase); 774var element = _targetElements[i]; 781foreach (ProjectTargetElement target in activeTargetsByEvaluationOrder) 912case ProjectTargetElement target: 1038private void ReadTargetElement(ProjectTargetElement targetElement, LinkedList<ProjectTargetElement> activeTargetsByEvaluationOrder, Dictionary<string, LinkedListNode<ProjectTargetElement>> activeTargets) 1050if (activeTargets.TryGetValue(targetName, out LinkedListNode<ProjectTargetElement> node)) 1062private 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)
31ProjectTargetElement target = project.AddTarget("t"); 56ProjectTargetElement target = project.CreateTargetElement("t"); 77ProjectTargetElement target1 = project.CreateTargetElement("t"); 78ProjectTargetElement target2 = project.CreateTargetElement("t2"); 108ProjectTargetElement target = project1.CreateTargetElement("t"); 122ProjectTargetElement target = project1.CreateTargetElement("t"); 136ProjectTargetElement target1 = project1.CreateTargetElement("t"); 137ProjectTargetElement target2 = project2.AddTarget("t2"); 151ProjectTargetElement target1 = project1.CreateTargetElement("t"); 152ProjectTargetElement target2 = project2.AddTarget("t2"); 248ProjectTargetElement target = project.AddTarget("t"); 262ProjectTargetElement target = project.AddTarget("t"); 276ProjectTargetElement target1 = project.AddTarget("t"); 277ProjectTargetElement target2 = project.AddTarget("t2"); 291ProjectTargetElement target1 = project.AddTarget("t"); 292ProjectTargetElement target2 = project.AddTarget("t2"); 306ProjectTargetElement target = project.CreateTargetElement("t"); 321ProjectTargetElement target = project.CreateTargetElement("t"); 336ProjectTargetElement target = project.CreateTargetElement("t"); 352ProjectTargetElement target = project.CreateTargetElement("t"); 366ProjectTargetElement target = project.CreateTargetElement("t"); 390ProjectTargetElement target = project.CreateTargetElement("t"); 438ProjectTargetElement target = project.CreateTargetElement("t"); 467ProjectTargetElement target = project.CreateTargetElement("t"); 490ProjectTargetElement target = project.CreateTargetElement("t"); 512ProjectTargetElement target1 = project.CreateTargetElement("t"); 513ProjectTargetElement target2 = project.CreateTargetElement("t2"); 543ProjectTargetElement target1 = project.CreateTargetElement("t"); 564ProjectTargetElement target = project.CreateTargetElement("t"); 585ProjectTargetElement target = project.CreateTargetElement("t"); 609ProjectTargetElement target = project.AddTarget("t"); 632ProjectTargetElement target = project.CreateTargetElement("t"); 646ProjectTargetElement target = project.CreateTargetElement("t"); 676ProjectTargetElement target = project.CreateTargetElement("t"); 703ProjectTargetElement target = project.CreateTargetElement("t"); 1173ProjectTargetElement target = project.AddTarget("t"); 1194ProjectTargetElement target = project.CreateTargetElement("t"); 1207ProjectTargetElement target = project1.CreateTargetElement("t"); 1333ProjectTargetElement target1 = project.AddTarget("t1"); 1334ProjectTargetElement target2 = project.AddTarget("t2"); 1357ProjectTargetElement target1 = project.AddTarget("t1"); 1358ProjectTargetElement target2 = project.AddTarget("t2"); 1381ProjectTargetElement target1 = project.AddTarget("t1"); 1382ProjectTargetElement target2 = project.AddTarget("t2"); 1398ProjectTargetElement target1 = project.AddTarget("t1"); 1412ProjectTargetElement target1 = project.AddTarget("t1"); 1413ProjectTargetElement target2 = project.AddTarget("t2"); 1438ProjectTargetElement target1 = project.AddTarget("t1"); 1461ProjectTargetElement target1 = project.AddTarget("t1"); 1483ProjectTargetElement target1 = project.AddTarget("t1"); 1503ProjectTargetElement target1 = project.AddTarget("t1"); 1551ProjectTargetElement target1 = project.AddTarget("t1"); 1552ProjectTargetElement target2 = project.AddTarget("t2"); 2708var element = ProjectRootElement.Create().AddTarget("t"); 2719var element = ProjectRootElement.Create().AddTarget("t"); 2730var element = ProjectRootElement.Create().AddTarget("t"); 2741var 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)
1167var target = pre.AddTarget("SomeTarget");
Construction\ProjectTargetElement_Tests.cs (20)
60ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 72ProjectTargetElement target = GetTargetXml(); 86ProjectTargetElement target = GetTargetXml(); 107ProjectTargetElement target = GetTargetXml(); 119ProjectTargetElement target = GetTargetXml(); 131ProjectTargetElement target = GetTargetXml(); 143ProjectTargetElement target = GetTargetXml(); 153ProjectTargetElement target = GetTargetXml(); 199ProjectTargetElement target = GetTargetXml(); 219ProjectTargetElement target = project.AddTarget("t"); 235ProjectTargetElement target = project.AddTarget("t"); 251ProjectTargetElement target = project.AddTarget("t"); 267ProjectTargetElement target = project.AddTarget("t"); 283ProjectTargetElement target = project.AddTarget("t"); 299ProjectTargetElement target = project.AddTarget("t"); 316ProjectTargetElement target = project.AddTarget("t"); 371private static ProjectTargetElement GetTargetXml() 384ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children);
Construction\ProjectTaskElement_Tests.cs (2)
302ProjectTargetElement 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)
3642ProjectTargetElement buildTarget = rootProject.AddTarget("Build");
ConsoleLogger_Tests.cs (1)
146ProjectTargetElement target = project.Xml.AddTarget("T");
Construction\SolutionProjectGenerator_Tests.cs (1)
332ProjectTargetElement target = projectXml.AddTarget("Build");
Evaluation\Evaluator_Tests.cs (6)
1374ProjectTargetElement target0 = main.AddTarget("t0"); 1379ProjectTargetElement target1 = import1.AddTarget("t1"); 1384ProjectTargetElement target2 = import2.AddTarget("t2"); 1389ProjectTargetElement target3 = import3.AddTarget("t3"); 5194private void AddPropertyDumpTasks(string prefix, ProjectTargetElement target) 5210ProjectTargetElement target = import.AddTarget(targetName);