共用方式為


SPFarm.GetPersistedFeatureDefinition method (Guid, Int32, Boolean)

會傳回指定的compatibilityLevel和featureId值**[T:HYPERLINK"https://msdn2.microsoft.com/EN-US/library/ms472446"\t"_blank"Microsoft.SharePoint.Administration.SPFeatureDefinition]物件。如果fallback參數值為true而指定的compatibilityLevel和featureId值找不到相符項目,此方法將嘗試傳回[T:HYPERLINK"https://msdn2.microsoft.com/EN-US/library/ms472446"\t"_blank"Microsoft.SharePoint.Administration.SPFeatureDefinition]物件具有較低的compatibilityLevel值。如果使用找不到相對應的[T:HYPERLINK"https://msdn2.microsoft.com/EN-US/library/ms472446"\t"_blank"Microsoft.SharePoint.Administration.SPFeatureDefinition]**物件使用指定的compatibilityLevel或較早的 (後援) 指定的featureId組建版本,傳回a null reference (Nothing in Visual Basic) 。

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

Syntax

'宣告
Public Function GetPersistedFeatureDefinition ( _
    featureId As Guid, _
    compatibilityLevel As Integer, _
    fallback As Boolean _
) As SPFeatureDefinition
'用途
Dim instance As SPFarm
Dim featureId As Guid
Dim compatibilityLevel As Integer
Dim fallback As Boolean
Dim returnValue As SPFeatureDefinition

returnValue = instance.GetPersistedFeatureDefinition(featureId, _
    compatibilityLevel, fallback)
public SPFeatureDefinition GetPersistedFeatureDefinition(
    Guid featureId,
    int compatibilityLevel,
    bool fallback
)

參數

  • compatibilityLevel
    Type: System.Int32

    整數,代表 (例如,14 或 15) 的功能相容性層級。

  • fallback
    Type: System.Boolean

    布林值,指定是否要改為較舊的相容性層級如果找不到此功能。

傳回值

Type: Microsoft.SharePoint.Administration.SPFeatureDefinition
[T:HYPERLINK"https://msdn2.microsoft.com/EN-US/library/ms472446"\t"_blank"Microsoft.SharePoint.Administration.SPFeatureDefinition] 物件,代表關聯的 GUID 與指定的相容性層級物件 (或如果fallback設為true舊版的相容性層級)。

Exceptions

Exception Condition
ArgumentOutOfRangeException

指定的compatibilityLevel值為大於主要組建版本或小於特定功能的最小的相容性層級。

請參閱

參照

SPFarm class

SPFarm members

GetPersistedFeatureDefinition overload

Microsoft.SharePoint.Administration namespace