SPImportContext Class

Detects if the event or feature activation of the code that calls this class is a part of the import context.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Deployment.SPImportContext

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

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public NotInheritable Class SPImportContext
'Usage
Dim instance As SPImportContext
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public sealed class SPImportContext

Remarks

SPImportContext has no public constructors. Get a reference to an SPImportContext from the Current property.

This class is used by event receivers of feature activation to detect if they are in the context of an import operation.

SPImportContext specifies whether an import is occurring or not for a given thread.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPImportContext Members

Microsoft.SharePoint.Deployment Namespace