Condividi tramite


BuildItemGroup 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 collection of items. It may be represented physically by an <ItemGroup> element persisted in the project file, or it may just be a virtual BuildItemGroup (e.g., the evaluated items).

public ref class BuildItemGroup : System::Collections::IEnumerable
public class BuildItemGroup : System.Collections.IEnumerable
type BuildItemGroup = class
    interface IEnumerable
Public Class BuildItemGroup
Implements IEnumerable
Inheritance
BuildItemGroup
Implements

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

BuildItemGroup()

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

Default constructor, which initializes a virtual (non-persisted) BuildItemGroup.

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 condition on the item group.

Count

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

Number of items in this group.

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 group was imported from another project, or whether it was defined in the main project. For virtual item groups which have no persistence, this is false.

Item[Int32]

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 item at the specified index.

Methods

AddNewItem(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

Adds a new item to the ItemGroup, optional treating the item Include as literal so that any special characters will be escaped before persisting it.

AddNewItem(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

Creates a new BuildItem defined by the given "Type" and "Include", and adds it to the end of this BuildItemGroup. If the group is persisted, the item is persisted; otherwise it is virtual

Clear()

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

Removes all Items from this BuildItemGroup, and also deletes the Condition and Name.

Clone(Boolean)

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

Clones the BuildItemGroup. A shallow clone here is one that references the same BuildItem objects as the original, whereas a deep clone actually clones the BuildItem objects as well. If this is a persisted BuildItemGroup, only deep clones are allowed, because you can't have the same XML element belonging to two parents.

GetEnumerator()

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

This IEnumerable method returns an IEnumerator object, which allows the caller to enumerate through the BuildItem objects contained in this BuildItemGroup.

RemoveItem(BuildItem)

Removes the given BuildItem from this BuildItemGroup. If item is not in this group, does nothing.

RemoveItemAt(Int32)

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 item at the specified index.

ToArray()

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

Copies the items in this group into a new array. NOTE: the copies are NOT clones i.e. only the references are copied

Applies to