Compartilhar via


SPBackupRestoreInformation.CurrentProgress Property

Gets or sets, as a percentage of the whole job, the degree to which the backup or restore operation is complete.

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

Syntax

'Declaration
Public Property CurrentProgress As Integer
    Get
    Set
'Usage
Dim instance As SPBackupRestoreInformation
Dim value As Integer

value = instance.CurrentProgress

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

Property Value

Type: System.Int32
An Int32 from 0 to 100.

Remarks

Set this property to 100 in implementations of OnBackupComplete and OnPostRestore. You should usually also set it to an appropriate value in OnBackup and OnRestore. Implementations of OnPrepareBackup and OnPreRestore should also set this property if the code in those implementations takes a significant amount of time.

Examples

The following example shows how to use the CurrentProgress property in an implementation of 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

See Also

Reference

SPBackupRestoreInformation Class

SPBackupRestoreInformation Members

Microsoft.SharePoint.Administration.Backup Namespace

UpdateProgress