ISharePointProjectItemCollection.Add 方法 (String, String, String, Boolean)
建立 SharePoint 專案項目並加入至專案中。
命名空間: Microsoft.VisualStudio.SharePoint
組件: Microsoft.VisualStudio.SharePoint (在 Microsoft.VisualStudio.SharePoint.dll 中)
語法
'宣告
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
)
參數
- path
型別:System.String
專案項目的基底路徑。可以是專案路徑的相對路徑或絕對路徑。
- name
型別:System.String
專案項目的名稱。名稱應該是檔案系統易記的名稱。
- projectItemType
型別:System.String
專案項目的型別。
- skipAutoPackage
型別:System.Boolean
如果為 true,則專案系統不會自動加入專案項目的功能或封裝。
傳回值
型別:Microsoft.VisualStudio.SharePoint.ISharePointProjectItem
新專案項目的執行個體。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentNullException | 如果有任何引數是 nullNull 參照 (即 Visual Basic 中的 Nothing),就會發生。 |
ArgumentException | 會發生於下列狀況:
|
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。