NotifyingChangeApplier::ApplyChanges Method (ConflictResolutionPolicy, ChangeBatch, IChangeDataRetriever, SyncKnowledge, ForgottenKnowledge, INotifyingChangeApplierTarget, SyncSessionContext, SyncCallbacks)

Performs conflict detection, conflict handling, and change application for a batch of changes.

Namespace:  Microsoft.Synchronization
Assembly:  Microsoft.Synchronization (in Microsoft.Synchronization.dll)

public:
void ApplyChanges(
	ConflictResolutionPolicy resolutionPolicy, 
	ChangeBatch^ sourceChanges, 
	IChangeDataRetriever^ changeDataRetriever, 
	SyncKnowledge^ destinationKnowledge, 
	ForgottenKnowledge^ destinationForgottenKnowledge, 
	INotifyingChangeApplierTarget^ changeApplierTarget, 
	SyncSessionContext^ syncSessionState, 
	SyncCallbacks^ syncCallback
)

Parameters

resolutionPolicy
Type: Microsoft.Synchronization::ConflictResolutionPolicy
The policy to use for resolving conflicts.
sourceChanges
Type: Microsoft.Synchronization::ChangeBatch
The batch of changes from the source provider.
changeDataRetriever
Type: Microsoft.Synchronization::IChangeDataRetriever
An object that can be used to retrieve item data from the source replica.
destinationKnowledge
Type: Microsoft.Synchronization::SyncKnowledge
The knowledge of the destination replica.
destinationForgottenKnowledge
Type: Microsoft.Synchronization::ForgottenKnowledge
The forgotten knowledge of the destination replica.
changeApplierTarget
Type: Microsoft.Synchronization::INotifyingChangeApplierTarget
The object that will be called to save changes and conflicts.
syncSessionState
Type: Microsoft.Synchronization::SyncSessionContext
State information about the current session.
syncCallback
Type: Microsoft.Synchronization::SyncCallbacks
Callbacks that will receive notifications about change application events.

ExceptionCondition
ArgumentNullException

sourceChanges, changeDataRetriever, destinationKnowledge, changeApplierTarget, or syncCallback is a nullptr.

ArgumentOutOfRangeException

resolutionPolicy is not member of the ConflictResolutionPolicy enumeration.

SyncIdFormatMismatchException
  • sourceChanges has some forgotten knowledge which is in a different format than that of destinationKnowledge

—or—

  • destinationForgottenKnowledge was given and has a different format than that of destinationKnowledge

This method detects conflicts that occur between the changes sent in sourceChanges and the corresponding items in the destination replica. It resolves any conflicts according to the policy specified by resolutionPolicy. If it is necessary, this method then calls methods on changeApplierTarget to save changes to the destination replica and to save unresolved conflicts.

To get the destination version, this method calls TryGetDestinationVersion on changeApplierTarget for each item in sourceChanges.

Show: