SPImportContext.IsRunning property
SharePoint 2013
Gets whether an import operation is running within the current thread context.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Gets whether an import operation is running within the current thread context.