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