Sdílet prostřednictvím


ProjectInstance.AddItem Method

Definition

Adds an item with no metadata to the project.

Overloads

AddItem(String, String)

Adds an item with no metadata to the project

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

Adds an item with metadata to the project. Metadata may be null.

AddItem(String, String)

Source:
ProjectInstance.cs

Adds an item with no metadata to the project

public:
 Microsoft::Build::Execution::ProjectItemInstance ^ AddItem(System::String ^ itemType, System::String ^ evaluatedInclude);
public Microsoft.Build.Execution.ProjectItemInstance AddItem (string itemType, string evaluatedInclude);
member this.AddItem : string * string -> Microsoft.Build.Execution.ProjectItemInstance
Public Function AddItem (itemType As String, evaluatedInclude As String) As ProjectItemInstance

Parameters

itemType
String

The item type of the item to be added.

evaluatedInclude
String

The evaluated Include attribute of the item.

Returns

The new item.

Remarks

We don't take a ProjectItemInstance to make sure we don't have one that's already in use by another ProjectInstance.

Applies to

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

Source:
ProjectInstance.cs

Adds an item with metadata to the project. Metadata may be null.

public:
 Microsoft::Build::Execution::ProjectItemInstance ^ AddItem(System::String ^ itemType, System::String ^ evaluatedInclude, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::String ^>> ^ metadata);
public Microsoft.Build.Execution.ProjectItemInstance AddItem (string itemType, string evaluatedInclude, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,string>> metadata);
member this.AddItem : string * string * seq<System.Collections.Generic.KeyValuePair<string, string>> -> Microsoft.Build.Execution.ProjectItemInstance
Public Function AddItem (itemType As String, evaluatedInclude As String, metadata As IEnumerable(Of KeyValuePair(Of String, String))) As ProjectItemInstance

Parameters

itemType
String

The item type of the item to be added.

evaluatedInclude
String

The evaluated Include attribute of the item.

metadata
IEnumerable<KeyValuePair<String,String>>

The metadata of the item.

Returns

Return the new item.

Remarks

We don't take a ProjectItemInstance to make sure we don't have one that's already in use by another ProjectInstance.

Applies to