Compartilhar via


SPSite.QueryFeatures Method (SPFeatureScope, Boolean)

Gets a collection of the features deployed in this site collection with either Site or Web scope, including only features that either do or do not need to be upgraded.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Function QueryFeatures ( _
    scope As SPFeatureScope, _
    needsUpgrade As Boolean _
) As SPFeatureQueryResultCollection
'Usage
Dim instance As SPSite
Dim scope As SPFeatureScope
Dim needsUpgrade As Boolean
Dim returnValue As SPFeatureQueryResultCollection

returnValue = instance.QueryFeatures(scope, _
    needsUpgrade)
public SPFeatureQueryResultCollection QueryFeatures(
    SPFeatureScope scope,
    bool needsUpgrade
)

Parameters

  • scope
    Type: Microsoft.SharePoint.SPFeatureScope

    An enumeration value that specifies the scope to which the feature applies. The only valid scopes for this method are Site and Web.

  • needsUpgrade
    Type: System.Boolean

    If true, only features that need to be upgraded are included. If false, only features that do not need to be upgraded are included.

Return Value

Type: Microsoft.SharePoint.SPFeatureQueryResultCollection
An enumerable collection of SPFeature objects.

See Also

Reference

SPSite Class

SPSite Members

QueryFeatures Overload

Microsoft.SharePoint Namespace