IBackupRestore.OnPostRestore 方法

开机自检提供还原处理。

命名空间:  Microsoft.SharePoint.Administration.Backup
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
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
)

参数

返回值

类型:System.Boolean
true如果成功 ;否则为false。

备注

至少,您的实现应将**CurrentProgess()**设置为 100%,并返回true。这通常就是全部所需。

在某些情况下,需要后恢复操作。例如, OnPostRestore的实现可以通过重新启动 Windows 服务已停止或暂停该还原操作。

如果OnRestore返回false,则不会运行的OnPostRestore方法。

示例

以下显示了最常见的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 接口

IBackupRestore 成员

Microsoft.SharePoint.Administration.Backup 命名空间