Aracılığıyla paylaş


ProjectMetadata Class

Definition

An evaluated design-time metadatum. Parented either by a ProjectItemDefinition or a ProjectItem.

public ref class ProjectMetadata : IEquatable<Microsoft::Build::Evaluation::ProjectMetadata ^>
public class ProjectMetadata : IEquatable<Microsoft.Build.Evaluation.ProjectMetadata>
type ProjectMetadata = class
    interface IEquatable<ProjectMetadata>
Public Class ProjectMetadata
Implements IEquatable(Of ProjectMetadata)
Inheritance
ProjectMetadata
Implements

Remarks

Never used to represent built-in metadata, like %(Filename). There is always a backing XML object.

Properties

ConditionLocation

Location of the condition attribute

EvaluatedValue

Gets the evaluated metadata value. Cannot be set directly: only the unevaluated value can be set. Is never null.

IsImported

If the metadatum originated in an imported file, returns true. Otherwise returns false.

ItemType

The item type of the parent item definition or item.

Location

Location of the element

Name

Name of the metadata

Predecessor

Any immediately previous metadatum (from item definition or item) that was overridden by this one during evaluation. This would include all metadata with the same name that lie above in the logical project file, who are on item definitions of the same type, and whose conditions evaluated to true. If this metadatum is on an item, it would include any previous metadatum with the same name on the same item whose condition evaluated to true, and following that any item definition metadata. If there are none above this is null. If the project has not been reevaluated since the last modification this value may be incorrect.

Project

Project that this metadatum lives in. ProjectMetadata's always live in a project.

UnevaluatedValue

Gets or sets the unevaluated metadata value.

As well as updating the unevaluated value, the setter updates the evaluated value, but does not affect anything else in the project until reevaluation. For example, --if a piece of metadata named "m" is modified on item of type "i", it does not affect "j" which is evaluated from "@(j->'%(m)')" until reevaluation. --if the unevaluated value of "m" is set to something that is modified by evaluation, such as "$(p)", the evaluated value will be set to "$(p)" until reevaluation. This is a convenience that it is understood does not necessarily leave the project in a perfectly self consistent state.

Setting metadata through a ProjectItem may cause the underlying ProjectItemElement to be split, if it originated with an itemlist, wildcard, or semicolon expression, because it was clear that the caller intended to only affect that particular item. Setting metadata through a ProjectMetadata does not cause any splitting, because we assume the caller presumably intends to affect all items using the underlying ProjectMetadataElement. At least, this seems a reasonable assumption, and it avoids the need for metadata to hold a pointer to their containing items.

Xml

Backing XML metadata. Can never be null.

Explicit Interface Implementations

IEquatable<ProjectMetadata>.Equals(ProjectMetadata)

Compares this metadata to another for equivalence.

Applies to