Share via


ISharePointProjectItemCollection.Add Method

Definition

Overloads

Add(String, String)

Creates and adds a new instance of a SharePoint project item.

Add(String, String, Boolean)

Creates and adds a new instance of SharePoint project item.

Add(String, String, String)

Creates and adds a new instance of SharePoint project item.

Add(String, String, String, Boolean)

Creates and adds a SharePoint project item to the project.

Add(String, String)

Creates and adds a new instance of a SharePoint project item.

public:
 Microsoft::VisualStudio::SharePoint::ISharePointProjectItem ^ Add(System::String ^ name, System::String ^ projectItemType);
public Microsoft.VisualStudio.SharePoint.ISharePointProjectItem Add (string name, string projectItemType);
abstract member Add : string * string -> Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
Public Function Add (name As String, projectItemType As String) As ISharePointProjectItem

Parameters

name
String

The name of SharePoint project item to add.

projectItemType
String

The type ID of the SharePoint project item to add.

Returns

An instance of the SharePoint project item that was added.

Exceptions

Occurs if any of the arguments are null.

Occurs in the following cases:If any of the parameters are empty strings.If a SharePoint project item with the provided name already exists.

Applies to

Add(String, String, Boolean)

Creates and adds a new instance of SharePoint project item.

public:
 Microsoft::VisualStudio::SharePoint::ISharePointProjectItem ^ Add(System::String ^ name, System::String ^ projectItemType, bool skipAutoPackage);
public Microsoft.VisualStudio.SharePoint.ISharePointProjectItem Add (string name, string projectItemType, bool skipAutoPackage);
abstract member Add : string * string * bool -> Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
Public Function Add (name As String, projectItemType As String, skipAutoPackage As Boolean) As ISharePointProjectItem

Parameters

name
String

The name of a SharePoint project item to add.

projectItemType
String

The type ID of the SharePoint project item to add.

skipAutoPackage
Boolean

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

Returns

An instance of the SharePoint project item that was added.

Exceptions

Occurs if any of the arguments are null.

Occurs in the following cases:If any of the parameters are empty strings.If a SharePoint project item with the provided name already exists.

Applies to

Add(String, String, String)

Creates and adds a new instance of SharePoint project item.

public:
 Microsoft::VisualStudio::SharePoint::ISharePointProjectItem ^ Add(System::String ^ path, System::String ^ name, System::String ^ projectItemType);
public Microsoft.VisualStudio.SharePoint.ISharePointProjectItem Add (string path, string name, string projectItemType);
abstract member Add : string * string * string -> Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
Public Function Add (path As String, name As String, projectItemType As String) As ISharePointProjectItem

Parameters

path
String

The subfolder in the project where the new SharePoint item is created.

name
String

The name of SharePoint project item to be added.

projectItemType
String

The type ID of the SharePoint project item to be added.

Returns

An instance of the SharePoint project item that was added.

Exceptions

Occurs if any of the arguments are null.

Occurs in the following cases:If any of the parameters are empty strings.If the path is not a valid absolute path (that is, not under the project root path).If a SharePoint project item with the provided name already exists.

Applies to

Add(String, String, String, Boolean)

Creates and adds a SharePoint project item to the project.

public:
 Microsoft::VisualStudio::SharePoint::ISharePointProjectItem ^ Add(System::String ^ path, System::String ^ name, System::String ^ projectItemType, bool skipAutoPackage);
public Microsoft.VisualStudio.SharePoint.ISharePointProjectItem Add (string path, string name, string projectItemType, bool skipAutoPackage);
abstract member Add : string * string * string * bool -> Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
Public Function Add (path As String, name As String, projectItemType As String, skipAutoPackage As Boolean) As ISharePointProjectItem

Parameters

path
String

The base path of the project item. Can be either relative to the project path or absolute.

name
String

The name of the project item. The name should be file system-friendly.

projectItemType
String

The type of the project item.

skipAutoPackage
Boolean

If true, the project system will not automatically add a feature or package for the project item.

Returns

An instance of the new project item.

Exceptions

Occurs if any of the arguments are null.

Occurs in the following cases:If any of the parameters are empty strings.If the path is not a valid absolute path (that is, not under the project root path).If a SharePoint project item with the provided name already exists.

Applies to