IBackupRestore.OnPostRestore method
Provides post restore processing.
Namespace: Microsoft.SharePoint.Administration.Backup
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Function OnPostRestore ( _
sender As Object, _
args As SPRestoreInformation _
) As Boolean
'Usage
Dim instance As IBackupRestore
Dim sender As Object
Dim args As SPRestoreInformation
Dim returnValue As Boolean
returnValue = instance.OnPostRestore(sender, _
args)
bool OnPostRestore(
Object sender,
SPRestoreInformation args
)
Parameters
sender
Type: System.ObjectThe object that calls OnPostRestore.
args
Type: Microsoft.SharePoint.Administration.Backup.SPRestoreInformationAn SPRestoreInformation object that contains data about the operation.
Return value
Type: System.Boolean
true if successful; otherwise, false.
Remarks
At a minimum, your implementation should set CurrentProgess() to 100 percent and return true. This is typically all that is required.
In some cases, post restoration actions are needed. For example, your implementation of OnPostRestore could restart a Windows service that had to be stopped or paused for the restoration operation.
The OnPostRestore method will not run if OnRestore returns false.
Examples
The following shows the most common implementation of OnPostRestore.
public Boolean OnPostRestore(Object sender, SPRestoreInformation args)
{
if (args == null)
{
throw new ArgumentNullException("args");
}
args.CurrentProgress = 100;
return true;
}
Public Function OnPostRestore(ByVal sender As Object, ByVal args As SPRestoreInformation) As Boolean
If args Is Nothing Then
Throw New ArgumentNullException("args")
End If
args.CurrentProgress = 100
Return True
End Function