Lingua

ITaskItem<T> Interface

Definition

A strongly-typed task item interface that wraps a value of type T and provides access to it along with standard task item functionality.

generic <typename T>
public interface class ITaskItem : Microsoft::Build::Framework::ITaskItem2
public interface ITaskItem<T> : Microsoft.Build.Framework.ITaskItem2
type ITaskItem<'T> = interface
    interface ITaskItem2
    interface ITaskItem
Public Interface ITaskItem(Of T)
Implements ITaskItem2

Type Parameters

T

The type of the value. Supported types are AbsolutePath, FileInfo, and DirectoryInfo.

Derived
Implements

Remarks

This interface allows tasks to receive strongly-typed item parameters while still working with MSBuild's item system. The value is parsed from the item's identity (ItemSpec) using MSBuild's standard parsing conventions.

Properties

Name Description
EvaluatedIncludeEscaped

Gets or sets the item include value e.g. for disk-based items this would be the file path.

(Inherited from ITaskItem2)
ItemSpec

Gets or sets the item "specification" e.g. for disk-based items this would be the file path.

(Inherited from ITaskItem)
MetadataCount

Gets the number of pieces of metadata on the item. Includes both custom and built-in metadata.

(Inherited from ITaskItem)
MetadataNames

Gets the names of all the metadata on the item. Includes the built-in metadata like "FullPath".

(Inherited from ITaskItem)
Value

Gets the strongly-typed value parsed from the item's identity.

Methods

Name Description
CloneCustomMetadata()

Get the collection of custom metadata. This does not include built-in metadata.

(Inherited from ITaskItem)
CloneCustomMetadataEscaped()

ITaskItem2 implementation which returns a clone of the metadata on this object. Values returned are in their original escaped form.

(Inherited from ITaskItem2)
CopyMetadataTo(ITaskItem)

Allows custom metadata on the item to be copied to another item.

(Inherited from ITaskItem)
GetMetadata(String)

Allows the values of metadata on the item to be queried.

(Inherited from ITaskItem)
GetMetadataValueEscaped(String)

Allows the values of metadata on the item to be queried.

(Inherited from ITaskItem2)
RemoveMetadata(String)

Allows the removal of custom metadata set on the item.

(Inherited from ITaskItem)
SetMetadata(String, String)

Allows a piece of custom metadata to be set on the item.

(Inherited from ITaskItem)
SetMetadataValueLiteral(String, String)

Allows a piece of custom metadata to be set on the item. Assumes that the value passed in is unescaped, and escapes the value as necessary in order to maintain its value.

(Inherited from ITaskItem2)

Applies to