Share via


ISharePointProjectItemCollection.Add Method (String, String, Boolean)

Creates and adds a new instance of SharePoint project item.

Namespace:  Microsoft.VisualStudio.SharePoint
Assembly:  Microsoft.VisualStudio.SharePoint (in Microsoft.VisualStudio.SharePoint.dll)

Syntax

'Declaration
Function Add ( _
    name As String, _
    projectItemType As String, _
    skipAutoPackage As Boolean _
) As ISharePointProjectItem
ISharePointProjectItem Add(
    string name,
    string projectItemType,
    bool skipAutoPackage
)

Parameters

  • name
    Type: String

    The name of a SharePoint project item to add.

  • projectItemType
    Type: String

    The type ID of the SharePoint project item to add.

  • skipAutoPackage
    Type: Boolean

    Skips auto-add to a first available feature if true.

Return Value

Type: Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
An instance of the SharePoint project item that was added.

Exceptions

Exception Condition
ArgumentNullException

Occurs if any of the arguments are nulla null reference (Nothing in Visual Basic).

ArgumentException

Occurs in the following cases:

  • If any of the parameters are empty strings.

  • If a SharePoint project item with the provided name already exists.

.NET Framework Security

See Also

Reference

ISharePointProjectItemCollection Interface

Add Overload

Microsoft.VisualStudio.SharePoint Namespace