Partager 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

Public Property CurrentProgress As Integer
    Get
    Set

Dim instance As SPBackupRestoreInformation
Dim value As Integer

value = instance.CurrentProgress

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

Property Value

Type: System.Int32
A 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;
        }

See Also

Reference

SPBackupRestoreInformation Class

SPBackupRestoreInformation Members

Microsoft.SharePoint.Administration.Backup Namespace

UpdateProgress