共用方式為


SPFeatureDefinitionCollection.Add method (String, Guid)

將 「 功能 」 定義具有指定資訊清單路徑及方案識別碼加入的功能定義集合。

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

Syntax

'宣告
Public Function Add ( _
    relativePathToFeatureManifest As String, _
    solutionId As Guid _
) As SPFeatureDefinition
'用途
Dim instance As SPFeatureDefinitionCollection
Dim relativePathToFeatureManifest As String
Dim solutionId As Guid
Dim returnValue As SPFeatureDefinition

returnValue = instance.Add(relativePathToFeatureManifest, _
    solutionId)
public SPFeatureDefinition Add(
    string relativePathToFeatureManifest,
    Guid solutionId
)

參數

  • relativePathToFeatureManifest
    Type: System.String

    內含該功能的資訊清單的相對路徑的字串。

  • solutionId
    Type: System.Guid

    System.Guid識別解決方案。

傳回值

Type: Microsoft.SharePoint.Administration.SPFeatureDefinition
Microsoft.SharePoint.Administration.SPFeatureDefinition 物件,代表新的功能定義。

備註

集合中加入一種功能會安裝此功能在伺服器陣列,使其成為可用於啟用其指定範圍中。新增具有伺服器陣列範圍的功能會安裝功能,不僅啟動伺服器陣列中。

注意

不支援使用SPFeatureDefinition建構函式來建立功能定義物件 ;如果您嘗試實作透過建構函式建立的物件的成員,則會傳回NullReferenceException 。

請參閱

參照

SPFeatureDefinitionCollection class

SPFeatureDefinitionCollection members

Add overload

Microsoft.SharePoint.Administration namespace