ISharePointProjectItemCollection.Add 方法 (String, String, Boolean)

建立並加入 SharePoint 專案項目的新執行個體。

命名空間:  Microsoft.VisualStudio.SharePoint
組件:  Microsoft.VisualStudio.SharePoint (在 Microsoft.VisualStudio.SharePoint.dll 中)

語法

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

參數

  • name
    型別:System.String
    要加入之 SharePoint 專案項目的名稱。
  • projectItemType
    型別:System.String
    要加入之 SharePoint 專案項目的型別識別碼。
  • skipAutoPackage
    型別:System.Boolean
    如果為 true,則略過自動加入至第一個可用功能。

傳回值

型別:Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
已加入之 SharePoint 專案項目的執行個體。

例外狀況

例外狀況 條件
ArgumentNullException

如果有任何引數是 nullNull 參照 (即 Visual Basic 中的 Nothing),就會發生。

ArgumentException

會發生於下列狀況:

  • 如果有任何參數是空字串。

  • 如果具有所提供之名稱的 SharePoint 專案項目已經存在。

.NET Framework 安全性

請參閱

參考

ISharePointProjectItemCollection 介面

Add 多載

Microsoft.VisualStudio.SharePoint 命名空間