ProjectItemInstance Class

Wraps an evaluated item for build purposes.


Namespace:  Microsoft.Build.Execution
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

public class ProjectItemInstance : ITaskItem2, 

The ProjectItemInstance type exposes the following members.

Public propertyDirectMetadataCountGets the number of pieces of metadata on this item.
Public propertyEvaluatedIncludeGets the evaluated Include attribute value.
Public propertyItemTypeGets the item type, for example "Compile".
Public propertyMetadataGets an enumerator over the evaluated metadata of the item. This is a read-only collection.
Public propertyMetadataCountGets the number of metadata entries, including metadata inherited from item definitions.
Public propertyMetadataNamesGets all metadata names of this item, including metadata inherited from item definitions.
Public propertyProjectGets the owning project.

Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetMetadataGet the metadata with the given name, including metadata inherited from item definitions.
Public methodGetMetadataValueGets the value of the metadata with the given name, including metadata inherited from item definitions.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodHasMetadataDetermines whether the metadata with the given name is defined on this item (even if its value is empty string).
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveMetadataRemoves metadata with the given name.
Public methodSetMetadata(IEnumerable<KeyValuePair<String, String>>)Adds metadata with the given names and values. Overwrites any metadata with the same name already in the collection.
Public methodSetMetadata(String, String)Add metadata with the given name and value. Overwrites any metadata with the same name already in the collection.
Public methodToStringGets a String that represents the current item. (Overrides Object.ToString().)

Explicit interface implemetationPrivate methodITaskItem.CloneCustomMetadataITaskItem implementation. Gets the collection of custom metadata.
Explicit interface implemetationPrivate methodITaskItem.CopyMetadataToITaskItem implementation. Copies the custom metadata entries to another item.
Explicit interface implemetationPrivate methodITaskItem.GetMetadataITaskItem implementation. Gets the value of the specified metadata entry.
Explicit interface implemetationPrivate propertyITaskItem.ItemSpecITaskItem implementation. Gets or sets the item specification.
Explicit interface implemetationPrivate propertyITaskItem.MetadataNamesITaskItem implementation. Gets the names of the metadata entries associated with the item.
Explicit interface implemetationPrivate methodITaskItem.SetMetadataITaskItem implementation. Adds or changes a custom metadata entry to the item.
Explicit interface implemetationPrivate methodITaskItem2.CloneCustomMetadataEscapedITaskItem2 implementation. Returns a clone of the metadata on this object. Values returned are in their original escaped form.
Explicit interface implemetationPrivate propertyITaskItem2.EvaluatedIncludeEscapedITaskItem2 implementation. Evaluated include value, escaped as necessary. May be empty string. Gets or sets the item include value e.g. for disk-based items this would be the file path.
Explicit interface implemetationPrivate methodITaskItem2.GetMetadataValueEscapedITaskItem2 implementation. Allows the values of metadata on the item to be queried.
Explicit interface implemetationPrivate methodITaskItem2.SetMetadataValueLiteralITaskItem2 implementation. 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.

Does not store item element information, because all evaluation and verification has already been performed.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft