SPRestoreInformation.MergeSPPersistedObjectState method
合併的目標元件的組態設定的來源 (Self) 的還原的元件的組態設定。
Namespace: Microsoft.SharePoint.Administration.Backup
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Sub MergeSPPersistedObjectState ( _
liveObject As SPPersistedObject _
)
'用途
Dim instance As SPRestoreInformation
Dim liveObject As SPPersistedObject
instance.MergeSPPersistedObjectState(liveObject)
public void MergeSPPersistedObjectState(
SPPersistedObject liveObject
)
參數
liveObject
Type: Microsoft.SharePoint.Administration.SPPersistedObject目標元件。
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | liveObject是a null reference (Nothing in Visual Basic)。 |
NotSupportedException | liveObject類型是不同的來源元件 (Self)。 |
備註
此方法會類似標準Microsoft .NET FrameworkCopyTo方法是,因為它將屬性值從一個物件複製到另一個相同類型的物件。當所設定的唯一選項已,它會呼叫內OnRestore(Object, SPRestoreInformation)覆寫。
如果Self的值。IBackupRestore不SPPersistedObject物件,然後不完成任何工作,並無例外狀況。
Examples
下列程式碼示範如何OnRestore(Object, SPRestoreInformation)覆寫會呼叫的方法。
public bool OnRestore(Object sender, SPRestoreInformation info){ SPWebService liveService = SPWebService.GetLiveWebService(info); //liveService is the restore target. if (liveService == null) { throw new SPException( SPResource.GetString( Strings.RestoreWebServiceLiveServiceNotFound)); } info.MergeSPPersistedObjectState(liveService); liveService.Update(); // Handle non-merged persisted properties …}