IBackupRestore.OnBackupComplete - Méthode

Permet de valider le processus de sauvegarde.

Espace de noms :  Microsoft.SharePoint.Administration.Backup
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
Function OnBackupComplete ( _
    sender As Object, _
    args As SPBackupInformation _
) As Boolean
'Utilisation
Dim instance As IBackupRestore
Dim sender As Object
Dim args As SPBackupInformation
Dim returnValue As Boolean

returnValue = instance.OnBackupComplete(sender, _
    args)
bool OnBackupComplete(
    Object sender,
    SPBackupInformation args
)

Paramètres

  • sender
    Type : System.Object

    L'objet qui appelle OnBackupComplete.

Valeur renvoyée

Type : System.Boolean
true en cas de réussite ; dans le cas contraire, false.

Remarques

Au minimum, votre implémentation doit définissez CurrentProgess() à 100 pour cent et true. Il s'agit généralement de tout ce qui est nécessaire.

Dans certains cas, les actions de sauvegarde sont nécessaires. Par exemple, votre implémentation de OnBackupComplete a pu redémarrer un service Windows qui devait être suspendu ou arrêté pour l'opération de sauvegarde.

La méthode OnBackupComplete ne s'exécutera pas si OnBackup renvoie false.

Exemples

Voici l'implémentation la plus courante de OnBackupComplete.

public Boolean OnBackupComplete(Object sender, SPBackupInformation args)
{
    if (args == null)
    {
        throw new ArgumentNullException("args");
    }
    args.CurrentProgress = 100;
    return true;
}
Public Function OnBackupComplete(ByVal sender As Object, ByVal args As SPBackupInformation) As Boolean
    If args Is Nothing Then
        Throw New ArgumentNullException("args")
    End If
    args.CurrentProgress = 100
    Return True
End Function

Voir aussi

Référence

IBackupRestore interface

IBackupRestore - Membres

Microsoft.SharePoint.Administration.Backup - Espace de noms