Share via


ProjectItemGroupElement.AddItem Method

Definition

Overloads

AddItem(String, String)

Convenience method that picks a location based on a heuristic: Adds a new item ordered by include.

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

Convenience method that picks a location based on a heuristic: Adds a new item ordered by include. Metadata may be null, indicating no metadata.

AddItem(String, String)

Source:
ProjectItemGroupElement.cs

Convenience method that picks a location based on a heuristic: Adds a new item ordered by include.

public:
 Microsoft::Build::Construction::ProjectItemElement ^ AddItem(System::String ^ itemType, System::String ^ include);
public Microsoft.Build.Construction.ProjectItemElement AddItem (string itemType, string include);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public Microsoft.Build.Construction.ProjectItemElement AddItem (string itemType, string include);
member this.AddItem : string * string -> Microsoft.Build.Construction.ProjectItemElement
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.AddItem : string * string -> Microsoft.Build.Construction.ProjectItemElement
Public Function AddItem (itemType As String, include As String) As ProjectItemElement

Parameters

itemType
String

Item element name of the item to be added.

include
String

Include attribute of the item to be added.

Returns

The new item element.

Attributes

Remarks

This convenience method picks a location in the MSBuild DOM based on a heuristic.

Applies to

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

Source:
ProjectItemGroupElement.cs

Convenience method that picks a location based on a heuristic: Adds a new item ordered by include. Metadata may be null, indicating no metadata.

public:
 Microsoft::Build::Construction::ProjectItemElement ^ AddItem(System::String ^ itemType, System::String ^ include, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::String ^>> ^ metadata);
public Microsoft.Build.Construction.ProjectItemElement AddItem (string itemType, string include, 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.Construction.ProjectItemElement
Public Function AddItem (itemType As String, include As String, metadata As IEnumerable(Of KeyValuePair(Of String, String))) As ProjectItemElement

Parameters

itemType
String

Item element name of the item to be added.

include
String

Include attribute of the item to be added.

metadata
IEnumerable<KeyValuePair<String,String>>

Metadata to be added.

Returns

The new item element.

Remarks

The Metadata parameter may be null, which indicates no metadata is present.

Applies to