ProjectItemInstance Class

Definition

Wraps an evaluated item for build purposes

public ref class ProjectItemInstance : Microsoft::Build::Framework::ITaskItem2
public class ProjectItemInstance : Microsoft.Build.Framework.ITaskItem2
type ProjectItemInstance = class
    interface ITaskItem
    interface ITaskItem2
type ProjectItemInstance = class
    interface ITaskItem2
    interface ITaskItem
Public Class ProjectItemInstance
Implements ITaskItem2
Inheritance
ProjectItemInstance
Implements

Remarks

Does not store XML location information. That is not needed by the build process as all correctness checks and evaluation has already been performed, so it is unnecessary bulk.

Properties

DirectMetadataCount

Number of pieces of metadata on this item

EvaluatedInclude

Evaluated include value. May be empty string.

ItemType

Item type, for example "Compile"

Metadata

Unordered collection of evaluated metadata on the item. If there is no metadata, returns an empty collection. Does not include built-in metadata. Includes any from item definitions. This is a read-only collection. To modify the metadata, use SetMetadata(String, String).

MetadataCount

Returns the number of metadata entries. Includes any from applicable item definitions. Includes both custom and built-in metadata.

MetadataNames

Returns all the metadata names on this item. Includes names from any applicable item definitions. Includes names of built-in metadata.

Project

Owning project

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetMetadata(String)

Get any metadata in the item that has the specified name, otherwise returns null. Includes any metadata inherited from item definitions. Includes any built-in metadata.

GetMetadataValue(String)

Get the value of a metadata on this item, or String.Empty if it does not exist or has no value. Includes any metadata inherited from item definitions and any built-in metadata. To determine whether a piece of metadata is actually present but with an empty value, use HasMetadata(String).

GetType()

Gets the Type of the current instance.

(Inherited from Object)
HasMetadata(String)

Returns true if a particular piece of metadata is defined on this item (even if its value is empty string) otherwise false. This includes built-in metadata and metadata from item definitions.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
RemoveMetadata(String)

Removes a metadatum with the specified name. Used by TaskItem

SetMetadata(IEnumerable<KeyValuePair<String,String>>)

Add a metadata with the specified names and values. Overwrites any metadata with the same name already in the collection.

SetMetadata(String, String)

Add a metadata with the specified name and value. Overwrites any metadata with the same name already in the collection.

ToString()

Produce a string representation.

Explicit Interface Implementations

ITaskItem.CloneCustomMetadata()

ITaskItem implementation

ITaskItem.CopyMetadataTo(ITaskItem)

ITaskItem implementation

ITaskItem.GetMetadata(String)

ITaskItem implementation.

ITaskItem.ItemSpec

ITaskItem implementation

ITaskItem.MetadataNames

ITaskItem implementation

ITaskItem.SetMetadata(String, String)

ITaskItem implementation

ITaskItem2.CloneCustomMetadataEscaped()

ITaskItem2 implementation

ITaskItem2.EvaluatedIncludeEscaped

Evaluated include value, escaped as necessary. May be empty string.

ITaskItem2.GetMetadataValueEscaped(String)

ITaskItem2 implementation.

ITaskItem2.SetMetadataValueLiteral(String, String)

ITaskItem2 implementation

Applies to