ISharePointProjectItemCollection.Add Method (String, String, String, Boolean)
Creates and adds a SharePoint project item to the project.
Namespace: Microsoft.VisualStudio.SharePoint
Assembly: Microsoft.VisualStudio.SharePoint (in Microsoft.VisualStudio.SharePoint.dll)
Syntax
'Declaration
Function Add ( _
path As String, _
name As String, _
projectItemType As String, _
skipAutoPackage As Boolean _
) As ISharePointProjectItem
ISharePointProjectItem Add(
string path,
string name,
string projectItemType,
bool skipAutoPackage
)
Parameters
path
Type: StringThe base path of the project item. Can be either relative to the project path or absolute.
name
Type: StringThe name of the project item. The name should be file system-friendly.
projectItemType
Type: StringThe type of the project item.
skipAutoPackage
Type: BooleanIf true, the project system will not automatically add a feature or package for the project item.
Return Value
Type: Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
An instance of the new project item.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Occurs if any of the arguments are nulla null reference (Nothing in Visual Basic). |
ArgumentException | Occurs in the following cases:
|
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.