Compartilhar via


SPBackupRestoreInformation.CurrentProgress property

Obtém ou define, como uma porcentagem do todo o trabalho, o grau ao qual a operação de backup ou restauração for concluída.

Namespace:  Microsoft.SharePoint.Administration.Backup
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaração
Public Property CurrentProgress As Integer
    Get
    Set
'Uso
Dim instance As SPBackupRestoreInformation
Dim value As Integer

value = instance.CurrentProgress

instance.CurrentProgress = value
public int CurrentProgress { get; set; }

Property value

Type: System.Int32
Uma Int32 de 0 a 100.

Comentários

Defina esta propriedade como 100 em implementações do OnBackupComplete e OnPostRestore. Você deve geralmente também defini-la para um valor apropriado no OnBackup e OnRestore. Implementações de OnPrepareBackup e OnPreRestore também devem definir essa propriedade se o código dessas implementações leva uma quantidade significativa de tempo.

Examples

O exemplo a seguir mostra como usar a propriedade CurrentProgress em uma implementação 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

Ver também

Referência

SPBackupRestoreInformation class

SPBackupRestoreInformation members

Microsoft.SharePoint.Administration.Backup namespace

UpdateProgress