다음을 통해 공유


BuildItem Class

Definition

This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

This class represents a single item of the project. An item is usually a file on disk, with a type associated with it, and its own item-specific attributes. The list of items is initially specified via XML tags in the project file, although a single item tag can represent multiple items through the use of standard wilcards * and ?. Also, tasks can add new items of various types to the project's item list -- these items don't have any XML representation.

public ref class BuildItem
public class BuildItem
type BuildItem = class
Public Class BuildItem
Inheritance
BuildItem

Remarks

Warning

This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.Construction Microsoft.Build.Evaluation Microsoft.Build.Execution

Constructors

BuildItem(String, ITaskItem)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

This constructor creates a new virtual (non-persisted) item based on a ITaskItem object that was emitted by a task.

BuildItem(String, String)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

This constructor creates a new virtual (non-persisted) item with the specified type and include.

Properties

Condition

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Accessor for the item's "condition".

CustomMetadataCount

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Gets the number of metadata set on the item.

CustomMetadataNames

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Gets the names of metadata on the item -- also includes the pre-defined/reserved item-spec modifiers.

Exclude

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Accessor for the item's "exclude" string.

FinalItemSpec

Returns the unescaped final value of the item.

Include

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Accessor for the item's "include" string.

IsImported

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

This returns a boolean telling you whether this particular item was imported from another project, or whether it was defined in the main project. For virtual items which have no persistence, this is false.

MetadataCount

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Gets the number of metadata set on the item.

MetadataNames

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Gets the names of metadata on the item -- also includes the pre-defined/reserved item-spec modifiers.

Name

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Accessor for the item's "type" string. Note that changing the "Type" of an BuildItem requires the whole project to be re-evalauted. This is because items are frequently stored in hash tables based on their item types, so changing an item type would mess up the tables. In the current implementation the caller who changes the item type is responsible for calling Project.MarkAsDirty().

Methods

Clone()

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

This creates a shallow clone of the BuildItem. If this is an xml-backed item, then the clone references the same XML element as the original, meaning that modifications to the clone will affect the original.

CopyCustomMetadataTo(BuildItem)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Copies all custom attributes to given item.

GetEvaluatedMetadata(String)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Retrieves an arbitrary metadata from the item element, expands any property and item references within it, and unescapes it.

GetMetadata(String)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Retrieves an arbitrary unevaluated metadata value from the item element. These are pieces of metadata that the project author has placed on the item element that have no meaning to MSBuild. They are just arbitrary metadata that travel around with the BuildItem wherever it goes.

HasMetadata(String)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Indicates if the given metadata is set on the item.

RemoveMetadata(String)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution Removes the specified metadata on the item.

SetMetadata(String, String, Boolean)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Sets custom metadata on this item, with the option of treating the metadata value literally, meaning that special sharacters will be escaped. Does not backup metadata before making changes.

SetMetadata(String, String)

This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: Microsoft.Build.ConstructionMicrosoft.Build.EvaluationMicrosoft.Build.Execution

Sets an arbitrary metadata on the item element. These are metadata that the project author has placed on the item element that have no meaning to MSBuild. They are just arbitrary metadata that travel around with the BuildItem. Does not backup metadata before making changes.

Applies to