共用方式為


IBackupRestore.OnPostRestore method

提供文章還原處理。

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

Syntax

'宣告
Function OnPostRestore ( _
    sender As Object, _
    args As SPRestoreInformation _
) As Boolean
'用途
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
)

參數

傳回值

Type: System.Boolean
true如果成功 ;否則,請false。

備註

在最低限度下,您實作應該將**CurrentProgess()**設為 100%,並傳回true。這通常是所有必要的。

在某些情況下,不需要修改後還原動作。例如, OnPostRestore實作無法重新啟動已停止或暫停還原作業的 Windows 服務。

如果OnRestore傳回falseOnPostRestore方法不會執行。

Examples

以下顯示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

請參閱

參照

IBackupRestore interface

IBackupRestore members

Microsoft.SharePoint.Administration.Backup namespace