3 instantiations of ProjectMetadataElement
Microsoft.Build (3)
Construction\ProjectMetadataElement.cs (1)
111return new ProjectMetadataElement(element, containingProject);
Evaluation\ProjectParser.cs (1)
403ProjectMetadataElement metadatum = new ProjectMetadataElement(element, parent, _project);
ObjectModelRemoting\LinkedObjectFactory.cs (1)
175return new ProjectMetadataElement(link);
160 references to ProjectMetadataElement
Microsoft.Build (76)
Construction\ProjectItemDefinitionElement.cs (8)
53public ICollection<ProjectMetadataElement> Metadata => GetChildrenOfType<ProjectMetadataElement>(); 59public ProjectMetadataElement AddMetadata(string name, string unevaluatedValue) 73public ProjectMetadataElement AddMetadata(string name, string unevaluatedValue, bool expressAsAttribute) 80ProjectMetadataElement.ValidateValidMetadataAsAttributeName(name, ElementName, Location); 83ProjectMetadataElement metadata = ContainingProject.CreateMetadataElement(name); 127protected override bool ShouldCloneXmlAttribute(XmlAttribute attribute) => !ProjectMetadataElement.AttributeNameIsValidMetadataName(attribute.LocalName); 129internal override bool ShouldCloneXmlAttribute(XmlAttributeLink attributeLink) => !ProjectMetadataElement.AttributeNameIsValidMetadataName(attributeLink.LocalName);
Construction\ProjectItemElement.cs (8)
286public ICollection<ProjectMetadataElement> Metadata => GetChildrenOfType<ProjectMetadataElement>(); 376public ProjectMetadataElement AddMetadata(string name, string unevaluatedValue) 390public ProjectMetadataElement AddMetadata(string name, string unevaluatedValue, bool expressAsAttribute) 397ProjectMetadataElement.ValidateValidMetadataAsAttributeName(name, ElementName, Location); 400ProjectMetadataElement metadata = ContainingProject.CreateMetadataElement(name); 506protected override bool ShouldCloneXmlAttribute(XmlAttribute attribute) => !ProjectMetadataElement.AttributeNameIsValidMetadataName(attribute.LocalName); 508internal override bool ShouldCloneXmlAttribute(XmlAttributeLink attributeLink) => !ProjectMetadataElement.AttributeNameIsValidMetadataName(attributeLink.LocalName);
Construction\ProjectMetadataElement.cs (1)
103internal static ProjectMetadataElement CreateDisconnected(string name, ProjectRootElement containingProject, ElementLocation location = null)
Construction\ProjectRootElement.cs (7)
1320public ProjectMetadataElement CreateMetadataElement(string name) 1322return Link != null ? RootLink.CreateMetadataElement(name) : ProjectMetadataElement.CreateDisconnected(name, this); 1329public ProjectMetadataElement CreateMetadataElement(string name, string unevaluatedValue) 1338public ProjectMetadataElement CreateMetadataElement(string name, string unevaluatedValue, ElementLocation location) 1345ProjectMetadataElement metadatum = ProjectMetadataElement.CreateDisconnected(name, this, location); 1783internal ProjectMetadataElement CreateMetadataElement(XmlAttributeWithLocation attribute)
Definition\ProjectItem.cs (4)
534ProjectMetadata IItem<ProjectMetadata>.SetMetadata(ProjectMetadataElement metadataElement, string evaluatedInclude) 604ProjectMetadataElement metadatumXml = _xml.AddMetadata(name, unevaluatedValue); 1028public void SetMetadata(IEnumerable<KeyValuePair<ProjectMetadataElement, string>> metadata, IEnumerable<ProjectItem> destinationItems) 1032foreach (KeyValuePair<ProjectMetadataElement, string> metadatum in metadata)
Definition\ProjectItemDefinition.cs (2)
175ProjectMetadataElement metadatumXml = itemDefinition.AddMetadata(name, unevaluatedValue); 194ProjectMetadata IItemDefinition<ProjectMetadata>.SetMetadata(ProjectMetadataElement metadataElement, string evaluatedValue, ProjectMetadata predecessor)
Definition\ProjectMetadata.cs (4)
37private readonly ProjectMetadataElement _xml; 58internal ProjectMetadata(object parent, ProjectMetadataElement xml) 71internal ProjectMetadata(IProjectMetadataParent parent, ProjectMetadataElement xml, string evaluatedValueEscaped, ProjectMetadata predecessor) 164public ProjectMetadataElement Xml
Evaluation\Conditionals\IItem.cs (1)
30M SetMetadata(ProjectMetadataElement metadataElement, string evaluatedValue);
Evaluation\Evaluator.cs (2)
504foreach (ProjectMetadataElement metadataElement in itemElement.Metadata) 1356foreach (ProjectMetadataElement metadataElement in itemDefinitionElement.Metadata)
Evaluation\EvaluatorMetadataTable.cs (3)
95internal void SetValue(ProjectMetadataElement xml, string evaluatedValueEscaped) 113public EvaluatorMetadata(ProjectMetadataElement xml, string evaluatedValueEscaped) 122public ProjectMetadataElement Xml
Evaluation\IItemDefinition.cs (1)
25M SetMetadata(ProjectMetadataElement metadataElement, string evaluatedValue, M predecessor);
Evaluation\IItemFactory.cs (1)
71void SetMetadata(IEnumerable<KeyValuePair<ProjectMetadataElement, string>> metadata, IEnumerable<T> destinationItems);
Evaluation\LazyItemEvaluator.cs (4)
484public readonly ImmutableArray<ProjectMetadataElement>.Builder Metadata = ImmutableArray.CreateBuilder<ProjectMetadataElement>(); 628private static IEnumerable<string> GetExpandedMetadataValuesAndConditions(ICollection<ProjectMetadataElement> metadata, Expander<P, I> expander) 637foreach (var metadatumElement in metadata)
Evaluation\LazyItemEvaluator.IncludeOperation.cs (1)
25private readonly ImmutableArray<ProjectMetadataElement> _metadata;
Evaluation\LazyItemEvaluator.ItemFactoryWrapper.cs (1)
78public void SetMetadata(IEnumerable<KeyValuePair<ProjectMetadataElement, string>> metadata, IEnumerable<I> destinationItems)
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (8)
165protected void DecorateItemsWithMetadata(IEnumerable<ItemBatchingContext> itemBatchingContexts, ImmutableArray<ProjectMetadataElement> metadata, bool? needToExpandMetadata = null) 206foreach (var metadataElement in metadata) 233List<KeyValuePair<ProjectMetadataElement, string>> metadataList = new(metadata.Length); 235foreach (var metadataElement in metadata) 255metadataList.Add(new KeyValuePair<ProjectMetadataElement, string>(metadataElement, evaluatedValue)); 273private static IEnumerable<string> GetMetadataValuesAndConditions(ImmutableArray<ProjectMetadataElement> metadata) 275foreach (var metadataElement in metadata) 282protected bool NeedToExpandMetadataForEachItem(ImmutableArray<ProjectMetadataElement> metadata, out ItemsAndMetadataPair itemsAndMetadataFound)
Evaluation\LazyItemEvaluator.UpdateOperation.cs (2)
19private readonly ImmutableArray<ProjectMetadataElement> _metadata; 150private bool QualifiedMetadataReferencesExist(ImmutableArray<ProjectMetadataElement> metadata, out bool? needToExpandMetadataForEachItem)
Evaluation\ProjectParser.cs (6)
327ProjectMetadataElement metadatum = _project.CreateMetadataElement(attribute); 337ProjectMetadataElement metadatum = ParseProjectMetadataElement(childElement, item); 393private ProjectMetadataElement ParseProjectMetadataElement(XmlElementWithLocation element, ProjectElementContainer parent) 403ProjectMetadataElement metadatum = new ProjectMetadataElement(element, parent, _project); 744ProjectMetadataElement metadatum = _project.CreateMetadataElement(attribute); 758ProjectMetadataElement metadatum = ParseProjectMetadataElement(childElement, itemDefinition);
Instance\ProjectItemDefinitionInstance.cs (1)
196ProjectMetadataInstance IItemDefinition<ProjectMetadataInstance>.SetMetadata(ProjectMetadataElement xml, string evaluatedValue, ProjectMetadataInstance predecessor)
Instance\ProjectItemInstance.cs (4)
455ProjectMetadataInstance IItem<ProjectMetadataInstance>.SetMetadata(ProjectMetadataElement metadataElement, string evaluatedInclude) 1297ProjectMetadataInstance IItem<ProjectMetadataInstance>.SetMetadata(ProjectMetadataElement metadataElement, string evaluatedInclude) 2059public void SetMetadata(IEnumerable<KeyValuePair<ProjectMetadataElement, string>> metadataList, IEnumerable<ProjectItemInstance> destinationItems) 2224public void SetMetadata(IEnumerable<KeyValuePair<ProjectMetadataElement, string>> metadata, IEnumerable<TaskItem> destinationItems)
ObjectModelRemoting\ConstructionObjectLinks\ProjectMetadataElementLink.cs (2)
12/// Allow for creating a local representation to external object of type <see cref="ProjectMetadataElement"/> 17/// Access to remote <see cref="ProjectMetadataElement.Value"/>.
ObjectModelRemoting\ConstructionObjectLinks\ProjectPropertyElementLink.cs (1)
17/// Access to remote <see cref="ProjectMetadataElement.Value"/>.
ObjectModelRemoting\ConstructionObjectLinks\ProjectRootElementLink.cs (2)
113public abstract ProjectMetadataElement CreateMetadataElement(string name); 118public abstract ProjectMetadataElement CreateMetadataElement(string name, string unevaluatedValue);
ObjectModelRemoting\DefinitionObjectsLinks\ProjectMetadataLink.cs (1)
27public abstract ProjectMetadataElement Xml { get; }
ObjectModelRemoting\LinkedObjectFactory.cs (1)
173public ProjectMetadataElement Create(ProjectMetadataElementLink link)
Microsoft.Build.Engine.OM.UnitTests (77)
Construction\ConstructionEditing_Tests.cs (22)
876Action<ProjectItemElement, ProjectMetadataElement, ProjectMetadataElement> act = (i, c, r) => { i.InsertAfterChild(c, r); }; 918Action<ProjectItemElement, ProjectMetadataElement, ProjectMetadataElement> act = (i, c, r) => { i.InsertBeforeChild(c, r); }; 999Action<ProjectItemElement, ProjectMetadataElement, ProjectMetadataElement> act = (i, c, r) => 1063Action<ProjectItemElement, ProjectMetadataElement, ProjectMetadataElement> act = (i, c, r) => 1072private static void AssertMetadataConstruction(AddMetadata addMetadata, int position, string expectedItem, Action<ProjectItemElement, ProjectMetadataElement, ProjectMetadataElement> actOnTestData) 1080var referenceSibling = item.Metadata.ElementAt(position); 1081var m = project.CreateMetadataElement("m", "v"); 1143var firstMetadata = project.CreateMetadataElement("m1"); 1144var secondMetadata = project.CreateMetadataElement("m1"); 2547var element = ProjectRootElement.Create().AddItemDefinition("i").AddMetadata("m", "M1"); 2558var element = ProjectRootElement.Create().AddItem("i", "i1").AddMetadata("m", "M1"); 2841var element = ProjectRootElement.Create().AddTarget("t").AddItemGroup().AddItem("i", "i1").AddMetadata("m", "m1"); 2894var element = ProjectRootElement.Create().AddItemDefinition("i").AddMetadata("m", "M1"); 2905var element = ProjectRootElement.Create().AddItem("i", "i1").AddMetadata("m", "M1"); 3100var element = ProjectRootElement.Create().AddTarget("t").AddItemGroup().AddItem("i", "i1").AddMetadata("m", "m1"); 3147var attributeMetadata = item.AddMetadata("A", "value_a", expressAsAttribute: true); 3148var elementMetadata = item.AddMetadata("B", "value_b", expressAsAttribute: false);
Construction\ProjectItemElement_Tests.cs (2)
100ProjectMetadataElement metadatum1 = item.Metadata.First(); 101ProjectMetadataElement metadatum2 = item.Metadata.Skip(1).First();
Construction\ProjectMetadataElement_Tests.cs (27)
36ProjectMetadataElement metadatum = GetMetadataXml(); 208ProjectMetadataElement metadatum = GetMetadataXml(); 220ProjectMetadataElement metadatum = GetMetadataXml(); 233ProjectMetadataElement metadatum = GetMetadataXml(); 249ProjectMetadataElement metadatum = GetMetadataXml(); 258ProjectMetadataElement metadatum = GetMetadataXml(); 271ProjectMetadataElement metadatum = GetMetadataXml(); 348ProjectMetadataElement metadatum = GetMetadataXml(); 362ProjectMetadataElement metadatum = GetMetadataXml(); 436var metadata = items[0].Metadata.First(); 461var metadata = itemDefinitions[0].Metadata.First(); 495var metadata = items[0].Metadata.First(); 520var metadata = itemDefinitions[0].Metadata.First(); 572var metadata = items[0].Metadata.First(); 615var metadata = itemDefinitions[0].Metadata.First(); 689var metadata = items[0].Metadata.First(); 732var metadata = itemDefinitions[0].Metadata.First(); 818var metadata = items[0].Metadata.First(); 881var metadata = itemDefinitions[0].Metadata.First(); 950var metadata = items[0].Metadata.First(); 993var metadata = itemDefinitions[0].Metadata.First(); 1065var metadata = items[0].AddMetadata("m1", "v1", true); 1105var metadata = itemDefinitions[0].AddMetadata("m1", "v1", true); 1176var metadata = items[0].AddMetadata("m1", "v1", true); 1223var metadata = itemDefinitions[0].AddMetadata("m1", "v1", true); 1257private static ProjectMetadataElement GetMetadataXml() 1273ProjectMetadataElement metadata = Helpers.GetFirst(item.Metadata);
Definition\DefinitionEditing_Tests.cs (1)
1212ProjectMetadataElement metadatumElement1 = item0.SetMetadataValue("m", "m1").Xml;
Definition\ProjectItem_Tests.cs (4)
2193ProjectMetadataElement metadataElement = item.Xml.Metadata.FirstOrDefault(); 2249var me1 = metadataElements.ElementAt(0); 2253var me2 = metadataElements.ElementAt(1); 2305var me1 = metadataElements.ElementAt(0);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (2)
619public static void Verify(ProjectMetadataElement viewXml, ProjectMetadataElement realXml, ValidationContext context = null)
ObjectModelRemoting\Helpers\ViewValidation.cs (1)
134if (VerifyCheckType<ProjectMetadataElement>(view, real, context, Verify))
ObjectModelRemoting\LinkedConstructionModify_Tests.cs (9)
111xmlPair.CreateWithVerify<ProjectMetadataElement>((p) => p.CreateMetadataElement("metadataName")); 112xmlPair.CreateWithVerify<ProjectMetadataElement>((p) => p.CreateMetadataElement("metadataName1", "value")); 352var metadata = item1.AddNewChaildWithVerify<ProjectMetadataElement>(ObjectType.View, "metadata", (p, n) => p.AddMetadata(n, "value"), (md, n) => md.Name == n); 616itemDef.Add2NewChildrenWithVerify<ProjectMetadataElement>("mshort", (id, n) => id.AddMetadata(n, $"value{n}"), (md, n) => md.Name == n, out var mdShort1, out var mdShort2); 618itemDef.Add2NewChildrenWithVerify<ProjectMetadataElement>("mlong", (id, n) => id.AddMetadata(n, $"value{n}", false), (md, n) => md.Name == n, out var mdLong1, out var mdLong2); 621itemDef.Add2NewChildrenWithVerify<ProjectMetadataElement>("mlongAttrib", (id, n) => id.AddMetadata(n, $"value{n}", true), (md, n) => md.Name == n, out var mdAttrib1, out var mdAttrib2); 672item.Add2NewChildrenWithVerify<ProjectMetadataElement>("mshort", (id, n) => id.AddMetadata(n, $"value{n}"), (md, n) => md.Name == n, out var mdShort1, out var mdShort2); 674item.Add2NewChildrenWithVerify<ProjectMetadataElement>("mlong", (id, n) => id.AddMetadata(n, $"value{n}", false), (md, n) => md.Name == n, out var mdLong1, out var mdLong2); 676item.Add2NewChildrenWithVerify<ProjectMetadataElement>("mlongAttrib", (id, n) => id.AddMetadata(n, $"value{n}", true), (md, n) => md.Name == n, out var mdAttrib1, out var mdAttrib2);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectMetadataElementLink.cs (2)
14public ProjectMetadataElement MetadataXml => (ProjectMetadataElement)Source;
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectRootElementLink.cs (4)
247public override ProjectMetadataElement CreateMetadataElement(string name) 249return (ProjectMetadataElement)this.Proxy.CreateMetadataElement(name).Import(this.Linker); 252public override ProjectMetadataElement CreateMetadataElement(string name, string unevaluatedValue) 254return (ProjectMetadataElement)this.Proxy.CreateMetadataElement(name, unevaluatedValue).Import(this.Linker);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\ProjectElemetExportHelper.cs (1)
59ElementInfo.New<ProjectMetadataElement , MockProjectMetadataElementLinkRemoter>(),
ObjectModelRemoting\RemoteProjectsProviderMock\EvaluationLinkMocks\MockProjectMetadataLink.cs (2)
80public override ProjectMetadataElement Xml => (ProjectMetadataElement)this.Proxy.Xml.Import(this.Linker);
Microsoft.Build.Engine.UnitTests (7)
Evaluation\Evaluator_Tests.cs (7)
1532ProjectMetadataElement xml1 = project.Xml.ItemDefinitions.ElementAt(0).Metadata.ElementAt(0); 1592ProjectMetadataElement xml1 = project.Xml.ItemDefinitions.ElementAt(0).Metadata.ElementAt(0); 1595ProjectMetadataElement xml2 = project.Xml.Items.ElementAt(0).Metadata.ElementAt(0); 1630ProjectMetadataElement xml1 = project.Xml.Items.ElementAt(1).Metadata.ElementAt(0); 1662ProjectMetadataElement xml1 = project.Xml.Items.ElementAt(0).Metadata.ElementAt(0); 1686ProjectMetadataElement metadataElementFromProjectRootElement = 1725ProjectMetadataElement metadataElementFromProjectRootElement =