Compartir a través de


Project.AddNewItem Method

Definition

Adds the specified element to the project.

Overloads

AddNewItem(String, String)

Called from the IDE to add a new item of a particular type to the project file. This method tries to add the new item near the other items of the same type.

AddNewItem(String, String, Boolean)

Adds a new item to the project, and optionally escapes the Include value so it's treated as a literal value.

AddNewItem(String, String)

Source:
Project.cs

Called from the IDE to add a new item of a particular type to the project file. This method tries to add the new item near the other items of the same type.

public:
 Microsoft::Build::BuildEngine::BuildItem ^ AddNewItem(System::String ^ itemName, System::String ^ itemInclude);
public Microsoft.Build.BuildEngine.BuildItem AddNewItem (string itemName, string itemInclude);
member this.AddNewItem : string * string -> Microsoft.Build.BuildEngine.BuildItem
Public Function AddNewItem (itemName As String, itemInclude As String) As BuildItem

Parameters

itemName
String

The name of the item list this item belongs to.

itemInclude
String

The value of the item's Include attribute i.e. the item-spec

Returns

The new item after evaluation.

Remarks

This method attempts to add the item to the project near the other items in the item collection.

Applies to

AddNewItem(String, String, Boolean)

Source:
Project.cs

Adds a new item to the project, and optionally escapes the Include value so it's treated as a literal value.

public:
 Microsoft::Build::BuildEngine::BuildItem ^ AddNewItem(System::String ^ itemName, System::String ^ itemInclude, bool treatItemIncludeAsLiteral);
public Microsoft.Build.BuildEngine.BuildItem AddNewItem (string itemName, string itemInclude, bool treatItemIncludeAsLiteral);
member this.AddNewItem : string * string * bool -> Microsoft.Build.BuildEngine.BuildItem
Public Function AddNewItem (itemName As String, itemInclude As String, treatItemIncludeAsLiteral As Boolean) As BuildItem

Parameters

itemName
String
itemInclude
String
treatItemIncludeAsLiteral
Boolean

Returns

Remarks

This method attempts to add the item to the project near the other items in the item collection.

Applies to