Share via


ChangeApplicationServices.GetChangeApplicationContext Method

Gets an object that represents the current change to be applied.

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

Syntax

'Declaration
Public Function GetChangeApplicationContext ( _
    sourceChange As ItemChange, _
    destinationVersion As ItemChange _
) As ChangeApplicationContext
'Usage
Dim instance As ChangeApplicationServices
Dim sourceChange As ItemChange
Dim destinationVersion As ItemChange
Dim returnValue As ChangeApplicationContext

returnValue = instance.GetChangeApplicationContext(sourceChange, _
    destinationVersion)
public ChangeApplicationContext GetChangeApplicationContext(
    ItemChange sourceChange,
    ItemChange destinationVersion
)
public:
ChangeApplicationContext^ GetChangeApplicationContext(
    ItemChange^ sourceChange, 
    ItemChange^ destinationVersion
)
member GetChangeApplicationContext : 
        sourceChange:ItemChange * 
        destinationVersion:ItemChange -> ChangeApplicationContext 
public function GetChangeApplicationContext(
    sourceChange : ItemChange, 
    destinationVersion : ItemChange
) : ChangeApplicationContext

Parameters

  • sourceChange
    Type: Microsoft.Synchronization.ItemChange
    A change received from the source provider. Can be a null reference (Nothing in Visual Basic) when the change batch is part of a recovery synchronization.
  • destinationVersion
    Type: Microsoft.Synchronization.ItemChange
    The version of sourceChange in the destination replica. Can be a null reference (Nothing in Visual Basic) when the destination replica does not have a version for sourceChange.

Return Value

Type: Microsoft.Synchronization.ChangeApplicationContext
Returns an object that can be used to process the change.

Exceptions

Exception Condition
ActiveChangeApplicationContextException

A ChangeApplicationContext object is already active. The active ChangeApplicationContext object must be processed until its ChangeApplicationAction property is set to Finished before another change can be processed.

ChangeNeedsKnowledgeException

sourceChange does not contain made-with knowledge.

ChangeVersionNotInKnowledgeException

The update version or creation version of sourceChange is not contained in its made-with knowledge.

ChangeUnitCountMismatchException

sourceChange and destinationVersion contain differing numbers of change units.

SyncIdFormatMismatchException

The ID format schema of the specified knowledge object does not match the ID format schema specified when this object was initialized.

SyncInvalidOperationException

Change application was not started or sourceChange has already been reported as successfully applied.

ItemHasChangeUnitsException

sourceChange or destinationVersion contains change units and the other does not.

ChangeNotExpectedException

sourceChange and destinationVersion refer to different item IDs.

Remarks

This method is typically called by the destination provider one time for each change that is sent from the source provider. The ChangeApplicationContext object that is returned can be used to perform conflict detection, conflict resolution, and to determine how the destination provider should apply the change specified by sourceChange.

See Also

Reference

ChangeApplicationServices Class

Microsoft.Synchronization Namespace